Wireless equipment control method and device for household alarm and storage medium

By adopting Bluetooth wireless communication technology and verification information mechanism in home gas alarms, the problems of alarm data transmission errors and wireless communication data errors in the existing technology are solved, and effective control and fault detection of multiple peripheral devices are realized, and the reliability and security of the system are improved.

CN119763285APending Publication Date: 2025-04-04河南驰诚电气股份有限公司
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411921215.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

Existing household gas alarms fail to effectively handle error problems during data transmission when issuing alarm data, and fail to consider the possibility of data errors during wireless communication.

Method used

Bluetooth wireless communication technology is used to connect the Bluetooth processor to the wireless peripheral device, realize the function of a gas alarm to control multiple peripheral devices, and monitor the faults and disconnection status of the peripheral device in real time. When transmitting the alarm information, add verification information to ensure that the peripheral device can receive the correct alarm information.

Benefits of technology

It realizes effective control and fault detection of multiple peripheral devices by gas alarms, ensures the correct transmission and reception of alarm information, and improves the reliability and safety of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119763285A_ABST
    Figure CN119763285A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of alarms, and particularly relates to a wireless equipment control method and device for a household alarm and a storage medium, and the method comprises the steps: collecting various gas concentrations in a target environment through a sensor, and transmitting the collected gas concentrations to a Bluetooth processor; the Bluetooth processor compares the gas concentration with a preset concentration threshold value, when the gas concentration is larger than the concentration threshold value, an acousto-optic alarm is given out through the acousto-optic equipment, alarm information and verification information are generated, Bluetooth connection with the wireless peripheral devices is established, the alarm information and the verification information are sent to the wireless peripheral devices through the Bluetooth connection, and the wireless peripheral devices are connected with the Bluetooth processor. And after receiving the alarm information and the verification information, the wireless peripheral device verifies the alarm information to obtain a verification result, judges whether the received alarm information is normal based on the verification result, and performs corresponding operation based on the alarm information under the normal condition. According to the invention, gas supply can be cut off in time when gas leakage occurs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of alarms, and in particular relates to a wireless device control method, a device and a storage medium for household alarms. Background Art

[0002] A household gas alarm is a small gas safety product suitable for use in a home environment. It can effectively avoid explosions, fires, poisoning and other serious accidents caused by gas leakage. At present, household gas alarms are widely used in homes, shopping malls, restaurants, companies, warehouses and other places. When the gas alarm detects that the concentration of gas or toxic and harmful gases in the environment exceeds the concentration value set by the instrument, it will issue an audible and visual alarm and promptly control the external device connected to it to close the gas valve. Similar prior art includes a Chinese patent application with publication number CN113223273A, which provides a gas alarm and a gas monitoring system. The gas alarm includes: at least two gas sensors, including a first gas sensor and a second gas sensor for detecting different gases respectively; a processor connected to the at least two gas sensors, used to process the signals collected by the at least two gas sensors to obtain the concentration value of the corresponding gas detected by each gas sensor, and to issue the data to be alarmed when the concentration value of the gas detected by any gas sensor is greater than the corresponding concentration threshold; an alarm unit connected to the processor, used to convert the data to be alarmed into alarm data after the processor continuously issues the data to be alarmed for a preset time, and to issue the alarm data; a communication unit, respectively connected to the at least two gas sensors, the processor, the alarm unit and the OneNET cloud platform. However, when issuing the alarm data, the document does not consider the problem that the alarm data may be wrong during the transmission process. Similar prior art also has a Chinese patent application with publication number CN108629951A, which discloses an intelligent combustible gas alarm system, including a core single-chip microcomputer, the core single-chip microcomputer is electrically connected with an Internet of Things communication module, a power supply, a storage module, a wireless communication module, a wired communication module, a combustible gas probe, an audible and visual alarm module, a leakage concentration display module, and a valve and exhaust fan switch. When the combustible gas probe detects combustible gas, it automatically transmits a signal to the data center through the Internet of Things communication module on the core single-chip microcomputer. During normal operation, the wireless communication module or the wired communication module is connected to the water meter and gas meter in the home by wireless or wired means, and the usage data is stored in the storage module. By setting the core single-chip microcomputer, the data in the storage module is uploaded to the data center at regular intervals. However, the system also does not consider the problem of data errors during wireless communication. Therefore, the present invention provides a wireless device control method, device and storage medium for a home alarm. Summary of the invention

[0003] The present invention adopts Bluetooth wireless communication technology to connect the Bluetooth processor with the wireless peripheral device, so that one gas alarm can control multiple peripheral devices, and can also monitor the failure and disconnection status of the wireless peripheral device in real time without establishing a Bluetooth connection, so that the wireless peripheral device can always maintain low power consumption operation. At the same time, it has a protocol adaptive algorithm, which can automatically identify the manufacturer model of the wireless peripheral device and match the corresponding protocol format in the database for parsing and packaging, so as to realize remote maintenance and upgrading, and add verification information when transmitting alarm information to ensure that the wireless peripheral device can receive the correct alarm information.

[0004] In order to achieve the above-mentioned object of the invention, the present invention provides the following wireless device control method for a home alarm, which is implemented by executing the following steps: Using sensors to collect various gas concentrations in the target environment, and transmitting the collected gas concentrations to a Bluetooth processor; The Bluetooth processor obtains the gas concentration collected by the sensor, compares the gas concentration with a preset concentration threshold, and when the gas concentration is greater than the concentration threshold, issues an audible and audible alarm through an audible and audible device, the audible and audible device includes a fault indicator light and a buzzer, and also generates an alarm message and generates verification information based on the alarm message. The Bluetooth processor establishes a Bluetooth connection with multiple wireless peripheral devices, and sends the alarm message and the verification information to the multiple wireless peripheral devices through the Bluetooth connection. After the alarm message is sent, the Bluetooth processor disconnects the Bluetooth connection with the wireless peripheral device, and the Bluetooth processor also sends the alarm message to a mobile phone APP; After receiving the alarm information and the verification information, the wireless peripheral device verifies the alarm information based on the verification information to obtain a verification result, and determines whether the received alarm information is normal based on the verification result. If normal, a corresponding operation is performed based on the alarm information.

