Low-power-consumption Bluetooth maintenance and detection method
Through the two-stage detection method, combining the serial port and the air interface to connect two low-power Bluetooth devices, the limitations of traditional testing methods are solved, and a comprehensive evaluation of interaction and stability between devices is achieved, which improves testing efficiency and diagnostic accuracy.
Patent Information
- Application Number
- CN202411083060.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-08
AI Technical Summary
Traditional Bluetooth low-power testing methods are limited to single device testing and cannot effectively evaluate interaction and stability between devices, resulting in long time to diagnose and solve problems and lack of systemicity.
Two-stage detection methods are adopted: functional testing and stability testing, connecting two devices through serial ports and air interfaces, using test scripts to simulate data frame processing and protocol stack scheduling, recording events and auxiliary information, locate the causes of errors, and analyze stability.
It realizes simultaneous testing of the transceiver function of Bluetooth devices, improves diagnostic efficiency, accurately observes the behavior of the minimum function unit and protocol stack within the system, and enhances the debugging capabilities of developers.
Smart Images

Figure CN119052844A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of Internet of Things, and in particular relates to a maintenance detection method for low-power Bluetooth. Background Art
[0002] The Internet of Things (IoT) technology is considered to be the third wave of the information industry after computers and the Internet. IoT integrates a variety of sensing, communication and computing technologies, extending and expanding information exchange and communication from human to human (H2H) to human to things (H2T) and things to things (T2T), and will eventually integrate human society, information space and the physical world (human-machine-thing). Wireless communication technology is an advanced information interaction technology that covers microwave communication technology and satellite communication technology. It has the characteristics of low energy consumption, miniaturization and economic efficiency. At present, mature short-range wireless communication technologies include low-power Bluetooth technology (BLE), WiFi technology, ZigBee technology and infrared connection technology (IrDA). Among them, BLE has strong competitiveness in the era of the Internet of Things due to its low power consumption, anti-interference and flexibility. It has been widely used in various fields such as smart wearables and smart homes.
[0003] Bluetooth technology is a form of mobile communication. Traditional testing methods mainly include the following categories: First, there is device testing, which tests the entire Bluetooth device to check whether its functions are normal. Secondly, there is functional testing, which tests the overall functions of the device to ensure that all functions of the device can operate normally. In addition, there is pure software testing of internal functions, which mainly verifies the functions inside the Bluetooth device. Finally, there is modular testing, which tests each module within the system independently and judges whether the output results meet expectations based on the interactive interfaces between the modules.
[0004] Traditional Bluetooth testing requires the PC to connect to the test device through a serial port, and the test is performed by capturing the HCI LOG. The HCI LOG capture software is used to capture the HCI LOG, and the HCI command / HCI event / data packet is parsed to observe whether the functional performance passes the test point. The traditional test method only studies a single device, and does not associate the paired Bluetooth device with it. In addition, a PC can only capture the HCI LOG of one end of the test machine. This test method has great limitations and the judgment standard is one-sided. When testing the entire device, it is usually only possible to rely on the output results outside the system to determine whether the test has reached the expected standard. The information provided by this method is relatively simple and abstract. If a problem occurs during the test, it usually takes a lot of time to find the root cause of the problem and solve it because of the lack of detailed information about the internal mechanism. And the test of the internal functions of the device usually does not explicitly consider other parts of the system, which may lead to insufficient association with the system as a whole. Similarly, the testing of functional modules usually ignores the relationship between modules. Summary of the invention
[0005] In view of the problems existing in the prior art, the present invention proposes a maintenance detection method for low-power Bluetooth, which is divided into two stages to perform function test and stability test respectively, and specifically includes the following steps:
[0006] When performing functional testing, two devices under test are connected to the host through serial ports respectively. The host simulates the Bluetooth device applications at both ends through the test script. When the host initiates the test, the two devices under test process the data frames generated by the test script and establish a connection with another device under test through the air interface. The device under test sends the HCI LOG and event information generated during the connection establishment process to the host. The host determines whether the test result is correct through the event information. If it is correct, the test is terminated. Otherwise, the cause of the test error is located through the HCI LOG and event information.
[0007] When conducting stability testing, a connection and communication is established with another device under test through the air interface, and the test script is automatically started. The auxiliary information and time information during the communication process are stored on the storage device. When the device under test completes the test, the stability is analyzed by viewing the auxiliary information and event information in the storage device.
[0008] Furthermore, the process of the device under test processing the data frame generated by the test script and establishing a connection includes:
[0009] A device under test maps the parameters in the payload field of the data frame to the payload field of the message interaction within the protocol stack, composes a new protocol stack message and sends it to the scheduling thread for scheduling;
[0010] The message includes multiple IDs. The protocol stack thread searches the function registry according to the multiple ID numbers to make function calls and jump between layers.
[0011] When the device under test generates a complete data packet required by the Bluetooth connection protocol after processing the data frame, it sends it to another device under test;
[0012] The other device under test maps the parameters in the payload field of the received data packet to the payload field of the message interaction within the protocol stack, composes a new protocol stack message and sends it to the scheduling thread for scheduling. After being processed by the protocol stack, the data packet containing the test data is transmitted to the peer device.
[0013] Furthermore, the event information includes timestamp, running thread information, protocol stack location information, and output information, wherein the timestamp is used to record the start time and end time of the test item, the running thread information is used to record the currently running thread, the protocol stack location information is used to record the location of the current test code in the protocol stack, and the output information is used to record the test results of the current test script.
[0014] Furthermore, the protocol stack location information is the function name corresponding to the ID number in the function registry, and the function name naming rule is: protocol stack layer name+operation name+request or event name.
[0015] Furthermore, the output information is empty by default. When performing related operations in the GATT or GAP layer, the output information will be filled, and the filling content includes:
[0016] When the device under test performs a connection test, the output information includes the peer device address and the local role identifier. When the local end is the initiator, the value of the local role identifier is set to 0, and when the local end is the receiver, the value of the local role identifier is set to 1.
[0017] When a connection parameter update is performed, the output information indicates the updated connection parameters;
[0018] When the device performs an MTU negotiation test, the output information is the data length negotiated by both ends;
[0019] When a device performs a GATT service discovery test, the output information is the service UUID description.
[0020] Furthermore, the auxiliary information includes the current power of the device under test and the current transmission power of the device under test.
[0021] Based on traditional Bluetooth testing, the present invention pairs and connects two test devices to form a micro-network, which can simultaneously test the transceiver functions of the Bluetooth device. During the test, real-time information can be continuously output and saved, such as battery power, data rate, etc. Through the logical feedback of the test device to the test script, the cause of the error can be accurately located, thereby improving the debugging efficiency of developers.
[0022] The test script of the present invention exists as a software system. During the test process, the system can accurately observe the smallest functional unit inside the system for the test data stream generated by the test script. At the same time, through the result information verification, the behavior accuracy of the entire Bluetooth protocol stack function can be reflected. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of the system architecture of low-power Bluetooth maintenance detection of the present invention;
[0024] Figure 2 This is a schematic diagram of data frame processing of the present invention;
[0025] Figure 3 It is a schematic diagram of the maintenance detection process of the first stage of a maintenance detection method of low-power Bluetooth according to the present invention;
[0026] Figure 4 The present invention is a schematic diagram of the second stage maintenance detection process of a maintenance detection method for low-power Bluetooth. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] The present invention proposes a maintenance detection method for low-power Bluetooth, which is divided into two stages to perform function test and stability test respectively, and specifically includes the following steps:
[0029] When performing functional testing, the two devices under test are connected to the host through the serial port respectively. The host simulates the Bluetooth device applications at both ends through the test script. When the host initiates the test, the two devices under test process the data frames generated by the test script and establish a connection with the other device under test through the air interface. The device under test sends the HCI LOG and event information generated during the functional test to the host. The host determines whether the test result is correct through the event information. If it is correct, the test is terminated. Otherwise, the cause of the test error is located through the HCI LOG and event information.
[0030] When conducting stability testing, a connection and communication is established with another device under test through the air interface, and the test script is automatically started. The auxiliary information and time information during the communication process are stored on the storage device. When the device under test completes the test, the stability is analyzed by viewing the auxiliary information and event information in the storage device.
[0031] like Figure 1 The hardware devices mainly involved in the present invention include a host, a device under test, and a storage device mounted on the device under test. A maintenance detection method for low-power Bluetooth of the present invention is applied to test the device function in the product development stage. The test script is used to generate data required for the test. The Bluetooth device under test is connected to the PC host through a serial port, and is paired and connected and communicated with the opposite device under test through an air interface. The device under test outputs the output information to the PC through the serial port; after the product passes the development stage, the product performance and stability are tested, the device under test is no longer connected to the PC through a serial port, and is paired and connected and communicated with the opposite device under test through an air interface, the storage device is mounted on the device under test, the file system in the real-time operating system is mounted on the storage device, and the log log is output to the file backend, and the log log file stores the output information of the test.
[0032] When executing the test, the test script will generate corresponding data frames, which will be sent to different protocol layers within the protocol stack of the tested low-power Bluetooth device for processing after some processing. Figure 2 As shown, the following steps are included:
[0033] The parameters in the payload field of the data frame are mapped to the payload field of the message interaction within the protocol stack, forming a new protocol stack message and sending it to the scheduling thread for scheduling;
[0034] The message contains different IDs. The protocol stack thread searches the function registry for function calls and jumps between layers by corresponding to different ID numbers.
[0035] Finally, the complete data packet is sent to the peer device through the air interface;
[0036] After receiving the complete data packet, the peer device extracts the payload field in the data packet, forms a new protocol stack message, sends it to the scheduling thread for scheduling, and jumps between different layers of the protocol stack.
[0037] When jumping between different protocol stack layers, the Bluetooth devices at both ends will output HCI LOG and event information as well as auxiliary information (device power, device transmission power, etc.) when passing through the test point. The completion or failure of the test function is determined based on whether the predetermined event information is generated.
[0038] In the present invention, the structure of event information includes timestamp, running thread information, protocol stack location information, and output information, wherein:
[0039] Timestamp, used to record the start and end time of the test item, which can be obtained by the standard library function;
[0040] Running thread information, used to record the name of the currently running thread. The thread name is given by the developer when the thread is created;
[0041] Protocol stack location information is used to record the location of the current test code in the protocol stack, that is, the function name corresponding to the id number in the function registry. The function name naming rule is: protocol stack layer (such as GAP, GATT, L2CAP, HCI) + operation (such as value reading, value writing, scanning, broadcasting, setting parameters, establishing connection, etc.) + request / event (such as request means sending, event means peer return);
[0042] Output information is used to record the test results of the current test script. Output information is optional and is empty by default. The output information will be filled only when the device performs related operations in the GATT or GAP layer. When the device performs a connection test, the output information includes the address of the other device and the role flag of the local end (that is, whether the local end is the connection initiator or the connection receiver. When the local end is the initiator, the value of the flag is set to 0, and when the local end is the receiver, the value of the flag is set to 1); when performing a connection parameter update, the output information indicates the updated connection parameters; when the device performs an MTU negotiation test, the output information is the data length negotiated by both ends; when the device performs a GATT service discovery test, the output information is the service UUID description.
[0043] When executing related processes, the event information is obtained by the protocol stack and saved in the structure, and the output thread returns the event information to the PC. For example, when the test device starts the connection test, it will call the GAP_CONNECT_REQ function in the registration function table. After being processed by the protocol stack, the other end returns the data packet, and the local end will call the GAP_CONNECT_Complete_EVT function after jumping between the protocol stack layers.
[0044] In this embodiment, if Figure 3When performing a functional test, the host controls the two devices under test to initiate a functional test. The devices under test perform protocol processing based on the received data and send the data packets containing the test data to the peer device through the air interface. The purpose of sending data packets between the devices under test is to negotiate and establish a connection. The data packets sent need to comply with the Bluetooth protocol. The HCI LOG and event information generated during the test are sent back to the host through the serial port. The host can determine whether the event information generated by the device under test is consistent with the event information corresponding to the executed test based on whether the received event information meets expectations. If they are consistent, the test is completed. If they are inconsistent, it means that an error occurred during the test, and the error is located through the HCI LOG and event information.
[0045] like Figure 4 When conducting equipment performance and stability tests, the devices at both ends store the data generated during the protocol processing in the mounted storage device. During the equipment performance and stability tests, the two devices under test establish connection and communication through the air interface, and automatically start the test script to store the auxiliary information and event information in the communication process in the storage device mounted on the local end. After the device completes the data sending and other tests, the technicians in this field analyze the stability and equipment performance of the device under test by checking the auxiliary information and event information stored in the storage device.
[0046] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A maintenance detection method for low-power Bluetooth, characterized in that: Functional testing and stability testing are carried out in two stages, including the following steps: When performing functional testing, the two devices under test are connected to the host through the serial port respectively. The host simulates the Bluetooth device applications at both ends through the test script. When the host initiates the test, the two devices under test process the data frames generated by the test script and establish a connection with another device under test through the air interface. The device under test sends the HCILOG and event information generated during the functional test to the host. The host determines whether the test result is correct through the event information. If it is correct, the test is terminated. Otherwise, the cause of the test error is located through the HCILOG and event information. When conducting stability testing, a connection and communication is established with another device under test through the air interface, and the test script is automatically started to store the auxiliary information and event information during the communication process on the storage device mounted. When the device under test completes the test, the stability is analyzed by viewing the auxiliary information and event information in the storage device.
2. A maintenance detection method for low-power Bluetooth according to claim 1, characterized in that: The process of the device under test processing the data frames generated by the test script and establishing a connection includes: A device under test maps the parameters in the payload field of the data frame to the payload field of the message interaction within the protocol stack, composes a new protocol stack message and sends it to the scheduling thread for scheduling; The message includes multiple IDs. The protocol stack thread searches the function registry according to the multiple ID numbers to make function calls and jump between layers. When the device under test processes the data frame, generates a complete data packet required by the Bluetooth connection protocol and sends it to another device under test; The other device under test maps the parameters in the payload field of the received data packet to the payload field of the message interaction within the protocol stack, composes a new protocol stack message and sends it to the scheduling thread for scheduling. After being processed by the protocol stack, the data packet containing the test data is transmitted to the peer device.
3. A maintenance detection method for low-power Bluetooth according to claim 1, characterized in that: Event information includes timestamp, running thread information, protocol stack location information, and output information. The timestamp is used to record the start time and end time of the test item, the running thread information is used to record the currently running thread, the protocol stack location information is used to record the location of the current test code in the protocol stack, and the output information is used to record the test results of the current test script.
4. A maintenance detection method for low-power Bluetooth according to claim 3, characterized in that: The protocol stack location information is the function name corresponding to the ID number in the function registry. The function name naming rule is: protocol stack layer name + operation name + request or event name.
5. A maintenance detection method for low-power Bluetooth according to claim 3, characterized in that: The output information is empty by default. When performing related operations in the GATT or GAP layer, the output information will be filled. The filling content includes: When the device under test performs a connection test, the output information includes the peer device address and the local role identifier. When the local end is the initiator, the value of the local role identifier is set to 0, and when the local end is the receiver, the value of the local role identifier is set to 1. When a connection parameter update is performed, the output information indicates the updated connection parameters; When the device performs an MTU negotiation test, the output information is the data length negotiated by both ends; When a device performs a GATT service discovery test, the output information is the service UUID description.
6. A maintenance detection method for low-power Bluetooth according to claim 1, characterized in that: The auxiliary information includes the current power of the device under test and the current transmission power of the device under test.
Citation Information
Patent Citations
Bluetooth test system and method
CN110024362A
Low-power-consumption Bluetooth test method, device and system, test equipment and storage medium
CN115002736A
Bluetooth function compatibility test system, method, device, equipment and medium
CN115567122A
Rigid-flex Bluetooth function test method and system
CN115694676A
Low-power-consumption Bluetooth function test system and method
CN116566511A
