Internet of Things equipment remote control method and platform, storage medium and program product
By generating and encapsulating control messages in remote control of IoT devices, the problem of additional information encapsulation and parsing in the prior art is solved, and direct remote control is realized, reducing development costs.
Patent Information
- Application Number
- CN202510113939.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2045-01-24
AI Technical Summary
In the remote control of IoT devices, the prior art requires additional information encapsulation and information parsing programs, resulting in increased program development costs.
By generating control messages and encapsulating them based on device identification and device resolution table, a target encapsulated message with the physical address of the Internet of Things device is obtained and sent to the server for remote control.
Without additional information encapsulation and information parsing programs, remote control of IoT devices is directly achieved through a unified communication protocol, reducing program development costs.
Smart Images

Figure CN119603339A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data transmission technology, and in particular to a remote control method, platform, storage medium and program product for an Internet of Things device. Background Art
[0002] At present, in the process of remote control between IoT devices, a client-server based message publish / subscribe transmission protocol is usually used for information transmission. Since this transmission protocol only defines the transmission method of information but does not involve the specific content and format of the information, for IoT devices in different network environments and with different functions, additional information encapsulation and information parsing programs are required to process the information to be received and sent in order to realize remote control of IoT devices, resulting in additional program development costs. Summary of the invention
[0003] The main purpose of this application is to provide a remote control method, platform, storage medium and program product for an Internet of Things device, aiming to solve the technical problem of needing to modify the processing program for receiving and sending messages when performing remote control of an Internet of Things device.
[0004] To achieve the above purpose, the present application proposes a remote control method for an IoT device, the method comprising: In response to a control instruction to a second Internet of Things device, a control message is generated, wherein the first Internet of Things device and the second Internet of Things device are connected to each other through an ad hoc network communication; Based on the device identifier of the second Internet of Things device in the control message and the device resolution table generated during the self-organizing network, the control message is encapsulated to obtain a target encapsulated message having the physical address of the second Internet of Things device; The target encapsulated message is sent to the server, so that the server sends the target encapsulated message to the second Internet of Things device to achieve remote control of the second Internet of Things device.
[0005] In one embodiment, the step of encapsulating the control message based on the device identifier of the second IoT device in the control message and the device resolution table generated during the ad hoc network includes: Extract the virtual address and the physical address corresponding to the device identifier in the device resolution table; Based on the virtual address, encapsulate the control message to obtain a preliminary encapsulated message having the virtual address of the second Internet of Things device; Based on the physical address, the preliminary encapsulated message is encapsulated to obtain a target encapsulated message having the physical address of the second Internet of Things device.
[0006] In one embodiment, after the step of generating a control message in response to a control instruction to the second IoT device, the step further includes: Initiate a connection request to the server; authenticating the server based on the received first identity authentication certificate of the server, wherein the first identity authentication certificate is sent to the local after the server receives the local connection request; In response to an identity authentication request sent by the server, a local second identity authentication certificate is sent to the server for the server to verify the local identity, wherein the identity authentication request is sent by the server to the local after successfully verifying the identity of the server; If verification success information is received, an encrypted channel is established with the server to transmit messages based on the encrypted channel, wherein the verification success information is sent to the local after the server successfully verifies the local identity.
[0007] In one embodiment, after the step of authenticating the server based on the received first identity authentication certificate of the server, the method further includes: Based on an asymmetric encryption algorithm, perform key exchange with the server to obtain a symmetrically encrypted session key; Wherein, after the step of encapsulating the control message based on the virtual address to obtain a preliminary encapsulated message having the virtual address of the second IoT device, the method further includes: The preliminary encapsulation message is encrypted based on the session key to obtain an encrypted preliminary encapsulation message.
[0008] In one embodiment, the method further comprises: When the connection state with the second IoT device changes, the state change information is sent to the server, so that the server updates the device resolution table based on the state change information; When a connection status confirmation request sent by the server is received, connection status information is fed back to the server, wherein the connection confirmation request is sent by the server to the local every preset first time period.
[0009] To achieve the above purpose, the present application also proposes a remote control method for an IoT device, which is applied to a server, and the method comprises: Receive a target encapsulated message, decrypt the target encapsulated message based on a session key, and obtain a decrypted encapsulated message, wherein the first Internet of Things device and the second Internet of Things device are connected through an ad hoc network communication, the target encapsulated message is obtained by the first Internet of Things device encapsulating the control message based on the device identifier of the second Internet of Things device in the control message and the device resolution table generated in the ad hoc network, the control message is generated by the first Internet device in response to a control instruction to the second Internet of Things device, and the session key is obtained by negotiation with the first Internet of Things device; Based on the physical address in the decrypted encapsulated message, the decrypted encapsulated message is sent to the second Internet of Things device to achieve remote control of the second Internet of Things device.
[0010] In one embodiment, the method further comprises: Sending a connection status confirmation request to the IoT device every preset first time period; Based on whether the connection status information fed back by the IoT device is received within a preset second time period, determining whether the corresponding IoT device is in a connected state; If the connection status information is not received within the preset second time period, it is determined that the corresponding Internet of Things device is not in a connected state; Based on the determination result, the device parsing table is updated.
[0011] In addition, to achieve the above purpose, the present application also proposes an IoT device remote control platform, the IoT device remote control platform comprising: A first Internet of Things device, configured to generate a control message in response to a control instruction for a second Internet of Things device, wherein the first Internet of Things device and the second Internet of Things device are connected via an ad hoc network communication, encapsulate the control message based on a device identifier of the second Internet of Things device in the control message and a device resolution table generated during the ad hoc network, obtain a target encapsulated message having a physical address of the second Internet of Things device, and send the target encapsulated message to a server, so that the server sends the target encapsulated message to the second Internet of Things device, thereby realizing remote control of the second Internet of Things device; A server is used to receive a target encapsulated message, decrypt the target encapsulated message based on a session key, and obtain a decrypted encapsulated message, wherein a first Internet of Things device and a second Internet of Things device are connected via a self-organizing network communication, the target encapsulated message is obtained by encapsulating a control message by the first Internet of Things device based on the device identifier of the second Internet of Things device in the control message and a device resolution table generated during the self-organizing network, the control message is generated by the first Internet device in response to a control instruction to the second Internet of Things device, the session key is obtained by negotiation with the first Internet of Things device, and based on the physical address in the decrypted encapsulated message, the decrypted encapsulated message is sent to the second Internet of Things device to achieve remote control of the second Internet of Things device.
[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the remote control method of the Internet of Things device as described above are implemented.
[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the remote control method of the Internet of Things device as described above.
[0014] One or more technical solutions proposed in this application have at least the following technical effects: The present application generates a control message by a first Internet of Things device in response to a control instruction to a second Internet of Things device, wherein the first Internet of Things device and the second Internet of Things device are connected through a self-organizing network communication, and based on the device identifier of the second Internet of Things device in the control message and the device resolution table generated during the self-organizing network, the control message is encapsulated to obtain a target encapsulated message with a physical address of the second Internet of Things device, and the target encapsulated message is sent to a server, so that the target encapsulated message can be sent to the second Internet of Things device through the server, thereby realizing remote control of the second Internet of Things device; Since the first Internet of Things device and the second Internet of Things device are connected via a self-organizing network communication, a unified communication protocol can be used for the Internet of Things devices in the network connection. By encapsulating the control message into a target encapsulated message with the physical address of the second Internet of Things device, the target encapsulated message can be sent to the second Internet of Things device through the server. Since the information transmission uses unified communication information, the second Internet of Things device can directly parse the control message in the target encapsulated message, so that the first Internet of Things device can remotely control the second Internet of Things device through the control message, without the need for additional information encapsulation and information parsing programs, thereby not incurring additional program development costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] Figure 1 A flowchart of the first embodiment of the remote control method for an Internet of Things device provided in this application; Figure 2 A schematic diagram of a first scenario provided in Example 1 of the method for remotely controlling an Internet of Things device of the present application; Figure 3 A schematic diagram of a second scenario provided in Example 1 of the method for remotely controlling an IoT device of the present application; Figure 4 A flowchart of the second embodiment of the remote control method for an Internet of Things device of the present application is provided; Figure 5 A flowchart of the third embodiment of the remote control method for an Internet of Things device of the present application; Figure 6 This is a schematic diagram of the structure of the remote control platform for Internet of Things devices according to an embodiment of the present application.
[0018] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0019] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0020] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0021] It should be noted that the execution subject of this embodiment may be a computing service device with message processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a message transmission device, etc. The following takes a message transmission device as an example to illustrate this embodiment and the following embodiments.
[0022] Based on this, the present application embodiment provides a remote control method for an Internet of Things device, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the remote control method for an Internet of Things device of the present application.
[0023] In this embodiment, the IoT device remote control method includes steps S10 to S30: Step S10, generating a control message in response to a control instruction to a second IoT device, wherein the first IoT device and the second IoT device are connected to each other via an ad hoc network communication; It is understandable that the current IoT message transmission generally adopts a message publish / subscribe transmission protocol based on a client-server architecture, such as the MQTT (Message Queuing Telemetry Transport) protocol. Figure 2 . This transmission protocol only supports the transmission of string type information, and does not support complex data types. There may be message duplication and message loss during the information transmission process, and the specific content and format of the information are not involved when the information is transmitted. For IoT devices in different network environments and with different functions, additional information encapsulation and information parsing programs are required to process the information that needs to be received and sent in order to realize remote control of IoT devices, resulting in additional program development costs.
[0024] It should be noted that the server is a system or platform specifically used to manage and monitor IoT devices, and in this embodiment is mainly used to transmit information. The first IoT device is an IoT device that sends a control instruction, and the second IoT device is a target IoT device that receives the control instruction.
[0025] Different from the traditional way of controlling all IoT devices on the server side, in this embodiment, the control instruction of the IoT device is sent from the first IoT device to a second IoT device in a remote location and in the self-organizing network. Different control messages are generated based on the different control instructions, and the second IoT device is controlled by the control message.
[0026] Specifically, there are devices A and B connected in an ad hoc network at locations A and B that are far apart. The overall manufacturing efficiency of the IoT devices at the two locations needs to exceed a preset value. When the manufacturing efficiency of device A is lower than the preset value, device A sends a control instruction to device B to increase the manufacturing efficiency, generates a corresponding control message, and controls device B to improve the manufacturing efficiency through the control message, thereby making the overall manufacturing efficiency above the preset value.
[0027] Step S20, based on the device identifier of the second IoT device in the control message and the device resolution table generated during the ad hoc network, encapsulate the control message to obtain a target encapsulated message having the physical address of the second IoT device; It should be noted that, in this embodiment, the IoT device determines the target IoT device to be controlled through device identifiers such as device codes, and the physical address and virtual address of the specific target IoT device are obtained through the device resolution table.
[0028] The device resolution table is a table used to record the relationship between the device code, virtual IP (Internet Protocol) address and physical address of each IoT device.
[0029] It can be understood that by determining the device code of the target IoT device, the virtual address and physical address of the target IoT device can be determined through the device resolution table, so that the control message can be sent to the target IoT device.
[0030] In order to ensure the reliability and efficiency of the message during transmission, the data needs to be encapsulated. Since the virtual address and physical address of the target IoT device can be determined through the device resolution table, during the message transmission process, the control message is encapsulated into a message with the physical address of the target IoT device, so that the control message can be accurately sent to the target IoT device.
[0031] In a feasible implementation manner, based on the device identification of the second IoT device in the control message and the device resolution table generated during the ad hoc network, the specific implementation manner of encapsulating the control message may also be: Extract the virtual address and the physical address corresponding to the device identifier in the device resolution table, encapsulate the control message based on the virtual address to obtain a preliminary encapsulated message with the virtual address of the second Internet of Things device, and encapsulate the preliminary encapsulated message based on the physical address to obtain a target encapsulated message with the physical address of the second Internet of Things device.
[0032] It should be noted that the initial encapsulation message has the virtual IP address of the second IoT device, and the target encapsulation message has the physical address of the second IoT device, which is used for data transmission in the same local area network. By using the physical address, the control message can be accurately sent to the target IoT device.
[0033] The process of encapsulating the message data into the first encapsulated message is performed by the sending process of the first IoT device, and the process of encapsulating the preliminary encapsulated message into the target encapsulated message is first sent to the Tun (network tunnel, Tunnel) network card device, and then performed through the client networking program, refer to Figure 3 The Tun network card device is a virtual network interface that can be used to create and process IP packets.
[0034] It is understandable that the client networking program is a user-side program. If the encrypted message data is processed by the client networking program, the message data usually needs to pass through the physical network interface. The Tun network card allows the user space program to directly read and write IP data packets without passing through the physical network interface, thereby improving the stability and security of the transmission process.
[0035] Step S30: Send the target encapsulated message to the server, so that the server sends the target encapsulated message to the second IoT device to achieve remote control of the second IoT device.
[0036] It should be noted that the target encapsulated message is sent by a network card in the first IoT device that can access the Internet.
[0037] It can be understood that the first IoT device and the second IoT device of this embodiment are IoT devices located in different places and cannot transmit information by direct transmission. Therefore, a network card that can access the Internet is required to transmit information through the Internet.
[0038] It should also be noted that the server has an Internet networking server program and a DNS (Domain Name System) service. The Internet networking server is used in the Internet of Things for centralized management of Internet of Things devices. The DNS (Domain Name System) service is used for Internet of Things devices to query the corresponding virtual IP address and physical address through the device code.
[0039] It is understandable that based on the physical address of the second IoT device in the encapsulated message data, it can be determined which IoT device the message data needs to be sent to. IoT devices may be in different network environments, and direct communication may encounter network connection problems. Therefore, it is necessary to use the server as an intermediary to transmit information.
[0040] In a feasible implementation manner, the method may also be implemented as follows: When the connection status with the second IoT device changes, the status change information is sent to the server, so that the server can update the device resolution table based on the status change information, and when a connection status confirmation request sent by the server is received, the connection status information is fed back to the server, wherein the connection confirmation request is sent by the server to the local every preset first time period.
[0041] It should be noted that the state change information includes situations where a certain IoT device has established a network connection with other IoT devices, and situations where a certain IoT device has disconnected from the network with other IoT devices.
[0042] It is understandable that, unlike Internet communication, the IoT environment usually involves machine-to-machine (M2M) communication, and the machine devices in the IoT environment need to communicate with other devices continuously or intermittently. When the connection status of the IoT device being networked changes, it may affect other IoT devices. Therefore, this embodiment updates the device resolution table based on the connection status changes of the IoT device.
[0043] The device resolution table that records the virtual IP address and device code of the IoT device is generated and updated by the server. The server will synchronize the generated device resolution table to the DNS service so that the first IoT device can query the corresponding device virtual IP address and physical address when sending a message.
[0044] When an IoT device is connected to other IoT devices, or when an IoT device is disconnected from other IoT devices, the IoT device information in the device resolution table will be different from the actual IoT device information. Therefore, the IoT device needs to send the state change information to the server so that the server can update the device resolution table.
[0045] It should also be noted that the request information is used to confirm whether the IoT device is still connected. The IoT device usually feeds back the connection status information by sending a heartbeat packet.
[0046] It is understandable that, under normal circumstances, the IoT device will send its own status change information to the server, but when the network connection of the device is suddenly interrupted, the IoT device cannot send its own status change information to the server, and the server does not update the device resolution table because it does not receive the information sent by the IoT device. Therefore, when receiving the request information sent by the server, the IoT device needs to send feedback information for confirming the connection status to the server so that the server can update the device resolution table.
[0047] In summary, in this embodiment, a control message is generated by a first Internet of Things device in response to a control instruction to a second Internet of Things device, wherein the first Internet of Things device and the second Internet of Things device are connected via an ad hoc network communication, and based on the device identifier of the second Internet of Things device in the control message and the device resolution table generated during the ad hoc network, the control message is encapsulated to obtain a target encapsulated message having a physical address of the second Internet of Things device, and the target encapsulated message is sent to a server, so that the target encapsulated message can be sent to the second Internet of Things device through the server, thereby realizing remote control of the second Internet of Things device; Since the first Internet of Things device and the second Internet of Things device are connected via a self-organizing network communication, a unified communication protocol can be used for the Internet of Things devices in the network connection. By encapsulating the control message into a target encapsulated message with the physical address of the second Internet of Things device, the target encapsulated message can be sent to the second Internet of Things device through the server. Since the information transmission uses unified communication information, the second Internet of Things device can directly parse the control message in the target encapsulated message, so that the first Internet of Things device can remotely control the second Internet of Things device through the control message, without the need for additional information encapsulation and information parsing programs, thereby not incurring additional program development costs.
[0048] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 4 , after the step of generating a control message in response to a control instruction to the second IoT device, the method further includes steps S11 to S14: Step S11, initiating a connection request to the server; It should be noted that the message transmission method based on the client-server message publish / subscribe transmission protocol is as follows: the client that publishes a message to the server will include a topic in the published message, and the clients that want to receive the message will subscribe to the topic. After receiving the information published by the client to the topic, the server will send the information to all clients that have subscribed to the topic.
[0049] The data transmitted by the above message transmission methods is not encrypted by default, and there is no strict control over which clients can subscribe to which topics. Malicious users may monitor sensitive information or publish false messages to specific topics. Therefore, the security of using client-server to transmit messages between IoT devices is low, and the message transmission program needs to be adapted and modified, resulting in high implementation complexity.
[0050] It is understandable that message transmission may cause problems such as data being intercepted or tampered with by middlemen. It is necessary to establish a secure transmission channel to ensure the security of data transmission. Therefore, it is necessary to first initiate a connection request to the server to perform subsequent identity authentication and information encryption and other operations that can improve the security of information transmission.
[0051] Step S12, authenticating the server based on the received first identity authentication certificate of the server, wherein the first identity authentication certificate is sent to the local after the server receives the local connection request; It should be noted that the first identity authentication certificate is used by the first IoT device to verify the identity of the service. In this embodiment, the verification method may be authentication methods such as TLS (Transport Layer Security) and SSL (Secure Sockets Layer).
[0052] It is understandable that ordinary data transmission emphasizes the confidentiality and integrity of user data in the virtual network to prevent the leakage of sensitive information. However, if the sent routes are tampered with during the interaction of multiple IoT devices, it may have a greater impact on remote control and cause the IoT devices to fail to operate normally. Therefore, in addition to ensuring the confidentiality and integrity of data, this embodiment also authenticates the server through an identity verification certificate for data transmission between IoT devices.
[0053] Specifically, when the first IoT device sends a message, it may send the message to other devices due to problems such as tampering with the sending route. Therefore, before sending the message, it is necessary to verify whether the target of the message is correct. Therefore, it is necessary to verify the identity of the server through the first identity authentication certificate of the server.
[0054] Step S13, in response to the identity authentication request sent by the server, sending the local second identity authentication certificate to the server for the server to verify the local identity, wherein the identity authentication request is sent by the server to the local after successfully verifying the identity of the server; It should be noted that the second identity authentication certificate is used by the server to verify the identity of the first IoT device.
[0055] It is understandable that the first identity authentication certificate can only allow the first IoT device to verify the identity of the server, but the server cannot determine whether the identity of the first IoT device is correct, which may cause the server to receive erroneous messages. Therefore, after the first IoT device successfully verifies the identity of the server, it is necessary to verify the identity of the first IoT device through the second identity authentication certificate to ensure the security of information transmission.
[0056] Step S14, if verification success information is received, an encrypted channel is established with the server to transmit messages based on the encrypted channel, wherein the verification success information is sent to the local after the server successfully verifies the local identity.
[0057] It can be understood that the first IoT device and the server have successfully verified each other's identity, and both parties can correctly send and receive messages. Therefore, by establishing an encrypted message transmission channel between the first IoT device and the server, the messages transmitted in the encrypted channel will not be intercepted, thereby ensuring the security of message transmission.
[0058] In a feasible implementation manner, after the step of authenticating the server based on the received first identity authentication certificate of the server, the implementation manner may also be: Based on an asymmetric encryption algorithm, a key is exchanged with the server to obtain a symmetrically encrypted session key, wherein after the step of encapsulating the control message based on the virtual address to obtain a preliminary encapsulated message having the virtual address of the second IoT device, the method further includes: The preliminary encapsulation message is encrypted based on the session key to obtain an encrypted preliminary encapsulation message.
[0059] It is understandable that during the message transmission process, a third party may modify the message, causing the message received by the server to be different from the message sent by the first IoT device. Therefore, it is necessary to encrypt the message transmission process to ensure that only the first IoT device and the receiving end can decrypt the information. The encryption and decryption of the message data are usually based on the session key of both parties.
[0060] A session key is a temporary encryption key used to protect data transmission between two communicating entities during a specific session. The session key is usually negotiated between the sender and the receiver. Since the negotiated session key may be intercepted or tampered with, in order to further increase the security of message transmission, the negotiation process of the session key also needs to be encrypted.
[0061] This embodiment uses an asymmetric encryption method to encrypt the key negotiation process. Asymmetric encryption is performed by generating a public key and a private key. The embodiment is described using the RSA (Rivest–Shamir–Adleman) asymmetric encryption method.
[0062] When using RSA for key negotiation, the server will first generate a public key and a private key. There is reciprocity between the public key and the private key. Information encrypted by the public key can only be decrypted by the private key, and information encrypted by the private key can only be decrypted by the public key. The public key will be sent by the server to the first IoT device. The first IoT device will randomly generate a session key and encrypt it with the public key. The encrypted session key will be sent by the first IoT device to the server. The server will decrypt it with the private key to obtain the session key. Therefore, the security of the key negotiation process can be guaranteed by asymmetric encryption.
[0063] After key negotiation through asymmetric encryption method, both ends of the message data sending and receiving obtain the keys used to encrypt and decrypt data. Therefore, during the message transmission process, based on the asymmetric encryption algorithm, key exchange is performed with the server to obtain a symmetric encrypted session key.
[0064] Understandably, ordinary data transmission mainly uses general computing devices such as computers, laptops, smartphones and tablets, which usually have high computing power and large storage space. The Internet of Things includes various types of embedded devices such as sensors, actuators and other specialized hardware. These devices are often resource-constrained and have limited computing power. Therefore, when transmitting information between IoT devices, it is necessary to reduce the complexity of calculation.
[0065] Specifically, since asymmetric encryption can improve the security of the key negotiation process, but the calculation complexity is high and the processing speed is relatively slow. Therefore, after the sending end and the receiving end complete the key negotiation and message transmission connection, this embodiment encrypts the message data to be transmitted by a symmetric encryption algorithm with low calculation complexity, thereby improving the efficiency of message transmission while ensuring the security of message transmission. Therefore, this embodiment encrypts the preliminary encapsulation message by symmetric encryption based on the session key to obtain the encrypted preliminary encapsulation message.
[0066] In summary, this embodiment establishes a message transmission connection between the first Internet of Things device and the server through two-way authentication, determines the session key between the first Internet of Things device and the server based on an asymmetric encryption algorithm, and encrypts the transmitted message based on the session key.
[0067] Message transmission may cause problems such as the message being intercepted or tampered by a middleman. The interception of the message usually occurs when the message data is sent from the sender to the receiver. The tampering of the message is usually due to the fact that the message is not encrypted. After the middleman tampered with the message, it can still be received by the receiver. By establishing a message transmission connection between the first IoT device and the server, the message can be prevented from being intercepted, and the session key used for message encryption can be determined. The message can be encrypted to prevent the message from being tampered with, and based on the asymmetric encryption algorithm, the session key between the first IoT device and the server can be determined, which can further improve the security of message transmission. Therefore, this embodiment ensures the confidentiality, integrity, and availability of data transmission by encrypting the message during the transmission process and establishing a message transmission connection.
[0068] Based on this, the third embodiment of the present application also provides a remote control method for an Internet of Things device, referring to Figure 5 , Figure 5 This is a flow chart of the third embodiment of the remote control method for an Internet of Things device of the present application; for the same or similar contents as those in the above-mentioned embodiments 1 and 2, reference can be made to the above introduction and no further description will be given later.
[0069] The method for remotely controlling an IoT device is applied to a server, and the method comprises steps H10 to H20: Step H10, receiving a target encapsulated message, decrypting the target encapsulated message based on a session key, and obtaining a decrypted encapsulated message, wherein the first Internet of Things device and the second Internet of Things device are connected via an ad hoc network communication, the target encapsulated message is obtained by the first Internet of Things device encapsulating the control message based on the device identifier of the second Internet of Things device in the control message and a device resolution table generated during the ad hoc network, the control message is generated by the first Internet device in response to a control instruction to the second Internet of Things device, and the session key is obtained by negotiation with the first Internet of Things device; It can be understood that the encrypted message needs to be decrypted to obtain the information therein. The target encapsulated message received by the server is a message encrypted by the first Internet of Things device, and the key for encrypting the target encapsulated message is negotiated between the first Internet of Things device and the server. Therefore, the server can decrypt the target encapsulated message through the negotiated session key and obtain the information therein.
[0070] Step H20: Based on the physical address in the decrypted encapsulated message, the decrypted encapsulated message is sent to the second Internet of Things device to achieve remote control of the second Internet of Things device.
[0071] It is understandable that after the server decrypts the target encapsulated message, it can obtain the physical address information in the target encapsulated message, and the server can confirm that the second IoT device is needed through the physical address information. Since the server has a route from the server to each Internet device, after determining the second IoT device, the message can be sent to the network card of the second IoT device through the route, so that the second IoT device can parse the message and run based on the control message obtained by the parsing, thereby realizing remote control of the second IoT device.
[0072] In a feasible implementation manner, the method may also be implemented as follows: At every preset first time period, a connection status confirmation request is sent to the Internet of Things device. Based on whether the connection status information fed back by the Internet of Things device is received within the preset second time period, it is determined whether the corresponding Internet of Things device is in a connected state. If the connection status information is not received within the preset second time period, it is determined that the corresponding Internet of Things device is not in a connected state. Based on the judgment result, the device resolution table is updated.
[0073] It should be noted that the preset first time period is the time interval for the server to send request information to each IoT device, and the preset second time period is used to determine whether the IoT device is in a connected state.
[0074] It is understandable that when the connection status of an IoT device changes, there may be a network interruption, which makes it impossible for the IoT device to send status change information to the server. Therefore, the server needs to send request information at fixed time intervals to confirm the status of each IoT device.
[0075] After the server sends the request information, if the IoT device can send feedback information back to the server within the preset second time period, the server determines that the IoT device is still connected. Otherwise, the server determines that the IoT device is not connected.
[0076] According to the judgment result, the actual connection status of the IoT device and the device status recorded in the device resolution table may be different. Therefore, the server needs to update the device resolution table based on the judgment result.
[0077] Specifically, IoT devices No. 1 to 6 were networked. IoT device No. 1 was disconnected from other IoT devices due to network connection problems, and did not send disconnection information to the server. After the preset first time period, the server sends request information to all IoT devices in the network. IoT devices No. 2 to 5 in the connected state send feedback information back to the server, and the server confirms that IoT devices No. 2 to 5 are still connected. After the preset second time period, the server still has not received feedback information from IoT device No. 1. Therefore, the server determines that Internet device No. 1 is not in a connected state, and updates the device resolution table based on the judgment result.
[0078] In summary, in this embodiment, request information for confirming the connection status is sent to each networking device every preset first time period, and whether the corresponding networking device is in a connected state is determined based on whether feedback information from the networking device is received within the preset second time period. If feedback information from the networking device is not received within the preset second time period, it is determined that the corresponding networking device is not in a connected state, and the device resolution table is updated based on the judgment result.
[0079] When the connection status of an IoT device changes, there may be a situation where the IoT device cannot send the status change information to the server, and the server needs to send request information at fixed time intervals to confirm the status of each IoT device. The actual status of each IoT device may be different from that recorded in the device resolution table, and the server needs to update the device resolution table based on the judgment result of the IoT device connection status. Therefore, this embodiment updates the device resolution table through the request information of the server and the feedback information of the IoT device, ensuring the accuracy of confirming the corresponding virtual IP address according to the device name.
[0080] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the remote control method of the Internet of Things device of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0081] This application also provides a remote control platform for IoT devices, please refer to Figure 6 , the IoT device remote control platform includes: The first Internet of Things device 10 is used to generate a control message in response to a control instruction for the second Internet of Things device, wherein the first Internet of Things device and the second Internet of Things device are connected via an ad hoc network communication, and based on the device identifier of the second Internet of Things device in the control message and the device resolution table generated during the ad hoc network, the control message is encapsulated to obtain a target encapsulated message with a physical address of the second Internet of Things device, and the target encapsulated message is sent to a server, so that the server sends the target encapsulated message to the second Internet of Things device, thereby realizing remote control of the second Internet of Things device; The server 20 is used to receive a target encapsulated message, decrypt the target encapsulated message based on a session key, and obtain a decrypted encapsulated message, wherein the first Internet of Things device and the second Internet of Things device are connected through a self-organizing network communication, and the target encapsulated message is obtained by the first Internet of Things device encapsulating the control message based on the device identifier of the second Internet of Things device in the control message and the device resolution table generated during the self-organizing network, the control message is generated by the first Internet device in response to a control instruction to the second Internet of Things device, the session key is obtained by negotiation with the first Internet of Things device, and the decrypted encapsulated message is sent to the second Internet of Things device based on the physical address in the decrypted encapsulated message to achieve remote control of the second Internet of Things device.
[0082] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the remote control method for an Internet of Things device in the above-mentioned embodiment.
[0083] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0084] The computer-readable storage medium may be included in the message transmission device; or may exist independently without being assembled into the message transmission device.
[0085] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the message transmission device, the message transmission device executes the Internet of Things device remote control method.
[0086] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0087] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to each embodiment of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0088] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0089] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for remotely controlling an IoT device, and can solve the technical problem that the processing program for receiving and sending messages needs to be modified when performing remote control of an IoT device. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for remotely controlling an IoT device provided by the above-mentioned embodiment, and will not be elaborated on here.
[0090] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned method for remote control of an Internet of Things device when executed by a processor.
[0091] The computer program product provided by the present application can solve the technical problem that when performing remote control of an IoT device, the processing program for receiving and sending messages needs to be modified. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the IoT device remote control method provided by the above embodiment, and will not be elaborated here.
[0092] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A remote control method for an Internet of Things device, characterized in that: Applied to a first IoT device, the method includes: In response to a control instruction to a second Internet of Things device, a control message is generated, wherein the first Internet of Things device and the second Internet of Things device are connected to each other through an ad hoc network communication; Based on the device identifier of the second Internet of Things device in the control message and the device resolution table generated during the ad hoc network, the control message is encapsulated to obtain a target encapsulated message having the physical address of the second Internet of Things device; The target encapsulated message is sent to the server, so that the server sends the target encapsulated message to the second Internet of Things device to achieve remote control of the second Internet of Things device.
2. The method according to claim 1, characterized in that: The step of encapsulating the control message based on the device identification of the second Internet of Things device in the control message and the device resolution table generated during the self-organizing network includes: Extract the virtual address and the physical address corresponding to the device identifier in the device resolution table; Based on the virtual address, encapsulate the control message to obtain a preliminary encapsulated message having the virtual address of the second Internet of Things device; Based on the physical address, the preliminary encapsulated message is encapsulated to obtain a target encapsulated message having the physical address of the second Internet of Things device.
3. The method according to claim 2, characterized in that After the step of generating a control message in response to the control instruction to the second IoT device, the method further includes: Initiate a connection request to the server; authenticating the server based on the received first identity authentication certificate of the server, wherein the first identity authentication certificate is sent to the local after the server receives the local connection request; In response to an identity authentication request sent by the server, a local second identity authentication certificate is sent to the server for the server to verify the local identity, wherein the identity authentication request is sent by the server to the local after successfully verifying the identity of the server; If verification success information is received, an encrypted channel is established with the server to transmit messages based on the encrypted channel, wherein the verification success information is sent to the local after the server successfully verifies the local identity.
4. The method according to claim 3, characterized in that After the step of authenticating the server based on the received first identity authentication certificate of the server, the method further includes: Based on an asymmetric encryption algorithm, perform key exchange with the server to obtain a symmetrically encrypted session key; Wherein, after the step of encapsulating the control message based on the virtual address to obtain a preliminary encapsulated message having the virtual address of the second IoT device, the method further includes: The preliminary encapsulation message is encrypted based on the session key to obtain an encrypted preliminary encapsulation message.
5. The method according to claim 1, characterized in that: The method further comprises: When the connection state with the second IoT device changes, the state change information is sent to the server, so that the server updates the device resolution table based on the state change information; When a connection status confirmation request sent by the server is received, connection status information is fed back to the server, wherein the connection confirmation request is sent by the server to the local every preset first time period.
6. A remote control method for an Internet of Things device, characterized in that: Applied to the server, the method includes: Receive a target encapsulated message, decrypt the target encapsulated message based on a session key, and obtain a decrypted encapsulated message, wherein the first Internet of Things device and the second Internet of Things device are connected through an ad hoc network communication, the target encapsulated message is obtained by the first Internet of Things device encapsulating the control message based on the device identifier of the second Internet of Things device in the control message and the device resolution table generated in the ad hoc network, the control message is generated by the first Internet device in response to a control instruction to the second Internet of Things device, and the session key is obtained by negotiation with the first Internet of Things device; Based on the physical address in the decrypted encapsulated message, the decrypted encapsulated message is sent to the second Internet of Things device to achieve remote control of the second Internet of Things device.
7. The method according to claim 6, characterized in that The method further comprises: Sending a connection status confirmation request to the IoT device every preset first time period; Based on whether the connection status information fed back by the IoT device is received within a preset second time period, determining whether the corresponding IoT device is in a connected state; If the connection status information is not received within the preset second time period, it is determined that the corresponding Internet of Things device is not in a connected state; Based on the determination result, the device parsing table is updated.
8. A remote control platform for Internet of Things devices, characterized in that: The IoT device remote control platform includes a first IoT device and a server: A first Internet of Things device, configured to generate a control message in response to a control instruction for a second Internet of Things device, wherein the first Internet of Things device and the second Internet of Things device are connected via an ad hoc network communication, encapsulate the control message based on a device identifier of the second Internet of Things device in the control message and a device resolution table generated during the ad hoc network, obtain a target encapsulated message having a physical address of the second Internet of Things device, and send the target encapsulated message to a server, so that the server sends the target encapsulated message to the second Internet of Things device, thereby realizing remote control of the second Internet of Things device; A server is used to receive a target encapsulated message, decrypt the target encapsulated message based on a session key, and obtain a decrypted encapsulated message, wherein a first Internet of Things device and a second Internet of Things device are connected via a self-organizing network communication, the target encapsulated message is obtained by encapsulating a control message by the first Internet of Things device based on the device identifier of the second Internet of Things device in the control message and a device resolution table generated during the self-organizing network, the control message is generated by the first Internet device in response to a control instruction to the second Internet of Things device, the session key is obtained by negotiation with the first Internet of Things device, and based on the physical address in the decrypted encapsulated message, the decrypted encapsulated message is sent to the second Internet of Things device to achieve remote control of the second Internet of Things device.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the remote control method for an Internet of Things device as described in any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method for remotely controlling an Internet of Things device according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Wireless ad hoc network system
CN111065093A
Secure transmission method and system based on SM2 key negotiation mechanism
CN113079022A
Equipment control method, device and system, storage medium and electronic device
CN113114753A
Big data analysis method based on Internet of Things
CN113518072A
Internet of Things communication method and device, equipment and storage medium
CN117793164A
Cited By
System and method for remotely managing multiple brands based on Microsoft system upper computer
CN120729926A
Remote control method and electronic equipment
CN121603489A