Remote control method, device and equipment and computer storage medium
By using stun server and WebRTC data channel in the remote control system, the problem of network delay during remote control is solved, efficient and real-time data transmission is achieved, and the security and compatibility of the system are improved.
Patent Information
- Application Number
- CN202510086506.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-01-20
AI Technical Summary
During remote control, network delay causes untimely data transmission, and how to reduce latency has become an urgent problem.
By obtaining user information and verifying their control permissions, receiving user instructions, establishing a WebRTC data channel with the target device based on the stun server, and sending remote control signals to the target device based on the user instructions and the WebRTC data channel.
Improves data transmission efficiency, reduces latency, improves real-time, and has high security and good compatibility.
Smart Images

Figure CN119966974A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of the Internet of Things, and in particular to a remote control method, device, equipment and computer storage medium. Background Art
[0002] With the development of technology, some devices need to be remotely controlled, that is, users can control the devices remotely through the network.
[0003] During the control process, it is necessary to transmit the user's operating instructions to the device, and also to transmit the feedback data from the device to the user, so that the user can understand the various data and status of the device while realizing remote control. However, during the data transmission process, there is network delay, which leads to untimely data transmission. Therefore, how to reduce the delay is an urgent problem to be solved. Summary of the invention
[0004] In order to reduce data transmission delay, the present application provides a remote control method, apparatus, device and computer storage medium.
[0005] A remote control method provided by the present application adopts the following technical solution: A remote control method, comprising: Get user information; Determine whether the user information has control authority; If the user information has control authority, receiving the user instruction; Acquire a target device based on the user instruction and the device list; Establishing a WebRTC data channel with the target device based on the stun server; A remote control signal is sent to the target device based on the user instruction and the WebRTC data channel.
[0006] By adopting the above technical solution, the electronic device obtains user information and then verifies it, that is, determines whether the user information has control authority. If the user information has control authority, it indicates that the user can input instructions to remotely control the operation of the device. After the electronic device receives the user instruction, the electronic device obtains the target device based on the user instruction and the device list, that is, screens and finds the device that the user needs to remotely control, and then the electronic device establishes a WebRTC data channel with the target device based on the stun server. After that, the electronic device sends a remote control signal to the target device based on the user instruction and the WebRTC data channel, thereby completing the remote operation of the device; establishing a WebRTC data channel can improve data transmission efficiency, reduce delays, and thus improve real-time performance; and it also has the characteristics of high security and good compatibility.
[0007] Optionally, establishing a WebRTC data channel with the target device based on a stun server includes: Sending a request message to the STUN server to obtain the NAT information of the target device; The NAT information includes NAT type and NAT external network IP address; Performing NAT traversal based on the ICE protocol and the NAT information; Determine whether the NAT crossing is successful; If successful, a WebRTC data channel is established with the target device; If unsuccessful, data is relayed based on the TURN server to perform data transmission with the target device.
[0008] By adopting the above technical solution and utilizing the IEC protocol technology, communication can be achieved in a complex network environment. Furthermore, the established WebRTC data channel can improve data transmission efficiency and reduce latency. In the event that a WebRTC data channel cannot be established, a TURN server is used to relay data and data transmission can also be performed.
[0009] Optionally, before sending a remote control signal to the target device based on the user instruction and the WebRTC data channel, the method further includes: Obtain the working status of the target device in real time; Determining whether the working state meets the control requirements; If the control requirement is met, executing the step of sending a remote control signal to the target device based on the user instruction and the WebRTC data channel; If the control requirement is not met, a first prompt signal is output.
[0010] By adopting the above technical solution, before sending a remote control signal, the electronic device obtains the working status of the target device in real time, and then determines whether the target device is in a state that meets the control requirements, that is, determines whether the target device can be remotely controlled. If the target device meets the control requirements, the electronic device executes the step of sending a remote control signal. If not, the first prompt signal is output to prompt the user that the target device cannot be controlled at this time.
[0011] Optionally, when the working state does not meet the control requirement, the method further includes: Packaging the received user instructions to obtain an instruction group; sending the instruction group to the target device; After the working state changes from not meeting the control requirement to meeting the control requirement, the process includes: Acquire a first instruction input by the user; Determining whether the first instruction is the same as the last user instruction in the instruction group; If they are the same, a parsing signal is outputted to make the target device parse the instruction group and obey the control of the instruction group.
[0012] By adopting the above technical solution, when the working state of the target device does not meet the control requirements, the electronic device packages the received user instructions to obtain an instruction group, and sends the instruction group to the target device. When the working state changes from not meeting the control requirements to meeting the control requirements, the electronic device obtains the user's first instruction, and then the electronic device determines whether the first instruction is the same as the last user instruction in the instruction group. If they are the same, it is determined that the user needs to remotely control the target device according to the previously input instructions, so the electronic device outputs a parsing signal to the target device, so that the target device parses the instruction group and obeys the control of the instruction group. It can improve convenience. Even if the target device cannot respond to the user input instruction, the instruction can be pre-stored, and after the subsequent target device changes, it is executed according to the instruction group, which can improve user convenience.
[0013] Optionally, before outputting the parsing signal, the method further includes: Determining whether other user instructions in the instruction group are associated with the first instruction; If there is a correlation, the step of outputting the analytical signal is executed; If there is no association, a second prompt signal is output; determining, based on the second prompt signal, whether a confirmation signal input by the user is received; If the confirmation signal input by the user is received, the step of outputting the analysis signal is performed.
[0014] By adopting the above technical solution, before the electronic device outputs the parsing signal, the electronic device determines whether other user instructions in the instruction group except the last user instruction are associated with the first instruction. If there is an association, it is determined that other user instructions in the instruction group also need to be executed by the target device, so the electronic device executes the output of the parsing signal. If there is no association, the electronic device outputs a second prompt signal, and then the electronic device determines whether a confirmation signal input by the user is received based on the second prompt signal. If a confirmation signal is received, it indicates that the user still needs to execute other user instructions instead of only executing the first instruction, so after receiving the confirmation signal, the electronic device still executes the step of outputting the parsing signal.
[0015] Optionally, the method further includes: Acquire feedback data of the target device in real time; Determining whether the feedback data is continuous data; If the feedback data is not the continuous data, obtaining a supplement strategy; Sending a supplement signal to the target device based on the supplement strategy, so that the target device supplements the missing data; The supplementary strategies include: Controlling the target device to obtain the missing data; Acquire the starting data and the ending data based on the missing data, and send the starting data and the ending data; The starting data is the first generated data in the missing data, and the ending data is the last generated data in the missing data; Acquire intermediate data based on the missing data, and send the intermediate data; Wherein, the intermediate data is data generated at an intermediate moment in the missing data; Sending first remaining data generated after the intermediate data with the intermediate data as a first starting time; The second remaining data generated after the start data is sent with the start data as a second start time.
[0016] By adopting the above technical solution, the electronic device obtains the feedback data of the target device in real time, and then the electronic device determines whether the feedback data is continuous data, that is, whether the feedback data is missing. If there is feedback data that is not continuous data, it indicates that the data is missing, and the target device needs to complete the missing data. Therefore, the electronic device obtains a supplementary strategy, and then sends a supplementary signal to the target device based on the supplementary strategy so that the target device supplements the missing data. The specific supplementary strategy includes controlling the target device to obtain missing data, and then controlling the target device to obtain the starting data and the ending data based on the missing data, and sending the starting data and the ending data to the electronic device. After that, the target device is controlled to obtain intermediate data based on the missing data, and the intermediate data is sent to the electronic device. After that, the first remaining data after the intermediate data is sent to the electronic device in succession, and finally the data after the starting data is sent to the electronic device in succession. Under the condition of ensuring normal data, that is, real-time data is transmitted normally, the missing data is sent to the electronic device to reduce the possibility of increasing real-time data delay. And the starting data and the ending data are sent first, and then the intermediate number is sent, which is convenient for judging whether there is a big change in the target device of the missing data device. If there is a change, the change trend can be roughly understood. Then, the first remaining data after the intermediate data is sent to the electronic device, so that the data closer to the current moment is obtained first, and the changes closer to the current moment during the period of missing data can be understood first, so that the user can make a better response.
[0017] Optionally, before sending the supplementary signal to the target device based on the supplementary strategy, the method further includes: Obtaining the initial time and the end time of missing the feedback data; Acquire the feedback data within a first preset time before the initial moment, and use the acquired feedback data as first feedback data; Acquire the feedback data within a second preset time after the cut-off time, and use the acquired feedback data as second feedback data; Determining whether there is a difference between the first feedback data and the second feedback data; If there is no difference between the first feedback data and the second feedback data, the step of sending a supplementary signal to the target device based on the supplementary strategy is not performed. If there is a difference between the first feedback data and the second feedback data, determining whether the difference meets a preset requirement; If the difference meets the preset requirement, the step of sending a supplementary signal to the target device based on the supplementary strategy is not performed.
[0018] By adopting the above technical solution, before the electronic device sends a supplementary signal to the target device based on the supplementary strategy, the electronic device obtains the initial time and the end time of the missing feedback data, and then obtains the feedback data within the first preset time before the initial time, that is, obtains the first feedback data, and then obtains the second feedback data, and then the electronic device determines whether there is a difference between the first feedback data and the second feedback data. If there is no difference, it is determined that the target device has not changed to a large extent, so the step of sending the supplementary signal is not performed, that is, the missing feedback data does not need to be supplemented. If there is a difference, it is determined whether the difference meets the preset requirements. If it meets the preset requirements, there is no need to complete the data.
[0019] In the second aspect, the remote control device provided by the present application adopts the following technical solution: A remote control device, comprising: A first acquisition module, used to acquire user information; A judgment module, used to judge whether the user information has control authority; if the user information has control authority, receiving a user instruction; A second acquisition module, used to acquire a target device based on the user instruction and the device list; Establishing a module for establishing a WebRTC data channel with the target device based on a stun server; A sending module is used to send a remote control signal to the target device based on the user instruction and the WebRTC data channel.
[0020] In a third aspect, the present application provides an electronic device that adopts the following technical solution: An electronic device comprises a processor, wherein the processor is coupled to a memory; the processor is used to execute a computer program stored in the memory, so that the electronic device executes a remote control method as described in the first aspect.
[0021] In a fourth aspect, the present application provides a computer-readable storage medium that adopts the following technical solution: A computer-readable storage medium includes a computer program or an instruction. When the computer program or the instruction is executed on a computer, the computer is enabled to execute a remote control method as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flow chart of the remote control method of an embodiment of the present application.
[0023] Figure 2 It is a block diagram of a remote control device according to an embodiment of the present application.
[0024] Figure 3 It is a block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. Technical users in this field can make non-creative modifications to the present embodiment as needed after reading this specification. However, as long as it is within the scope of the claims of the present application, it is protected by the patent law.
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technical users in the field without creative work are within the scope of protection of this application.
[0027] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.
[0028] The embodiment of the present application discloses a remote control method. The remote control method can be executed by an electronic device. The electronic device can be a server or a terminal device, wherein the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smart phone, a tablet computer, a desktop computer, etc., but is not limited thereto.
[0029] The present application embodiment discloses a remote control method. Figure 1 , a remote control method includes the following main processes (S100~S600): Step S100, obtaining user information; Step S200, determining whether the user information has control authority; if the user information has control authority, proceeding to step S300; Step S300, receiving a user instruction; Step S400, obtaining a target device based on a user instruction and a device list; Step S500, establishing a WebRTC data channel with the target device based on the stun server; Step S600: Send a remote control signal to a target device based on a user instruction and a WebRTC data channel.
[0030] The electronic device obtains user information, and then determines whether the user information has control authority, that is, it determines whether the user has control authority. If the user information has control authority, the electronic device receives the user instruction. At this time, the verification has been successful, and the user has control authority. Therefore, the electronic device receives and executes the user instruction for user remote control input by the user. The electronic device obtains the target device based on the user instruction and the device list. The user instruction contains the device that the user needs to control. The electronic device selects and filters the device list based on the user instruction to obtain the target device. After obtaining the target device, the electronic device establishes a WebRTC data channel with the target device based on the stun server, and then sends a remote control signal to the target device based on the user instruction and the WebRTC data channel, thereby realizing remote control of the target device. Using the WebRTC data channel for data transmission can reduce latency to improve the real-time nature of control and feedback.
[0031] Moreover, when it is implemented, WebRTC technology is combined with VNC technology to realize remote control through client browser, WeChat applet, etc. This further improves convenience, and the diverse control methods can also be more flexibly adapted to different usage scenarios.
[0032] Specifically, a WebRTC data channel is established with the target device based on the STUN server, including: sending a request message to the STUN server to obtain the NAT information of the target device; the NAT information includes the NAT type and the NAT external network IP address; performing NAT traversal based on the ICE protocol and the NAT information; determining whether the NAT traversal is successful; if successful, establishing a WebRTC data channel with the target device; if unsuccessful, relaying data based on the TURN server to perform data transmission with the target device.
[0033] The electronic device sends a request message to the STUN server, thereby using the STUN server to obtain the NAT information of the target device, and then uses the ICE protocol and the NAT information to perform NAT traversal. After that, the electronic device determines whether the NAT traversal is successful. If successful, the channel WebRTC data channel is successfully established; if not, it is necessary to relay data based on the TURN server, that is, use the TURN server as a transit to achieve data transmission with the target device, and then complete remote control.
[0034] As an optional implementation of an embodiment of the present application, before sending a remote control signal to the target device based on user instructions and a WebRTC data channel, it also includes: acquiring the working status of the target device in real time; determining whether the working status meets the control requirements; if it meets the control requirements, executing the step of sending a remote control signal to the target device based on the user instructions and the WebRTC data channel; if it does not meet the control requirements, outputting a first prompt signal.
[0035] Before the electronic device sends a remote control signal to the target device based on the user instruction and the WebRTC data channel, the electronic device obtains the working status of the target device in real time and determines whether the working status meets the control requirements, that is, determines whether the target device can receive remote control. If the target device meets the control requirements, the above-mentioned step of sending the remote control signal is executed. If it does not meet the control requirements, the electronic device outputs a first prompt signal to prompt the user.
[0036] As an optional implementation manner of an embodiment of the present application, when the working state does not meet the control requirements, it also includes: packaging the received user instructions to obtain an instruction group; sending the instruction group to the target device; after the working state changes from not meeting the control requirements to meeting the control requirements, it includes: obtaining a first instruction input by the user; determining whether the first instruction is the same as the last user instruction in the instruction group; if they are the same, outputting a parsing signal to enable the target device to parse the instruction group and obey the control of the instruction group.
[0037] When the working state of the target device does not meet the control requirements, the electronic device packages the received large user instructions to obtain an instruction group, and then sends the instruction group to the target device, thereby temporarily storing the instructions input by the user. After the working state of the target device changes from not meeting the control requirements to meeting the control requirements, the electronic device obtains the first instruction input by the user, and then the electronic device determines whether the first instruction is the same as the last user instruction in the instruction group. If the first instruction is the same as the last user instruction in the instruction group, the electronic device sends a parsing signal to the target device, so that the target device parses the instruction group and obeys the control of the instruction group.
[0038] As an optional implementation manner of an embodiment of the present application, before outputting the analysis signal, it also includes: determining whether other user instructions in the instruction group are associated with the first instruction; if there is an association, executing the step of outputting the analysis signal; if there is no association, outputting a second prompt signal; based on the second prompt signal, determining whether a confirmation signal input by the user is received; if a confirmation signal input by the user is received, executing the step of outputting the analysis signal.
[0039] Before the electronic device outputs a parsing signal, the electronic device determines whether other user instructions in the instruction group are associated with the first instruction, and uses the determination of whether there is an association to determine whether the user instructions in the instruction group need to be executed. If there is an association with the first instruction, the electronic device executes the step of outputting a parsing signal. If there is no association with the first instruction, the electronic device determines that the first instruction output by the user may be a single instruction and has nothing to do with other user instructions in the instruction group. Therefore, the electronic device outputs a second prompt signal at this time, and the electronic device determines whether a confirmation signal input by the user is received based on the second prompt signal. If a confirmation signal input by the user is received, it indicates that although the first instruction is not associated with other user instructions in the instruction group, the user still needs to control the target device according to the previous control requirements, so the electronic device executes the step of outputting a parsing signal.
[0040] As an optional implementation manner of the embodiment of the present application, the method also includes: acquiring feedback data of the target device in real time; determining whether the feedback data is continuous data; if the feedback data is not continuous data, acquiring a supplementary strategy; sending a supplementary signal to the target device based on the supplementary strategy so that the target device supplements the missing data; the supplementary strategy includes: controlling the target device to acquire the missing data; acquiring starting data and ending data based on the missing data, and sending the starting data and ending data; wherein the starting data is the first data generated in the missing data, and the ending data is the last data generated in the missing data; acquiring intermediate data based on the missing data, and sending the intermediate data; wherein the intermediate data is data generated at an intermediate moment in the missing data; sending the first remaining data generated after the intermediate data with the intermediate data as the first starting moment; and sending the second remaining data generated after the starting data with the starting data as the second starting moment.
[0041] The electronic device obtains the feedback data of the target device in real time, that is, after establishing a connection with the target device, in addition to controlling the target device, it also needs to know the status and situation of the target device, that is, the target device will generate feedback data so that the user can understand. The electronic device determines whether the feedback data is continuous data, that is, whether the feedback data is complete and whether there is any loss when the target device is providing feedback. If the feedback data is continuous data, it is determined that the feedback data is lost at this time. At this time, the electronic device obtains a supplementary strategy and sends a supplementary signal to the target device based on the supplementary strategy, so that the target device supplements the missing data.
[0042] Specifically, the supplementary strategy includes: the electronic device controls the target device to have missing data, and then enables the target device to obtain the starting data and the ending data based on the missing data, and then sends the starting data and the ending data to the electronic device; at the same time, the intermediate data in the actual data is obtained, that is, the data at the middle moment of the missing data, and then the intermediate data is sent to the electronic device, and then the target device sends the data generated after the intermediate data with the intermediate data as the first starting moment, until the data generated at the moment before the ending data is sent. Then, the second remaining data generated after the starting data is sent with the starting data as the second starting moment, until the data generated at the moment before the intermediate data is sent; the electronic device can first obtain the data of the target device closer to the current moment, so as to better judge the situation of the target device. First, the starting data and the ending data are sent to the electronic device, and the electronic device can judge whether the state of the target device during the period of missing data has changed significantly based on the data at the starting and ending moments, and then send the intermediate data to check whether the target device has changed significantly at the middle moment. That is, after the feedback data of the three moments are sent to the electronic device, the situation of the target device during this period can be basically determined. In addition, sending data in segments at different times can reduce the impact of actual data on the data and control signals fed back by the target device at the current moment, that is, while being able to learn about the changes in the target device during the period of missing data as soon as possible, the occupancy of the data channel can be minimized.
[0043] As an optional implementation manner of an embodiment of the present application, before sending a supplementary signal to the target device based on the supplementary strategy, it also includes: obtaining an initial time and a deadline of missing feedback data; obtaining feedback data within a first preset time before the initial time, and using the obtained feedback data as first feedback data; obtaining feedback data within a second preset time after the deadline, and using the obtained feedback data as second feedback data; judging whether there is a difference between the first feedback data and the second feedback data; if there is no difference between the first feedback data and the second feedback data, not executing the step of sending a supplementary signal to the target device based on the supplementary strategy; if there is a difference between the first feedback data and the second feedback data, judging whether the difference meets the preset requirements; if the difference meets the preset requirements, not executing the step of sending a supplementary signal to the target device based on the supplementary strategy.
[0044] Before sending a supplementary signal to the target device based on the supplementary strategy, the electronic device obtains the initial time and the end time of the missing feedback data, and then obtains the feedback data within the first preset time before the initial time, that is, obtains the first feedback data, and then obtains the second feedback data, and then the electronic device determines whether there is a difference between the first feedback data and the second feedback data. If there is no difference, it is determined that the target device has not changed to a large extent, so the step of sending the supplementary signal is not performed, that is, there is no need to complete the missing feedback data. If there is a difference, it is determined whether the difference meets the preset requirements. If it meets the preset requirements, there is no need to complete the data.
[0045] After not executing the step of sending a supplementary signal to the target device based on the supplementary strategy, the electronic device determines in real time whether the target device changes from complying with the control requirements to not complying with the control requirements. If the target device changes, the electronic device sends a completion signal to the target device so that the target device sends all missing data to the electronic device.
[0046] Since the target device has changed to a state that does not meet the control requirements, the transmission of real data at this time will not affect the transmission of control signals and real-time data, and since the judgment has been made before, it will not affect the user's monitoring of the feedback data of the target device.
[0047] As an optional implementation manner of an embodiment of the present application, after sending a supplementary signal to the target device based on the supplementary strategy, it also includes: obtaining the amount of missing data, obtaining the amount of correctly completed data based on the amount of missing data, and calculating the data completion accuracy based on the amount of missing data and the amount of correctly completed data, that is, dividing the amount of correctly completed data by the amount of missing data, the electronic device determines whether the data completion accuracy is greater than the accuracy threshold. If the data completion accuracy is greater than the accuracy threshold, the electronic device does not act; if the data completion accuracy is less than the accuracy threshold, the electronic device outputs an accuracy prompt signal.
[0048] Figure 2 A structural block diagram of a remote control device 700 provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the remote control device 700 includes: The first acquisition module 701 is used to acquire user information; The judging module 702 is used to judge whether the user information has the control authority; if the user information has the control authority, it is transferred to the receiving module 703; Receiving module 703, used to receive user instructions; The second acquisition module 704 is used to acquire the target device based on the user instruction and the device list; Establishing module 705, used to establish a WebRTC data channel with the target device based on the stun server; The sending module 706 is used to send a remote control signal to the target device based on the user instruction and the WebRTC data channel.
[0049] Specifically, the establishment module 705 includes: The request acquisition module is used to send a request message to the STUN server to obtain the NAT information of the target device; the NAT information includes the NAT type and the NAT external network IP address; Traversal module, used for NAT traversal based on ICE protocol and NAT information; The first judgment submodule is used to judge whether the NAT traversal is successful; if successful, a WebRTC data channel is established with the target device; if unsuccessful, data is relayed based on the TURN server to perform data transmission with the target device.
[0050] In this optional embodiment, the remote control device 700 further includes: A first acquisition submodule is used to acquire the working status of the target device in real time before sending a remote control signal to the target device based on a user instruction and a WebRTC data channel; The second judgment submodule is used to judge whether the working state meets the control requirements; if it meets the control requirements, the step of sending a remote control signal to the target device based on the user instruction and the WebRTC data channel is executed; if it does not meet the control requirements, the first prompt signal is output.
[0051] In this optional embodiment, the remote control device 700 further includes: A packing module, used for packing received user instructions to obtain an instruction group when the working state does not meet the control requirements; A first sending submodule, used for sending the instruction group to the target device; A second acquisition submodule is used to acquire a first instruction input by a user after the working state changes from not meeting the control requirement to meeting the control requirement; The third judgment submodule is used to judge whether the first instruction is the same as the last user instruction in the instruction group; if they are the same, a parsing signal is output to make the target device parse the instruction group and obey the control of the instruction group.
[0052] In this optional embodiment, the remote control device 700 further includes: The fourth judgment submodule is used to judge whether other user instructions in the instruction group are associated with the first instruction before outputting the analysis signal; if so, the step of outputting the analysis signal is executed; if not, the second prompt signal is output; The fifth judgment submodule is used to judge whether a confirmation signal input by the user is received based on the second prompt signal; if a confirmation signal input by the user is received, the step of outputting a parsing signal is executed.
[0053] In this optional embodiment, the remote control device 700 further includes: The third acquisition submodule is used to obtain feedback data of the target device in real time; The sixth judgment submodule is used to judge whether the feedback data is continuous data; if the feedback data is not continuous data, a supplementary strategy is obtained; A second sending submodule is used to send a supplementary signal to the target device based on the supplementary strategy, so that the target device supplements the missing data; Supplemental strategies include: Control the target device to obtain missing data; Obtaining the starting data and the ending data based on the missing data, and sending the starting data and the ending data; Among them, the starting data is the first generated data among the missing data, and the ending data is the last generated data among the missing data; Obtain intermediate data based on missing data and send the intermediate data; Among them, the intermediate data is the data generated at the intermediate moment of the missing data; Sending first remaining data generated after the intermediate data with the intermediate data as a first starting time; The second remaining data generated after the start data is sent with the start data as the second start time.
[0054] In this optional embodiment, the remote control device 700 further includes: A fourth acquisition submodule, used for acquiring an initial time and a cutoff time of missing feedback data before sending a supplementary signal to a target device based on a supplementary strategy; A fifth acquisition submodule, used to acquire feedback data within a first preset time before the initial moment, and use the acquired feedback data as first feedback data; A sixth acquisition submodule, configured to acquire feedback data within a second preset time after the cutoff time, and use the acquired feedback data as second feedback data; The seventh judgment submodule is used to judge whether there is a difference between the first feedback data and the second feedback data; if there is no difference between the first feedback data and the second feedback data, the step of sending a supplementary signal to the target device based on the supplementary strategy is not executed. If there is a difference between the first feedback data and the second feedback data, it is judged whether the difference meets the preset requirements; if the difference meets the preset requirements, the step of sending a supplementary signal to the target device based on the supplementary strategy is not executed.
[0055] Figure 3The electronic device 800 is a block diagram of a structure of an electronic device 800 provided in an embodiment of the present application. The electronic device 800 may be a mobile phone, a tablet computer, a PC, a server, etc. Figure 3 As shown, the electronic device 800 includes a memory 801, a processor 802 and a communication bus 803; the memory and the processor 802 are connected via the communication bus 803. The memory 801 stores a computer program that can be loaded by the processor 802 and execute the remote control method provided in the above embodiment.
[0056] The memory 801 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 801 may include a program storage area and a managed data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the remote control method provided in the above embodiment, etc.; the managed data storage area may store managed data involved in the remote control method provided in the above embodiment, etc.
[0057] The processor 802 may include one or more processing cores. The processor 802 calls the managed data stored in the memory 801 by running or executing the instructions, programs, code sets or instruction sets stored in the memory 801, executes various functions of the present application and processes the managed data. The processor 802 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller and a microprocessor. It is understandable that for different devices, the electronic device used to implement the above-mentioned processor 802 function can also be other, and the embodiment of the present application is not specifically limited.
[0058] The communication bus 803 may include a path to transmit information between the above components. The communication bus 803 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 803 may be divided into an address bus, a managed data bus, a control bus, etc. For ease of representation, Figure 3 Only one double arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0059] An embodiment of the present application provides a computer storage medium storing a computer program that can be loaded by a processor and execute the remote control method provided in the above embodiment.
[0060] In this embodiment, the computer storage medium may be a tangible device that holds and stores instructions used by the instruction execution device. The computer storage medium may be, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof. Specifically, the computer storage medium may be a portable computer disk, a hard disk, a USB flash drive, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a podium random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, an optical disk, a magnetic disk, a mechanical encoding device, and any combination thereof.
[0061] The terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus.
Claims
1. A remote control method, characterized in that: include: Get user information; Determine whether the user information has control authority; If the user information has control authority, receiving the user instruction; Acquire a target device based on the user instruction and the device list; Establishing a WebRTC data channel with the target device based on the stun server; A remote control signal is sent to the target device based on the user instruction and the WebRTC data channel.
2. The method according to claim 1, characterized in that The establishing of a WebRTC data channel between the target device and the stun server includes: Sending a request message to the STUN server to obtain the NAT information of the target device; The NAT information includes NAT type and NAT external network IP address; Performing NAT traversal based on the ICE protocol and the NAT information; Determine whether the NAT crossing is successful; If successful, a WebRTC data channel is established with the target device; If unsuccessful, data is relayed based on the TURN server to perform data transmission with the target device.
3. The method according to claim 1, characterized in that Before sending a remote control signal to the target device based on the user instruction and the WebRTC data channel, the method further includes: Obtain the working status of the target device in real time; Determining whether the working state meets the control requirements; If the control requirement is met, executing the step of sending a remote control signal to the target device based on the user instruction and the WebRTC data channel; If the control requirement is not met, a first prompt signal is output.
4. The method according to claim 3, characterized in that When the working state does not meet the control requirements, the method further includes: Packaging the received user instructions to obtain an instruction group; sending the instruction group to the target device; After the working state changes from not meeting the control requirement to meeting the control requirement, the process includes: Acquire a first instruction input by the user; Determining whether the first instruction is the same as the last user instruction in the instruction group; If they are the same, a parsing signal is outputted to make the target device parse the instruction group and obey the control of the instruction group.
5. The method according to claim 1, characterized in that Before outputting the analytical signal, the method further comprises: Determining whether other user instructions in the instruction group are associated with the first instruction; If there is a correlation, the step of outputting the analysis signal is executed; If there is no association, a second prompt signal is output; determining, based on the second prompt signal, whether a confirmation signal input by the user is received; If the confirmation signal input by the user is received, the step of outputting the analysis signal is performed.
6. The method according to claim 1, characterized in that The method further comprises: Acquire feedback data of the target device in real time; Determining whether the feedback data is continuous data; If the feedback data is not the continuous data, obtaining a supplement strategy; Sending a supplement signal to the target device based on the supplement strategy, so that the target device supplements the missing data; The supplementary strategies include: Controlling the target device to obtain the missing data; Acquire the starting data and the ending data based on the missing data, and send the starting data and the ending data; The starting data is the first generated data in the missing data, and the ending data is the last generated data in the missing data; Acquire intermediate data based on the missing data, and send the intermediate data; Wherein, the intermediate data is data generated at an intermediate moment in the missing data; Sending first remaining data generated after the intermediate data with the intermediate data as a first starting time; The second remaining data generated after the start data is sent with the start data as a second start time.
7. The method according to claim 6, characterized in that Before sending the supplementary signal to the target device based on the supplementary strategy, the method further includes: Obtaining the initial time and the end time of missing the feedback data; Acquire the feedback data within a first preset time before the initial moment, and use the acquired feedback data as first feedback data; Acquire the feedback data within a second preset time after the cut-off time, and use the acquired feedback data as second feedback data; Determining whether there is a difference between the first feedback data and the second feedback data; If there is no difference between the first feedback data and the second feedback data, the step of sending a supplementary signal to the target device based on the supplementary strategy is not performed. If there is a difference between the first feedback data and the second feedback data, determining whether the difference meets a preset requirement; If the difference meets the preset requirement, the step of sending a supplementary signal to the target device based on the supplementary strategy is not performed.
8. A remote control device, characterized in that: include: A first acquisition module, used to acquire user information; A judgment module, used to judge whether the user information has control authority; If the user information has control authority, it is transferred to the receiving module; The receiving module is used to receive user instructions; A second acquisition module, used to acquire a target device based on the user instruction and the device list; Establishing a module for establishing a WebRTC data channel with the target device based on a stun server; A sending module is used to send a remote control signal to the target device based on the user instruction and the WebRTC data channel.
9. An electronic device, characterized in that: It comprises a processor, which is coupled to a memory; the processor is used to execute a computer program stored in the memory, so that the electronic device executes a remote control method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The invention comprises a computer program or an instruction, and when the computer program or the instruction is executed on a computer, the computer is enabled to execute a remote control method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Smart home equipment control method and device, electronic equipment and storage medium
CN112331213A
Data restoration method and device
CN112433997A
Video data storage method, device and system, electronic equipment and storage medium
CN113986611A
Method, device and system for realizing remote driving based on WebRTC and MQTT, and medium
CN117411917A
Remote vehicle diagnostic and detection method based on instant messaging communication, electronic device, and storage medium
US20230009246A1