[0005] As a preferred technical solution of the present invention, after the Bluetooth processor performs the sound and light alarm, the following steps are further performed: The Bluetooth processor determines whether it has been paired with the wireless peripheral device by determining whether the MAC address of the wireless peripheral device is stored in the memory space. If the wireless peripheral device has been paired, the Bluetooth processor establishes Bluetooth links with multiple wireless peripheral devices in sequence according to the pre-stored MAC addresses of the wireless peripheral devices, and sends alarm information to the wireless peripheral devices through the Bluetooth connection. If the wireless peripheral device has not been paired, the Bluetooth processor and the wireless peripheral device enter the pairing process for pairing. After the pairing is completed, the Bluetooth processor establishes Bluetooth links with multiple paired wireless peripheral devices in sequence according to the MAC addresses, and sends alarm information to the wireless peripheral devices through the Bluetooth connection.

[0006] As a preferred technical solution of the present invention, the Bluetooth processor and the wireless peripheral device enter a pairing process for pairing, including the following steps: The wireless peripheral device transmits a broadcast packet at a preset time interval. During the period of sending the broadcast packet, the Bluetooth chip of the wireless peripheral device turns on the radio frequency function to transmit the broadcast. The wireless peripheral device also adds its own device information to the broadcast packet. The Bluetooth processor obtains the device information of the wireless peripheral device through the broadcast packet. The device information includes a device identification code, a Bluetooth broadcast name, a MAC address, a solenoid valve connection status, and device power information. The Bluetooth processor continuously scans the wireless peripheral devices that can be paired around and obtains the broadcast packets of the wireless peripheral devices, obtains the Bluetooth broadcast name and AMC address through the broadcast packets, identifies the wireless peripheral devices through the Bluetooth broadcast name and MAC address, and after continuously scanning for a preset first time, sorts the wireless peripheral devices according to the Bluetooth signal strength according to the scanning results, sends handshake connection instructions to the wireless peripheral devices in sequence according to the sorting, and simultaneously authenticates each other with the wireless peripheral devices, and after successful authentication, handshakes to confirm that pairing is completed. After pairing is completed, the Bluetooth processor stores the MAC addresses of all the wireless peripheral devices that are successfully paired with itself, and the Bluetooth processor also performs fault detection on all the wireless peripheral devices that are successfully paired with itself; After pairing is completed, the wireless peripheral device stores the MAC address of the Bluetooth processor, and then sets its own broadcast to directional broadcast, so that its own broadcast packet is only received by the Bluetooth processor that has been successfully paired with itself.

[0007] As a preferred technical solution of the present invention, the Bluetooth processor and multiple wireless peripheral devices establish a Bluetooth connection, including the following steps: The Bluetooth processor obtains the Bluetooth device information of the wireless peripheral device, compares the Bluetooth device information with the protocol information pre-stored in the protocol database, and when the protocol information matching the Bluetooth device information is found, the Bluetooth processor actively sends a test instruction to the wireless peripheral device for verification, and when the return information of the wireless peripheral device can be received, the matching protocol information is used to communicate with the wireless peripheral device, and when the protocol information matching the Bluetooth device information cannot be found, the Bluetooth processor sends the Bluetooth device information to the mobile phone APP, searches for the protocol information matching the Bluetooth information device through the mobile phone APP, and adds the found protocol information matching the Bluetooth device information to the protocol database, and uses the matching protocol information to communicate with the wireless peripheral device, and when the protocol information matching the Bluetooth device information cannot be found through the mobile phone APP, the general protocol information is used to communicate with the wireless peripheral device.

[0008] As a preferred technical solution of the present invention, mutual authentication with the wireless peripheral device includes the following steps: Generate a first arbitrary value, send the first arbitrary value to the wireless peripheral device, the wireless peripheral device generates a second arbitrary value after receiving the first arbitrary value, send the second arbitrary value to the Bluetooth processor, the Bluetooth processor generates a first password based on the first arbitrary value and the second arbitrary value, the Bluetooth processor encrypts first data using the first password to generate first ciphertext data, and sends the first ciphertext data to the wireless peripheral device; The wireless peripheral device generates a second password based on the first arbitrary value and the second arbitrary value, and also uses the second password to decrypt the received first ciphertext data to obtain second data. The wireless peripheral device sends the second data to the Bluetooth processor, and the Bluetooth processor determines whether the first data and the second data are the same. If they are the same, the wireless peripheral device sends a handshake confirmation message to the wireless peripheral device. If they are not the same, the wireless peripheral device does not send a handshake confirmation message.

[0009] As a preferred technical solution of the present invention, generating the first arbitrary value includes the following steps: Acquire a predetermined number of storage spaces, set initial storage values ​​of all the storage spaces to be empty, acquire a first storage address of a first storage space, acquire a timestamp of a current time, acquire several bits of the timestamp as a first operation value, add the first operation value and the first storage address to generate a first operation value, and use the first operation value as a first storage value of the first storage space; Obtain a second storage address of a second storage space, perform an XOR operation on the first storage value and the second storage address to obtain a second operation value, use the second operation value as the second storage value of the second storage space, and repeat this step to set corresponding storage values ​​for the remaining storage spaces; The first arbitrary value R is calculated using a first formula, wherein the first formula is R=HN % 2 M , wherein HN is the storage value of the last storage space, and M is the number of binary digits of the first arbitrary value to be generated; Use the first arbitrary value and several bits of the current timestamp to add to obtain a new calculation value, perform an XOR operation on the new calculation value and the storage value of the last storage space, update the obtained result as the first storage value of the first storage space, use the storage value of the previous storage space and the storage value of the current storage space to perform an XOR operation and use the obtained result as the new storage value to update the storage value of the current storage space.

[0010] As a preferred technical solution of the present invention, generating the second arbitrary value includes the following steps: Define a first value, randomly generate a number of first numbers that are greater than zero and less than or equal to the first value, combine the first numbers into a first data set, the number of first numbers in the first data set is the first value, and number the first numbers in the first data set from one; Define an initial value as 1, randomly generate a second number that is less than or equal to the first value, obtain the first number numbered as the second number in the first data set, add the first number to the second data set, increase the initial value by 1, and repeat this step until the initial value is the first value; All second numbers in the second data set are obtained, and all second numbers are combined in sequence to form the second arbitrary value.

[0011] As a preferred technical solution of the present invention, generating verification information based on the alarm information includes the following steps: Use the first conversion method to convert the alarm information into the first information, determine whether the number of bits of the alarm information and the first information are the same, if they are the same, convert the alarm information and the first information into binary data, perform an XOR operation on the converted alarm information and the first information to obtain the second information, sum all the number of bits of the second information to obtain the sum result, and use the sum result as the verification information.

