Information interaction method, cloud, equipment and readable storage medium
By assigning device identifiers and keys to wireless communication devices when registering in the cloud, and using encryption algorithms to encrypt instructions, the problem of poor security and heavy gateway burden in the interaction between the cloud and wireless communication devices is solved, and the security and efficiency of information transmission are improved. .
Patent Information
- Application Number
- CN202411092543.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-10-01
AI Technical Summary
The interaction between the cloud and wireless communication devices has poor security and the gateway has a heavy workload. The use of the same encryption method and key in the existing technology results in low security, and the gateway is overburdened during the information interaction process.
By assigning a unique device identification and device key to each wireless communication device when registering in the cloud, encrypting the instructions using a preset encryption algorithm, and publishing the encrypted instructions through the target topic to the gateway for forwarding to the device, only when the device Encryption and decryption operations are performed between the cloud and the cloud to reduce the processing burden on the gateway.
It achieves security guarantee during the information transmission process, reduces the business volume of the gateway, and improves the security and efficiency of information interaction between the cloud and wireless communication equipment.
Smart Images

Figure CN118741501A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of smart devices. Specifically, the present application relates to an information interaction method, a cloud, a device and a readable storage medium. Background Art
[0002] With the development of Internet of Things technology, more and more wireless communication devices are connected to the network through gateways to achieve remote control and data transmission. For scenarios where a large number of wireless communication devices are used, they are usually used in conjunction with gateways. Usually, the information interacting between the cloud and the wireless communication device needs to be parsed and processed by the gateway before being sent to the wireless communication device or the cloud.
[0003] However, the related technology has the problems of poor interaction security between the cloud and wireless communication devices and heavy workload of the gateway. Summary of the invention
[0004] The embodiments of the present application provide an information interaction method, a cloud, a device and a readable storage medium, which are used to solve the technical problems of poor interaction security between the cloud and wireless communication devices and heavy gateway workload.
[0005] According to a first aspect of an embodiment of the present application, there is provided an information interaction method, which is applied to a cloud, and the method includes: Determine a first instruction, a device identification and a device key of a target wireless communication device to be interacted with; the first instruction is used to instruct the target wireless communication device to perform a corresponding first operation; Encrypting the first instruction according to a preset encryption algorithm and a device key; Determine a target topic corresponding to the target wireless communication device according to the device identifier, and publish the encrypted first instruction to the target topic, so that a gateway subscribed to the target topic receives the encrypted first instruction and forwards the encrypted first instruction to the target wireless communication device corresponding to the target topic; receiving a first response message sent by a target wireless communication device and forwarded by a gateway; the first response message is sent by the target wireless communication device after successfully decrypting the encrypted first instruction according to the device key and executing a first operation corresponding to the first instruction; Among them, the device key and the target subject are both determined when the target wireless communication device is registered in the cloud.
[0006] According to a second aspect of an embodiment of the present application, there is provided an information interaction method, which is applied to a wireless communication device, and the method includes: The encrypted first instruction sent by the cloud and forwarded by the receiving gateway is obtained by encrypting the first instruction by the cloud according to the device key of the wireless communication device and a preset encryption algorithm, and the device key is determined when the wireless communication device is registered in the cloud; Decrypting the encrypted first instruction according to the locally cached device key to obtain the first instruction; After executing the corresponding first operation according to the first instruction, a first response message is sent to the cloud through the gateway; the first response message is used to indicate that the device has completed the first operation corresponding to the first instruction.
[0007] In a possible implementation, before receiving the encrypted first instruction sent by the cloud and forwarded by the gateway, when the wireless communication device is started for the first time, the product identification and the corresponding product key burned on the wireless communication device are read through the serial port; Sending a registration request to the cloud through the gateway, so that after receiving the registration request, if the cloud determines that the product identifier and the corresponding product key are recorded in the first list, the cloud generates and stores the device identifier and the device key of the wireless communication device according to a preset generation method; the registration request includes the product identifier and the corresponding product key; Receive the device ID and device key sent by the cloud through a preset encrypted channel.
[0008] In yet another possible implementation, after receiving the device identification and the device key sent by the cloud through a preset encryption channel, uplink information is determined, and the uplink information is encrypted using a preset encryption algorithm and the device identification; Sending the encrypted uplink information and uplink attribute data to the gateway, so that after receiving the encrypted uplink information and uplink attribute data, the gateway sends the encrypted uplink information to the cloud; The uplink attribute data is used to instruct the gateway to send information to the cloud.
[0009] According to a third aspect of an embodiment of the present application, a cloud is provided, the device comprising: A determination module, used to determine a first instruction, a device identification and a device key of a target wireless communication device to be interacted with; the first instruction is used to instruct the target wireless communication device to perform a corresponding first operation; An encryption module, used to encrypt the first instruction according to a preset encryption algorithm and a device key; A publishing module, used to determine a target topic corresponding to a target wireless communication device according to a device identifier, and publish an encrypted first instruction to the target topic, so that a gateway subscribed to the target topic receives the encrypted first instruction and forwards the encrypted first instruction to a target wireless communication device corresponding to the target topic; A first receiving module is used to receive a first response message sent by a target wireless communication device and forwarded by a gateway; the first response message is sent after the target wireless communication device successfully decrypts the encrypted first instruction according to the device key and executes a first operation corresponding to the first instruction; Among them, the device key and the target subject are both determined when the target wireless communication device is registered in the cloud.
[0010] According to a fourth aspect of an embodiment of the present application, a wireless communication device is provided, the device comprising: A second receiving module is used to receive the encrypted first instruction sent by the cloud and forwarded by the gateway; the encrypted first instruction is obtained by the cloud encrypting the first instruction according to the device key of the wireless communication device and a preset encryption algorithm, and the device key is determined when the wireless communication device is registered in the cloud; A decryption module, used to decrypt the encrypted first instruction according to the locally cached device key to obtain the first instruction; The sending module is used to send a first response message to the cloud through the gateway after executing the corresponding first operation according to the first instruction; the first response message is used to indicate that the device has completed the first operation corresponding to the first instruction.
[0011] According to a fifth aspect of an embodiment of the present application, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory, and when the processor executes the program, the steps of the method provided in the first aspect are implemented.
[0012] According to a sixth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method provided in the first aspect are implemented.
[0013] The beneficial effects of the technical solution provided by the embodiment of the present application are: The information interaction method provided by the embodiment of the present application determines a first instruction for instructing a target wireless communication device to perform a corresponding first operation, a device identifier and a device key assigned to the target wireless communication device to be interacted with when it is registered in the cloud, encrypts the first instruction according to the device key and a preset encryption algorithm to obtain an encrypted first instruction, determines a target topic corresponding to the target wireless communication device according to the device identifier, and publishes the encrypted first instruction to the target topic, so that a gateway subscribed to the target topic can receive the encrypted first instruction in time, and forward the encrypted first instruction to the target wireless communication device corresponding to the target topic. When the cloud receives the first response information, it indicates that the target wireless communication device has successfully decrypted the encrypted first instruction according to the assigned device key and completed the corresponding first operation. Since the device key involved in the encryption is assigned by the cloud during registration and is unique, it is realized that only the target wireless communication device assigned with the device key can decrypt the encrypted first instruction, thereby ensuring the security of the first instruction during the information transmission process. At the same time, the gateway only performs the operations of receiving the encrypted first instruction and forwarding the encrypted first instruction to the target wireless communication device in the above-mentioned information interaction process, and does not perform any processing on the encrypted first instruction, thereby greatly reducing the business volume of the gateway. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0015] Figure 1 A schematic diagram of a system architecture for implementing an information interaction method provided in an embodiment of the present application; Figure 2 A flowchart of an information interaction method applied to the cloud provided in an embodiment of the present application; Figure 3 A flowchart of a registration method for a wireless communication device in an information interaction method provided in an embodiment of the present application; Figure 4 A schematic diagram of the data format of interactive information in an information interaction method provided in an embodiment of the present application; Figure 5 A flowchart of a method for determining topics that a gateway can subscribe to in an information interaction method provided in an embodiment of the present application; Figure 6 A flowchart of an information interaction method applied to a wireless communication device provided in an embodiment of the present application; Figure 7 A schematic diagram of an interaction flow of an information interaction method of a wireless communication device provided in an embodiment of the present application; Figure 8A schematic diagram of a cloud structure provided in an embodiment of the present application; Fig. 9 A schematic diagram of the structure of a wireless communication device provided in an embodiment of the present application; Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0016] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0017] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "an" and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we call an element "connected" or "coupled" to another element, the one element can be directly connected or coupled to the other element, or it can refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used here may include wireless connection or wireless coupling. The term "and / or" used here indicates at least one of the items defined by the term, for example, "A and / or B" can be implemented as "A", or as "B", or as "A and B".
[0018] The following is an explanation of the relevant technology: In the information interaction between the cloud and the wireless communication device in the relevant technology, in order to facilitate development, the wireless communication devices in the same system usually use the same information encryption method and use a common key. As a result, when a wireless communication device is cracked, all devices in the same system will be cracked at the same time, resulting in a low security problem. In addition, in the relevant technology, when the gateway receives the interactive information from the cloud or wireless communication device, it usually parses the information first, and then performs various business processing, and preferably sends it to the wireless communication device or the cloud. Therefore, when a new wireless device or gateway is connected, the gateway needs to develop business according to the new wireless communication device, and data needs to be circulated among the wireless communication device, the gateway and the cloud, resulting in high complexity in gateway development and large business volume.
[0019] In response to at least one of the above-mentioned technical problems or areas that need improvement in the related technology, the present application proposes an information interaction method, which implements that only the target wireless communication device that is assigned a device key can decrypt the encrypted first instruction, thereby ensuring the security of the first instruction during the information transmission process. At the same time, the gateway only executes the operations of receiving the encrypted first instruction and forwarding the encrypted first instruction to the target wireless communication device during the above-mentioned information interaction process, without performing any processing on the encrypted first instruction, thereby greatly reducing the gateway's business volume.
[0020] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0021] Figure 1 A schematic diagram of a system architecture for implementing an information interaction method provided in an embodiment of the present application, wherein the system architecture includes: a wireless communication device 120, a cloud 140 and a gateway 160.
[0022] The wireless communication device 120 installs and runs an application program having an information interaction method. The wireless communication device 120 is used to receive and decrypt the encrypted first instruction, and perform a corresponding first operation according to the first instruction.
[0023] The gateway 160 is used to forward the encrypted first instruction and perform information exchange with the wireless communication device 120 and the cloud 140 .
[0024] The cloud 140 includes at least one of a server, multiple servers, a cloud computing platform, and a virtualization center. Schematically, the server 140 includes a processor 144 and a memory 142, and the memory 142 includes a display module 1421, a control module 1422, and a receiving module 1423. The server 140 is used to provide background services for the application of the information interaction method.
[0025] Optionally, the device types of the wireless communication device include: at least one of a smart phone, a tablet computer, an e-book reader, a Moving Picture Experts Group Audio Layer III (MP3) player, a Moving Picture Experts Group Audio Layer IV (MP4) player, a laptop computer and a desktop computer.
[0026] Those skilled in the art will appreciate that the number of the wireless communication devices may be more or less. For example, the number of the wireless communication devices may be only one, or the number of the wireless communication devices may be dozens or hundreds, or more. The embodiment of the present application does not limit the number and type of wireless communication devices.
[0027] The present application provides an information interaction method, which is applied to the cloud. Figure 2 As shown, the method includes: S101, determining a first instruction, a device identification and a device key of a target wireless communication device to be interacted with.
[0028] In the embodiments of the present application, wireless communication devices refer to devices that can transmit and communicate data through wireless technology. These devices use radio waves or other wireless technologies to exchange information without being connected through a physical interface. Wireless communication devices can be low-power near-field communication devices with Bluetooth, Zigbee, etc., such as smart door locks, smart lights, and smart clothes drying poles.
[0029] In the embodiment of the present application, the first instruction is an instruction for instructing the target wireless communication device to perform a corresponding first operation, such as an instruction for controlling the temperature, an instruction for adjusting the height, an instruction for adjusting the light, etc.; the first operation refers to the operation performed by the wireless communication device according to the instruction of the first instruction. For example, the first instruction is an instruction to adjust the temperature to 20°, then the corresponding first operation is that the wireless communication device adjusts the current temperature to 20°.
[0030] In an embodiment of the present application, the device key and device identifier are determined when the target wireless communication device is registered in the cloud; when the wireless communication device is registered in the cloud, a device identifier is assigned to the cloud for identifying and distinguishing different devices, which is usually a string or number generated by the cloud and assigned to the wireless communication device when the wireless communication device is registered. The device key is confidential information used for authentication and encryption, generated by the cloud and assigned to the device, to ensure that only wireless communication devices that know the key can communicate and interact with the cloud, and use the device key to encrypt communications between the device and the platform to protect the privacy and integrity of the data.
[0031] In an embodiment of the present application, the cloud determines the first instruction based on the control requirement including the first instruction device identification sent by the user through the application, and determines the device identification and device key of the target wireless communication device to be interacted from the wireless communication devices registered in the cloud; for example, the user sends a first instruction to close the vehicle door lock through the application, and the application sends the first instruction to close the vehicle door lock together with the vehicle's device identification as a control requirement to the cloud. After receiving the above control requirement, the cloud determines the first instruction and the device identification of the target wireless communication device to be interacted, and then the cloud determines the device key based on the correspondence between the device identification and the stored device identification and device key.
[0032] S102: Encrypt the first instruction according to a preset encryption algorithm and a device key.
[0033] In an embodiment of the present application, the cloud encrypts the first instruction according to the device key of the target wireless communication device and a preset encryption algorithm to obtain the encrypted first instruction, wherein the preset encryption algorithm may be a symmetric encryption algorithm, such as the AES ECB Zero 128bits encryption algorithm.
[0034] S103, determining a target topic corresponding to the target wireless communication device according to the device identifier, and issuing an encrypted first instruction to the target topic.
[0035] In an embodiment of the present application, the target topic is determined when the target wireless communication device is registered in the cloud; when the target wireless communication device is registered, the cloud assigns a target topic to the target wireless communication device, and directly maps the device identifier to the target topic corresponding to the target wireless communication device. Therefore, after determining the device identifier, the target topic corresponding to the target wireless communication device can be determined according to the device identifier, thereby publishing the encrypted first instruction to the target topic. The encrypted first instruction can be accurately transmitted to the target wireless communication device through the target topic, ensuring the effective transmission and processing of the encrypted first instruction.
[0036] In the embodiment of the present application, the information published to the target topic can only be received by the gateway that subscribes to the target topic, so it can be ensured that the information message is only received by the device that specifically subscribes to the topic. This method helps to protect the security and privacy of the message and prevent unauthorized devices from accessing the data.
[0037] In an embodiment of the present application, an encrypted first instruction is published to a target topic, so that a gateway subscribed to the target topic receives the encrypted first instruction and forwards the encrypted first instruction to a target wireless communication device corresponding to the target topic.
[0038] In an embodiment of the present application, since the interaction between the cloud and the wireless communication device needs to be transferred through the gateway, and the wireless communication devices that each gateway is responsible for transferring are different, the gateway needs to subscribe to the topic corresponding to the wireless communication device in the cloud to receive information sent by the cloud to the wireless communication device, thereby forwarding the information to the corresponding wireless communication device.
[0039] In an embodiment of the present application, the encrypted first instruction published by the cloud to the corresponding target topic will be received by the gateway subscribed to the above target topic. After the gateway receives the encrypted first instruction from the subscribed target topic, it determines the recipient of the encrypted first instruction based on the target wireless communication device corresponding to the target topic, and then forwards the encrypted first instruction to the target wireless communication device.
[0040] S104: Receive first response information sent by the target wireless communication device and forwarded by the gateway.
[0041] In the embodiment of the present application, the first response information is sent after the target wireless communication device successfully decrypts the encrypted first instruction according to the device key and executes the first operation corresponding to the first instruction.
[0042] In an embodiment of the present application, the cloud receives a first response message sent by the gateway. The first response message is information sent to the cloud after the target wireless communication device decrypts the encrypted first instruction according to the device key and successfully executes the corresponding first operation according to the first instruction. After the cloud receives the first response message, it can confirm that the issued instruction has been executed.
[0043] The information interaction method applied to the cloud provided by the embodiment of the present application determines a first instruction for instructing a target wireless communication device to perform a corresponding first operation, a device identifier and a device key assigned to the target wireless communication device to be interacted when it is registered in the cloud, encrypts the first instruction according to the device key and a preset encryption algorithm to obtain the encrypted first instruction, determines the target topic corresponding to the target wireless communication device according to the device identifier, and publishes the encrypted first instruction to the target topic, so that a gateway subscribed to the target topic can receive the encrypted first instruction in time, and forward the encrypted first instruction to the target wireless communication device corresponding to the target topic. When the cloud receives the first response information, it indicates that the target wireless communication device successfully decrypts the encrypted first instruction according to the assigned device key and completes the corresponding first operation. Since the device key involved in the encryption is assigned by the cloud during registration and is unique, it is realized that only the target wireless communication device assigned the device key can decrypt the encrypted first instruction, thereby ensuring the security of the first instruction during the information transmission process. At the same time, the gateway only performs the operations of receiving the encrypted first instruction and forwarding the encrypted first instruction to the target wireless communication device in the above-mentioned information interaction process, and does not perform any processing on the encrypted first instruction, which greatly reduces the business volume of the gateway.
[0044] Based on the above embodiments, as an optional embodiment, the registration process of the wireless communication device is as follows: Figure 3 The specific contents are as follows: S201, receiving a registration request sent by a target wireless communication device and forwarded by a gateway; S202, if it is determined that the product identification and product key of the target wireless communication device exist in the first list, then generate and store the device identification and device key of the target wireless communication device; the first list is used to record the product identification and product key of the wireless communication device that is allowed to be registered; S203, configuring a target topic of the target wireless communication device according to the device identification of the target wireless communication device; S204: Send the device identification and the device key to the target wireless communication device through a preset encryption channel.
[0045] In an embodiment of the present application, when a wireless communication device is connected to the Internet of Things, it needs to be registered in the cloud. Only a successfully registered wireless communication device can receive instructions issued by the cloud and upload information to the cloud. Therefore, when issuing instructions to the wireless communication device, the registration of the wireless communication device must be completed first. The cloud receives the device request sent by the wireless communication device and determines whether the wireless communication device can be successfully registered based on the device request.
[0046] In an embodiment of the present application, the registration request includes the product identification and product key of the target wireless communication device; the product identification is used to identify wireless communication devices of the same model, and the product key is used to authenticate the same model of wireless communication devices, that is, the same product identification and product key are burned on all wireless communication devices of the same model, and the product identification and product key are usually provided by the manufacturer of the wireless communication device.
[0047] In S201 in the embodiment of the present application, the cloud receives a registration request of a target wireless communication device forwarded by a gateway, where the registration request includes a product identification and a product key of the target wireless communication device.
[0048] In an embodiment of the present application, a wireless communication device is allowed to register in the cloud only after passing communication capability verification, security assessment, interoperability testing, performance testing and compliance certification. The above-mentioned inspections are required when the wireless communication device is officially put on the market. Since the first list is used to record the product identification and product key of the wireless communication device that is allowed to register, the product identification and product key of the wireless communication device that has passed the inspection will be recorded in the first list of the wireless communication device, so that when a subsequent wireless communication device with the same product identification and product key is burned to initiate a registration request, the registration request of the above-mentioned wireless communication device will be allowed to pass.
[0049] In the embodiment of the present application, since the device identifier assigned to the target wireless communication device must be unique in the entire cloud, the device identifier can be assigned to the wireless communication device according to predefined allocation strategies and rules.
[0050] In the embodiment of the present application, the device key is usually an encrypted string or numeric value. The cloud usually uses a symmetric encryption algorithm, an asymmetric encryption algorithm, a hash function or a secure random number generation algorithm to generate the key to ensure that the entropy value of the device key is high and difficult to crack.
[0051] In S202 of the embodiment of the present application, if the cloud determines that the product identification and product key of the target wireless communication device exist in the first list, it means that the device model to which the target wireless communication device belongs is allowed to be registered in the cloud, and therefore the target wireless communication device is allowed to be registered in the cloud. The cloud assigns a device identification and a device key to the target wireless communication device, and establishes a mapping relationship between the device identification and the device key, so that the cloud can accurately identify the target wireless communication device, and encrypt the interaction information between the cloud and the target wireless communication device through the device key.
[0052] In an embodiment of the present application, the cloud will predefine the topic structure of the device topic. The topic structure is usually composed of one or more hierarchical paths, such as devices / {device_id} / data, where {device_id} is replaced by a specific device identifier. The defined topic is used to publish information that needs to be published to the corresponding wireless communication device.
[0053] In the embodiment of the present application, the cloud configures the target topic of the target wireless communication device according to the device identification in order to effectively manage the information communication with the target wireless communication device and ensure that the information can be transmitted accurately and securely.
[0054] In S203 of the embodiment of the present application, the target topic of the target wireless communication device is configured according to the device identification of the target wireless communication device. After the target topic of the target wireless communication device is configured, the cloud will wait for the gateway to initiate a subscription request to the cloud for the target topic. After the gateway subscribes to the above target topic, the gateway can obtain the information that the cloud wants to send to the target wireless communication device through the above target topic.
[0055] In the embodiment of the present application, after the cloud allocates a device key to the target wireless communication device, it needs to securely transmit the device key to the device. Therefore, the cloud will select a preset encryption channel when the device is registered to transmit the device key and the device identifier to the target wireless communication device. The preset encryption channel can be a secure communication protocol. For example, HTTPS (Hypertext Transfer Protocol Secure) or TLS (Transport Layer Security) is used to transmit the device key.
[0056] In S204 of the embodiment of the present application, the device key will be encrypted during the transmission process to prevent man-in-the-middle attacks and eavesdropping, and the encrypted device key and device identification are transmitted to the target wireless communication device through a preset encryption channel.
[0057] In the above scheme, after receiving the registration request sent by the target wireless communication device, it is determined whether the target wireless communication device is allowed to register based on the product identification and product key carried in the registration request. When the product identification and the corresponding product key are recorded in the first list, it means that the wireless communication device has passed the relevant verification such as legality and is allowed to register. Therefore, a unique device identification and device key are assigned to the target wireless communication device, and the target subject of the target wireless communication device is configured according to the device identification. Finally, the device identification and key are sent to the target wireless communication device through a preset encrypted channel. Through the inspection of the product identification and product key, it is ensured that only wireless communication devices that are allowed to register can register, avoiding interaction with non-compliant wireless communication devices. When sending the assigned device identification and device key, they are transmitted through the preset encrypted channel so that the gateway used to forward information does not participate in the transmission of the device key, thereby improving the security of information interaction between the cloud and the wireless communication device.
[0058] Based on the above embodiments, as an optional embodiment, an encrypted first instruction and downlink attribute data are published to a target subject, so that when the gateway determines that the encrypted first instruction carries the downlink attribute data, the encrypted first instruction is forwarded to the target wireless communication device corresponding to the target subject; wherein the downlink attribute data is used to instruct the gateway to send instructions to the wireless communication device.
[0059] In the embodiment of the present application, the downlink attribute data belongs to the transparent transmission attribute and is an attribute in the device object model. The downlink attribute data is an attribute used by the cloud to send instructions or control information to the wireless communication device. When the gateway determines that the received information carries downlink attribute data, the gateway knows that the received information must be sent to the device at this time.
[0060] In an embodiment of the present application, the cloud sends an encrypted first instruction and downlink attribute data to the target topic. After the gateway publishes the encrypted first instruction and downlink attribute data in the subscribed target topic, it determines to send the encrypted first instruction to the wireless communication device based on the downlink attribute data, determines the target wireless communication device to receive the encrypted first instruction based on the device identifier corresponding to the target topic, and then directly sends the encrypted first instruction to the target wireless communication device.
[0061] In the above scheme, when the cloud publishes the encrypted first instruction to the target topic, it will also carry downlink attribute data, so that when the gateway receives information from the subscribed topic, it can determine the need to send the encrypted first instruction to the corresponding target wireless communication device based on the downlink attribute data, thereby ensuring the timeliness and accuracy of information interaction between the cloud and the wireless communication device.
[0062] Based on the above embodiments, as an optional embodiment, the first instruction includes: a service identifier and an instruction serial number; the service identifier is used to distinguish different services, and the instruction serial number is used to distinguish different instructions for the same service.
[0063] In the embodiment of the present application, the interactive information between the wireless communication device and the cloud is in the data format of the Bluetooth module transparent transmission service protocol, such as Figure 4 As shown, the format of the interactive information consists of 4+N bytes. The first byte is the synchronization header, the second byte is used to indicate the device type, the third byte is used to indicate the encryption type, the fourth byte is used to indicate the message body length, the 4th+n bytes are used to indicate the specific command (instruction) and message content, and the 5th+N bytes are composed of the checksum.
[0064] In an embodiment of the present application, the first instruction includes a service identifier, which is used to distinguish different services. For example, service identifier A is used to represent the temperature adjustment service, and service identifier B represents the camera activation service. Different service identifiers can be used to determine the service that the cloud currently instructs the wireless communication device to perform.
[0065] In an embodiment of the present application, the first instruction includes an instruction serial number, and the instruction needs to be used to distinguish different instructions for the same service. For example, if fingerprints need to be added in batches, then each fingerprint addition in the above-mentioned fingerprint adding service needs to be distinguished. Therefore, the instruction serial number is used to allow the wireless communication device to distinguish different fingerprint additions.
[0066] In an example, the business identifier is 0XA4, the corresponding function is to send WiFi information, the communication direction is from the cloud to the gateway, and the data annotation of the first downstream instruction is: synchronization header-device type, encryption type-message body length-business identifier-WiFi account length-WiFi account-password length-password content-checksum, and the corresponding uplink reply data is synchronization header-device type-encryption type-message body length-business identifier-result-checksum.
[0067] In an example, the service identifier corresponding to the fingerprint adding service is C. Now the fingerprints of 5 people need to be added in batches, and three first instructions are generated respectively. In chronological order, the service identifier in the first first instruction generated is C, and the instruction sequence number is 1, the service identifier in the second first instruction generated is C, and the instruction sequence number is 2, and the service identifier of the third first instruction generated is C, and the instruction sequence number is 3, so that when the target wireless communication device receives the first instruction of the same service, it can also distinguish different first instructions according to the instruction sequence number.
[0068] In the above scheme, the first instruction sent to the target wireless communication device contains a service identifier for distinguishing the service, so that the wireless communication device that parses the first instruction can perform accurate operations, and because the first instruction also includes an instruction serial number, it is also ensured that when the wireless communication device is instructed to execute the same service multiple times at a certain moment, the issued first instruction can also be distinguished.
[0069] In an embodiment of the present application, after the first instruction is issued, it is necessary to receive a reply message returned by the wireless communication device to confirm the execution status of the first instruction. For example, when the same instruction is issued twice, the normal process is to issue an instruction, receive a reply, issue an instruction, and receive a reply. That is, when an instruction is processed and the specific execution status is completed, the instruction will be issued again. However, in the present application, the instruction serial number is used to allow the issued instruction information to carry a unique instruction serial number identification, so that the second instruction can be issued before receiving a reply to the first instruction, so that the cloud can process data asynchronously, thereby speeding up the data processing speed.
[0070] Based on the above embodiments, as an optional embodiment, the method for determining the topics that the gateway can subscribe to is as follows: Figure 5 The specific contents include: S301, periodically obtaining the device group identifier of the device group bound to each gateway and the broadcast information of each wireless communication device collected by each gateway; the broadcast information includes the device identifier of the corresponding wireless communication device, the signal strength and the device group identifier of the device group bound to the corresponding wireless communication device; S302, for each cycle, according to the device group identifier of the device group bound to each gateway, combined with the device group identifier of the device group bound to each wireless communication device, determine the reference gateway corresponding to each wireless communication device in the current cycle, and each wireless communication device is bound to the same device group identifier as the corresponding reference gateway; S303, for each cycle, based on the signal strength of the current cycle of the wireless communication device collected by each reference gateway, the reference gateway corresponding to the maximum signal strength is used as the target gateway corresponding to the current cycle of the wireless communication device, and the device identification of the wireless communication device is recorded in the controllable information list of the current cycle corresponding to the target gateway; the controllable information list is used to record the device identification of the device that the gateway can connect to; S304: For each target gateway, if the controllable information list of the current cycle corresponding to the target gateway is inconsistent with the controllable information list of the previous cycle, the corresponding controllable information list of the current cycle is sent to the target gateway, so that the gateway sends a subscription request for the corresponding topic of each connectable device to the cloud according to the controllable information list of the current cycle; S305, receiving a topic subscription request sent by the gateway; the topic subscription request includes a device identifier; S306: If the device identifier is recorded in the controllable information list of the current period corresponding to the gateway, a subscription success message is returned to the gateway.
[0071] In the embodiment of the present application, the broadcast information of the embodiment of the present application may include at least one of a device identification of the wireless communication device, a signal strength, and a device group identification of a device group to which the wireless communication device is bound.
[0072] In an embodiment of the present application, the signal strength in the broadcast information refers to the signal strength when the gateway receives the wireless communication device. The signal strength is used to evaluate the connection quality between devices. The signal strength of the wireless communication device can be used to help the cloud select the best gateway for the wireless communication device to provide the best wireless connection.
[0073] In an embodiment of the present application, the device group identifier of the device group bound to the wireless communication device, the device group is a classification of different wireless communication devices, and the wireless communication devices belonging to the same device group refer to the same type of wireless communication devices. For example, they can be divided according to the manufacturer of the wireless communication devices. Then the wireless communication devices of the same manufacturer belong to the same device group and have the same device group identifier. The device group identifier of the device group bound to each gateway is determined, that is, the device group to which each gateway belongs is determined.
[0074] In an embodiment of the present application, when the wireless communication device is within the broadcast information scanning range of the gateway, the gateway can scan the broadcast information of the wireless communication device. Therefore, as long as the gateway and the wireless communication device are within the broadcast information scanning range, different gateways can receive the broadcast information broadcast by the same wireless communication device.
[0075] In an embodiment of the present application, the cloud receives broadcast information of each wireless communication device collected by each gateway. Since the broadcast information of the same wireless communication device will be scanned by different gateways and different gateways are located at different locations, the signal strengths in the same broadcast information scanned by different gateways are different. By receiving the broadcast information of the wireless communication device uploaded by the gateway, the cloud can understand the category of the wireless communication device and the signal strength between the wireless communication device and the scanned gateway.
[0076] In an embodiment of the present application, the gateway periodically scans the wireless communication devices to obtain the broadcast information of the wireless communication devices and upload it to the cloud. Correspondingly, the cloud periodically receives the broadcast information of each wireless communication device uploaded by each gateway, thereby adjusting the connectable wireless communication devices of the gateway according to the latest broadcast information.
[0077] In S301 of the embodiment of the present application, the cloud periodically obtains the device group identifier of the device group bound to each gateway and the broadcast information of each wireless communication device collected by each gateway, and the connectable devices of the gateway can be adjusted in time according to the above information obtained.
[0078] In S302 of the embodiment of the present application, after the broadcast information is obtained in each cycle, the gateway consistent with the device group identifier of the wireless communication device is determined according to the device group identifier of each gateway and the device group identifier of each wireless communication device, that is, the reference gateway corresponding to each wireless communication device is determined.
[0079] In an example, gateway A, gateway B and gateway C all uploaded broadcast information of wireless communication devices. The device group identifiers of the device groups bound to gateway A, gateway B and gateway C are S1, S2 and S1 respectively. By parsing the broadcast information, the device group identifier of the device group bound to the wireless communication device is S1. Then, it can be determined that the reference gateways corresponding to the wireless communication devices are gateway A and gateway C.
[0080] In S303 of the embodiment of the present application, since there may be multiple corresponding reference gateways for the same wireless communication device, the gateway with the strongest signal strength with the wireless communication device is determined as the target gateway based on the signal strength in the broadcast information uploaded by each reference gateway, so that when the wireless communication device needs to interact with information, the target gateway can establish a Bluetooth connection with the wireless communication device; after determining the target gateway of each wireless communication device, the device identification of the wireless communication device is recorded in the controllable information list of the target gateway, so that all wireless communication devices that can be connected to each gateway in the current period can be determined based on the controllable information list that records the device identification.
[0081] In S304 of the embodiment of the present application, since a controllable information list is generated in each cycle, if the controllable information list of the current cycle corresponding to the target gateway is inconsistent with the controllable information list of the previous cycle, it means that the wireless communication device that can be connected to the target gateway in the current cycle has changed. The target gateway needs to connect to the wireless communication device according to the controllable information list of the current cycle, and also needs to send a subscription request for the corresponding topic of the connectable device to the cloud according to the controllable information list item of the current cycle. Therefore, the corresponding controllable information list of the current cycle is sent to the target gateway.
[0082] In S305 of the embodiment of the present application, after the gateway receives the controllable information list of the current period, it will determine whether there is a topic corresponding to the wireless communication device to which it has not subscribed in the controllable information list. If so, it is necessary to promptly initiate a topic subscription request for the topic corresponding to the above-mentioned wireless communication device to the cloud to avoid failure to promptly receive the interactive information sent by the cloud to the above-mentioned wireless communication device. Therefore, the cloud will receive the topic subscription request containing the device identification of the wireless communication device sent by the gateway.
[0083] In S306 of the embodiment of the present application, in order to prevent the gateway from subscribing to the topic of a wireless communication device that cannot be connected, the cloud determines whether the device identifier carried in the topic subscription request is stored in the controllable information list corresponding to the gateway in the current period. If so, it means that the gateway can be allowed to subscribe to the corresponding topic. Therefore, the topic subscription request of the gateway is passed, and the subscription success information is returned to the gateway.
[0084] In the above scheme, by receiving the broadcast information of each wireless communication device reported by each gateway, the wireless communication devices that can be connected to each gateway can be dynamically updated. According to the device group identifier of the device group pre-bound by the gateway and the device group identifier of the device group pre-bound by the wireless communication device reported by the gateway, the gateway with the same device group identifier is used as the reference gateway of the wireless communication device. Since the broadcast information of the wireless communication device may be reported by multiple gateways at the same time, the gateway with the largest signal strength in the received broadcast information is selected as the target gateway of the wireless communication device, that is, the connectable gateway, and the device identifier of the wireless communication device is written into the controllable information list, so that the connectable devices of the current period corresponding to each gateway can be obtained. When the controllable information list of the current period is inconsistent with the controllable information list of the previous period, it means that the topic of the wireless communication device that needs to be subscribed has changed. Therefore, the controllable information list is sent to the gateway, so that the gateway initiates a topic subscription request for the connectable device to the cloud according to the controllable information list, ensuring that the gateway can timely obtain the instructions sent by the cloud for the connectable device and forward them to the corresponding wireless communication device. The controllable information list is dynamically adjusted, and the gateway can subscribe to the topic according to the latest controllable information list.
[0085] The present application provides an information interaction method, which is applied to a wireless communication device, such as Figure 6 As shown, the method includes: S401, receiving the encrypted first instruction sent by the cloud and forwarded by the gateway.
[0086] In an embodiment of the present application, the encrypted first instruction is obtained by encrypting the first instruction in the cloud according to the device key of the wireless communication device and a preset encryption algorithm, and the device key is determined when the wireless communication device is registered in the cloud.
[0087] In an embodiment of the present application, the device key and device identifier are determined when the target wireless communication device is registered in the cloud; when the wireless communication device is registered in the cloud, a device identifier is assigned to the cloud for identifying and distinguishing different devices, which is usually a string or number generated by the cloud and assigned to the wireless communication device when the wireless communication device is registered. The device key is confidential information used for authentication and encryption, generated by the cloud and assigned to the device, to ensure that only wireless communication devices that know the key can communicate and interact with the cloud, and use the device key to encrypt communications between the device and the platform to protect the privacy and integrity of the data.
[0088] In an embodiment of the present application, after receiving the encrypted first instruction issued by the cloud, the gateway forwards the received encrypted first instruction to the wireless communication device, so that the wireless communication device receives the encrypted first instruction forwarded by the gateway.
[0089] S402: Decrypt the encrypted first instruction according to the locally cached device key to obtain the first instruction.
[0090] In an embodiment of the present application, since the encrypted first instruction is encrypted by the cloud according to the device key assigned to the wireless communication device, the wireless communication device decrypts the encrypted first instruction according to the device identifier returned by the cloud during registration to obtain the first instruction.
[0091] S403, after executing the corresponding first operation according to the first instruction, sending a first response message to the cloud through the gateway.
[0092] In the implementation of the present application, the first response information is used to indicate that the device has completed the first operation corresponding to the first instruction.
[0093] In the embodiment of the present application, the first instruction is an instruction for instructing the target wireless communication device to perform a corresponding first operation, such as an instruction for controlling the temperature, an instruction for adjusting the height, an instruction for adjusting the light, etc.; the first operation refers to the operation performed by the wireless communication device according to the instruction of the first instruction. For example, the first instruction is an instruction to adjust the temperature to 20°, then the corresponding first operation is that the wireless communication device adjusts the current temperature to 20°.
[0094] In an embodiment of the present application, the wireless communication device executes a corresponding first operation according to a first instruction, and after completing the first operation, sends a first response message to the cloud through a gateway. The first response message is to inform the cloud that the first operation corresponding to the first instruction has been completed.
[0095] The information interaction method applied to the wireless communication device provided in the embodiment of the present application receives the encrypted first instruction, and decrypts the encrypted first instruction according to the device key assigned by the cloud when registering in the cloud, so as to obtain the first instruction, so that only the wireless communication device assigned the corresponding device key can decrypt the encrypted first instruction, and ensure the security of the first instruction during the information transmission process. After executing the corresponding operation according to the first instruction, the first response information is sent through the gateway, so that the cloud can timely understand the execution status of the instruction.
[0096] On the basis of the above embodiments, as an optional embodiment, before receiving the encrypted first instruction sent by the cloud and forwarded by the gateway, when the wireless communication device is started for the first time, the product identification and the corresponding product key burned on the wireless communication device are read through the serial port; a registration request is sent to the cloud through the gateway, so that after the cloud receives the registration request, if it determines that the product identification and the corresponding product key are recorded in the first list, the device identification and device key of the wireless communication device are generated and stored according to a preset generation method; the registration request includes the product identification and the corresponding product key; and the device identification and device key sent by the cloud through a preset encrypted channel are received.
[0097] In an embodiment of the present application, the wireless communication device needs to be registered in the cloud before use. Before the wireless communication device sends a registration request to the cloud, it obtains the product identification and the corresponding product key burned on the wireless communication device through the serial port. The product identification is used to identify wireless communication devices of the same model, and the product key is used for identity authentication during registration. The product identification and product key are usually provided by the manufacturer of the wireless communication device.
[0098] In an embodiment of the present application, the wireless communication device sends a registration request carrying a product identification and a product key to the gateway. After receiving the registration request sent by the wireless communication device, the gateway directly forwards the registration request to the cloud. After receiving the registration request, if the cloud determines that the product identification and product key of the target wireless communication device exist in the first list, it means that the device model of the target wireless communication device is allowed to be registered in the cloud. Therefore, the target wireless communication device is allowed to register in the cloud. The cloud assigns a device identification and a device key to the target wireless communication device, and establishes a mapping relationship between the device identification and the device key.
[0099] In the above scheme, when the wireless communication device initiates a registration request, it obtains the product identification and product key burned on the device through the serial port, and sends them to the cloud together with the registration request, so that the cloud can confirm the legitimacy of the device based on the burned product identification and product key, thereby completing the registration of the device in the cloud and allocating the corresponding device identification and device key, so that the content of information exchange with the cloud can be encrypted and decrypted through the key in the future, thereby improving the security of information interaction.
[0100] Based on the above embodiments, as an optional embodiment, after receiving the device identification and device key sent by the cloud through a preset encryption channel, the uplink information is determined, and the uplink information is encrypted by a preset encryption algorithm and the device identification; the encrypted uplink information and uplink attribute data are sent to the gateway, so that after the gateway receives the encrypted uplink information and the uplink attribute data, the encrypted uplink information is sent to the cloud; the uplink attribute data is used to instruct the gateway to send information to the cloud.
[0101] In the embodiment of the present application, the information sent by the wireless communication device to the cloud is called uplink information. The wireless communication device can encrypt the uplink information using a symmetric encryption algorithm and a device key, for example, using an AES ECB Zero128bits encryption algorithm and a device key to encrypt the uplink information.
[0102] In the embodiment of the present application, the uplink attribute data belongs to the transparent transmission attribute, which is an attribute in the device object model and is used as a pair of attributes with the downlink attribute data. The uplink attribute data is the attribute used by the wireless communication device to send information to the cloud. When the gateway determines that the received information carries the uplink attribute data, the gateway knows that the received information must be sent to the cloud at this time.
[0103] In an embodiment of the present application, the wireless communication device sends uplink information and uplink attribute data to the gateway. When the gateway receives the uplink attribute data, it determines that the uplink information needs to be sent to the cloud at this time.
[0104] In the above scheme, after the wireless communication device receives the device key assigned by the cloud, when the device needs to send uplink information to the cloud, the device can first encrypt the uplink information according to the device key, and then send it to the gateway together with the uplink attribute data, so that when the gateway receives the uplink attribute data, it determines that the current information needs to be sent to the cloud later, and then forwards the encrypted uplink information directly to the cloud without performing any processing on the encrypted first instruction, which greatly reduces the gateway's business workload and ensures the security of the interaction between the device and the cloud.
[0105] In an embodiment of the present application, an information interaction method is provided, and a schematic diagram of the interaction process is shown as follows: Figure 7 The specific contents are as follows: S501, the wireless communication device sends a registration request carrying a product identification and a product key through a gateway; S502: If it is determined that the product identification and product key of the wireless communication device exist in the first list, the cloud generates and stores the product identification and device key of the wireless communication device, and configures the theme of the wireless communication device according to the device identification of the wireless communication device; S504, the cloud sends the device identification and device key to the wireless communication device through a preset encryption channel; S505, the cloud determines the first instruction, the device identification and the device key of the wireless communication device to be interacted; S506: The cloud encrypts the first instruction according to a preset encryption algorithm and a device key to obtain the encrypted first instruction, and publishes the encrypted first instruction together with the downlink attribute data to a topic corresponding to the wireless communication device; S507, the gateway obtains the encrypted first instruction and downlink attribute data from the subscribed topic; S508, forwarding the encrypted first instruction to the wireless communication device corresponding to the topic according to the downlink attribute data; S509, the wireless communication device decrypts the encrypted first instruction according to the locally cached device key to obtain the first instruction; S510, the wireless communication device performs a corresponding first operation according to the first instruction, and generates first response information after completing the first operation; S511, the wireless communication device sends a first response message to the gateway; S512, the gateway forwards the first response information to the cloud.
[0106] In the information interaction method provided in the embodiment of the present application, the gateway only serves as a transfer station for information. It obtains the encrypted first instruction that needs to be sent to the wireless communication device according to the topic of the subscribed wireless communication device, and then directly forwards the information to the corresponding wireless communication device. There is no need to parse the information and then perform various business processing. It only needs to execute the forwarding operation. The gateway has a single responsibility and a small workload. Moreover, since the gateway only needs to forward the interactive information between the wireless communication device and the cloud, when the wireless communication device is added to the Internet of Things system, there is no need to change the task code of the gateway. It is only necessary to complete the command docking between the cloud and the wireless communication device at the back end to complete the development work, which greatly reduces the development complexity and development workload. In addition, since the encryption and decryption of the interactive information are performed according to the device key assigned to each device when it is registered, the device key of each device is different. Even if one device is forcibly cracked, other devices will not be affected, thereby improving the security of information interaction between the cloud and the wireless communication device.
[0107] The present application embodiment provides a cloud, such as Figure 8 As shown, the device 80 may include a determination module 801, an encryption module 802, a publishing module 803 and a first receiving module 804, wherein: A determination module 801 is used to determine a first instruction, a device identification and a device key of a target wireless communication device to be interacted with; the first instruction is used to instruct the target wireless communication device to perform a corresponding first operation; The encryption module 802 is used to encrypt the first instruction according to a preset encryption algorithm and a device key; A publishing module 803 is used to determine a target topic corresponding to a target wireless communication device according to a device identifier, and publish an encrypted first instruction to the target topic, so that a gateway subscribed to the target topic receives the encrypted first instruction and forwards the encrypted first instruction to a target wireless communication device corresponding to the target topic; The first receiving module 804 is used to receive the first response information sent by the target wireless communication device and forwarded by the gateway; the first response information is sent by the target wireless communication device after successfully decrypting the encrypted first instruction according to the device key and executing the first operation corresponding to the first instruction; Among them, the device key and the target subject are both determined when the target wireless communication device is registered in the cloud.
[0108] The present application embodiment provides a wireless communication device, such as Fig. 9 As shown, the device 90 may include a second receiving module 901, a decryption module 902, and a sending module 903, wherein: The second receiving module 901 is used to receive the encrypted first instruction sent by the cloud and forwarded by the gateway; the encrypted first instruction is obtained by the cloud encrypting the first instruction according to the device key of the wireless communication device and a preset encryption algorithm, and the device key is determined when the wireless communication device is registered in the cloud; A decryption module 902, configured to decrypt the encrypted first instruction according to a locally cached device key to obtain the first instruction; The sending module 903 is used to send a first response message to the cloud through the gateway after executing the corresponding first operation according to the first instruction; the first response information is used to indicate that the device has completed the first operation corresponding to the first instruction.
[0109] An embodiment of the present application provides an electronic device (computer device / equipment / system), including a memory, a processor, and a computer program stored on the memory, and the processor executes the above-mentioned computer program to implement the steps of the information interaction method, which can be implemented compared with the related art. In an alternative embodiment, an electronic device is provided, such as Fig.10 As shown, Fig.10The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0110] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0111] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0112] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0113] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.
[0114] Among them, the electronic equipment package may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0115] The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented. Compared with the prior art, the following can be achieved: the security of information interaction is improved, and the workload of the gateway is reduced.
[0116] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0117] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor. Compared with the prior art, it can achieve: improving the security of information interaction and reducing the workload of the gateway.
[0118] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.
[0119] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0120] The above are only optional implementation methods for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the scheme of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.
Claims
1. An information interaction method, characterized in that: Applied in the cloud, including: Determine a first instruction, a device identification and a device key of a target wireless communication device to be interacted with; the first instruction is used to instruct the target wireless communication device to perform a corresponding first operation; Encrypting the first instruction according to a preset encryption algorithm and the device key; Determine a target topic corresponding to the target wireless communication device according to the device identifier, and publish an encrypted first instruction to the target topic, so that a gateway subscribed to the target topic receives the encrypted first instruction and forwards the encrypted first instruction to the target wireless communication device corresponding to the target topic; receiving a first response message sent by the target wireless communication device and forwarded by the gateway; the first response message is sent by the target wireless communication device after successfully decrypting the encrypted first instruction according to the device key and executing a first operation corresponding to the first instruction; The device key and the target subject are both determined when the target wireless communication device is registered in the cloud.
2. The method according to claim 1, characterized in that The determining of the first instruction, the device identification and the device key of the target wireless communication device to be interacted with, further comprises: receiving a registration request sent by the target wireless communication device and forwarded by a gateway; the registration request includes a product identification and a product key of the target wireless communication device; If it is determined that the product identification and product key of the target wireless communication device exist in the first list, then generating and storing the device identification and device key of the target wireless communication device; the first list is used to record the product identification and product key of the wireless communication device that is allowed to be registered; According to the device identification of the target wireless communication device, configuring the target subject of the target wireless communication device; The device identification and the device key are sent to the target wireless communication device through a preset encryption channel.
3. The method according to claim 1, characterized in that The issuing of the encrypted first instruction to the target subject comprises: Publishing the encrypted first instruction and the downlink attribute data to the target topic, so that when the gateway determines that the encrypted first instruction carries the downlink attribute data, the gateway forwards the encrypted first instruction to the target wireless communication device corresponding to the target topic; The downlink attribute data is used to instruct the gateway to send instructions to the wireless communication device.
4. The method according to claim 1, characterized in that: The first instruction includes: a service identifier and an instruction sequence number; The service identifier is used to distinguish different services, and the instruction sequence number is used to distinguish different instructions for the same service.
5. The method according to claim 1, characterized in that The method further comprises: Periodically obtain the device group identifier of the device group bound to each gateway and the broadcast information of each wireless communication device collected by each gateway; the broadcast information includes the device identifier of the corresponding wireless communication device, the signal strength and the device group identifier of the device group bound to the corresponding wireless communication device; For each cycle, the reference gateway corresponding to each wireless communication device in the current cycle is determined according to the device group identifier of the device group bound to each gateway and the device group identifier of the device group bound to each wireless communication device, and each wireless communication device is bound to the same device group identifier as the corresponding reference gateway; For each cycle, according to the signal strength of the current cycle of the wireless communication device collected by each reference gateway, the reference gateway corresponding to the maximum signal strength is used as the target gateway corresponding to the current cycle of the wireless communication device, and the device identification of the wireless communication device is recorded in the controllable information list of the current cycle corresponding to the target gateway; the controllable information list is used to record the device identification of the device that the gateway can connect to; For each target gateway, if the controllable information list of the current cycle corresponding to the target gateway is inconsistent with the controllable information list of the previous cycle, the corresponding controllable information list of the current cycle is sent to the target gateway, so that the gateway sends a subscription request for the topic corresponding to each connectable device to the cloud according to the controllable information list of the current cycle; Receiving a topic subscription request sent by a gateway; the topic subscription request includes a device identifier; If the device identifier is recorded in the controllable information list of the current period corresponding to the gateway, a subscription success message is returned to the gateway.
6. An information interaction method, characterized in that: Applied to wireless communication equipment, including: receiving an encrypted first instruction sent by the cloud and forwarded by the gateway; the encrypted first instruction is obtained by encrypting the first instruction by the cloud according to the device key of the wireless communication device and a preset encryption algorithm, and the device key is determined when the wireless communication device is registered on the cloud; Decrypting the encrypted first instruction according to the locally cached device key to obtain the first instruction; After executing the corresponding first operation according to the first instruction, a first response message is sent to the cloud through the gateway; the first response message is used to indicate that the device has completed the first operation corresponding to the first instruction.
7. The method according to claim 6, characterized in that The receiving gateway forwards the encrypted first instruction sent by the cloud, and also includes: When the wireless communication device is started for the first time, the product identification and the corresponding product key burned into the wireless communication device are read through the serial port; Sending a registration request to the cloud through the gateway, so that after receiving the registration request, if the cloud determines that the product identifier and the corresponding product key are recorded in the first list, the cloud generates and stores the device identifier and the device key of the wireless communication device according to a preset generation method; the registration request includes the product identifier and the corresponding product key; Receive the device identification and device key sent by the cloud through a preset encryption channel.
8. The method according to claim 7, characterized in that The receiving the device identification and the device key sent by the cloud through a preset encryption channel further includes: Determine uplink information, and encrypt the uplink information using a preset encryption algorithm and the device identifier; Sending the encrypted uplink information and uplink attribute data to the gateway, so that after receiving the encrypted uplink information and uplink attribute data, the gateway sends the encrypted uplink information to the cloud; The uplink attribute data is used to instruct the gateway to send information to the cloud.
9. A cloud, characterized in that: include: A determination module, used to determine the first instruction, the device identification and the device key of the target wireless communication device to be interacted; The first instruction is used to instruct the target wireless communication device to perform a corresponding first operation; An encryption module, used for encrypting the first instruction according to a preset encryption algorithm and the device key; a publishing module, configured to determine a target topic corresponding to the target wireless communication device according to the device identifier, and publish the encrypted first instruction to the target topic, so that a gateway subscribed to the target topic receives the encrypted first instruction and forwards the encrypted first instruction to the target wireless communication device corresponding to the target topic; A first receiving module, configured to receive a first response message sent by the target wireless communication device and forwarded by a gateway; The first response information is sent after the target wireless communication device successfully decrypts the encrypted first instruction according to the device key and executes the first operation corresponding to the first instruction; The device key and the target subject are both determined when the target wireless communication device is registered in the cloud.
10. A wireless communication device, characterized in that: include: A second receiving module is used to receive an encrypted first instruction sent by the cloud and forwarded by the gateway; the encrypted first instruction is obtained by the cloud encrypting the first instruction according to the device key of the wireless communication device and a preset encryption algorithm, and the device key is determined when the wireless communication device is registered on the cloud; A decryption module, used to decrypt the encrypted first instruction according to a locally cached device key to obtain the first instruction; A sending module, configured to send a first response message to the cloud through a gateway after executing a corresponding first operation according to the first instruction; The first response information is used to indicate that the device has completed the first operation corresponding to the first instruction.
11. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 8.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Interaction system and method of gateway and cloud platform
CN121012716A
