Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In addition, in the description of the present application, the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
The first embodiment is as follows:
fig. 1 shows a schematic flow chart of a first robot signal instruction control method provided in an embodiment of the present application, which is detailed as follows:
in S101, system clock signals respectively transmitted by a control end and the robot are obtained and an initial time difference between the two is calculated.
The control end is a device for sending instructions to realize remote control of the robot, wherein the instructions comprise locking instructions and control instructions. The locking instruction is an instruction for establishing a one-to-one connection relationship between a request sent by the control end and the robot, and after receiving the locking instruction, the robot establishes a connection with the control end and locks and uniquely receives the control instruction of the control end without being controlled by other control ends. The control instruction is an instruction for controlling the robot to execute a specific action, and the specific action comprises the functions of integrating mechanical movement, voice playing, image acquisition and the like of the robot into the robot.
There is usually a certain delay from the time when the control end sends the instruction to the time when the robot receives the instruction, and the initial time difference between the control end and the robot can be calculated by acquiring system clock signals respectively sent by the control end and the robot. And setting the time difference between the system clock signal when the control end sends the locking instruction and the system clock signal when the robot receives the locking instruction as the initial time difference between the control end and the robot. The system clock signal sent by the control end can be acquired by the robot through analyzing the information in the received locking instruction.
In S102, a first transmission time difference between the control end sending a control command and the robot receiving the control command is recorded.
Similarly, there is a time delay between the time when the control end issues the control command and the time when the robot receives the control command, and the time delay is determined as the first transmission time difference of the control command. And recording a first transmission time difference corresponding to the control instruction while receiving the control instruction or after receiving the control instruction.
In S103, a network fluctuation duration is determined according to the initial time difference and the first transmission time difference.
And determining whether the delay time when the robot receives the locking instruction is different from the delay time when the robot receives the control instruction or not according to the initial time difference and the first transmission time difference, if so, indicating that the transmission time of the instruction of the control end reaching the robot is unstable, and the network fluctuates, and determining the network fluctuation time at the moment. Specifically, the network fluctuation duration is obtained by calculating the first transmission time difference minus the initial time difference and taking the absolute value.
In S104, if the network fluctuation duration is greater than the target duration, the control instruction is abandoned.
According to the network fluctuation time length obtained in the step S103, if the network fluctuation time length exceeds a certain time range, i.e., the target time length, it is determined that the current network fluctuation is large, the network signal is unstable, and the execution of the control instruction is abandoned.
According to the embodiment of the invention, the network fluctuation time length in the robot control instruction transmission process is determined according to the initial time difference and the first transmission time difference between the control end and the robot, if the network fluctuation time length exceeds the target time length, the current network fluctuation is considered to be large, the network signal is unstable, and the current control instruction is abandoned to be executed, so that the problem that the robot is out of control due to mutual conflict or overlapped execution of a plurality of instructions caused by overtime arrival of the network fluctuation instruction when the remote control robot moves is solved, the remote control robot moves more safely, the robot is protected from being damaged, and surrounding people or objects cannot be mistakenly injured.
Example two:
fig. 2 shows a flowchart of a signal instruction control method for a second robot according to an embodiment of the present application, which is detailed as follows:
in S201, system clock signals respectively transmitted by a control end and the robot are obtained and an initial time difference between the two is calculated.
In this embodiment, S201 is the same as S101 in the previous embodiment, and please refer to the related description of S101 in the previous embodiment, which is not repeated herein.
Optionally, before the obtaining system clock signals respectively sent by a control end and the robot and calculating an initial time difference between the two, the method further includes:
if the robot is detected to be in an unlocked state, receiving a locking instruction of a control end, and simultaneously recording a first system timestamp of the robot, wherein the locking instruction comprises a first timestamp of the locking instruction sent by the control end, the first timestamp is a system clock signal sent by the control end, and the first timestamp is a system clock signal sent by the robot;
and calculating the initial time difference between the control end and the robot according to the first system time stamp and the first time stamp.
If the robot is detected to be in an unlocked state, it is indicated that the current robot is not connected with any control end, and the initial time difference does not exist. At this time, the robot may receive a lock instruction from a control terminal, where the lock instruction includes a first timestamp Ts1 when the control terminal sends the lock instruction. The robot records the current first system timestamp Ts2 of the robot while receiving the lock instruction, and the system timestamp can be obtained by a system currenttimemillis () function.
And calculating the initial time difference T1 between the control end and the robot according to the first time stamp Ts1 and the first system time stamp Ts 2. The first system time stamp Ts2 is subtracted from the first time stamp Ts1, and the absolute value is taken, so that the initial time difference T1 between the control end and the robot can be obtained. Optionally, the initial time difference T1 is obtained by the following function calculation method:
T1=Math.abs(Ts1-System.currentTimeMillis())
in S202, a first transmission time difference between the control end sending a control instruction and the robot receiving the control instruction is recorded.
When a control instruction is received, or after the control instruction is received, recording a first transmission time difference between the time when the control end sends the control instruction and the time when the robot receives the control instruction.
Specifically, the S202 includes:
S202A: and receiving a control instruction of the control end, and recording a second system time stamp when the robot receives the control instruction, wherein the control instruction comprises a second time stamp when the control end sends the control instruction.
And receiving a control instruction of the control end, wherein the control instruction comprises a second time stamp Ts3 when the control end sends the control instruction. And the robot records a current second system time stamp Ts4 of the robot while receiving the control command, wherein the system time stamp can be obtained by a System.
S202B: and recording a first transmission time difference according to the second system time stamp and the second time stamp.
And calculating and recording a first transmission time difference T2 between the control command at the control end and the robot according to the second system time stamp Ts4 and the second time stamp Ts 3. And subtracting the second system time stamp Ts4 from the second time stamp Ts3, and taking an absolute value to obtain a first transmission time difference T2 between the control end and the robot. Optionally, the first transmission time difference T2 is obtained by the following function calculation method:
T2=Math.abs(Ts3-System.currentTimeMillis())
optionally, after recording a first transmission time difference between the control end sending a control instruction and the robot receiving the control instruction, the method further includes:
and if the initial time difference is larger than the first transmission time difference and exceeds the preset time length, prompting to recalibrate the initial time difference.
If the initial time difference is larger than the first transmission time difference and the part of the initial time difference, which is larger than the first transmission time difference, exceeds the preset time length, the initial time difference is over-large when the initial time difference is calculated, namely the control end and the robot are just in a state of poor network signals when connection is established. The initial time difference in this case is not suitable as a reference time difference at the time of the later transmission of the control command, and therefore the initial time difference needs to be recalibrated. At this time, the prompt recalibration initial time difference can be prompted by sending out prompt voice or displaying information on a display screen.
In S203, determining a network fluctuation duration according to the initial time difference and the first transmission time difference.
In this embodiment, S203 is the same as S103 in the previous embodiment, and please refer to the related description of S103 in the previous embodiment, which is not repeated herein.
In S204, if the network fluctuation duration is greater than the target duration, the control instruction is abandoned.
If the network fluctuation time length exceeds a certain time range, namely the target time length, the current network fluctuation is judged to be large, the network signal is unstable, and the control instruction is abandoned.
Optionally, before the S204, the method further includes:
and acquiring historical average instruction response speed of the robot, and determining the target duration according to the historical average instruction response speed.
The instruction response speed refers to the speed of the robot responding to the execution instruction when executing continuous action, and the instruction response time includes the interval duration between the control instruction corresponding to the current execution instruction and the last control instruction, the transmission duration of the corresponding control instruction, and the duration required for analyzing the corresponding control instruction into the execution instruction. For example, the historical average command response speed may be calculated by recording the movement speed of the robot when the robot normally performs mechanical movement at ordinary times. And acquiring the historical average command response speed and determining the target time length. For example, according to the historical average command response speed, the average response interval duration of every two command responses when the robot executes continuous actions is obtained, and the target duration needs to be less than the response interval duration so that the robot cannot be out of control due to overlapping conflict of two executed commands. Optionally, the target duration is-0.1 seconds of the response interval duration.
For example, according to historical average command response speed, the response interval duration 1s between every two response execution commands of the robot is obtained, after the command A is responded for 1s under a normal condition, the command B is responded, after the command B is responded for 1s, the command C is responded, and after the command C is responded for 1s, the command D is responded. However, if there is network fluctuation when receiving the control command corresponding to the C command, which results in 1s + network fluctuation time Tc after responding to the B command, the C command can only be responded. And when the control instruction corresponding to the D instruction is received, the network returns to normal, namely after the B instruction is responded for 1s +1s, the D instruction is responded. At the moment, if the network fluctuation time Tc is greater than or equal to the interval time Tc, the C instruction and the D instruction overlap and collide, and the robot is out of control.
Optionally, the S204 specifically includes:
and if the network fluctuation time length is greater than the target time length, giving up executing the control instruction and prompting information for network switching.
If the network fluctuation time length exceeds the target time length, the current network fluctuation is judged to be large, the network signal is unstable, the control instruction is abandoned to be executed, and prompt information is sent out in time to prompt a user to carry out network switching. Optionally, the prompting is performed by voice-emitting a prompting voice and/or displaying information on a display screen.
In S205, information of the control instruction execution result is returned.
And returning information of the execution result of the control instruction, and in S204, if the network fluctuation time length is greater than the target time length, giving up executing the control instruction, and returning information of the execution failure of the control instruction. Otherwise, namely the network fluctuation time length is less than or equal to the target time length, the control instruction is normally executed, and information that the control instruction is successfully executed is returned.
According to the embodiment of the invention, the network fluctuation time length in the robot control instruction transmission process is determined according to the initial time difference and the first transmission time difference between the control end and the robot, if the network fluctuation time length exceeds the target time length, the current network fluctuation is considered to be large, the network signal is unstable, and the current control instruction is abandoned to be executed, so that the problem that the robot is out of control due to mutual conflict or overlapped execution of a plurality of instructions caused by overtime arrival of the network fluctuation instruction when the remote control robot moves is solved, the remote control robot moves more safely, the robot is protected from being damaged, and surrounding people or objects cannot be mistakenly injured; meanwhile, the execution result information of the control instruction is returned after the control instruction is judged and processed every time, and the feedback is timely carried out so that a user can master the current running state of the robot at any time.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Example three:
fig. 3 is a schematic structural diagram of a signal command control device of a robot according to an embodiment of the present application, and for convenience of description, only portions related to the embodiment of the present application are shown:
the signal command control device of the robot comprises: a first acquiring unit 31, a first recording unit 32, a first determining unit 33, and a judging unit 34. Wherein:
the first obtaining unit 31 is configured to obtain system clock signals respectively sent by a control end and the robot and calculate an initial time difference between the two.
The control end is a device for sending instructions to realize remote control of the robot, wherein the instructions comprise locking instructions and control instructions. The locking instruction is an instruction for establishing a one-to-one connection relationship between a request sent by the control end and the robot, and after receiving the locking instruction, the robot establishes a connection with the control end and locks and uniquely receives the control instruction of the control end without being controlled by other control ends. The control instruction is an instruction for controlling the robot to execute a specific action, and the specific action comprises the functions of integrating mechanical movement, voice playing, image acquisition and the like of the robot into the robot.
There is usually a certain delay from the time when the control end sends the instruction to the time when the robot receives the instruction, and the initial time difference between the control end and the robot can be calculated by acquiring system clock signals respectively sent by the control end and the robot. And setting the time difference between the system clock signal when the control end sends the locking instruction and the system clock signal when the robot receives the locking instruction as the initial time difference between the control end and the robot. The system clock signal sent by the control end can be acquired by the robot through analyzing the information in the received locking instruction.
Optionally, the first obtaining unit includes a detecting module and an initial time difference calculating module:
the detection module is used for receiving a locking instruction of a control end and recording a first system time stamp of the robot if the robot is detected to be in an unlocked state, wherein the locking instruction comprises the control end for sending the first time stamp of the locking instruction, the first time stamp is a system clock signal sent by the control end, and the first time stamp is the system clock signal sent by the robot.
And the initial time difference calculation module is used for calculating the initial time difference between the control end and the robot according to the first system time stamp and the first time stamp.
The first recording unit 32 is configured to record a first transmission time difference between the control end sending the control instruction and the robot receiving the control instruction.
And a time delay also exists between the time when the control end sends the control command and the time when the robot receives the control command, and the time delay is determined as the first transmission time difference of the control command. At the same time as or after receiving the control instruction, a first transmission time difference of the control instruction is calculated and recorded.
Optionally, the first recording unit 32 includes a control instruction receiving module and a first transmission time difference determining module:
and the control instruction receiving module is used for receiving the control instruction of the control end and recording a second system time stamp when the robot receives the control instruction, wherein the control instruction comprises the second time stamp for sending the control instruction.
And the first transmission time difference determining module is used for determining the first transmission time difference according to the second system time stamp and the second time stamp.
Optionally, the signal command control device of the robot further includes:
and the first prompting unit is used for prompting to recalibrate the initial time difference if the initial time difference is greater than the first transmission time difference and exceeds a preset time length.
Optionally, the signal command control device of the robot further includes:
and the target duration determining unit is used for acquiring the historical average instruction response speed of the robot and determining the target duration according to the historical average instruction response speed.
A first determining unit 33, configured to determine a network fluctuation duration according to the initial time difference and the first transmission time difference.
And determining whether the delay time when the robot receives the locking instruction is different from the delay time when the robot receives the control instruction or not according to the initial time difference and the first transmission time difference, if so, indicating that the transmission time of the instruction of the control end reaching the robot is unstable, and the network fluctuates, and determining the network fluctuation time at the moment. Specifically, the network fluctuation duration is obtained by calculating the first transmission time difference minus the initial time difference and taking the absolute value.
And the judging unit 34 is configured to abandon execution of the control instruction if the network fluctuation duration is greater than a target duration.
If the network fluctuation time length exceeds a certain time range, namely the target time length, the current network fluctuation is judged to be large, the network signal is unstable, and the control instruction is abandoned.
Optionally, the judging unit 34 includes:
and the second prompting unit is used for giving up executing the control instruction and prompting the information for network switching if the network fluctuation time length is greater than the target time length.
Optionally, the signal command control device of the robot further includes:
and the feedback unit is used for returning the information of the control instruction execution result.
According to the embodiment of the invention, the network fluctuation time length in the robot control instruction transmission process is determined according to the initial time difference and the first transmission time difference between the control end and the robot, if the network fluctuation time length exceeds the target time length, the current network fluctuation is considered to be large, the network signal is unstable, and the current control instruction is abandoned to be executed, so that the problem that the robot is out of control due to mutual conflict or overlapped execution of a plurality of instructions caused by overtime arrival of the network fluctuation instruction when the remote control robot moves is solved, the remote control robot moves more safely, the robot is protected from being damaged, and surrounding people or objects cannot be mistakenly injured.
Example four:
fig. 4 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 4, the terminal device 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42, such as a signal instruction control program of a robot, stored in said memory 41 and executable on said processor 40. The processor 40, when executing the computer program 42, implements the steps in the signal instruction control method embodiments of the robots described above, such as the steps S101 to S104 shown in fig. 1. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 31 to 34 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 42 in the terminal device 4. For example, the computer program 42 may be divided into a first acquiring unit, a first recording unit, a first determining unit, and a determining unit, and each unit has the following specific functions:
the first acquisition unit is used for acquiring system clock signals respectively sent by a control end and the robot and calculating the initial time difference of the control end and the robot;
the first recording unit is used for recording a first transmission time difference between the control command sent by the control end and the control command received by the robot;
a first determining unit, configured to determine a network fluctuation duration according to the initial time difference and the first transmission time difference;
and the judging unit is used for giving up executing the control instruction if the network fluctuation time length is greater than the target time length.
The terminal device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of a terminal device 4 and does not constitute a limitation of terminal device 4 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing the computer program and other programs and data required by the terminal device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.