Sensor data transmission method and system based on BLE, terminal and storage medium

By selecting the peripheral device with the highest signal strength in the sensor data transmission scheme to connect and shut down during non-operating periods, the problems of low transmission frequency, small data volume and high power consumption in low real-time scenarios are solved. Achieve stable and low-cost data transmission.

CN119110262APending Publication Date: 2024-12-10SUZHOU DHMS INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411102810.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The existing BLE-based sensor data transmission scheme has problems such as low data transmission frequency, small data volume, high power consumption and high wireless environment complexity in scenarios with low real-time requirements, resulting in high implementation cost and operation and maintenance difficulties.

Method used

Using sensors as the center of the Bluetooth protocol, by scanning the Bluetooth broadcast signal of peripheral devices, obtaining signal strength values, selecting the device with the highest signal strength for connection, realizing data transmission, and directly shutting down during non-operating periods to reduce power consumption.

Benefits of technology

It reduces conflicts and competition in wireless environments, reduces implementation costs and operation and maintenance difficulties, ensures the stability of data transmission, and improves resource utilization and sensor work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119110262A_ABST
    Figure CN119110262A_ABST
Patent Text Reader

Abstract

The invention relates to a sensor data transmission method and system based on BLE, a terminal and a storage medium. The method comprises the following steps: starting and receiving a Bluetooth broadcast signal according to a Bluetooth signal receiving period; when Bluetooth broadcast signals are received, signal intensity values are obtained and compared with a preset signal intensity threshold value, each signal intensity value corresponds to one access control address, and when the signal intensity values are larger than the threshold value, the signal intensity values are stored in a signal intensity list; when the signal strength value exists in the signal strength list, selecting one signal strength value as a target signal strength value and a target access control address; and establishing connection with the peripheral equipment, executing data transmission operation when the connection is successful, and after the data transmission operation is completed, shutting down and waiting until the restart moment arrives. According to the scheme, the sensor serves as a center node, the peripheral equipment serves as a target node, a simpler and smoother wireless environment is constructed, and the implementation cost and the operation and maintenance difficulty of the scheme are greatly reduced on the premise that the data transmission stability is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of sensors and data transmission, and in particular to a method, system, terminal and storage medium for BLE-based sensor data transmission under low real-time requirements. Background Art

[0002] At present, in some data transmission scenarios with low real-time requirements, such as underground environments in the coal industry, a data transmission architecture based on BLE (Bluetooth Low Energy) is usually used. In this type of architecture, the gateway is basically used as the central device and the sensor is used as the peripheral device.

[0003] In the prior art, there are mainly two transmission schemes for performing sensor data transmission using the above data transmission architecture.

[0004] First, broadcast transmission, that is, the sensor performs periodic sleep, wake-up, and collection operations, fills data in the broadcast, and the gateway obtains the corresponding data after scanning. In actual operation, although the sensor will theoretically enter a dormant state and will not wake up during the non-working period, its Bluetooth radio frequency part will still operate periodically to maintain the transmission of the broadcast. In this method, the defects are mainly reflected in two aspects. First, due to the characteristics of broadcasting, the sensor cannot confirm whether the gateway has obtained the data. Therefore, in order to ensure that the broadcasted data can be smoothly accepted by the gateway, the frequency of data update must be as low as possible. Secondly, because the sensor cannot confirm the data acquisition status of the gateway, the data content cannot be transmitted in packets, and the amount of data that can be transmitted is too small. For example, in the BLE4.0 version, the maximum amount of broadcast data is 31 bytes, while in the BLE5.0 version, the maximum amount of broadcast data is only 254 bytes.

[0005] The second is scanning connection transmission, that is, the gateway actively scans and connects to the sensor for data transmission. Although this method can transmit data in packets and increase the amount of data that can be transmitted, in actual operation, in order to ensure multiple, repeated and stable connections between the gateway and the sensor, the broadcast interval of the sensor will be shortened, which will undoubtedly increase the power consumption of the sensor.

[0006] In addition to the defects of the two transmission schemes mentioned above, they also have a common problem, that is, if there are too many broadcasting devices in the environment, the wireless environment of the specific frequency band (2.4GHz) on site will become extremely complex, and there will be conflicts and competition between sensors, resulting in data loss when the gateway is scanning. In addition, in such scenarios, it is difficult to achieve full coverage using a single gateway, and using multiple gateways requires adding relevant operating logic and grouping management on the gateway side to avoid data duplication, which will undoubtedly greatly increase the difficulty of implementation and operation and maintenance on the gateway side.