[0012] As a preferred technical solution of the present invention, verifying the alarm information based on the verification information to obtain a verification result includes the following steps: The wireless peripheral device generates second verification information based on the received alarm information using the same method as the Bluetooth processor to generate the verification information, and determines whether the second verification information is the same as the received alarm information. If they are the same, the alarm information is determined to be normal; if they are not the same, the alarm information is determined to be abnormal.

[0013] The present invention also provides a wireless device control device for a household alarm, comprising the following modules: A sensor module, which uses a sensor to collect the concentrations of various gases in the target environment and transmits the collected gas concentrations to a Bluetooth processor; An alarm module, using the Bluetooth processor to obtain the gas concentration collected by the sensor, comparing the gas concentration with a preset concentration threshold, and when the gas concentration is greater than the concentration threshold, sending an audible and visual alarm through an audible and visual device, the audible and visual device including a fault indicator light and a buzzer, and also generating alarm information and generating verification information based on the alarm information, the Bluetooth processor and multiple wireless peripheral devices establish a Bluetooth connection, and send the alarm information and the verification information to the multiple wireless peripheral devices through the Bluetooth connection. After the alarm information is sent, the Bluetooth processor and the wireless peripheral device disconnect the Bluetooth connection, and the Bluetooth processor also sends the alarm information to a mobile phone APP; The wireless peripheral module is used to verify the alarm information based on the verification information to obtain a verification result after receiving the alarm information and the verification information, and to determine whether the received alarm information is normal based on the verification result. If normal, perform corresponding operations based on the alarm information.

[0014] The present invention also provides a storage medium storing program instructions, wherein when the program instructions are executed, the device where the storage medium is located is controlled to execute any one of the wireless device control methods for home alarms described above.

[0015] Compared with the prior art, the beneficial effects of the present invention are at least as follows: The present invention adopts Bluetooth wireless communication technology to connect the Bluetooth processor with the wireless peripheral device, so that one gas alarm can control multiple peripheral devices; the wireless peripheral device is detected for faults, so that the user can find the fault at the first time, and can obtain detailed fault causes and treatment plans through the mobile phone APP; the protocol of wireless peripheral devices from different manufacturers is adapted, and the protocol database can be continuously expanded to achieve compatibility with various types of wireless peripheral devices; in the process of pairing the Bluetooth alarm and the wireless peripheral device, the two are mutually verified to ensure the security of the communication between the two; when sending alarm information to the wireless peripheral device, verification information is also added to ensure that the wireless peripheral device can receive the correct alarm information. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flowchart of the steps of the wireless device control method for a home alarm of the present invention; Figure 2 The figure is a structural diagram of the wireless device control device for a household alarm according to the present invention. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0018] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.

[0019] The present invention provides Figure 1 The wireless device control method for a home alarm is implemented by executing the following steps: Step S1: Use sensors to collect various gas concentrations in the target environment, and transmit the collected gas concentrations to a Bluetooth processor.

[0020] Specifically, in order to obtain the concentrations of various gases in the environment and determine whether the gas concentration in the environment exceeds the concentration threshold through concentration information, a gas sensor is set in the target area where gas is used, generally in the kitchen and other areas, to collect the concentrations of various gases in the target environment and transmit the collected gas concentrations to the Bluetooth processor.

[0021] Step S2, the Bluetooth processor obtains the gas concentration collected by the sensor, and compares the gas concentration with a preset concentration threshold. When the gas concentration is greater than the concentration threshold, an audible and visual alarm is issued through the audible and visual device, the audible and visual device includes a fault indicator light and a buzzer, and also generates alarm information and generates verification information based on the alarm information. The Bluetooth processor establishes a Bluetooth connection with multiple wireless peripheral devices, and sends alarm information and verification information to multiple wireless peripheral devices through the Bluetooth connection. After the alarm information is sent, the Bluetooth processor and the wireless peripheral device disconnect the Bluetooth connection, and the Bluetooth processor also sends the alarm information to the mobile phone APP.

[0022] Specifically, after the Bluetooth processor obtains the gas concentration, it determines whether the gas concentration in the environment exceeds the preset concentration threshold. If it exceeds, the Bluetooth processor enters the alarm mode, controls the buzzer to sound, and controls the indicator light to flash to alarm. By issuing an audible and visual alarm, the user is reminded to take safety measures. After that, the Bluetooth processor also establishes a Bluetooth connection with multiple wireless peripheral devices, and the multiple wireless peripheral devices include Bluetooth solenoid valves, Bluetooth manipulators, Bluetooth gas meters, etc. The Bluetooth processor generates an alarm message and sends the alarm message to multiple wireless peripheral devices. The wireless peripheral devices perform corresponding operations based on the alarm message, such as closing the gas valve, cutting off the gas port, etc. In order to ensure the correctness of the alarm message sent by the Bluetooth processor, prevent data from being tampered with, and ensure that the wireless peripheral device receives the correct alarm message, thereby ensuring that the wireless peripheral device can perform the correct operation, the Bluetooth processor also generates verification information based on the alarm message, and sends the alarm message and the verification message to the wireless peripheral device together. After the alarm message is sent, the Bluetooth processor and the wireless peripheral device disconnect the Bluetooth connection to ensure that the wireless peripheral device can operate with low power consumption. The Bluetooth processor also sends the alarm message to the mobile phone APP to ensure that the user can obtain the alarm message in time according to the mobile phone APP when the user is not at home.

[0023] Step S3: After receiving the alarm information and the verification information, the wireless peripheral device verifies the alarm information based on the verification information to obtain a verification result, and determines whether the received alarm information is normal based on the verification result. If normal, a corresponding operation is performed based on the alarm information.

[0024] Specifically, in order to ensure that the wireless peripheral device can perform correct operations based on the alarm information, after the wireless peripheral device receives the alarm information and verification information, the wireless peripheral device uses the method of generating verification information with the Bluetooth processor to generate a second verification information based on the received alarm information. If the generated second verification information is the same as the received verification information, it means that there is no error in the transmission of the alarm information, and the wireless peripheral device performs corresponding operations based on the alarm information. For example, the Bluetooth solenoid valve closes the gas valve based on the alarm information, the Bluetooth manipulator closes the gas port based on the alarm information, and the Bluetooth gas meter closes the gas meter based on the alarm information. If they are not the same, it means that there is an error in the transmission of the alarm information. The alarm information is abnormal, and the user or relevant staff can be notified to take corresponding inspection measures.

