Detailed Description
As known in the background art, communication between a server and a controlled device currently depends on a mobile data network, and particularly, in a place where WiFi coverage is not available, communication can be performed only through the mobile data network. However, this causes a problem that the server cannot communicate with the controlled device when the mobile data network is unavailable, which eventually leads to the uncontrolled device.
Analysis shows that the unavailability of the mobile data network of the controlled device does not mean that contact with the outside world is completely unavailable. In particular, when the mobile data network of the controlled device is not available, the mobile data network cannot be used, and the signaling channel of the controlled device may still be available, for example, the controlled device may send and receive short messages through a signaling system No. 7 or the like.
In order to solve the above problem, an embodiment of the present invention provides a remote control method, which is applied to a server, and includes: generating a control command; and under the condition that a mobile data network of the controlled equipment is unavailable, the control command is issued to the controlled equipment through a short message so as to control the controlled equipment to act.
According to the remote control method provided by the embodiment of the invention, when the mobile data network of the controlled equipment is unavailable, the cloud end enables the signaling channel between the cloud end and the controlled equipment to send the control command to the controlled equipment in a short message mode through the signaling channel, so that the controlled equipment can still receive the control command sent by the cloud end to act, namely still be in a controlled state and not be out of control, and the dependence of remote control on the mobile data network is overcome.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that in various embodiments of the invention, numerous technical details are set forth in order to provide a better understanding of the present invention. However, the claimed invention may be practiced without these specific details or with various changes and modifications based on the following embodiments.
The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
An embodiment of the present invention provides a remote control method, which is applied to a server, and a flow of the remote control method is shown in fig. 1, where the remote control method includes:
step 101, generating a control command.
In this embodiment, the control command is mainly used to instruct the controlled device to execute a specified task, where the control command may be generated by the server according to a received user command, or may be generated autonomously by the server. The format, type, etc. of the control command are not limited in the present embodiment.
In some examples, generating the control command may be implemented as follows: receiving a user command, wherein the user command can be sent to the server by a user terminal, or the setting of a user on an interactive interface provided by the server can be transmitted to the server through an interface; analyzing a user command to obtain at least one instruction, wherein the user command may be analyzed into different numbers of instructions along with the change of the complexity of a task indicated by the user command or the complexity of a task execution condition, for example, a capture task may be analyzed into a plurality of instructions such as environment analysis, target positioning, motion planning and the like, and when each instruction is simpler and clearer, the subsequent coding pressure is smaller and the efficiency is higher; and coding the obtained instruction according to a pre-stored data dictionary to obtain an instruction set, wherein the data dictionary is agreed by the controlled equipment and the server together, and the agreed mode can be that the data dictionary is predefined in the system when the controlled equipment and other equipment are deployed or started, or the server periodically sends the data dictionary to the controlled equipment to ensure that the same data dictionary is used for server coding and controlled equipment decoding. In particular, in consideration of security in data dictionary transmission, it may be required that the server issues the data dictionary to the controlled device through a Virtual Private Network (VPN) tunnel in the mobile data Network when the mobile data Network of the controlled device is available.
It is worth mentioning that encoding according to the data dictionary can enhance the concealment of the control command, and even if the intercepted or sent error is lack of the correct data dictionary, the correct information cannot be analyzed, so that information leakage cannot occur, and encrypted transmission is realized. And the control instruction of the subsequent controlled equipment can be issued in a short message mode, and one short message can only support 160 characters, and the command length can be shortened according to the data dictionary code.
To facilitate a better understanding of the encoding according to a data dictionary, the following is illustrated, wherein the various definitions in the data dictionary are shown in the following table:
| before coding | After being coded | Code length |
| Software | S | 1 |
| Hardware | H | 1 |
| Command | A | 1 |
| Command connector | C | 1 |
Table 1 code definition table for information statements
| Before coding | After being coded | Code length |
| Wireless network card | 001 | 3 |
| Camera head | 002 | 3 |
| Microphone (CN) | 003 | 3 |
TABLE 2 code definition table for hardware operands
| Before coding | After being coded | Code length |
| VPN application | 001 | 3 |
| Media player | 002 | 3 |
TABLE 3 code definition table of software operation object
| Before coding | After being coded | Code length |
| 01 | Restarting | 2 |
| 00 | Starting up | 2 |
| 02 | Stop | 2 |
Table 4 code definition table of operations
The structure of an instruction may be defined as: software and hardware type + operation object + operation, different instructions, different operation objects and different operations can be connected by a command connector, for example, two instructions are coded as: the software and hardware type of the first instruction + the operation object of the first instruction + the operation of the first instruction + the command connector + the software and hardware type of the second instruction + the operation object of the second instruction + the operation of the second instruction, and a certain instruction is coded as follows: the software and hardware type of the first operation object + the command connector + the software and hardware type of the second operation object + the operation instruction and the like. Of course, some declaration information may also be inserted into the above structure, such as a start identifier for starting description of operation information added between an operation object and an operation from the end of the operation object description in an instruction.
For example, a user command indicates the controlled device to restart the network card, at this time, the user command is analyzed, and a command, that is, the network card is restarted, can be determined, where the software and hardware type is hardware, the operation object is the network card, and the operation action is restart, and then the encoded control command can be expressed as: h001a 01; the user command indicates the controlled device to open the VPN, at this time, the user command is analyzed, and a command can be determined, that is, the VPN is opened, wherein the software and hardware type is software, the operation object is a VPN application, and the operation action is open, then the encoded control command can be expressed as: s001a 01; the user command instructs the controlled device to restart the network card and start the VPN, at this time, the user command is analyzed, two instructions can be determined, under the condition that no special statement or no sequence exists, different instructions are encoded according to the sequence in the user command, and the encoded control command can be expressed as: h001a01CS001a 01. It should be noted that a in the above coding result is used to declare the content of the operation to be described.
It should be noted that the codes defined by the data dictionary pre-stored by the server at least need to cover the configured software and hardware devices of all the controlled devices controlled by the server and the supportable operations of the devices, so as to support the server to control the controlled devices controlled by the server. However, the data dictionary pre-stored in each controlled device at least needs to cover each software and hardware device configured by the controlled device and the operation supportable by each device, so as to support the response of the controlled device to the instruction issued by the server. Of course, the data dictionary pre-stored by the controlled device may be the same as the data dictionary pre-stored by the server. Whether they are the same or not, they are called the database dictionary agreed by the server and the controlled device together, and are not described herein.
It should be noted that the data dictionary needs to have a certain margin for defining the code to ensure the extension of the data dictionary, and after the controlled device adds devices and applications, the data dictionary can still be extended to achieve normal control.
And 102, under the condition that a mobile data network of the controlled equipment is unavailable, issuing a control command to the controlled equipment through a short message to control the controlled equipment to act.
It can be understood that when the mobile data network is unavailable, only other communication modes are required to normally receive and transmit the control command, and therefore, considering that the signaling channel between the controlled device and the server may still be available, at this time, the transmission channel of the control command may be adjusted from the original mobile data network to the signaling channel, that is, the channel for transmitting the short message, so that the control command is transmitted to the controlled device in a short message manner, instead of only depending on the mobile data network, and when the mobile data network is unavailable, only the control over the controlled device is given up, resulting in the problem of runaway of the controlled device.
Particularly, when issuing a control instruction to a controlled device, it is desirable to have a certain security protection capability to avoid the occurrence of problems such as tampering of a control command.
Based on this, in some examples, before issuing the control command to the controlled device by the short message, the remote control method further includes: and encrypting the control command according to a preset encryption key, wherein the encryption key and a decryption key corresponding to the encryption key are agreed by the controlled equipment and the server together, so that the controlled equipment can accurately decode and execute the encrypted control command after receiving the encrypted control command. Certainly, the agreed mode may be predefined in the system when the controlled device and other devices are deployed, or the server periodically issues an encryption/decryption key and the like to the controlled device, so as to ensure that the server can accurately decrypt the encrypted information sent by the other party when encoding and decoding the controlled device. In particular, in consideration of security during transmission, when the mobile data network of the controlled device is available, the server may be required to issue the encryption and decryption keys to the controlled device through the mobile data network, and different controlled devices may use different sets of encryption and decryption keys, and the like, which is not described herein any more. Correspondingly, the control command is issued to the controlled equipment through the short message, and the method comprises the following steps: and sending the encrypted control command to the controlled equipment through a short message.
It should be noted that the encryption key in the server corresponds to the decryption key in the controlled device, and in consideration of the fact that the controlled device actively sends a message to the server through a short message, the controlled device also needs the encryption key and the server also needs the decryption key, and at this time, the decryption key in the server corresponds to the encryption key in the controlled device. However, the present embodiment does not limit whether the decryption key in the server and the encryption key in the controlled device correspond to the encryption key in the server and the decryption key in the controlled device, and the same set of encryption and decryption keys may be used or may not be used.
In other examples, before issuing the control command to the controlled device by the short message, the remote control method further includes: the token is added to the control command, wherein the token is generated by the controlled device and reported to the server by the controlled device, and particularly, in order to guarantee the security of the token, the token can be reported to the server by the controlled device through the mobile data network when the mobile data network is available. Correspondingly, the control command is issued to the controlled equipment through the short message, and the method comprises the following steps: and issuing the control command with the attached token to the controlled equipment through the short message, so that the controlled equipment can verify the control command according to the token attached to the control command.
It can be understood that the three situations are implementation manners proposed for improving the security of the control command, and in other examples, the three situations may be combined, for example, a token is added while the control command is encrypted, and details are not repeated here.
Certainly, the controlled device may issue the control command through the short message when the short message function of the controlled device is available, and the controlled device cannot receive the control command when the short message function is unavailable, so that before the control command is issued to the controlled device through the short message, the remote control method further includes: and sending a query request to the controlled equipment through the short message, so that the controlled equipment can detect whether the short message function is available according to the query request. Correspondingly, the control command is issued to the controlled equipment through the short message, and the method comprises the following steps: and after receiving the short message function available response returned by the controlled equipment, sending a control command to the controlled equipment through a short message. Of course, under the condition that no response is received within a certain time, the server may determine that the short message function of the controlled device is unavailable, and no control command is issued. Furthermore, when the short message function of the controlled device is unavailable, the server controlled device may also perform an alarm, so that the related user or operation and maintenance personnel may perform maintenance and the like on the controlled device.
It is understood that the mobile data network of the controlled device may not always be available, and in case the mobile data network of the controlled device is available, it may be prioritized to issue the control command using the mobile data network. In particular, in order to improve the security of issuing the control command through the mobile data network, in the case that the mobile data network of the controlled device is available, the control command is issued to the controlled device through a VPN tunnel in the mobile data network to control the controlled device to perform an action, wherein the VPN tunnel may be provided at the server.
It can also be understood that, before issuing the control command, the server may first detect whether the mobile data network of the controlled device is available, in the case that the mobile data network is available, issue the control command through the mobile data network, and in the case that the mobile data network is unavailable, issue the control command through a short message, where detecting whether the mobile data network of the controlled device is available may be to send data to the controlled device through the mobile data network, and the like.
Based on this, in some examples, the controlled device establishes a heartbeat link with the server mobile data network, such as a heartbeat connection over a VPN tunnel, and at this time, after the control command is generated, the remote control method further includes: and detecting whether the mobile data network of the controlled equipment is available according to the state of the heartbeat connection, wherein the mobile data network is judged to be available under the condition that the heartbeat link is in a connected state, and the mobile data network is judged to be unavailable under the condition that the heartbeat link is in a disconnected state.
In other examples, after generating the control command, the remote control method further comprises: the method comprises the steps of sending an inquiry request to controlled equipment through a mobile data network, detecting whether the mobile data network of the controlled equipment is available according to whether the controlled equipment responds to the inquiry request, judging whether the mobile data network of the controlled equipment is unavailable under the condition that the controlled equipment does not respond within a certain time, judging whether the quality of the mobile data network returned by the controlled equipment meets a preset quality condition or not under the condition that the controlled equipment responds, judging that the mobile data network of the controlled equipment is available under the condition that the preset quality condition is met, and judging that the mobile data network of the controlled equipment is unavailable under the condition that the preset quality condition is not met.
It should be noted that, in the above example, after the control command is generated, it is described as an example to detect whether the mobile data network of the controlled device is available, in other embodiments, the generation of the control command and the detection of the availability of the mobile data network may occur simultaneously, or it is detected first whether the mobile data network of the controlled device is available, and then the control command is generated, which is not described herein again.
In another aspect, the embodiment of the present invention further provides a remote control method, which is applied to a controlled device, where the controlled device may be an electronic device such as a robot, a mechanical arm, or a computer. The flow of the remote control method is shown in fig. 2, and includes:
step 201, receiving a control command sent by a server through a short message.
In this embodiment, since the controlled short message is sent by a short message, when the control command is received in the form of a short message, the controlled device may also be required to detect the received short message according to a certain policy, and screen the short message where the obtained control command is located from the common short message.
Of course, since the server issues the control command through the mobile data network when the mobile data network of the controlled device is available, the controlled device is also subjected to the control command issued by the server through the mobile data network. The present embodiment is mainly directed to a remote control method in a scenario where a mobile data network of a controlled device is unavailable, and does not mean that the controlled device according to the present embodiment can only receive a control command issued by a short message.
It is understood that, in the case where the controlled device receives the control command transmitted by the short message, the server may need to detect whether the short message function of the controlled device is available before issuing the control command. Based on this, in some examples, before receiving the control command, the remote control method further includes: receiving a query request issued by a server, and triggering a process of detecting whether a short message function is available or not after the controlled equipment receives the query request, namely detecting whether the short message function is available or not according to the request of the server; and returning a short message function available response to the server under the condition of detecting that the short message function is available. Then, the server will issue a control command under the condition of obtaining the available response of the short message function, and the controlled device will receive the control command issued by the server. And when the short message function is detected to be unavailable, the controlled equipment does not receive the query request sent by the server and does not generate a response, or when the short message function is available, the query request can be received, but before the response is sent, the short message function becomes unavailable and cannot respond. And when the server does not receive the response of the controlled equipment, the server does not issue the control command any more, and the controlled equipment does not receive the control command.
Of course, after receiving the query request issued by the cloud server, the controlled device may preferentially check whether the mobile data network of the controlled device is available, and when the mobile data network of the controlled device is available, return a mobile data network available response to the server, so that the server triggers a process of sending a control command through mobile network data according to the mobile data network available response. It should be noted that the mobile data network availability mentioned here is understood to mean that the mobile data network is restored from unavailable to available. And when the mobile data network of the mobile terminal is unavailable, continuously detecting whether the short message function is available.
It should be noted that, when the response result of the query request is a mobile data network data available response, the controlled device may directly return a response through the VPN tunnel, and when the response result of the query request is a short message function available response, the controlled device returns a response through a short message, at this time, the controlled device may also encrypt the response, encode the response according to a data dictionary, or attach a token, which is generated by the server and issued by the server only, so that the server decrypts, or verifies the received response, and the like. Therefore, it is easy to see that, at this time, the server is the receiver, the controlled device is the sender, and the steps that the receiver and the sender need to execute at this time are similar to the steps in the scenario where the server sends information and the controlled device is the receiver, and are not described here any more.
Step 202, according to the control command, the operation is performed.
The embodiment does not limit the way of the controlled device responding to the control command, and the related tasks can be completed according to the instruction of the control command.
In some examples, since the control command issued by the server is encoded according to the data dictionary, before execution, the received control command needs to be decoded first, that is, before acting according to the control command, the remote control method further includes: and decoding the control command according to a data dictionary, wherein the data dictionary is agreed by the controlled equipment and the server together. Correspondingly, acting according to the control command comprises: and performing action according to the decoded control command.
In other examples, the controlled device detects that the control command is encrypted, and therefore, before executing, it needs to decrypt the received control command, that is, before acting according to the control command, the remote control method further includes: decrypting the control command according to a pre-stored decryption key; the decryption key and the encryption key corresponding to the decryption key are both agreed by the controlled device and the server together. Correspondingly, acting according to the control command comprises: and performing action according to the decrypted control command.
In still other examples, the controlled device detects that the control command also carries the token, and therefore, before executing, a check needs to be performed to determine whether the control command is safe and reliable, that is, before performing an action according to the control command, the remote control method further includes: and verifying the control command according to the received token, wherein the received token can be matched with a non-invalid token issued by the control command, if the matching is successful, the verification is judged to be passed, and if the matching is failed, the verification is judged to be not passed. Correspondingly, acting according to the control command comprises: and when the control command passes the verification, performing action according to the control command. Of course, in the case where the control command fails the verification, the control command is discarded.
It can be understood that the server may determine two or three ways to process the control command according to the data dictionary encoding, the encrypting, and the additional token, and accordingly, the controlled device needs to analyze the received control command into an executable instruction through corresponding operations in the data dictionary decoding, and the token checking, so as to perform an action according to the executable instruction, which is not described herein any more.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
Another aspect of the embodiments of the present invention further provides a server, as shown in fig. 3, including:
agenerating module 301, configured to generate a control command.
The sendingmodule 302 is configured to issue a control command to the controlled device through a short message to control the controlled device to perform an action when the mobile data network of the controlled device is unavailable.
It should be noted that, in some examples, in a cloud collaboration scenario, the functional modules are specifically deployed on a cloud server, that is, the server is a cloud server, so that the cloud server controls the controlled terminal device, which is not described herein any more.
It is to be understood that this embodiment is a server embodiment corresponding to the first method embodiment, and that this embodiment may be implemented in cooperation with the first method embodiment. The related technical details mentioned in the first method embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first method embodiment.
It should be noted that, all the modules involved in this embodiment are logic modules, and in practical application, one logic unit may be one physical unit, may also be a part of one physical unit, and may also be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, a unit which is not so closely related to solve the technical problem proposed by the present invention is not introduced in the present embodiment, but this does not indicate that there is no other unit in the present embodiment.
Another aspect of the embodiments of the present invention further provides a controlled device, as shown in fig. 4, including:
the receivingmodule 401 is configured to receive a control command sent by a server through a short message.
And an executingmodule 402, configured to perform an action according to the control command.
In particular, the functional module is deployed on a robot, that is, the controlled device is a robot, so as to implement remote control of the robot, which is not described herein any more.
It should be understood that this embodiment is a robot embodiment corresponding to the second embodiment, and that this embodiment can be implemented in cooperation with the second embodiment. The related technical details mentioned in the second method embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related art details mentioned in the present embodiment can also be applied to the second method embodiment.
It should be noted that, all the modules involved in this embodiment are logic modules, and in practical application, one logic unit may be one physical unit, may also be a part of one physical unit, and may also be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, a unit which is not so closely related to solve the technical problem proposed by the present invention is not introduced in the present embodiment, but this does not indicate that there is no other unit in the present embodiment.
Another aspect of the embodiments of the present invention further provides a remote control system, as shown in fig. 5, including: an end server and a plurality of controlled devices.
The server is used for generating a control command; detecting whether a mobile data network of a controlled device is available; under the condition that a mobile data network of the controlled equipment is available, a control command is issued to the controlled equipment through a VPN tunnel in the mobile data network so as to control the controlled equipment to act; and under the condition that the mobile data network of the controlled equipment is unavailable, transmitting a control command to the controlled equipment through the short message so as to control the controlled equipment to act. The controlled device is used for receiving a control command, and the control command is issued by the server according to the mode; and performing action according to the control command.
Particularly, the server can be a cloud server, and the controlled device can be a robot, so that the robot is cooperatively controlled based on the cloud server, and the method is more efficient, rapid and accurate.
It should be understood that the present embodiment is a system embodiment corresponding to the method embodiment, and the present embodiment can be implemented in cooperation with the method embodiment. The related technical details mentioned in the method embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related art details mentioned in the present embodiment can also be applied in the method embodiment.
It should be noted that, all the modules involved in this embodiment are logic modules, and in practical application, one logic unit may be one physical unit, may also be a part of one physical unit, and may also be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, a unit which is not so closely related to solve the technical problem proposed by the present invention is not introduced in the present embodiment, but this does not indicate that there is no other unit in the present embodiment.
Another aspect of the embodiments of the present invention further provides an electronic device, as shown in fig. 6, including: at least oneprocessor 601; and amemory 602 communicatively coupled to the at least oneprocessor 601; thememory 602 stores instructions executable by the at least oneprocessor 601, and the instructions are executed by the at least oneprocessor 601 to enable the at least oneprocessor 601 to perform the remote control method described in any of the above method embodiments.
Where thememory 602 and theprocessor 601 are coupled by a bus, the bus may comprise any number of interconnected buses and bridges that couple one or more of the various circuits of theprocessor 601 and thememory 602 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by theprocessor 601 is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to theprocessor 601.
Theprocessor 601 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Whilememory 602 may be used to store data used byprocessor 601 in performing operations.
In another aspect, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program. The computer program, when executed by a processor, implements the remote control method described in any of the method embodiments.
That is, those skilled in the art can understand that all or part of the steps in the method according to the above embodiments may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific embodiments for practicing the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.