[0007] In view of the various defects in the above-mentioned existing technologies, how to propose a new sensor data transmission solution for data transmission scenarios with low real-time requirements, and minimize the implementation cost and operation and maintenance difficulty of the solution while ensuring the stability of data transmission, has become an urgent problem to be solved by technicians in this field. Summary of the invention

[0008] In order to meet various transmission requirements in data transmission scenarios with low real-time requirements, the present application provides a sensor data transmission method, system, terminal and storage medium based on BLE.

[0009] The solution of this application uses sensors as the center of the Bluetooth protocol and rationally utilizes peripheral devices to build a simpler and smoother wireless environment. While ensuring the stability of data transmission, it minimizes the implementation cost and operation and maintenance difficulty of the solution.

[0010] In a first aspect, the present application provides a sensor data transmission method based on BLE, which adopts the technical solution described below.

[0011] A sensor data transmission method based on BLE includes the following steps:

[0012] Start and perform peripheral device scanning, and receive Bluetooth broadcast signals from the peripheral devices according to a preset Bluetooth signal receiving cycle;

[0013] When any group of the Bluetooth broadcast signals is received, the signal strength values ​​in the group of the Bluetooth broadcast signals are obtained, each of the signal strength values ​​corresponds to an access control address of the peripheral device that is the sender of the group of the Bluetooth broadcast signals, the signal strength value is compared with a preset signal strength threshold, and when the signal strength value is greater than the signal strength threshold, the signal strength value is saved in a signal strength list;

[0014] Reading the signal strength list, when there is at least one signal strength value in the signal strength list, selecting one of the signal strength values ​​from the signal strength list as a target signal strength value, and using the access control address corresponding to the target signal strength value as a target access control address;

[0015] A connection is established with the peripheral device corresponding to the target access control address. When the connection is successful, a data transmission operation is performed. After the data transmission operation is completed, a restart time is determined, and the computer is shut down and waits until the restart time arrives.

[0016] By adopting the above technical solution, a network structure with sensors as central nodes and peripheral devices as target nodes was established. Compared with the existing technology, the number of peripheral devices and the number of Bluetooth broadcast signals were greatly reduced, the conflicts and competitions in the wireless environment were reduced, the congestion of the specific frequency band (2.4GHz) was avoided to the greatest extent, and the stability of the data transmission process was ensured.

[0017] Preferably, the starting and performing peripheral device scanning to receive the Bluetooth broadcast signal from the peripheral device according to a preset Bluetooth signal receiving cycle specifically includes the following steps:

[0018] The startup operation is performed at the preset restart time. After the startup operation is completed, a peripheral device scan is performed, and a Bluetooth broadcast signal sent by the peripheral device according to a preset Bluetooth signal broadcast cycle is received according to a preset Bluetooth signal reception cycle. The duration of the Bluetooth signal reception cycle is at least twice the duration of the Bluetooth signal broadcast cycle.

[0019] By adopting the above technical solution, the process of obtaining the Bluetooth broadcast signal in the solution is refined and limited, and the limitation on the Bluetooth signal receiving period also ensures to the greatest extent that the sensor can successfully obtain the Bluetooth broadcast signal from the peripheral device, providing the corresponding operational basis for the subsequent signal strength comparison and access address determination.

[0020] Preferably, when any group of the Bluetooth broadcast signals is received, the signal strength values ​​in the group of the Bluetooth broadcast signals are obtained, each of the signal strength values ​​corresponds to an access control address of the peripheral device that is the sender of the group of the Bluetooth broadcast signals, the signal strength value is compared with a preset signal strength threshold, and when the signal strength value is greater than the signal strength threshold, the signal strength value is saved in a signal strength list, specifically comprising the following steps:

[0021] If any group of the Bluetooth broadcast signals is received, the signal strength values ​​contained in the group of the Bluetooth broadcast signals are obtained, each of the signal strength values ​​corresponds to an access control address of the peripheral device that is also contained in the group of the Bluetooth broadcast signals and is the sender of the group of the Bluetooth broadcast signals, the signal strength value is compared with a preset signal strength threshold, if the signal strength value is greater than the signal strength threshold, the signal strength value is saved in a signal strength list, if the signal strength value is less than the signal strength threshold, the signal strength value is discarded;

[0022] If the Bluetooth broadcast signal is not received, the restart time is determined and the device is shut down immediately until the restart time arrives.