[0025] Through the above method, the Bluetooth processor and the wireless peripheral device are connected using Bluetooth wireless communication technology, so that multiple wireless peripheral devices can be controlled by one Bluetooth processor. In a large space environment with multiple gas valve nodes, the installation point is flexible and the construction is convenient. When sending alarm information to control the wireless peripheral device, verification information is also generated through the alarm information to ensure that the alarm information is not tampered with during the transmission process. At the same time, it also ensures that the wireless peripheral device can make correct operations according to the alarm information, such as timely cutting off the gas supply when a gas leak occurs.

[0026] Furthermore, after the Bluetooth processor performs the sound and light alarm, the following steps are also performed: The Bluetooth processor determines whether it has been paired with the wireless peripheral device by determining whether the MAC address of the wireless peripheral device is stored in the memory space. If it has been paired, the Bluetooth processor establishes Bluetooth links with multiple wireless peripheral devices in sequence according to the MAC addresses of the wireless peripheral devices stored in advance, and sends alarm information to the wireless peripheral devices through the Bluetooth connection. If it has not been paired, the Bluetooth processor and the wireless peripheral device enter the pairing process for pairing. After the pairing is completed, the Bluetooth links are established in sequence with the multiple paired wireless peripheral devices according to the MAC addresses, and the alarm information is sent to the wireless peripheral devices through the Bluetooth connection.

[0027] Specifically, when a gas leak or other dangerous situation is detected, in order to be able to quickly and effectively notify and trigger relevant safety measures, the Bluetooth processor needs to send an alarm message to the wireless peripheral device after the sound and light alarm is issued. Before sending the alarm message to the wireless peripheral device, it is necessary to establish a Bluetooth connection with the wireless peripheral device. First, determine whether the MAC address of the wireless peripheral device is stored in the memory space. If the MAC address is stored, it means that it has been paired with the wireless peripheral device before. A Bluetooth connection is established directly with the wireless peripheral device through the MAC address, and an alarm message is sent through the Bluetooth connection. If the wireless peripheral device is not stored, it means that the Bluetooth processor has not been paired with the wireless peripheral device. At this time, it is necessary to display the wireless peripheral device to enter the pairing process for pairing. After the pairing is completed, a Bluetooth connection is established with the paired wireless peripheral device based on the MAC address, and an alarm message is sent to the wireless peripheral device through the Bluetooth connection. Through the above steps, the alarm message can be sent to the wireless peripheral device in a timely manner.

[0028] Furthermore, the Bluetooth processor and the wireless peripheral device enter a pairing process for pairing, including the following steps: The wireless peripheral device transmits broadcast packets at preset time intervals. During the period of sending the broadcast packets, the Bluetooth chip of the wireless peripheral device turns on the radio frequency function to transmit the broadcast. The wireless peripheral device also adds its own device information to the broadcast packet. The Bluetooth processor obtains the device information of the wireless peripheral device through the broadcast packet. The device information includes the device identification code, Bluetooth broadcast name, MAC address, solenoid valve connection status and device power information.

[0029] Specifically, as a Bluetooth slave device, the wireless peripheral device must be discovered by the host before it can be connected to the host, which refers to the Bluetooth processor. The wireless peripheral device continuously broadcasts Bluetooth to the outside, which will keep the efficiency of the wireless peripheral device in a high state. Therefore, the wireless peripheral device will regularly broadcast Bluetooth to the outside, such as transmitting a Bluetooth broadcast every 2 seconds, to reduce the average power consumption of the wireless peripheral device and increase the usage time of the wireless peripheral device. In order to quickly pair with the Bluetooth processor, the wireless peripheral device adds its own device information to the broadcast packet and sends it out in the form of broadcast, so that after the Bluetooth processor receives the broadcast packet, it can quickly pair and connect with the wireless processor based on the content of the broadcast packet.

[0030] The Bluetooth processor continuously scans the surrounding wireless peripheral devices that can be paired and obtains the broadcast packets of the wireless peripheral devices, obtains the Bluetooth broadcast name and AMC address through the broadcast packets, identifies the wireless peripheral devices through the Bluetooth broadcast name and MAC address, and after continuously scanning for a preset first time period, sorts the wireless peripheral devices according to the Bluetooth signal strength based on the scanning results, sends handshake connection instructions to the wireless peripheral devices in sequence according to the sorting, and authenticates each other with the wireless peripheral devices at the same time. After the authentication is successful, a handshake is performed to confirm that the pairing is completed. After the pairing is completed, the Bluetooth processor stores the MAC addresses of all wireless peripheral devices that have been successfully paired with itself. The Bluetooth processor also performs fault detection on all wireless peripheral devices that have been successfully paired with itself.

[0031] Specifically, the Bluetooth processor is generally powered by AC power, and there is no need to consider the problem of power consumption. The Bluetooth processor can continuously scan the surrounding wireless peripheral devices that can be paired. After scanning the broadcast packet of the wireless peripheral device, the Bluetooth broadcast name and MAC address are obtained based on the broadcast packet to identify the corresponding wireless peripheral device. After the first duration of continuous scanning, such as 10 seconds of continuous scanning, multiple wireless peripheral devices may be scanned. The wireless peripheral devices are sorted based on the Bluetooth signal strength of the multiple wireless peripheral devices, and handshake instructions are sent to the wireless peripheral devices in sequence. There may be Bluetooth devices in the environment that are not for gas alarm. In order to remove interference and enable the wireless peripheral device and the Bluetooth processor to pair with each other, it is necessary to verify the legitimacy of each other. Therefore, the Bluetooth processor and the wireless peripheral device perform mutual verification. The specific verification process will be explained later. After the verification is successful, the pairing is confirmed to be completed. After the pairing is completed, the Bluetooth processor also stores the MAC addresses of all wireless peripheral devices that have been successfully paired with itself. Since the wireless peripheral device may fail, such as running out of power, in order to obtain the status of the wireless peripheral device in time, the Bluetooth processor also performs fault detection on all wireless peripheral devices that have been successfully paired with itself. The specific fault detection method will be explained later.

