Equipment control method and equipment control system
By introducing paired broadcast packets with MAC addresses, SEQs, target keys and verification codes, the Bluetooth Mesh networking process is simplified and one-way control is realized, which solves the problems of low distribution network efficiency and high latency in Bluetooth Mesh networking, and improves the distribution network speed and control efficiency.
Patent Information
- Application Number
- CN202510816040.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-08-15
AI Technical Summary
In the existing Bluetooth Mesh networking technology, distribution network efficiency is inefficient and communication delay is too high, traditional handshake protocols are complex, and bidirectional data interaction increases network load and delay.
The paired broadcast packets with MAC address, message sequence number (SEQ), target key and verification code are used to replace the complex handshake process of traditional Bluetooth networking, realize a one-way control mechanism, simplify the distribution process and reduce communication delay.
Significantly shorten the distribution network time, improve distribution network efficiency, reduce communication delay, improve control efficiency, and reduce network load.
Smart Images

Figure CN120499245A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Bluetooth technology, and in particular to a device control method and a device control system. Background Art
[0002] In existing Bluetooth Mesh networking technology, device configuration often involves a complex handshake protocol, resulting in a large number of interactive data packets and lengthy configuration times. Furthermore, in traditional Mesh networking, communication between control and controlled nodes relies on bidirectional data exchange and message confirmation mechanisms, such as packet transmission and status feedback. This not only increases data transmission latency but also significantly increases network load.
[0003] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention
[0004] The main purpose of this application is to provide a device control method and a device control system, aiming to solve the technical problems of low network distribution efficiency and high communication delay in the Bluetooth Mesh networking technology in the existing technology.
[0005] To achieve the above objectives, the present application proposes a device control method, which is applied to a control terminal and includes:
[0006] Sending a pairing broadcast packet to a terminal device so that the terminal device performs pairing according to the pairing broadcast packet, wherein the pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code;
[0007] Generate a control data packet according to the target control information corresponding to the controlled terminal, the data lifetime, the access control address, the updated message sequence field, and the control packet check code, wherein the controlled terminal is a terminal device for which network configuration has been completed;
[0008] The control data packet is sent to the controlled terminal, and the controlled terminal is unidirectionally controlled through the control data packet.
[0009] In one embodiment, before the step of generating a control data packet according to the target control information corresponding to the controlled terminal, the data lifetime, the access control address, the updated message sequence field, and the control packet check code, the step further includes:
[0010] Generate information to be encrypted according to the device identification information of the controlled terminal and the control data corresponding to the controlled terminal;
[0011] The information to be encrypted is encrypted according to the target secret key to generate target control information corresponding to the controlled terminal.
[0012] In one embodiment, before the step of sending a pairing broadcast packet to a terminal device so that the terminal device performs pairing according to the pairing broadcast packet, the step further includes:
[0013] Determine the message sequence field of the pairing broadcast packet according to the current message sequence number;
[0014] A pairing broadcast packet is generated according to the data lifetime, the access control address, the message sequence field, the target secret key, and the pairing packet verification code.
[0015] In addition, to achieve the above objectives, the present application also proposes a control terminal, which includes:
[0016] A sending module, configured to send a pairing broadcast packet to a terminal device, so that the terminal device performs pairing according to the pairing broadcast packet, wherein the pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code;
[0017] A generation module, configured to generate a control data packet based on target control information corresponding to a controlled terminal, data lifetime, the access control address, an updated message sequence field, and a control packet check code, wherein the controlled terminal is a terminal device for which network configuration has been completed;
[0018] The control module is configured to send the control data packet to the controlled terminal and perform unidirectional control on the controlled terminal through the control data packet.
[0019] In addition, to achieve the above objectives, the present application also proposes a control terminal, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the device control method as described above.
[0020] In addition, to achieve the above-mentioned purpose, the present application also proposes a device control method, which is applied to a controlled terminal and includes:
[0021] When a pairing broadcast packet is received from the control terminal within a target time period after power-on, performing broadcast packet verification on the pairing broadcast packet, wherein the pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code;
[0022] When the broadcast packet verification result is a preset pass result, extracting information from the paired broadcast packet to determine the access control address of the control terminal and the target key corresponding to the control terminal;
[0023] Storing the access control address of the control terminal and the target key corresponding to the control terminal to complete device network configuration with the control terminal;
[0024] When the network configuration is completed and a control data packet sent by the control terminal is received, performing control packet verification on the control data packet;
[0025] When the control packet verification result is a preset passing result, a control response is performed on the control data packet.
[0026] In one embodiment, when a pairing broadcast packet is received from a control terminal within a target time period after power-on, performing broadcast packet verification on the pairing broadcast packet, wherein the pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code, includes:
[0027] When a pairing broadcast packet sent by the control terminal is received within a target time period after power-on, information is extracted from the pairing broadcast packet to determine a pairing packet verification code in the pairing broadcast packet;
[0028] Performing an integrity check on the pairing broadcast packet according to the pairing packet verification code to obtain a second verification result;
[0029] When the second verification result is a preset passing result, extracting information from the pairing broadcast packet to determine a message sequence field present in the pairing broadcast packet;
[0030] When the message sequence number corresponding to the message sequence field present in the paired broadcast packet is greater than the sequence number storage value, it is determined that the broadcast packet verification result is a pass result.
[0031] In one embodiment, after extracting information from the pairing broadcast packet and determining the message sequence field present in the pairing broadcast packet when the second verification result is a preset pass result, the method further includes:
[0032] When the message sequence number corresponding to the message sequence field present in the paired broadcast packet is less than or equal to the sequence number storage value and the sequence number storage value is a preset storage value, determining that the broadcast packet verification result is a pass result;
[0033] When the message sequence number corresponding to the message sequence field present in the paired broadcast packet is less than or equal to the sequence number storage value and the sequence number storage value is not a preset storage value, it is determined that the broadcast packet verification result is a failure result.
[0034] In one embodiment, when the network configuration is completed and a control data packet sent by the control terminal is received, the step of performing control packet verification on the control data packet includes:
[0035] When the network configuration is completed and a control data packet sent by the control terminal is received, extracting information from the control data packet and determining a control packet check code in the control data packet;
[0036] Performing an integrity check on the control data packet according to the control packet check code to obtain a first check result;
[0037] When the first verification result is a preset passing result, extracting information from the control data packet to determine an access control address present in the control data packet;
[0038] When the access control address corresponding to the device network configuration is consistent with the access control address in the control data packet, it is determined that the control packet verification result is a pass result.
[0039] In one embodiment, when the control packet verification result is a preset pass result, the step of performing a control response to the control data packet includes:
[0040] When the control packet verification result is a preset pass result, extracting information from the control packet to determine a message sequence field in the control packet;
[0041] When the message sequence number corresponding to the message sequence field in the control data packet is greater than the stored value of the sequence number, decrypting the target control information in the control data packet according to the target secret key corresponding to the control terminal to obtain decrypted control information;
[0042] When the device identification information in the decryption control information is consistent with the target identification information, a control response is performed according to the control data in the decryption control information.
[0043] In one embodiment, after the step of performing a control response on the control data packet when the control packet verification result is a preset pass result, the method further includes:
[0044] Get the current storage status of the storage queue;
[0045] When the current storage state of the storage queue is a preset full queue state, each stored data packet in the storage queue is deleted according to the storage time of each stored data packet, and the control data packet is stored in the storage queue.
[0046] In addition, to achieve the above objectives, the present application also proposes a controlled terminal, which includes:
[0047] a verification module, configured to, upon receiving a pairing broadcast packet sent by the control terminal within a target time period after power-on, perform broadcast packet verification on the pairing broadcast packet, wherein the pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code;
[0048] an extraction module, configured to extract information from the paired broadcast packet when the broadcast packet verification result is a preset pass result, and determine the access control address of the control terminal and the target key corresponding to the control terminal;
[0049] A network configuration module, configured to store the access control address of the control terminal and the target key corresponding to the control terminal, so as to complete network configuration of the device with the control terminal;
[0050] The verification module is further configured to perform control packet verification on the control data packet when the network configuration is completed and the control data packet sent by the control terminal is received;
[0051] The response module is used to perform a control response to the control data packet when the control packet verification result is a preset pass result.
[0052] In addition, to achieve the above objectives, the present application also proposes a controlled terminal, which includes: a memory, a processor, and a computer program stored in the memory and runnable on the processor, and the computer program is configured to implement the steps of the device control method as described above.
[0053] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the device control method as described above are implemented.
[0054] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the device control method as described above are implemented.
[0055] In addition, to achieve the above-mentioned purpose, the present application also proposes a device control system, which includes a control terminal and multiple controlled terminals, and the device control method described above is executed on the control terminal, and the device control method described above is executed on the controlled terminal.
[0056] The present application provides a device control method, which is applied to a control terminal. When there is a need for model fine-tuning, the method obtains multiple fine-tuning motion data of a user and the true motion labels of each fine-tuning motion data sent by a wearable device; calibrates the parameters of the adapter corresponding to the user based on the fine-tuning motion data and the true motion labels of each fine-tuning motion data to determine the fine-tuning parameters of the adapter corresponding to the user; and sends the fine-tuning parameters of the adapter corresponding to the user to the wearable device so that the wearable device updates the parameters of the motion recognition model based on the fine-tuning parameters of the adapter corresponding to the user, and recognizes the user's current motion data through the updated motion recognition model. In this way, the parameters of the adapter corresponding to the user are calibrated only with a small amount of labeled motion data, and accurate modeling and rapid adaptation of the user's personalized motion characteristics are achieved while consuming low resources, thereby improving the recognition accuracy and adaptability of the motion recognition model for individual users, avoiding the computational overhead and universality damage of the full model update, and maintaining the compatibility and stability of the model in multi-user scenarios. By sending the fine-tuning parameters to the wearable device, the device can recognize the user's current motion data in real time and efficiently based on the updated model, thereby enhancing the practicality and user experience of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0059] Figure 1 A flow chart of the first embodiment of the device control method of the present application is provided;
[0060] Figure 2 This is a schematic diagram of the overall architecture of the device control system provided in Example 1 of the present application;
[0061] Figure 3 A flow chart of the second embodiment of the device control method of this application is provided;
[0062] Figure 4 A flowchart of the third embodiment of the device control method of this application is provided;
[0063] Figure 5 This is a schematic diagram of the system structure of the equipment control system of this application.
[0064] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0065] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0066] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0067] The main solution of the embodiment of the present application is: sending a pairing broadcast packet to the terminal device so that the terminal device is paired according to the pairing broadcast packet, the pairing broadcast packet contains an access control address, a message sequence field, a target key and a pairing packet verification code; generating a control data packet according to the target control information corresponding to the controlled terminal, the data lifetime, the access control address, the updated message sequence field and the control packet verification code, the controlled terminal is a terminal device that has completed network configuration; sending the control data packet to the controlled terminal, and performing unidirectional control of the controlled terminal through the control data packet.
[0068] In existing Bluetooth Mesh networks, device configuration involves a complex handshake invitation, public key exchange, secret key generation, authentication, and network key distribution process. This results in a large number of interactive data packets and a long configuration time. Furthermore, after a Mesh network is established, communication between the control node and the controlled nodes requires two-way data exchange and message confirmation mechanisms. Furthermore, the large number of data packets transmitted between the control node and the controlled nodes involves packet segmentation, which not only increases data transmission latency but also significantly increases network load.
[0069] This application replaces the complex handshake process of traditional Bluetooth networking by introducing a pairing broadcast package of MAC address, SEQ, target key and verification code, which significantly simplifies the network configuration process and shortens the network configuration time. At the same time, it adopts a one-way control mechanism, eliminating the two-way confirmation link, reducing communication delay and improving control efficiency.
[0070] Based on this, the embodiment of the present application provides a device control method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the device control method of the present application.
[0071] In this embodiment, the device control method is applied to a control terminal, and the device control method includes steps S10 to S30:
[0072] Step S10: Send a pairing broadcast packet to the terminal device so that the terminal device is paired according to the pairing broadcast packet. The pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code.
[0073] It should be noted that the execution subject of this embodiment is the control terminal in the device control system, which is a computing device with data processing, network communication and program running functions, such as a tablet computer, personal computer and mobile phone.
[0074] It can be understood that the device control system includes a control terminal and multiple controlled terminals. The control terminal is a command initiator with Bluetooth broadcast and networking control capabilities, which is used to generate and send pairing broadcast packets and control data packets; multiple terminal devices in an unconfigured state enter a pairing window period of a preset duration after physical power-on. After the terminal device successfully responds to the pairing broadcast packet of the control terminal, it becomes a controlled terminal and saves the MAC (Media Access Control) address of the control terminal and the target key KEY. The relay node is automatically served by all the controlled terminals that have been configured, and the network coverage is expanded through hardware-level data packet filtering and forwarding mechanisms to form a decentralized multi-hop relay network. The device control system of this embodiment is as follows Figure 2 As shown, the controlling terminal performs unidirectional control over the controlled terminal and is not concerned with the final state of the controlled terminal. Controlled terminals A, B, and C can communicate bidirectionally and relay received control messages to expand the control range. In this embodiment, the preset duration is set to 10 seconds, which can be adjusted as needed and is not limited in this embodiment.
[0075] It can be understood that the access control address (i.e. MAC address) refers to the unique identity of the control terminal, which is used to establish a binding relationship between the controlled terminal and the control terminal during the network configuration process, and ensure that the controlled terminal only listens to and forwards data packets carrying the MAC address in subsequent communications. The controlled terminal filters data packets with other MAC addresses, thereby isolating the networks from each other and reducing the forwarding of data packets to avoid network storms.
[0076] It should be noted that the message sequence field is a key field for preventing replay attacks and message sorting. The message sequence field is composed of SEQ (Sequence Number Field). All nodes in the device control system ensure the security and reliability of network communications by maintaining SEQ. Every time the control end sends a message, SEQ+1 is added, and it returns to zero after overflow. The controlled terminal records its own SEQ value and establishes a dynamic verification mechanism. It only performs operations when the SEQ value of the new data packet is greater than the latest local cache value, and automatically resets the verification window when it overflows, thereby replacing the complex security vector update process.
[0077] It is understood that the target key KEY, a core parameter for encrypted communication, is generated by the control terminal during the network configuration phase and transmitted to the controlled terminal. The control terminal uses the target key to encrypt subsequent control messages. The controlled terminal stores the target key corresponding to the control terminal and uses it to decrypt messages from the control terminal. When a controlled terminal joins different networks, it needs to store multiple independent target keys KEY.
[0078] In specific implementations, the pairing packet checksum is generated using an encryption algorithm (such as a hash algorithm, AES-CCM algorithm, or other encryption algorithm). It covers all fields in the pairing broadcast packet and is used to verify the integrity and legitimacy of the pairing broadcast packet. After receiving the pairing broadcast packet, the terminal device recalculates the checksum and compares it with the pairing packet checksum carried in the pairing broadcast packet. If they match, it confirms that the packet has not been tampered with and the source is trustworthy. Otherwise, the packet is discarded, thus ensuring data reliability during the network configuration process. The encryption algorithm of the controlling terminal and the controlled terminal must be consistent.
[0079] It should be noted that the pairing broadcast packet consists of the following fields: TTL (Time To Live), the MAC address of the control terminal, SEQ, the target key KEY, and the pairing packet check code. The TTL is used to control the maximum number of forwarding hops of the message in the network. The TTL value is reduced by 1 after each relay node. When TTL = 0, the message stops being forwarded.
[0080] It can be understood that the control terminal sends a pairing broadcast packet to the terminal device. When the terminal device is powered on and enters a pairing window period of a preset length, the terminal device only receives and processes the pairing broadcast packet sent by the control terminal within the pairing window period. The purpose is to prevent the problem of being "snatched" by receiving and processing the pairing broadcast packet after pairing.
[0081] In specific implementations, after receiving a pairing broadcast packet, the terminal device recalculates the checksum and compares it with the pairing packet checksum carried in the pairing broadcast packet. If they match, the terminal confirms that the packet has not been tampered with and the source is trustworthy. At this point, the terminal saves the MAC address of the control terminal and the target key KEY of the control terminal, completing the network configuration process with the control terminal and becoming a controlled terminal. If the calculated checksum does not match the pairing packet checksum, the terminal discards the packet.
[0082] It should be noted that through the synergy of the various fields in the pairing broadcast packet, fast and complete device pairing is achieved, which not only simplifies the complex handshake process in the traditional Mesh protocol, but also ensures the one-way control characteristics of communication, low-latency response capability and network isolation through address binding, serial number anti-replay, key encryption and verification mechanism.
[0083] In a feasible implementation manner, before step S10, steps A11 to A12 may also be included:
[0084] Step A11: Determine the message sequence field of the pairing broadcast packet according to the current message sequence number.
[0085] It should be noted that to prevent replay attacks and ensure message sequencing, the control terminal increments SEQ by 1 each time it sends a message, returning it to zero if it overflows. Therefore, before generating a pairing broadcast packet, the control terminal must obtain the current message sequence number SEQ. If the current message sequence number SEQ has not reached the overflow value of SEQ, the control terminal increments SEQ by 1 to obtain the SEQ corresponding to the pairing broadcast packet. Based on the SEQ corresponding to the pairing broadcast packet, the message sequence field of the pairing broadcast packet is obtained. If the current message sequence number SEQ exceeds the set overflow value, the SEQ corresponding to the pairing broadcast packet is determined to be 0, and the message sequence field of the pairing broadcast packet is obtained.
[0086] Step A12: Generate a pairing broadcast packet according to the data lifetime, the access control address, the message sequence field, the target key, and the pairing packet verification code.
[0087] It should be noted that the data lifetime refers to the TTL of the paired broadcast packet. The data lifetime can be set by the control terminal according to the network configuration protocol or by the user. This embodiment does not impose any restrictions on this. The data lifetime is an integer.
[0088] It can be understood that the control terminal generates a pairing package verification code covering the data lifetime, access control address, message sequence field and target key according to the encryption algorithm, and generates a pairing broadcast package based on the data lifetime, access control address, message sequence field, target key and pairing package verification code.
[0089] Step S20, generating a control data packet according to the target control information, data lifetime, the access control address, the updated message sequence field and the control packet check code corresponding to the controlled terminal, wherein the controlled terminal is a terminal device for which network configuration has been completed.
[0090] It should be noted that after the control terminal sends the pairing broadcast packet to the terminal device, it is assumed that the terminal device has completed network configuration and has become a controlled terminal; or the control terminal resends the pairing broadcast packet. If it cannot bind the device, it proves that the device has completed network configuration and has become a controlled terminal.
[0091] It can be understood that the target control information refers to the encrypted information of the operation instructions that need to be executed by the controlled terminal; the data lifetime refers to the TTL lifetime of the control data packet; the control terminal generates a control packet check code through an encryption algorithm. The control packet check code covers all fields in the control data packet and is used to verify the integrity and legitimacy of the control data packet.
[0092] In a specific implementation, before generating a control packet, the control terminal obtains the current message sequence number SEQ. If the current message sequence number SEQ has not reached the SEQ overflow value, the control terminal adds 1 to the current message sequence number SEQ to obtain the SEQ corresponding to the control packet. If the current message sequence number SEQ reaches the set SEQ overflow value, the SEQ corresponding to the control packet is determined to be 0. The updated message sequence field consists of the SEQ corresponding to the control packet.
[0093] It should be noted that the control terminal generates a one-way control data packet based on the target control information, data lifetime, access control address, updated message sequence field and control packet check code corresponding to the controlled terminal.
[0094] In a feasible implementation manner, before step S20, steps B11 to B12 may also be included:
[0095] Step B11: Generate information to be encrypted based on the device identification information of the controlled terminal and the control data corresponding to the controlled terminal.
[0096] It should be noted that the device identification information refers to the unique identity of the controlled terminal, such as the unique identifier or other identity fixed at the factory of the controlled terminal. The control data includes the operation instructions and related control parameters that the controlled terminal is expected to execute.
[0097] It can be understood that the control terminal binds the device identification information of the controlled terminal and the control data corresponding to the controlled terminal to form a data structure that can be encrypted, and obtains the encrypted information corresponding to the controlled terminal to ensure the pertinence and uniqueness of subsequent encryption operations.
[0098] Step B12: Encrypt the information to be encrypted according to the target key to generate target control information corresponding to the controlled terminal.
[0099] It should be noted that the control terminal uses the target key KEY to process the encrypted information through an encryption algorithm. The encrypted information becomes the target control information corresponding to the controlled terminal. In this embodiment, the encryption algorithm must comply with the Bluetooth Mesh standard (for example, the AES-CCM algorithm) to ensure that the target control information is tamper-resistant and replay-resistant. At the same time, the uniqueness of the target key KEY ensures the confidentiality of the communication.
[0100] Step S30: Send the control data packet to the controlled terminal, and perform unidirectional control on the controlled terminal through the control data packet.
[0101] It should be noted that the control terminal sends a control data packet to the controlled terminal. During the transmission process, the control data packet can be forwarded through a relay node or sent directly to the controlled terminal. After sending the control data packet, the control terminal does not wait for or parse any response information from the controlled terminal. No data is transmitted back to the control terminal at all. Decentralized control is achieved only through MAC address matching, SEQ verification, command execution, and relay forwarding chain. There is no two-way handshake or status feedback, and a millisecond-level one-way control closed loop is achieved.
[0102] It can be understood that after matching the MAC address of the data packet, the controlled terminal executes the operation instruction through SEQ verification and secret key decryption, and determines whether to relay and forward it based on the TTL value in the control data packet.
[0103] In specific implementations, the method of this embodiment can be applied to scenarios that require extremely high device response speed and synchronization and one-way control. For example, in a smart home scenario, multiple lights or switches can be controlled by a remote control with high control efficiency and low latency.
[0104] This embodiment provides a device control method, which is applied to a control terminal, by sending a pairing broadcast packet to a terminal device so that the terminal device is paired according to the pairing broadcast packet, wherein the pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code; a control data packet is generated according to the target control information, data lifetime, the access control address, the updated message sequence field, and the control packet verification code corresponding to the controlled terminal, wherein the controlled terminal is a terminal device that has completed network configuration; the control data packet is sent to the controlled terminal, and the controlled terminal is unidirectionally controlled by the control data packet. In the above manner, by introducing a pairing broadcast packet of MAC address, SEQ, target key, and verification code, the complex handshake process of traditional Bluetooth networking is replaced, which significantly simplifies the network configuration process and shortens the network configuration time. At the same time, a one-way control mechanism is adopted to eliminate the two-way confirmation link, reduce communication delay, and improve control efficiency.
[0105] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 5 , refer to Figure 3 , Figure 3 This is a flow chart of the second embodiment of the device control method of the present application.
[0106] In this embodiment, the device control method is applied to a controlled terminal, and the device control method includes steps S01 to S05:
[0107] Step S01: When a pairing broadcast packet is received from a control terminal within a target time period after power-on, a broadcast packet verification is performed on the pairing broadcast packet, which contains an access control address, a message sequence field, a target key, and a pairing packet verification code.
[0108] It should be noted that the target time period refers to the pairing window period of preset length after the controlled terminal is physically powered on. After the controlled terminal is physically powered on, its RF receiving circuit will forcibly turn on the pairing broadcast packet receiving function within the target time period. After the timeout, the function will be physically cut off to prevent malicious binding after network configuration.
[0109] It is understood that within the target time period after power-on, the controlled terminal has not yet established a binding with the controlling terminal. At this time, if the controlled terminal receives a pairing broadcast packet sent by the controlling terminal, it will recalculate the check code covering all fields in the pairing broadcast packet, except the pairing packet check code, using the encryption algorithm negotiated with the controlling terminal. The calculated check code is compared with the pairing packet check code carried in the pairing broadcast packet. If they match, it confirms that the packet has not been tampered with and the source is trustworthy. Otherwise, the packet is discarded, thus ensuring data reliability during the network configuration process.
[0110] In the specific implementation, when the controlled terminal receives a new message, the SEQ corresponding to the new message must be greater than the current SEQ storage value. Only when the current SEQ storage value reaches the set maximum value can it receive an arbitrary value once and start a new round of SEQ message filtering from this arbitrary value.
[0111] For example, the control terminal sends the first message with SEQ=0. The controlled terminal receives the message and saves SEQ=0. Then the control terminal sends the second message with SEQ incremented by 1, i.e., SEQ=1. The controlled terminal determines that the control terminal's SEQ is greater than its own saved SEQ, so it receives and processes the message and updates and saves SEQ=1. The control terminal sends the third message with SEQ incremented by 1, i.e., SEQ=2. The controlled terminal processes the message in the same way. If the control terminal sends a message with SEQ=2, the controlled terminal also updates its own saved SEQ=2. At this time, if the controlled terminal receives an "outdated" message (SEQ=0, 1, or 2), the controlled terminal determines that the received SEQ is smaller than its own saved SEQ and considers it an outdated message, filtering the message and not processing it. If the maximum value of SEQ is 10, the controlled terminal's own saved SEQ=10. If the control terminal sends a message with SEQ=2, the controlled terminal updates its own saved SEQ=2, processes the message, and starts a new round of message filtering from SEQ=2.
[0112] It should be noted that after the pairing broadcast packet is verified by the verification code of the pairing broadcast packet and the verification passes, the controlled terminal will use its own stored SEQ value and the message sequence field in the pairing broadcast packet for comparison. If the self-stored SEQ value is not the maximum value and the self-stored SEQ value is less than the SEQ corresponding to the message sequence field in the pairing broadcast packet, then the broadcast packet verification result of the pairing broadcast packet is determined to be a passed result. If the self-stored SEQ value is not the maximum value and the self-stored SEQ value is greater than or equal to the SEQ corresponding to the message sequence field in the pairing broadcast packet, then the broadcast packet verification result of the pairing broadcast packet is determined to be a failed result. If the self-stored SEQ value is the maximum value, then the broadcast packet verification result of the pairing broadcast packet is determined to be a passed result. If the pairing broadcast packet is verified by the verification code of the pairing broadcast packet and the verification fails, then the broadcast packet verification result of the pairing broadcast packet is determined to be a failed result.
[0113] Step S02: When the broadcast packet verification result is a preset passing result, information is extracted from the pairing broadcast packet to determine the access control address of the control terminal and the target key corresponding to the control terminal.
[0114] It should be noted that when the controlled terminal determines that the broadcast packet verification result of the pairing broadcast packet is a preset pass result, it extracts information from the pairing broadcast packet to obtain the MAC address of the control terminal and the target key KEY corresponding to the control terminal.
[0115] It is understandable that when the broadcast packet verification result of the pairing broadcast packet is a failure result, no response is made to the pairing broadcast packet sent by the control terminal.
[0116] Step S03: storing the access control address of the control terminal and the target key corresponding to the control terminal to complete the device network configuration with the control terminal.
[0117] It should be noted that the controlled terminal stores the target key KEY and the MAC address of the controlling terminal. When the controlled terminal joins different networks, it needs to store multiple independent target keys. After storage is complete, the controlled terminal completes device pairing with the controlling terminal and successfully responds to the pairing broadcast packet sent by the controlling terminal.
[0118] Step S04: When the network configuration is completed and the control data packet sent by the control terminal is received, a control packet check is performed on the control data packet.
[0119] It should be noted that when the controlled terminal completes network configuration with the control terminal and receives a control data packet sent by the control terminal, the controlled terminal uses the control packet verification code in the control data packet to verify the integrity and legitimacy of the control data packet. After the verification passes, the controlled terminal compares the stored MAC address with the MAC address in the control data packet. If the MAC address stored by the controlled terminal is consistent with the MAC address in the control data packet, the control packet verification result is determined to be a pass. If any one or more of the following conditions are met: the integrity check and legitimacy check of the control data packet fail, or the MAC address stored by the controlled terminal is inconsistent with the MAC address in the control data packet, the control packet verification result is determined to be a fail.
[0120] In a feasible implementation, step S04 may include steps C11 to C14:
[0121] Step C11: When the network configuration is completed and a control data packet sent by the control terminal is received, information is extracted from the control data packet to determine a control packet check code in the control data packet.
[0122] It should be noted that, when the controlled terminal completes network configuration with the control terminal and receives a control data packet sent by the control terminal, the controlled terminal parses the control data packet and extracts the control packet check code in the control data packet.
[0123] Step C12: performing integrity check on the control data packet according to the control packet check code to obtain a first check result.
[0124] It should be noted that the controlled terminal uses the encryption algorithm negotiated with the controlling terminal (such as the AES-CCM algorithm) to recalculate the checksums covering all fields in the control data packet, except the control packet checksum. The calculated checksum is compared with the control packet checksum carried in the control data packet. If they match, it confirms that the packet has not been tampered with and the source is trustworthy. Otherwise, the packet is discarded, thus ensuring data reliability, integrity, and legitimacy.
[0125] It is understood that if the check code calculated through the above process is consistent with the control packet check code carried in the control data packet, the first check result is a pass result; if they are inconsistent, the first check result is a fail result. If the first check result is a fail result, the control data packet is considered unreliable and is not processed.
[0126] Step C13: When the first verification result is a preset passing result, extract information from the control data packet to determine the access control address in the control data packet.
[0127] Step C14: When the access control address corresponding to the device network configuration is consistent with the access control address in the control data packet, determine that the control packet verification result is a pass result.
[0128] It should be noted that when the first verification result is a preset pass result, the controlled terminal parses the control data packet and extracts the MAC address in the control data packet. The MAC address in the control data packet is compared with the MAC address stored during the device network configuration process. If the two are consistent, the control packet verification result is determined to be a pass result; if the MAC address in the control data packet is inconsistent with the MAC address stored during the device network configuration process, the control packet verification result is determined to be a fail result. In this embodiment, the access control address corresponding to the device network configuration refers to the MAC address stored by the controlled terminal during the device network configuration process. If the control packet verification result is a fail result, the data packet will not be processed.
[0129] Step S05: When the control packet verification result is a preset pass result, a control response is performed on the control data packet.
[0130] It should be noted that when the control packet verification result is a preset pass result, the controlled terminal first compares the SEQ value stored in its own storage with the SEQ value corresponding to the message sequence field in the control data packet to determine whether the control packet is a new message. If so, it uses the stored target key KEY to decrypt the target control information in the control packet and responds to the relevant operation instructions. If the control packet is not a new message, it is filtered.
[0131] It can be understood that after determining that the control data packet is a new message, the controlled terminal will determine whether to relay the control data packet to other controlled terminals based on the TTL in the control data packet. If TTL=0, no forwarding will be performed. If TTL≠0, the control data packet needs to be forwarded to other controlled terminals.
[0132] In a feasible implementation, step S05 may include steps D11 to D13:
[0133] Step D11: When the control packet verification result is a preset pass result, information is extracted from the control data packet to determine the message sequence field in the control data packet.
[0134] It should be noted that when the control data packet verification result is a preset pass result, the controlled terminal parses the control data packet and extracts the message sequence field in the control data packet.
[0135] Step D12, when the message sequence number corresponding to the message sequence field in the control data packet is greater than the sequence number storage value, the target control information in the control data packet is decrypted according to the target key corresponding to the control terminal to obtain decrypted control information.
[0136] It should be noted that the stored sequence number value refers to the SEQ value stored by the controlled terminal itself. Each time a new message is received, the SEQ value is increased by 1. The SEQ corresponding to the message sequence field in the control data packet is compared with the SEQ value stored by the controlled terminal itself. If the SEQ corresponding to the message sequence field in the control data packet is greater than the SEQ value stored by the controlled terminal itself, the control data packet is deemed to be a new message. The controlled terminal uses the target secret key KEY corresponding to the control terminal stored during the network configuration process to decrypt the target control information in the control data packet, thereby obtaining the decrypted control information.
[0137] It is understood that if the SEQ corresponding to the message sequence field in the control data packet is less than or equal to the SEQ value stored by the controlled terminal, a further determination is made as to whether the SEQ value stored by the controlled terminal has reached a set maximum value. If so, the control data packet is considered a new message. If the SEQ value stored by the controlled terminal has not reached the set maximum value, the control data packet is filtered and considered an expired message.
[0138] Step D13: When the device identification information in the decryption control information is consistent with the target identification information, a control response is performed according to the control data in the decryption control information.
[0139] It should be noted that the decrypted control information contains the device identification information of the controlled terminal and its corresponding control data; the target identification information refers to the unique identity of the controlled terminal. The target identification information is compared with the device identification information in the decrypted control information. If the two match, the controlled terminal is the controlled terminal that the controlling terminal expects to control. In this case, the controlled terminal responds according to the control data in the decrypted control information and executes the operation instructions corresponding to the control data.
[0140] It is understandable that if the target identification information is inconsistent with the device identification information in the decrypted control information, it means that the controlled terminal is not the controlled terminal that the control terminal expects to control. At this time, the controlled terminal does not respond to the control data in the decrypted control information.
[0141] In a feasible implementation manner, after step S05, steps E11 to E12 may be further included:
[0142] Step E11: Acquire the current storage status of the storage queue.
[0143] It should be noted that the storage queue refers to the message buffer area built into the controlled terminal, which is used to store data packets. The controlled terminal continuously evaluates the relationship between the number of cached data packets in the queue and the queue's maximum capacity to determine the current storage status of the storage queue. When the number of cached data packets equals the queue's maximum capacity, the storage queue is full and the current storage status is determined to be full. When the number of cached data packets is less than the queue's maximum capacity, the storage queue is not full and the current storage status is determined to be not full.
[0144] Step E12: When the current storage state of the storage queue is a preset full queue state, each stored data packet in the storage queue is deleted according to the storage time of each stored data packet, and the control data packet is stored in the storage queue.
[0145] It should be noted that stored data packets refer to data packets stored in the storage queue. When the current storage state of the storage queue is the preset full queue state, the storage time of each stored data packet in the storage queue is obtained. The data packets in the queue are sorted according to the storage time of each stored data packet, and the earliest stored (i.e., oldest) data packet is deleted first to free up storage space. Subsequently, the newly received control data packet is inserted at the end of the queue and its storage time is updated, so that only the latest data packets that meet the timeliness requirements are cached in the queue.
[0146] It can be understood that this embodiment replaces the heavyweight IV update protocol with a timing-sensitive lightweight cache elimination mechanism, filters expired data packets through queues and timeout mechanisms, and simplifies encryption logic to improve processing efficiency. It solves the long-standing problem of mutual exclusion between security and real-time in the Bluetooth Mesh field, and provides controlled terminals with core capabilities of timeliness assurance, resource optimization, and response acceleration.
[0147] This embodiment provides a device control method, which is applied to a controlled terminal. When a pairing broadcast packet sent by a control terminal is received within a target time period after power-on, the pairing broadcast packet is subjected to broadcast packet verification, wherein the pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code. When the broadcast packet verification result is a preset pass result, information is extracted from the pairing broadcast packet to determine the access control address of the control terminal and the target key corresponding to the control terminal. The access control address of the control terminal and the target key corresponding to the control terminal are stored to complete the device network configuration with the control terminal. When the network configuration is completed and a control data packet sent by the control terminal is received, the control data packet is subjected to control packet verification. When the control packet verification result is a preset pass result, a control response is performed on the control data packet. In the above manner, by introducing a pairing broadcast packet containing a MAC address, SEQ, target key, and verification code, the complex handshake process of traditional Bluetooth networking is replaced, significantly simplifying the network configuration process and shortening the network configuration time. At the same time, a one-way control mechanism is adopted to eliminate the two-way confirmation link, reducing communication delay and improving control efficiency.
[0148] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first and second embodiments above can be referred to the above introduction and will not be described in detail later. Figure 4 , step S01, the device control method includes steps S11 to S14:
[0149] Step S11 : when a pairing broadcast packet is received from a control terminal within a target time period after power-on, information is extracted from the pairing broadcast packet to determine a pairing packet verification code in the pairing broadcast packet.
[0150] It should be noted that when the controlled terminal receives the pairing broadcast packet sent by the control terminal within the target time period after power-on, it parses the pairing broadcast packet and extracts the pairing packet verification code in the pairing broadcast packet.
[0151] Step S12: performing an integrity check on the pairing broadcast packet according to the pairing packet verification code to obtain a second verification result.
[0152] It should be noted that the controlled terminal uses the encryption algorithm negotiated with the controlling terminal (such as the AES-CCM algorithm) to recalculate the checksums covering all fields in the pairing broadcast packet, except for the pairing packet checksum. The calculated checksum is compared with the pairing packet checksum carried in the pairing broadcast packet. If they match, it confirms that the packet has not been tampered with and the source is trustworthy. Otherwise, the packet is discarded, thus ensuring data reliability, integrity, and legitimacy.
[0153] It is understood that if the verification code calculated through the above process is consistent with the verification code of the pairing packet, the second verification result is a pass; if they are inconsistent, the second verification result is a fail. If the second verification result is a fail, the pairing broadcast packet is considered unreliable, and no response is given to the data packet, and device network pairing is not performed with the control terminal that sent the pairing broadcast packet.
[0154] Step S13: When the second verification result is a preset passing result, information is extracted from the pairing broadcast packet to determine a message sequence field in the pairing broadcast packet.
[0155] It should be noted that when the second verification result is the preset pass result, the controlled terminal parses the pairing broadcast packet, extracts the message sequence field in the pairing broadcast packet, and compares the SEQ value corresponding to the message sequence field with the SEQ value stored in the controlled terminal itself.
[0156] Step S14: When the message sequence number corresponding to the message sequence field in the paired broadcast packet is greater than the stored value of the sequence number, determining that the broadcast packet verification result is a pass result.
[0157] It should be noted that when the SEQ value corresponding to the message sequence field is greater than the SEQ value stored in the controlled terminal itself, it means that the paired broadcast packet is a new message in the network. At this time, the broadcast packet verification result of the paired broadcast packet is determined to be a pass result.
[0158] In a feasible implementation, step S11 may further include steps F11 to F12:
[0159] Step F11 , when the message sequence number corresponding to the message sequence field in the paired broadcast packet is less than or equal to the sequence number storage value and the sequence number storage value is a preset storage value, determining that the broadcast packet verification result is a pass result.
[0160] It should be noted that the preset storage value refers to the maximum value of the pre-set SEQ. If the SEQ value corresponding to the message sequence field in the paired broadcast packet is less than or equal to the SEQ value stored in the controlled terminal itself, it is further determined whether the SEQ value stored in the controlled terminal itself is the preset storage value. If so, it means that the paired broadcast packet is a new message, and the broadcast packet verification result is determined to be a pass result.
[0161] Step F12: When the message sequence number corresponding to the message sequence field in the paired broadcast packet is less than or equal to the sequence number storage value and the sequence number storage value is not a preset storage value, determining that the broadcast packet verification result is a failure result.
[0162] It should be noted that if the SEQ value corresponding to the message sequence field in the paired broadcast packet is less than or equal to the SEQ value stored by the controlled terminal itself and the SEQ value stored by the controlled terminal itself is not the preset storage value, it means that the paired broadcast packet is an old message, and the broadcast packet verification result is determined to be a failure result.
[0163] This embodiment provides a device control method, which extracts information from the pairing broadcast packet when receiving a pairing broadcast packet sent by a control terminal within a target time period after power-on, and determines the pairing packet verification code in the pairing broadcast packet; performs an integrity check on the pairing broadcast packet based on the pairing packet verification code to obtain a second verification result; when the second verification result is a preset pass result, extracts information from the pairing broadcast packet and determines the message sequence field in the pairing broadcast packet; when the message sequence number corresponding to the message sequence field in the pairing broadcast packet is greater than the stored sequence number value, determines that the broadcast packet verification result is a pass result. In the above manner, the pairing broadcast packet is verified through time window access, integrity verification, and sequence number filtering, thereby ensuring the security and efficiency of the network configuration process.
[0164] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the device control method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0165] This application also provides a device control system, such as Figure 5 As shown, the device control system includes a control terminal and multiple controlled terminals. The device control method described above is executed on the control terminal, and the device control method described above is executed on the controlled terminals.
[0166] The device control system provided in this application, employing the device control method described in the aforementioned embodiments, can address the technical issues of low network configuration efficiency and high communication latency in existing Bluetooth Mesh networking technology. Compared to the existing technology, the device control system provided in this application achieves the same beneficial effects as the device control method described in the aforementioned embodiments. Other technical features of the device control system are the same as those disclosed in the aforementioned embodiments and are not further elaborated here.
[0167] The above are only some embodiments of the present application and are not intended to limit the patent scope of the present application. All equivalent structural transformations made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A device control method, characterized in that: The device control method is applied to a control terminal, and the method includes: Sending a pairing broadcast packet to a terminal device so that the terminal device performs pairing according to the pairing broadcast packet, wherein the pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code; Generate a control data packet according to the target control information corresponding to the controlled terminal, the data lifetime, the access control address, the updated message sequence field, and the control packet check code, wherein the controlled terminal is a terminal device for which network configuration has been completed; The control data packet is sent to the controlled terminal, and the controlled terminal is unidirectionally controlled through the control data packet.
2. The method according to claim 1, wherein Before the step of generating a control data packet according to the target control information corresponding to the controlled terminal, the data lifetime, the access control address, the updated message sequence field, and the control packet check code, the method further includes: Generate information to be encrypted according to the device identification information of the controlled terminal and the control data corresponding to the controlled terminal; The information to be encrypted is encrypted according to the target secret key to generate target control information corresponding to the controlled terminal.
3. The method according to claim 1 or 2, wherein Before the step of sending a pairing broadcast packet to the terminal device so that the terminal device performs pairing according to the pairing broadcast packet, the method further includes: Determine the message sequence field of the pairing broadcast packet according to the current message sequence number; A pairing broadcast packet is generated according to the data lifetime, the access control address, the message sequence field, the target secret key, and the pairing packet verification code.
4. A device control method, characterized in that: The device control method is applied to a controlled terminal, and the method includes: When a pairing broadcast packet is received from the control terminal within a target time period after power-on, performing broadcast packet verification on the pairing broadcast packet, wherein the pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code; When the broadcast packet verification result is a preset pass result, extracting information from the paired broadcast packet to determine the access control address of the control terminal and the target key corresponding to the control terminal; Storing the access control address of the control terminal and the target key corresponding to the control terminal to complete device network configuration with the control terminal; When the network configuration is completed and a control data packet sent by the control terminal is received, performing control packet verification on the control data packet; When the control packet verification result is a preset passing result, a control response is performed on the control data packet.
5. The method according to claim 4, wherein The step of performing broadcast packet verification on the pairing broadcast packet when receiving the pairing broadcast packet sent by the control terminal within the target time period after power-on, wherein the pairing broadcast packet contains an access control address, a message sequence field, a target key, and a pairing packet verification code comprises: When a pairing broadcast packet sent by the control terminal is received within a target time period after power-on, information is extracted from the pairing broadcast packet to determine a pairing packet verification code in the pairing broadcast packet; Performing an integrity check on the pairing broadcast packet according to the pairing packet verification code to obtain a second verification result; When the second verification result is a preset passing result, extracting information from the pairing broadcast packet to determine a message sequence field present in the pairing broadcast packet; When the message sequence number corresponding to the message sequence field present in the paired broadcast packet is greater than the sequence number storage value, it is determined that the broadcast packet verification result is a pass result.
6. The method according to claim 5, wherein After extracting information from the pairing broadcast packet and determining the message sequence field in the pairing broadcast packet when the second verification result is a preset passing result, the method further includes: When the message sequence number corresponding to the message sequence field present in the paired broadcast packet is less than or equal to the sequence number storage value and the sequence number storage value is a preset storage value, determining that the broadcast packet verification result is a pass result; When the message sequence number corresponding to the message sequence field present in the paired broadcast packet is less than or equal to the sequence number storage value and the sequence number storage value is not a preset storage value, it is determined that the broadcast packet verification result is a failure result.
7. The method according to claim 4, wherein The step of performing control packet verification on the control data packet when the network configuration is completed and the control data packet sent by the control terminal is received includes: When the network configuration is completed and a control data packet sent by the control terminal is received, extracting information from the control data packet and determining a control packet check code in the control data packet; Performing an integrity check on the control data packet according to the control packet check code to obtain a first check result; When the first verification result is a preset passing result, extracting information from the control data packet to determine an access control address present in the control data packet; When the access control address corresponding to the device network configuration is consistent with the access control address in the control data packet, it is determined that the control packet verification result is a pass result.
8. The method according to claim 4, wherein When the control packet verification result is a preset pass result, the step of performing a control response on the control data packet includes: When the control packet verification result is a preset pass result, extracting information from the control packet to determine a message sequence field in the control packet; When the message sequence number corresponding to the message sequence field in the control data packet is greater than the stored value of the sequence number, decrypting the target control information in the control data packet according to the target secret key corresponding to the control terminal to obtain decrypted control information; When the device identification information in the decryption control information is consistent with the target identification information, a control response is performed according to the control data in the decryption control information.
9. The method according to any one of claims 4 to 8, characterized in that After the step of performing a control response on the control data packet when the control packet verification result is a preset pass result, the method further includes: Get the current storage status of the storage queue; When the current storage state of the storage queue is a preset full queue state, each stored data packet in the storage queue is deleted according to the storage time of each stored data packet, and the control data packet is stored in the storage queue.
10. A device control system, characterized in that: The device control system includes a control terminal and multiple controlled terminals. The device control method according to any one of claims 1 to 3 is executed on the control terminal, and the device control method according to any one of claims 4 to 9 is executed on the controlled terminals.
Citation Information
Cited By
Data transmission method, system and device, storage medium and electronic equipment
CN122450858A