[0023] By adopting the above technical solution, the screening process for Bluetooth broadcast signals and the processing process when the Bluetooth broadcast signal is not obtained are clarified; in particular, for the screening of Bluetooth broadcast signals, it is ensured that all peripheral devices that can be selected in the access address determination process have good connection effects, providing a stable and reliable communication link for subsequent data transmission.

[0024] Preferably, the reading of the signal strength list, when at least one signal strength value exists in the signal strength list, selecting one of the signal strength values ​​from the signal strength list as the target signal strength value, and using the access control address corresponding to the target signal strength value as the target access control address, specifically comprises the following steps:

[0025] Reading the signal strength list;

[0026] If there is at least one signal strength value in the signal strength list, all the signal strength values ​​in the signal strength list are sorted in descending order according to a preset sorting algorithm, the signal strength list is updated according to the sorting result, the signal strength value ranked first in the updated signal strength list is selected as the target signal strength value, and the access control address corresponding to the target signal strength value is used as the target access control address;

[0027] If the signal strength value does not exist in the signal strength list, the restart time is determined and the computer is shut down immediately until the restart time arrives.

[0028] By adopting the above technical solution, the peripheral device selected as the transmission target each time has the highest signal strength and the best connection effect with the sensor within the optional range, further providing a stable and reliable communication link for subsequent data transmission.

[0029] Preferably, the peripheral device corresponding to the target access control address establishes a connection, and when the connection is successful, performs a data transmission operation, specifically comprising the following steps:

[0030] establishing a connection with the peripheral device corresponding to the target access control address;

[0031] If the connection with the peripheral device is successful, a data transmission operation is performed;

[0032] If the connection with the peripheral device fails, the device goes into sleep mode according to a preset connection interval, and after the sleep mode is completed, a connection is established again with the peripheral device corresponding to the target access control address.

[0033] Preferably, the establishing of a connection with the peripheral device corresponding to the target access control address and, when the connection is successful, performing a data transmission operation further comprises the following steps:

[0034] If the number of consecutive connection failures with the same peripheral device reaches a preset number of abandonment times, the signal strength value that is ranked next to the current target signal strength value in the updated signal strength list is selected, the target signal strength value is updated according to the selection result, the target access control address is updated using the access control address corresponding to the updated target signal strength value, and then a connection is established with the peripheral device corresponding to the updated target access control address.

[0035] By adopting the above technical solution, not only the process of establishing the communication link between the sensor and the peripheral device selected as the transmission target is clarified, but also a response strategy is provided for connection failures that may be caused by various reasons in real scenarios; in particular, when the connection between the sensor and a peripheral device fails for multiple consecutive times, the connection attempt is decisively terminated, which not only ensures the normal execution of data transmission, but also improves the transmission efficiency and avoids the waste of resources caused by more meaningless attempts.

[0036] Preferably, the step of determining the restart time and then shutting down and waiting until the restart time arrives specifically includes the following steps:

[0037] Determine a first time interval according to the current time and a preset working schedule, generate a random value as a second time interval, and determine a restart time in combination with the first time interval and the second time interval;

[0038] After determining the restart time, shut down and wait until the restart time arrives.

[0039] By adopting the above technical solution, the sensor can directly enter the shutdown state during non-working hours without having to wake up frequently, ensuring that the entire network structure has higher resource utilization and lower device power consumption; in addition, the introduction of the second time interval also avoids the situation where multiple sensors are connected to the same peripheral device at the same time as much as possible, further reducing conflicts and competition in the wireless environment.

[0040] In a second aspect, the present application provides a sensor data transmission system based on BLE, which adopts the technical solution described below.

[0041] A sensor data transmission system based on BLE, including the following modules:

[0042] A broadcast signal receiving module is configured to start and perform peripheral device scanning, and receive a Bluetooth broadcast signal from the peripheral device according to a preset Bluetooth signal receiving cycle;

[0043] A signal strength acquisition module, configured to, when receiving any group of the Bluetooth broadcast signals, acquire the signal strength value in the group of the Bluetooth broadcast signals, each of the signal strength values ​​corresponding to an access control address of the peripheral device as the sender of the group of the Bluetooth broadcast signals, compare the signal strength value with a preset signal strength threshold, and when the signal strength value is greater than the signal strength threshold, save the signal strength value to a signal strength list;