[0032] After pairing is completed, the wireless peripheral device stores the MAC address of the Bluetooth processor, and then sets its own broadcast to directional broadcast so that its own broadcast packet is only received by the Bluetooth processor that has been successfully paired with itself.

[0033] Specifically, considering the privacy of data and the interference of other devices, after pairing is completed, the wireless peripheral device stores the MAC address of the Bluetooth processor that has successfully paired with itself, and then sets its own broadcast to directional broadcast so that its own broadcast packet is only received by the Bluetooth processor that has been successfully paired with itself.

[0034] Furthermore, the Bluetooth processor also performs fault detection on all wireless peripheral devices paired with itself, including the following steps: After scanning the broadcast packet sent by the wireless peripheral device, the Bluetooth processor sets a timer with a preset second duration. If a broadcast packet from the wireless peripheral device is received within the second duration, the timer is restarted. If no broadcast packet from the corresponding wireless peripheral device is received within the second duration, it is determined that the wireless peripheral device has a fault, and an audible and visual alarm is issued through the audible and visual equipment, and the fault information is also sent to the mobile phone APP connected to the Bluetooth processor.

[0035] Specifically, in the event of a failure of a wireless peripheral device, the wireless peripheral device may not be able to send broadcast packets outward. At this time, the Bluetooth processor cannot scan the wireless peripheral device. Based on this principle, the Bluetooth processor performs fault detection on the wireless peripheral device. After the Bluetooth processor scans the broadcast packet sent by the wireless peripheral device, it is assumed that the wireless peripheral device sends broadcast packets outward in sequence every 2 seconds. Considering that other interference may cause the loss of broadcast packets, a 30-second timer can be set. If the broadcast packet of the corresponding wireless peripheral device is received within 30 seconds, it means that the wireless peripheral device is in a normal state. At this time, the timer is reset and restarted. If the broadcast packet of the corresponding wireless peripheral device is not received within 30 seconds, it means that the wireless peripheral device has failed. The Bluetooth processor sends an audible and visual alarm through an audible and visual device. In order to distinguish it from other abnormal situations, different sounds and lights can be set for different fault types when issuing an audible and visual alarm, so that users can judge the fault type conveniently. After that, the Bluetooth processor also sends the fault information to the mobile phone APP connected to itself, so that users can view the specific fault information through the mobile phone APP and take effective troubleshooting and maintenance measures accordingly.

[0036] Furthermore, the Bluetooth processor and the plurality of wireless peripheral devices establish a Bluetooth connection, comprising the following steps: The Bluetooth processor obtains the Bluetooth device information of the wireless peripheral device, compares the Bluetooth device information with the protocol information pre-stored in the protocol database, and when the protocol information matching the Bluetooth device information is found, the Bluetooth processor actively sends a test instruction to the wireless peripheral device for verification, and when the return information of the wireless peripheral device can be received, the matching protocol information is used to communicate with the wireless peripheral device, and when the protocol information matching the Bluetooth device information cannot be found, the Bluetooth device information is sent to the mobile phone APP, and the protocol information matching the Bluetooth information device is searched through the mobile phone APP, and the found protocol information matching the Bluetooth device information is added to the protocol database, and the matching protocol information is used to communicate with the wireless peripheral device, and when the protocol information matching the Bluetooth device information cannot be found through the mobile phone APP, the general protocol information is used to communicate with the wireless peripheral device.

[0037] Specifically, different wireless peripheral devices have different functions due to different manufacturers, and usually the protocols they use cannot be fully compatible. If different software programs are developed for different wireless peripheral devices, it will not only greatly increase the workload, but also be detrimental to product upgrades and maintenance. Therefore, the present invention proposes a protocol adaptation method. After establishing a connection with the wireless peripheral device, the Bluetooth device information is first obtained. The Bluetooth device information includes the manufacturer name, device model, device model, firmware revision version, etc. of the wireless peripheral device. The Bluetooth device information is compared with the protocol information pre-stored in the protocol database. The protocol information refers to the communication protocol between the Bluetooth processor and the wireless peripheral device, including alarm instructions, alarm recovery instructions, and self-test instructions. The protocol information of different manufacturers is pre-stored in the database and matched with it. The matching protocol information is obtained, and a test instruction is sent for verification. If the return information of the corresponding wireless peripheral device is received, it means that the match is successful. After that, the corresponding protocol information can be used to communicate with the wireless peripheral device. If the corresponding protocol information cannot be found in the protocol database, the Bluetooth device information is sent to the mobile phone APP, and the Bluetooth device information is uploaded to the server through the mobile phone APP. The server searches for the relevant protocol information, and adds the corresponding protocol information to the protocol database if it is found. If it cannot be found, try to use the general protocol to communicate with the wireless peripheral device. Through the above method, only one set of software code is used to regularly maintain and update the protocol data block, so that the Bluetooth processor can have stronger compatibility and can connect more wireless peripheral devices from different manufacturers.

[0038] Furthermore, mutual authentication with the wireless peripheral device includes the following steps: Generate a first arbitrary value, send the first arbitrary value to the wireless peripheral device, the wireless peripheral device generates a second arbitrary value after receiving the first arbitrary value, send the second arbitrary value to the Bluetooth processor, the Bluetooth processor generates a first password based on the first arbitrary value and the second arbitrary value, the Bluetooth processor encrypts the first data using the first password to generate first ciphertext data, and sends the first ciphertext data to the wireless peripheral device; The wireless peripheral device generates a second password based on the first arbitrary value and the second arbitrary value, and also uses the second password to decrypt the received first ciphertext data to obtain second data. The wireless peripheral device sends the second data to the Bluetooth processor, and the Bluetooth processor determines whether the first data and the second data are the same. If they are the same, a handshake confirmation message is sent to the wireless peripheral device. If they are not the same, the wireless peripheral device does not send a handshake confirmation message.