[0044] an access address determination module, configured to read the signal strength list, and when at least one signal strength value exists in the signal strength list, select one of the signal strength values ​​from the signal strength list as a target signal strength value, and use the access control address corresponding to the target signal strength value as a target access control address;

[0045] The data transmission execution module is configured to establish a connection with the peripheral device corresponding to the target access control address, and when the connection is successful, execute a data transmission operation. After the data transmission operation is completed, determine a restart time, shut down and wait until the restart time arrives.

[0046] By adopting the above technical solution, the aforementioned BLE-based sensor data transmission method is implemented at the hardware level. It can be seen that the sensors used in the solution are not coupled with peripheral devices, and the working logic of the constructed system at the hardware level is simple and easy, with low implementation cost and conducive to large-scale promotion and application; in addition, the entire system has good scalability, and sensors and peripheral devices can be flexibly configured according to actual usage requirements, which also reduces the occurrence of data duplication.

[0047] In a third aspect, the present application provides a smart terminal, which adopts the following technical solution:

[0048] A smart terminal includes a memory and a processor, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the BLE-based sensor data transmission method as described above.

[0049] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:

[0050] A computer-readable storage medium, wherein at least one instruction, at least one program, code set or instruction set is stored in the computer-readable storage medium, wherein the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the BLE-based sensor data transmission method as described above.

[0051] In summary, the present application includes at least one of the following beneficial technical effects:

[0052] 1. Compared with the prior art, the solution of this application has greatly reduced the number of peripheral devices and the number of Bluetooth broadcast signals, reduced conflicts and competitions in the wireless environment, avoided congestion in the specific frequency band (2.4GHz) to the greatest extent, and ensured the stability of the data transmission process.

[0053] 2. The sensor used as the central node in the solution of this application can directly enter the shutdown state during non-working hours without having to wake up frequently, ensuring that the entire network structure has higher resource utilization and lower device power consumption.

[0054] 3. The peripheral devices and sensors used as target nodes in the solution of this application are not coupled, and the working logic of the constructed system at the hardware level is simple and easy, with low implementation cost and conducive to large-scale promotion and application; the application party can also flexibly configure sensors and peripheral devices according to actual usage requirements, ensuring the overall scalability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, they can also refer to these drawings to obtain other drawings without paying creative work.

[0056] Figure 1It is a rough flow chart of a sensor data transmission method based on BLE in an embodiment of the present application;

[0057] Figure 2 It is a schematic diagram of a specific flow chart of a sensor data transmission method based on BLE in an embodiment of the present application;

[0058] Figure 3 It is a flow chart of a method for calibrating a signal strength threshold in a sensor data transmission method based on BLE according to an embodiment of the present application;

[0059] Figure 4 It is a schematic diagram of the architecture of a BLE-based sensor data transmission system according to an embodiment of the present application. DETAILED DESCRIPTION

[0060] This application provides a method, system, terminal and storage medium for BLE-based sensor data transmission under low real-time requirements in a data transmission scenario with low real-time requirements, such as in an underground environment of the coal industry. In order to make the purpose, technical solution and advantages of this application clearer, the implementation method of this application will be further described below.

[0061] The following is a detailed description of a BLE-based sensor data transmission method, system, terminal and storage medium of the present application in conjunction with the drawings of the specification.

[0062] First, a sensor data transmission method based on BLE in an embodiment of the present application is introduced. The method in this embodiment is implemented based on a network structure with a sensor as a central node and peripheral devices as target nodes.

[0063] In order to smoothly implement the subsequent method flow, the single chip microcomputer used by the sensor in this embodiment needs to have a timed power on / off function. In actual application scenarios, an RTC (Real Time Clock) module can be used to generate a signal at a specified time through the RTC module, thereby controlling the sensor to start up and realize this function. In addition, the peripheral devices described in this embodiment are all Bluetooth peripheral devices, and the device type, model and other details are not limited, but the broadcast cycle of all the peripheral devices needs to be consistent, and the Bluetooth protocol version is required to be above 4.0.

[0064] A sensor data transmission method based on BLE, such as Figure 1 , Figure 2 As shown, the following steps are included:

[0065] S1, start and perform peripheral device scanning, and receive the Bluetooth broadcast signal from the peripheral device according to a preset Bluetooth signal receiving cycle; this step specifically includes the following process.