[0039] Specifically, in order to enable the Bluetooth processor and the wireless peripheral device to authenticate each other, the Bluetooth processor uses a preset first algorithm to generate a first arbitrary value and sends it to the wireless peripheral device. After receiving the first arbitrary value, the wireless peripheral device generates a second arbitrary value and sends it to the Bluetooth processor. The Bluetooth processor generates a first password based on the first arbitrary value and the second arbitrary value, and also uses the first password to encrypt the first data to generate first ciphertext data. The first data can use preset arbitrary data or randomly generate an arbitrary number. The first ciphertext data is sent to the wireless peripheral device. The wireless peripheral device generates a second password based on the first arbitrary value and the second arbitrary value, and uses the second password to decrypt the first ciphertext data to obtain the second data. The data is sent to the Bluetooth processor. After receiving the second data, the Bluetooth processor determines whether the first data and the second data are the same. If they are the same, it means that the two have been authenticated successfully and can communicate safely. The Bluetooth processor sends a handshake confirmation message to the wireless peripheral device to make the two pair successfully. If they are not the same, it means that the two have been authenticated unsuccessfully and the two may not be Bluetooth devices that need to communicate with each other. Therefore, the Bluetooth processor does not send a handshake confirmation message to the wireless peripheral device, making the pairing of the two unsuccessful. The above method can ensure safe and interference-free communication between the Bluetooth processor and the corresponding wireless peripheral device, avoid connecting to other wireless peripheral devices that are not related to the gas alarm, and avoid interference with the transmission of alarm information by other devices when gas leaks.

[0040] Further, generating a first arbitrary value comprises the following steps: Obtain a predetermined number of storage spaces, set initial storage values ​​of all storage spaces to be empty, obtain a first storage address of a first storage space, obtain a timestamp of a current time, obtain a number of bits of the timestamp as a first operation value, add the first operation value and the first storage address to generate a first operation value, and use the first operation value as a first storage value of the first storage space; Obtain a second storage address of the second storage space, perform an XOR operation on the first storage value and the second storage address to obtain a second operation value, use the second operation value as the second storage value of the second storage space, and repeat this step to set corresponding storage values ​​for the remaining storage spaces; Calculate the first arbitrary value R using the first formula, the first formula is R=HN % 2 M , where HN is the storage value of the last storage space, and M is the number of binary digits of the first arbitrary value to be generated; Use the first arbitrary value and several bits of the current timestamp to add to obtain a new calculation value, perform an XOR operation on the new calculation value and the storage value of the last storage space, update the obtained result as the first storage value of the first storage space, use the storage value of the previous storage space and the storage value of the current storage space to perform an XOR operation and use the obtained result as the new storage value to update the storage value of the current storage space.

[0041] Specifically, the predetermined number is set to a value greater than or equal to five, for example, the predetermined number is set to five, the initial storage value of all storage spaces is set to null, the storage address of the storage space is generally an eight-digit hexadecimal number, for example, the storage address of the first storage space is 0x12345678, and several bits of the timestamp of the current time are obtained, for example, the last four bits of the timestamp are obtained, assuming that the last four bits are 1234, then the first storage value of the first storage space is 0x12345678+1234=0x12356AB2, the storage address of the second storage space is obtained, assuming that it is 0x00112233, and the second storage value of the second storage space is 0x00112233 XOR 0x12356AB2=0x124688C5, the second storage value and the storage address of the third storage space are XORed to obtain the third storage value of the third storage space, and the storage values ​​corresponding to the subsequent storage spaces are subsequently generated in the same way. After calculating the storage values ​​of all storage spaces, the first arbitrary value is calculated using the above-mentioned first formula, where M can control the size of the generated first arbitrary value. Then, the generated first arbitrary value and several bits of the current timestamp are added to obtain a new operation value, and the new operation value and the storage value of the last storage space are XORed and the obtained result is used as the storage value of the first storage space, so as to achieve the purpose of updating the storage value of the first storage space. Then, the storage value of the first storage space and the current storage value of the second storage space are XORed and the obtained result is used as the new storage value of the second storage space, so as to achieve the purpose of updating the storage value of the second storage space. The storage values ​​of all other storage spaces are updated using the same method to prepare for the next generation of the first arbitrary value.

[0042] Further, generating a second arbitrary value comprises the following steps: A first value is defined, a plurality of first numbers greater than zero and less than or equal to the first value are randomly generated, the plurality of first numbers are combined into a first data set, the number of first numbers in the first data set is the first value, and the first numbers in the first data set are numbered from one; Define the initial value as 1, randomly generate a second number that is less than or equal to the first value, obtain the first number numbered as the second number in the first data set, add the first number to the second data set, increase the initial value by 1, and repeat this step until the initial value is the first value; All second numbers in the second data set are obtained, and all second numbers are combined together in order to form a second arbitrary value.

[0043] Specifically, in the process of mutual authentication, in order to prevent the outside world from easily obtaining the method of mutual authentication between the Bluetooth processor and the wireless peripheral device, the above method is used to generate an efficient and complex second arbitrary value, so that the generation of the second arbitrary value is more flexible and the randomness is improved, and the generated second arbitrary values ​​are unpredictable and independent. The arbitrary value generated by the above method can make the generated second arbitrary value random, and two completely identical arbitrary values ​​cannot be easily generated.

[0044] Further, generating verification information based on the alarm information includes the following steps: Use the first conversion method to convert the alarm information into the first information, determine whether the number of bits of the alarm information and the first information are the same, if they are the same, convert the alarm information and the first information into binary data, perform an XOR operation on the converted alarm information and the first information to obtain the second information, sum all the bits of the second information to obtain the sum result, and use the sum result as verification information.

[0045] Specifically, in order to enable the wireless peripheral device to receive correct alarm information, make correct control operations according to the alarm information, generate verification information based on the alarm information, and enable the wireless peripheral device to determine whether there is an error in the transmission of the alarm information based on the verification information, first use the first conversion method to convert the alarm information into the first information. The first conversion method can be a hash function, that is, the alarm information is converted into the first information through the hash function, and then the alarm information and the first information are converted into binary data. It is also determined whether the number of bits of the two converted binary numbers is the same. In different situations, for example, the number of bits of the alarm information is less than that of the first information, 0 is added after the alarm information to make the number of bits of the alarm information the same as that of the first information, and the two are XORed to obtain the second information, all the bits of the second information are summed to obtain the sum result, and the sum result is used as verification information. The verification information and the alarm information are sent to the wireless peripheral device. By generating verification information through the above complex method, it is possible to avoid matching the error pattern of the data with the calculation method of the verification information, thereby improving the error detection rate of the wireless peripheral device.

[0046] Further, verifying the alarm information based on the verification information to obtain a verification result includes the following steps: The wireless peripheral device generates second verification information based on the received alarm information using the same method as the Bluetooth processor to generate verification information, and determines whether the second verification information is the same as the received alarm information. If they are the same, the alarm information is determined to be normal; if not, the alarm information is determined to be abnormal.

[0047] Specifically, the wireless peripheral device uses the method of generating verification information with the Bluetooth processor to generate second verification information based on the received alarm information. If the generated second verification information is the same as the received verification information, it means that there is no error in the transmission of the alarm information. The wireless peripheral device takes corresponding measures based on the alarm information, such as closing the gas valve. If they are not the same, it means that there is an error in the transmission of the alarm information. The alarm information is abnormal, and the user or relevant staff can be notified to take corresponding inspection measures.

[0048] According to another aspect of the embodiment of the present invention, Figure 2 As shown, a wireless device control device for a home alarm is also provided, including a sensor module, an alarm module and a wireless peripheral module, which is used to implement the wireless device control method for a home alarm as described above. The specific functions of each module are as follows: The sensor module uses sensors to collect the concentrations of various gases in the target environment and transmits the collected gas concentrations to the Bluetooth processor; The alarm module uses a Bluetooth processor to obtain the gas concentration collected by the sensor, compares the gas concentration with a preset concentration threshold, and when the gas concentration is greater than the concentration threshold, an audible and visual alarm is issued through an audible and visual device, the audible and visual device includes a fault indicator light and a buzzer, and also generates alarm information and generates verification information based on the alarm information. The Bluetooth processor establishes a Bluetooth connection with multiple wireless peripheral devices, and sends alarm information and verification information to multiple wireless peripheral devices through the Bluetooth connection. After the alarm information is sent, the Bluetooth processor and the wireless peripheral device disconnect the Bluetooth connection, and the Bluetooth processor also sends the alarm information to the mobile phone APP; The wireless peripheral module is used to verify the alarm information based on the verification information to obtain a verification result after receiving the alarm information and verification information, and to determine whether the received alarm information is normal based on the verification result. If it is normal, perform corresponding operations based on the alarm information.

[0049] According to another aspect of an embodiment of the present invention, a storage medium is further provided, wherein the storage medium stores program instructions, wherein when the program instructions are executed, the device where the storage medium is located is controlled to execute any one of the above-mentioned wireless device control methods for home alarms.

[0050] In summary, the wireless device control method, device and storage medium for household alarm of the present invention include using sensors to collect various gas concentrations in the target environment, and transmitting the collected gas concentrations to a Bluetooth processor, the Bluetooth processor compares the gas concentration with a preset concentration threshold, and when the gas concentration is greater than the concentration threshold, an audible and visual alarm is issued through an audible and visual device, and alarm information and verification information are generated, and a Bluetooth connection is established with multiple wireless peripheral devices, and alarm information and verification information are sent to multiple wireless peripheral devices through the Bluetooth connection. After the wireless peripheral device receives the alarm information and verification information, the alarm information is verified to obtain a verification result, and whether the received alarm information is normal is determined based on the verification result. Under normal circumstances, corresponding operations are performed based on the alarm information. The present invention can ensure that the gas supply is cut off in time when a gas leak occurs.

[0051] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0052] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0053] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0054] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

[0055] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A wireless device control method for a home alarm, characterized in that: The method comprises the following steps: Using sensors to collect various gas concentrations in the target environment, and transmitting the collected gas concentrations to a Bluetooth processor; The Bluetooth processor obtains the gas concentration collected by the sensor, compares the gas concentration with a preset concentration threshold, and when the gas concentration is greater than the concentration threshold, issues an audible and audible alarm through an audible and audible device, the audible and audible device includes a fault indicator light and a buzzer, and also generates an alarm message and generates verification information based on the alarm message. The Bluetooth processor establishes a Bluetooth connection with multiple wireless peripheral devices, and sends the alarm message and the verification information to the multiple wireless peripheral devices through the Bluetooth connection. After the alarm message is sent, the Bluetooth processor disconnects the Bluetooth connection with the wireless peripheral device, and the Bluetooth processor also sends the alarm message to a mobile phone APP; After receiving the alarm information and the verification information, the wireless peripheral device verifies the alarm information based on the verification information to obtain a verification result, and determines whether the received alarm information is normal based on the verification result. If normal, a corresponding operation is performed based on the alarm information.

2. The method according to claim 1, characterized in that After the Bluetooth processor performs the sound and light alarm, the following steps are also performed: The Bluetooth processor determines whether it has been paired with the wireless peripheral device by determining whether the MAC address of the wireless peripheral device is stored in the memory space. If the wireless peripheral device has been paired, the Bluetooth processor establishes Bluetooth links with multiple wireless peripheral devices in sequence according to the pre-stored MAC addresses of the wireless peripheral devices, and sends alarm information to the wireless peripheral devices through the Bluetooth connection. If the wireless peripheral device has not been paired, the Bluetooth processor and the wireless peripheral device enter the pairing process for pairing. After the pairing is completed, the Bluetooth processor establishes Bluetooth links with multiple paired wireless peripheral devices in sequence according to the MAC addresses, and sends alarm information to the wireless peripheral devices through the Bluetooth connection.

3. The method according to claim 2, characterized in that The Bluetooth processor and the wireless peripheral device enter into a pairing process for pairing, including the following steps: The wireless peripheral device transmits a broadcast packet at a preset time interval. During the period of sending the broadcast packet, the Bluetooth chip of the wireless peripheral device turns on the radio frequency function to transmit the broadcast. The wireless peripheral device also adds its own device information to the broadcast packet. The Bluetooth processor obtains the device information of the wireless peripheral device through the broadcast packet. The device information includes a device identification code, a Bluetooth broadcast name, a MAC address, a solenoid valve connection status, and device power information. The Bluetooth processor continuously scans the wireless peripheral devices that can be paired around and obtains the broadcast packets of the wireless peripheral devices, obtains the Bluetooth broadcast name and AMC address through the broadcast packets, identifies the wireless peripheral devices through the Bluetooth broadcast name and MAC address, and after continuously scanning for a preset first time, sorts the wireless peripheral devices according to the Bluetooth signal strength according to the scanning results, sends handshake connection instructions to the wireless peripheral devices in sequence according to the sorting, and simultaneously authenticates each other with the wireless peripheral devices, and after successful authentication, handshakes to confirm that pairing is completed. After pairing is completed, the Bluetooth processor stores the MAC addresses of all the wireless peripheral devices that are successfully paired with itself, and the Bluetooth processor also performs fault detection on all the wireless peripheral devices that are successfully paired with itself; After pairing is completed, the wireless peripheral device stores the MAC address of the Bluetooth processor, and then sets its own broadcast to directional broadcast, so that its own broadcast packet is only received by the Bluetooth processor that has been successfully paired with itself.