[0066] The startup operation is performed at the preset restart time. After the startup operation is completed, the peripheral device is scanned, and the Bluetooth broadcast signal sent by the peripheral device according to the preset Bluetooth signal broadcast cycle within i seconds is received according to the preset Bluetooth signal reception cycle. Here, i seconds reflects the duration of the Bluetooth signal reception cycle, which can be determined according to the Bluetooth signal broadcast cycle of the peripheral device itself. In principle, in order to ensure that the Bluetooth broadcast signal can be received, the duration of the Bluetooth signal reception cycle is at least twice the duration of the Bluetooth signal broadcast cycle.

[0067] S2. When any group of the Bluetooth broadcast signals is received, the signal strength values ​​in the group of the Bluetooth broadcast signals are obtained, each of the signal strength values ​​corresponds to an access control address of the peripheral device that is the sender of the group of the Bluetooth broadcast signals, the signal strength value is compared with a preset signal strength threshold, and when the signal strength value is greater than the signal strength threshold, the signal strength value is saved in a signal strength list; this step specifically includes the following process.

[0068] S201, if the sensor scans and connects to any of the peripheral devices within i seconds, the sensor receives any group of the Bluetooth broadcast signals, and the Bluetooth protocol stack will feed back a string of report events to the upper layer. Generally speaking, one numerical value in the Bluetooth broadcast signal corresponds to one report event. Then, the signal strength value contained in the group of Bluetooth broadcast signals is obtained, and each signal strength value corresponds to an access control address of the peripheral device that is also contained in the group of Bluetooth broadcast signals and is the sender of the group of Bluetooth broadcast signals. The signal strength value is compared with a preset signal strength threshold. If the signal strength value is greater than the signal strength threshold, the signal strength value is saved in the signal strength list in the sensor's own memory. If the signal strength value is less than the signal strength threshold, the signal strength value is discarded.

[0069] S202: If the Bluetooth broadcast signal is not received, determine a restart time and then shut down the device until the restart time arrives.

[0070] There are two points that need to be explained here. First, in this embodiment, the signal strength value is an RSSI (Received Signal Strength Indication) value, and the access control address is a MAC (Media Access Control) address.

[0071] Secondly, the signal strength threshold (K value) in this embodiment will change according to actual conditions, and the signal strength threshold will also be affected by differences in the radio frequency performance of Bluetooth chips from different manufacturers. Therefore, a general calibration method for the signal strength threshold is briefly described here.

[0072] The signal strength threshold calibration method is as follows: Figure 3 As shown, the following steps are included:

[0073] The first step is to take a sensor and a peripheral device that will be used in the actual project application and connect the two;

[0074] The second step is to use the sensor to transmit data n times with m bytes. It should be noted that m here should be consistent with the maximum number of bytes of data transmitted in actual project applications, and n should be as large as possible;

[0075] Step 3: If no data loss occurs, increase the distance L between the sensor as the central node and the peripheral device as the target node to reduce the signal strength value between the two, and perform the second step again;

[0076] It should be noted here that, in theory, the smaller the amplitude of the L value is during each adjustment, the higher the calibration accuracy is. However, the change of the signal strength value (RSSI value) should also be considered. If the adjustment amplitude is too small, the RSSI value will not change, and the adjustment operation of the L value will lose its meaning.

[0077] The fourth step is, if data loss happens to occur, then the signal strength value of the peripheral device received by the sensor at the current moment is calibrated as the signal strength threshold, that is, the K value.

[0078] S3. Read the signal strength list. When there is at least one signal strength value in the signal strength list, select one of the signal strength values ​​from the signal strength list as the target signal strength value, and use the access control address corresponding to the target signal strength value as the target access control address. This step specifically includes the following process.

[0079] S31, reading the signal strength list stored in the memory.

[0080] S311. If there is at least one signal strength value in the signal strength list, all the signal strength values ​​in the signal strength list are sorted in descending order according to a preset sorting algorithm, the signal strength list is updated according to the sorting result, and the signal strength value ranked first in the updated signal strength list is selected as the target signal strength value, and the access control address corresponding to the target signal strength value is used as the target access control address.

[0081] It should be noted here that, in this embodiment, there is no limitation on the sorting algorithm, which may be insertion sort, shell sort, selection sort, bubble sort, merge sort, quick sort, heap sort, radix sort, etc., and can be determined according to the actual application scenario.

[0082] S312: If the signal strength value does not exist in the signal strength list, it may be that the sensor is started for the first time, or the signal strength values ​​collected several times before are discarded because they do not reach the threshold. Then, a restart time is determined and the device is shut down until the restart time arrives.

[0083] S4. Establish a connection with the peripheral device corresponding to the target access control address. When the connection is successful, perform a data transmission operation. After the data transmission operation is completed, determine the restart time, then shut down and wait until the restart time arrives. This step specifically includes the following process.

[0084] S41. Establish a connection with the peripheral device corresponding to the target access control address.

[0085] S411: If the connection with the peripheral device is successful, perform a data transmission operation.

[0086] S412. If the connection with the peripheral device fails, sleep according to a preset connection interval. The connection interval can be set according to the actual application scenario. In this embodiment, the connection interval is preferably 60S. After the sleep is completed, a connection is established again with the peripheral device corresponding to the target access control address.

[0087] S413. If the number of consecutive connection failures with the same peripheral device reaches a preset number of abandonment times, it means that there is a problem with the communication link or a hardware failure of the peripheral device itself, then the signal strength value that is ranked next to the current target signal strength value in the updated signal strength list is selected, the target signal strength value is updated according to the selection result, the target access control address is updated using the access control address corresponding to the updated target signal strength value, and then a connection is established with the peripheral device corresponding to the updated target access control address. It should be noted that the number of abandonment times can also be set according to the actual application scenario. In this embodiment, the number of abandonment times is preferably 3 times.

[0088] S42: Determine a first time interval according to the current time and a preset working schedule, generate a random value as a second time interval, and determine a restart time in combination with the first time interval and the second time interval.

[0089] It should be noted here that the working schedule is formulated by the application party based on the actual application scenario, and the first time interval is actually the difference between the current moment and the next working moment closest to the current moment in the working schedule. The purpose of introducing a random value, i.e., the second time interval, here is to avoid multiple sensors being connected to the same peripheral device at the same time as much as possible. Finally, the first time interval and the second time interval are added together to obtain the final time interval, which can be combined with the current moment to determine the restart moment, i.e., the moment when the sensor performs the next startup operation.

[0090] S43: After determining the restart time, shut down and wait until the restart time arrives.

[0091] Based on the same inventive concept as above, the embodiment of the present application also discloses a sensor data transmission system based on BLE, such as Figure 4 As shown, the system includes the following modules:

[0092] A broadcast signal receiving module is configured to start and perform peripheral device scanning, and receive a Bluetooth broadcast signal from the peripheral device according to a preset Bluetooth signal receiving cycle;

[0093] A signal strength acquisition module, configured to, when receiving any group of the Bluetooth broadcast signals, acquire the signal strength value in the group of the Bluetooth broadcast signals, each of the signal strength values ​​corresponding to an access control address of the peripheral device as the sender of the group of the Bluetooth broadcast signals, compare the signal strength value with a preset signal strength threshold, and when the signal strength value is greater than the signal strength threshold, save the signal strength value to a signal strength list;

[0094] an access address determination module, configured to read the signal strength list, and when at least one signal strength value exists in the signal strength list, select one of the signal strength values ​​from the signal strength list as a target signal strength value, and use the access control address corresponding to the target signal strength value as a target access control address;

[0095] The data transmission execution module is configured to establish a connection with the peripheral device corresponding to the target access control address, and when the connection is successful, execute a data transmission operation. After the data transmission operation is completed, determine a restart time, shut down and wait until the restart time arrives.

[0096] In a possible implementation, the broadcast signal receiving module specifically includes the following units:

[0097] The broadcast signal receiving unit is configured to perform a startup operation at a preset restart time. After the startup operation is completed, a peripheral device scan is performed to receive a Bluetooth broadcast signal sent by the peripheral device according to a preset Bluetooth signal broadcast cycle according to a preset Bluetooth signal receiving cycle, and the duration of the Bluetooth signal receiving cycle is at least twice the duration of the Bluetooth signal broadcast cycle.

[0098] In a possible implementation, the signal strength acquisition module specifically includes the following units:

[0099] A first signal strength acquisition unit is configured to, if any group of the Bluetooth broadcast signals is received, acquire a signal strength value contained in the group of the Bluetooth broadcast signals, each of the signal strength values ​​corresponding to an access control address of the peripheral device that is also contained in the group of the Bluetooth broadcast signals and is a sender of the group of the Bluetooth broadcast signals, compare the signal strength value with a preset signal strength threshold, and if the signal strength value is greater than the signal strength threshold, save the signal strength value to a signal strength list; if the signal strength value is less than the signal strength threshold, discard the signal strength value;