4. The method according to claim 1, characterized in that: The Bluetooth processor and the plurality of wireless peripheral devices establish a Bluetooth connection, comprising the following steps: The Bluetooth processor obtains the Bluetooth device information of the wireless peripheral device, compares the Bluetooth device information with the protocol information pre-stored in the protocol database, and when the protocol information matching the Bluetooth device information is found, the Bluetooth processor actively sends a test instruction to the wireless peripheral device for verification, and when the return information of the wireless peripheral device can be received, the matching protocol information is used to communicate with the wireless peripheral device, and when the protocol information matching the Bluetooth device information cannot be found, the Bluetooth processor sends the Bluetooth device information to the mobile phone APP, searches for the protocol information matching the Bluetooth information device through the mobile phone APP, and adds the found protocol information matching the Bluetooth device information to the protocol database, and uses the matching protocol information to communicate with the wireless peripheral device, and when the protocol information matching the Bluetooth device information cannot be found through the mobile phone APP, the general protocol information is used to communicate with the wireless peripheral device.

5. The method according to claim 3, characterized in that: Mutual authentication with the wireless peripheral device includes the following steps: Generate a first arbitrary value, send the first arbitrary value to the wireless peripheral device, the wireless peripheral device generates a second arbitrary value after receiving the first arbitrary value, send the second arbitrary value to the Bluetooth processor, the Bluetooth processor generates a first password based on the first arbitrary value and the second arbitrary value, the Bluetooth processor encrypts first data using the first password to generate first ciphertext data, and sends the first ciphertext data to the wireless peripheral device; The wireless peripheral device generates a second password based on the first arbitrary value and the second arbitrary value, and also uses the second password to decrypt the received first ciphertext data to obtain second data. The wireless peripheral device sends the second data to the Bluetooth processor, and the Bluetooth processor determines whether the first data and the second data are the same. If they are the same, the wireless peripheral device sends a handshake confirmation message to the wireless peripheral device. If they are not the same, the wireless peripheral device does not send a handshake confirmation message.

6. The method according to claim 5, characterized in that Generating a first arbitrary value comprises the following steps: Obtain a predetermined number of storage spaces, set the initial storage values ​​of all the storage spaces to be empty, obtain a first storage address of the first storage space, obtain a timestamp of the current time, obtain several bits of the timestamp as a first operation value, add the first operation value and the first storage address to generate a first operation value, and use the first operation value as the first storage value of the first storage space; Obtain a second storage address of a second storage space, perform an XOR operation on the first storage value and the second storage address to obtain a second operation value, use the second operation value as the second storage value of the second storage space, and repeat this step to set corresponding storage values ​​for the remaining storage spaces; The first arbitrary value R is calculated using a first formula, wherein the first formula is R=HN % 2 M , wherein HN is the storage value of the last storage space, and M is the number of binary digits of the first arbitrary value to be generated; Use the first arbitrary value and several bits of the current timestamp to add to obtain a new calculation value, perform an XOR operation on the new calculation value and the storage value of the last storage space, update the obtained result as the first storage value of the first storage space, use the storage value of the previous storage space and the storage value of the current storage space to perform an XOR operation and use the obtained result as the new storage value to update the storage value of the current storage space.

7. The method according to claim 5, characterized in that Generating a second arbitrary value comprises the following steps: Define a first value, randomly generate a number of first numbers that are greater than zero and less than or equal to the first value, combine the first numbers into a first data set, the number of first numbers in the first data set is the first value, and number the first numbers in the first data set from one; Define an initial value as 1, randomly generate a second number that is less than or equal to the first value, obtain the first number numbered as the second number in the first data set, add the first number to the second data set, increase the initial value by 1, and repeat this step until the initial value is the first value; All second numbers in the second data set are obtained, and all second numbers are combined in sequence to form the second arbitrary value.

8. The method according to claim 1, characterized in that Generating verification information based on the alarm information includes the following steps: Use the first conversion method to convert the alarm information into the first information, determine whether the number of bits of the alarm information and the first information are the same, if they are the same, convert the alarm information and the first information into binary data, perform an XOR operation on the converted alarm information and the first information to obtain the second information, sum all the number of bits of the second information to obtain the sum result, and use the sum result as the verification information.

9. A wireless device control apparatus for a home alarm, used to implement a wireless device control method for a home alarm as claimed in any one of claims 1 to 8, characterized in that: Includes the following modules: A sensor module, which uses a sensor to collect the concentrations of various gases in the target environment and transmits the collected gas concentrations to a Bluetooth processor; An alarm module, using the Bluetooth processor to obtain the gas concentration collected by the sensor, comparing the gas concentration with a preset concentration threshold, and when the gas concentration is greater than the concentration threshold, sending an audible and visual alarm through an audible and visual device, the audible and visual device including a fault indicator light and a buzzer, and also generating alarm information and generating verification information based on the alarm information, the Bluetooth processor and multiple wireless peripheral devices establish a Bluetooth connection, and send the alarm information and the verification information to the multiple wireless peripheral devices through the Bluetooth connection. After the alarm information is sent, the Bluetooth processor and the wireless peripheral device disconnect the Bluetooth connection, and the Bluetooth processor also sends the alarm information to a mobile phone APP; The wireless peripheral module is used to verify the alarm information based on the verification information to obtain a verification result after receiving the alarm information and the verification information, and to determine whether the received alarm information is normal based on the verification result. If normal, perform corresponding operations based on the alarm information.

10. A storage medium, characterized in that: The storage medium stores program instructions, wherein when the program instructions are executed, the device where the storage medium is located is controlled to execute the wireless device control method for a home alarm according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method suitable for heartbeat keeping of low-power consumption Bluetooth device

    CN104348522A

  • Network secret key interaction system, device and method

    CN108777678A

  • Bluetooth authentication method and device, equipment and medium

    CN109862560A

  • Industrial protocol adaptation method and device, edge device and cloud server

    CN114153468A

  • Data detection method and device, equipment and medium

    CN118762417A