[0100] The second signal strength acquisition unit is configured to determine a restart time if the Bluetooth broadcast signal is not received, and then shut down until the restart time arrives.

[0101] In a possible implementation, the access address determination module specifically includes the following units:

[0102] an access address determination unit configured to read the signal strength list;

[0103] The access address determines the first subunit, configured to, if there is at least one signal strength value in the signal strength list, sort all the signal strength values ​​in the signal strength list in descending order according to a preset sorting algorithm, update the signal strength list according to the sorting result, select the signal strength value ranked first in the updated signal strength list as the target signal strength value, and use the access control address corresponding to the target signal strength value as the target access control address;

[0104] The access address determines the second subunit, and is configured to determine a restart time if the signal strength value does not exist in the signal strength list, and then shut down until the restart time arrives.

[0105] In a possible implementation, the data transmission execution module specifically includes the following units:

[0106] a first data transmission execution unit, configured to establish a connection with the peripheral device corresponding to the target access control address;

[0107] a first data transmission execution first subunit, configured to execute a data transmission operation if the connection with the peripheral device is successful;

[0108] The first data transmission executes the second subunit, which is configured to sleep according to a preset connection interval if the connection with the peripheral device fails, and to establish a connection with the peripheral device corresponding to the target access control address again after the sleep is completed.

[0109] The first data transmission executes the third subunit, which is configured to select the signal strength value that is ranked next to the current target signal strength value in the updated signal strength list if the number of consecutive connection failures with the same peripheral device reaches a preset number of abandonment times, update the target signal strength value according to the selection result, update the target access control address using the access control address corresponding to the updated target signal strength value, and then establish a connection with the peripheral device corresponding to the updated target access control address.

[0110] A second data transmission execution unit is configured to determine a first time interval according to a current time and a preset working schedule, generate a random value as a second time interval, and determine a restart time in combination with the first time interval and the second time interval;

[0111] The third data transmission execution unit is configured to, after determining the restart time, shut down and wait until the restart time arrives.

[0112] Based on the same inventive concept mentioned above, an embodiment of the present application also discloses an intelligent terminal, including a memory and a processor, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement any one of the BLE-based sensor data transmission methods described above.

[0113] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0114] Also based on the same inventive concept above, an embodiment of the present application also discloses a computer-readable storage medium, in which at least one instruction, at least one program, code set or instruction set is stored. The at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement any one of the BLE-based sensor data transmission methods described above.

[0115] Those skilled in the art should understand that all or part of the steps to implement the above embodiments may be completed by hardware, or may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium. The above-mentioned storage medium may include, for example: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0116] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A sensor data transmission method based on BLE, It is characterized in that The steps include: Start and perform peripheral device scanning, and receive Bluetooth broadcast signals from the peripheral devices according to a preset Bluetooth signal receiving cycle; When any group of the Bluetooth broadcast signals is received, the signal strength values ​​in the group of the Bluetooth broadcast signals are obtained, each of the signal strength values ​​corresponds to an access control address of the peripheral device that is the sender of the group of the Bluetooth broadcast signals, the signal strength value is compared with a preset signal strength threshold, and when the signal strength value is greater than the signal strength threshold, the signal strength value is saved in a signal strength list; Reading the signal strength list, when there is at least one signal strength value in the signal strength list, selecting one of the signal strength values ​​from the signal strength list as a target signal strength value, and using the access control address corresponding to the target signal strength value as a target access control address; A connection is established with the peripheral device corresponding to the target access control address. When the connection is successful, a data transmission operation is performed. After the data transmission operation is completed, a restart time is determined, and the computer is shut down and waits until the restart time arrives.

2. The sensor data transmission method based on BLE according to claim 1, It is characterized in that The starting and performing peripheral device scanning, receiving the Bluetooth broadcast signal from the peripheral device according to a preset Bluetooth signal receiving cycle, specifically includes the following steps: The startup operation is performed at the preset restart time. After the startup operation is completed, a peripheral device scan is performed, and a Bluetooth broadcast signal sent by the peripheral device according to a preset Bluetooth signal broadcast cycle is received according to a preset Bluetooth signal reception cycle. The duration of the Bluetooth signal reception cycle is at least twice the duration of the Bluetooth signal broadcast cycle.

3. The sensor data transmission method based on BLE according to claim 1, It is characterized in that When any group of the Bluetooth broadcast signals is received, the signal strength values ​​in the group of the Bluetooth broadcast signals are obtained, each of the signal strength values ​​corresponds to an access control address of the peripheral device that is the sender of the group of the Bluetooth broadcast signals, the signal strength value is compared with a preset signal strength threshold, and when the signal strength value is greater than the signal strength threshold, the signal strength value is saved in a signal strength list, specifically comprising the following steps: If any group of the Bluetooth broadcast signals is received, the signal strength values ​​contained in the group of the Bluetooth broadcast signals are obtained, each of the signal strength values ​​corresponds to an access control address of the peripheral device that is also contained in the group of the Bluetooth broadcast signals and is the sender of the group of the Bluetooth broadcast signals, the signal strength value is compared with a preset signal strength threshold, if the signal strength value is greater than the signal strength threshold, the signal strength value is saved in a signal strength list, if the signal strength value is less than the signal strength threshold, the signal strength value is discarded; If the Bluetooth broadcast signal is not received, the restart time is determined and the device is shut down immediately until the restart time arrives.

4. The sensor data transmission method based on BLE according to claim 1, It is characterized in that The reading of the signal strength list, when at least one signal strength value exists in the signal strength list, selecting a signal strength value from the signal strength list as a target signal strength value, and using the access control address corresponding to the target signal strength value as a target access control address, specifically comprises the following steps: Reading the signal strength list; If there is at least one signal strength value in the signal strength list, all the signal strength values ​​in the signal strength list are sorted in descending order according to a preset sorting algorithm, the signal strength list is updated according to the sorting result, the signal strength value ranked first in the updated signal strength list is selected as the target signal strength value, and the access control address corresponding to the target signal strength value is used as the target access control address; If the signal strength value does not exist in the signal strength list, the restart time is determined and the computer is shut down immediately until the restart time arrives.

5. The sensor data transmission method based on BLE according to claim 4, It is characterized in that The peripheral device corresponding to the target access control address is connected, and when the connection is successful, a data transmission operation is performed, which specifically includes the following steps: establishing a connection with the peripheral device corresponding to the target access control address; If the connection with the peripheral device is successful, a data transmission operation is performed; If the connection with the peripheral device fails, the device goes into sleep mode according to a preset connection interval, and after the sleep mode is completed, a connection is established again with the peripheral device corresponding to the target access control address.

6. The sensor data transmission method based on BLE according to claim 5, It is characterized in that The step of establishing a connection with the peripheral device corresponding to the target access control address and executing a data transmission operation when the connection is successful also includes the following steps: If the number of consecutive connection failures with the same peripheral device reaches a preset number of abandonment times, the signal strength value that is ranked next to the current target signal strength value in the updated signal strength list is selected, the target signal strength value is updated according to the selection result, the target access control address is updated using the access control address corresponding to the updated target signal strength value, and then a connection is established with the peripheral device corresponding to the updated target access control address.

7. The sensor data transmission method based on BLE according to claim 5, It is characterized in that The step of determining the restart time and then shutting down and waiting until the restart time arrives specifically includes the following steps: Determine a first time interval according to the current time and a preset working schedule, generate a random value as a second time interval, and determine a restart time in combination with the first time interval and the second time interval; After determining the restart time, shut down and wait until the restart time arrives.

8. A sensor data transmission system based on BLE, It is characterized in that Includes the following modules: A broadcast signal receiving module is configured to start and perform peripheral device scanning, and receive a Bluetooth broadcast signal from the peripheral device according to a preset Bluetooth signal receiving cycle; A signal strength acquisition module, configured to, when receiving any group of the Bluetooth broadcast signals, acquire the signal strength value in the group of the Bluetooth broadcast signals, each of the signal strength values ​​corresponding to an access control address of the peripheral device as the sender of the group of the Bluetooth broadcast signals, compare the signal strength value with a preset signal strength threshold, and when the signal strength value is greater than the signal strength threshold, save the signal strength value to a signal strength list; an access address determination module, configured to read the signal strength list, and when at least one signal strength value exists in the signal strength list, select one of the signal strength values ​​from the signal strength list as a target signal strength value, and use the access control address corresponding to the target signal strength value as a target access control address; The data transmission execution module is configured to establish a connection with the peripheral device corresponding to the target access control address, and when the connection is successful, execute a data transmission operation. After the data transmission operation is completed, determine a restart time, shut down and wait until the restart time arrives.

9. A smart terminal, It is characterized in that It includes a memory and a processor, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the BLE-based sensor data transmission method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by a processor to implement the BLE-based sensor data transmission method as described in any one of claims 1 to 7.