Automatic testing method for bluetooth device and electronic device
Through the automatic testing method, the problem of low efficiency of Bluetooth device performance testing is solved, the automated testing of Bluetooth devices is realized, and the testing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202510506215.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-04-22
AI Technical Summary
The performance testing of Bluetooth devices is inefficient and requires manual operation, resulting in low efficiency.
Provided is an automatic testing method for Bluetooth devices. The method automatically establishes a Bluetooth connection, performs test steps, and determines the device's qualification level based on the connection status and command response status, including first-class qualification, second-class qualification, and failure. Test accuracy is improved through retransmission and reconnection testing.
It realizes automatic testing of Bluetooth devices, improves testing efficiency, reduces labor costs, and improves testing accuracy and efficiency.
Smart Images

Figure CN120034272B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Bluetooth technology, and in particular to an automatic testing method for a Bluetooth device and an electronic device. Background Art
[0002] Bluetooth devices must undergo performance testing before leaving the factory to ensure that qualified Bluetooth devices enter the market. Typically, performance testing of Bluetooth devices requires manual labor. However, this testing method is relatively inefficient. Summary of the Invention
[0003] The embodiments of the present application provide an automatic testing method and electronic device for a Bluetooth device to improve the testing efficiency of the Bluetooth device.
[0004] In a first aspect, an embodiment of the present application provides a method for automatically testing a Bluetooth device. For each Bluetooth device, the method includes:
[0005] Automatically establish a Bluetooth connection with the Bluetooth device and perform test steps. Disconnect the Bluetooth connection after completing the test steps.
[0006] The test steps include:
[0007] When a Bluetooth connection is successfully established:
[0008] Send specified instructions to the Bluetooth device;
[0009] If the Bluetooth device successfully responds to the command, it is determined that the Bluetooth device is first-class qualified;
[0010] Alternatively, if the Bluetooth device fails to respond to the command, a retransmission test is performed on the Bluetooth device to retest the command response of the Bluetooth device;
[0011] If the Bluetooth device passes the retransmission test, it is determined that the Bluetooth device is second-class qualified;
[0012] Alternatively, if the Bluetooth device fails the retransmission test, the Bluetooth device is determined to be unqualified;
[0013] Or, in the event that the Bluetooth connection is lost after being established:
[0014] Perform a reconnection and resend test on the Bluetooth device to retest the connection status and command response of the Bluetooth device;
[0015] If the Bluetooth device passes the reconnection and retransmission test, it is determined that the Bluetooth device is second-class qualified;
[0016] Alternatively, if the Bluetooth device fails the reconnection and retransmission test, the Bluetooth device is determined to be unqualified;
[0017] Or, if the Bluetooth connection fails to establish successfully:
[0018] Perform a reconnection test on the Bluetooth device to retest the connection of the Bluetooth device;
[0019] If the Bluetooth device passes the reconnection test, send a command to the Bluetooth device and determine whether the Bluetooth device is qualified based on the response of the Bluetooth device;
[0020] Alternatively, if the Bluetooth device fails the reconnection test, it is determined that the Bluetooth device is unqualified.
[0021] Optionally, sending the specified instruction to the Bluetooth device includes: repeatedly sending the instruction to the Bluetooth device multiple times;
[0022] If the Bluetooth device successfully responds to the command, determining that the Bluetooth device is first-class qualified includes: if the Bluetooth device successfully responds to the command multiple times, determining that the Bluetooth device is first-class qualified;
[0023] If the Bluetooth device fails to respond to the instruction, a retransmission test is performed on the Bluetooth device, including: if the Bluetooth device fails to respond to the instruction at least once, a retransmission test is performed on the Bluetooth device.
[0024] Optionally, the retransmission test includes repeatedly sending a command to the Bluetooth device multiple times at a fixed time interval;
[0025] If the Bluetooth device successfully responds to the command multiple times, it is determined that the Bluetooth device has passed the retransmission test;
[0026] Alternatively, if the Bluetooth device fails to respond to the command at least once, it is determined that the Bluetooth device fails the retransmission test.
[0027] Optionally, the method may further include: recording a response log of the Bluetooth device during the retransmission test, wherein the response log includes a response status of each instruction.
[0028] Optionally, the reconnection and retransmission test includes repeating the operations of re-establishing the Bluetooth connection, sending instructions, and automatically disconnecting the Bluetooth connection multiple times at fixed time intervals;
[0029] If the Bluetooth connection is not interrupted for multiple consecutive times and the Bluetooth device successfully responds to multiple commands, it is determined that the Bluetooth device has passed the reconnection and retransmission test;
[0030] Alternatively, if the Bluetooth connection is not interrupted for multiple consecutive times, but the Bluetooth device fails to respond to at least one command, it is determined that the Bluetooth device fails the reconnection and retransmission test;
[0031] Alternatively, if the Bluetooth connection is interrupted at least once, it is determined that the Bluetooth device fails the reconnection retransmission test.
[0032] Optionally, the method may further include: recording a connection and response log of the Bluetooth device in the reconnection and retransmission test, wherein the connection and response log includes a connection status of each Bluetooth connection and a response status of each instruction.
[0033] Optionally, the reconnection test includes: repeating the operations of re-establishing the Bluetooth connection and automatically disconnecting the Bluetooth connection multiple times at fixed time intervals;
[0034] If the Bluetooth connection is successfully established multiple times without interruption, the Bluetooth device has passed the reconnection test.
[0035] Alternatively, if at least one of the multiple Bluetooth connections fails to be successfully established, or at least one of the multiple successfully established Bluetooth connections is interrupted, it is determined that the Bluetooth device fails the reconnection test.
[0036] Optionally, the method may further include: recording a connection log of the Bluetooth device during the reconnection test, where the connection log includes connection status of each Bluetooth connection.
[0037] In a second aspect, an embodiment of the present application provides an electronic device comprising a module for executing any of the methods described in the first aspect above.
[0038] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, at least one processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in any one of the first aspects above is implemented.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in any one of the above-mentioned first aspects is implemented.
[0040] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute any one of the methods described in the first aspect above.
[0041] In this application, a Bluetooth connection can be automatically established for each Bluetooth device and a test step can be performed. During the test step, the different qualification levels of the Bluetooth device are determined based on the Bluetooth connection status and the response to the command. After the test step is completed, the Bluetooth connection is disconnected. Based on this, automatic testing of Bluetooth devices can be achieved, which helps to improve the testing efficiency of Bluetooth devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.
[0043] Figure 1 This is a flow chart of an automatic testing method for a Bluetooth device provided in an embodiment of the present application.
[0044] Figure 2A-2C This is a schematic diagram of the test steps in the automatic testing method for a Bluetooth device provided in an embodiment of the present application.
[0045] Figure 3 This is an example diagram of the automatic testing method for a Bluetooth device provided in an embodiment of the present application.
[0046] Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solutions of the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
[0048] The performance of Bluetooth devices directly impacts the user experience. Therefore, Bluetooth devices must undergo performance testing before leaving the factory to ensure that qualified Bluetooth devices enter the market. Typically, performance testing of Bluetooth devices requires manual labor. However, this testing method is relatively inefficient.
[0049] Based on this, Figure 1 The figure shows an automatic testing method for a Bluetooth device provided in an embodiment of the present application.
[0050] Exemplarily, the method may be executed by a smart terminal with Bluetooth functionality, such as a mobile phone or a tablet, etc. Alternatively, the method may be implemented by an application (APP) in the smart terminal.
[0051] Illustratively, the Bluetooth device may be a Bluetooth headset, a watch, or the like.
[0052] See also Figure 1 , for each Bluetooth device, in step S110, a Bluetooth connection is automatically established with the Bluetooth device, and a test step is performed, and the Bluetooth connection is disconnected after the test step is completed.
[0053] Optionally, the Bluetooth device may be a Bluetooth device with a designated name, where the designated name of the Bluetooth device facilitates selection of the Bluetooth device from surrounding Bluetooth devices.
[0054] For each Bluetooth device, the test steps can be as follows Figure 2A-2C shown.
[0055] The test steps can be used to perform different test contents according to different situations of Bluetooth devices. Figure 2A-2C ,The different situations of the Bluetooth device may include three types, namely ,successfully establishing a Bluetooth connection with the Bluetooth ,device, the Bluetooth connection with the Bluetooth device is interrupted after ,establishment, and failure to successfully establish a Bluetooth connection with the Bluetooth ,device (i.e., failure to establish a Bluetooth connection with the Bluetooth ,device).
[0056] If a Bluetooth connection is successfully established with a Bluetooth device, it can be determined that the Bluetooth connection performance of the Bluetooth device is normal, and the Bluetooth device's transceiver performance (i.e., command response) can be further tested. Figure 2A .
[0057] In step S201, a specified instruction is sent to a Bluetooth device.
[0058] Optionally, the specified instruction may be one or more instructions, and the data format, mode, etc. of the instruction are not limited.
[0059] Depending on the response of the Bluetooth device to the instruction, step S202 or step S203 may be performed.
[0060] In step S202, if the Bluetooth device successfully responds to the command sent to it, it is determined that the Bluetooth device is first-class qualified.
[0061] Here, the Bluetooth device successfully responds to the instruction sent to it, which may refer to receiving a response returned by the Bluetooth device in response to the instruction. Optionally, the response content of the Bluetooth device may be agreed in advance.
[0062] If a Bluetooth device successfully responds to commands sent to it, it can be determined that its transceiver performance is also normal. Connectivity and transceiver performance are the most important aspects of a Bluetooth device, so if both are normal, the device can be considered first-class qualified.
[0063] Alternatively, in step S203, if the Bluetooth device fails to respond to the instruction sent thereto, a retransmission test is performed on the Bluetooth device to retest the instruction response of the Bluetooth device.
[0064] Here, the failure of the Bluetooth device to respond to the instruction sent thereto may refer to the failure to receive a response returned by the Bluetooth device for the instruction.
[0065] Optionally, not receiving a response from the Bluetooth device to the instruction may mean not receiving a response from the Bluetooth device to the instruction within a certain time interval. For example, the certain time interval may be 5 seconds.
[0066] If a Bluetooth device fails to respond to a command sent to it, it may be due to abnormalities in the Bluetooth device's transceiver performance, or it may be caused by accidental factors. Therefore, it is necessary to retest the Bluetooth device's command response through a retransmission test.
[0067] Depending on whether the Bluetooth device passes the retransmission test, step S204 or step S205 may be performed.
[0068] In step S204, if the Bluetooth device passes the retransmission test, it is determined that the Bluetooth device is second-class qualified.
[0069] The retransmission test confirms that the Bluetooth device's transceiver performance is normal, indicating that the Bluetooth device's previous failure to respond to commands was due to accidental factors. However, given that accidental factors can cause a Bluetooth device to fail to respond to commands, the Bluetooth device cannot be determined to be first-class qualified. Accordingly, the Bluetooth device can be determined to be second-class qualified. It should be noted that a second-class qualified Bluetooth device may undergo further performance testing, which is not limited in this application.
[0070] Alternatively, in step S205 , if the Bluetooth device fails the retransmission test, it is determined that the Bluetooth device is unqualified.
[0071] If the Bluetooth device fails the retransmission test, it means that there is indeed an abnormality in the Bluetooth device's transceiver performance. Therefore, it can be determined that the Bluetooth device is unqualified.
[0072] If the Bluetooth connection with the Bluetooth device is interrupted after being established, it is impossible to determine whether the connection performance of the Bluetooth device is normal. The connection interruption may be due to abnormal connection performance of the Bluetooth device, or it may be caused by accidental factors. Therefore, it is necessary to re-confirm whether the connection performance of the Bluetooth device is normal, and then confirm whether the receiving and transmitting performance of the Bluetooth device is normal. For this situation, the test content can be found in Figure 2B .
[0073] In step S206, a reconnection and retransmission test is performed on the Bluetooth device to retest the connection status and instruction response status of the Bluetooth device.
[0074] Depending on whether the Bluetooth device passes the reconnection and retransmission test, step S207 or step S208 may be performed.
[0075] In step S207, if the Bluetooth device passes the reconnection and retransmission test, it is determined that the Bluetooth device is second-class qualified.
[0076] The Bluetooth device's reconnection and retransmission tests confirm that its connection and transceiver performance are normal, indicating that the previous Bluetooth connection interruption was caused by an accidental factor. However, given that accidental factors can cause Bluetooth device connection interruptions, the device cannot be determined to be first-class qualified. Accordingly, the device can be determined to be second-class qualified.
[0077] Alternatively, in step S208 , if the Bluetooth device fails the reconnection and retransmission test, it is determined that the Bluetooth device is unqualified.
[0078] If a Bluetooth device fails the reconnection and retransmission test, it can be determined that the connection performance or transceiver performance of the Bluetooth device is abnormal, and therefore the Bluetooth device can be determined to be unqualified.
[0079] If a Bluetooth connection cannot be established successfully with a Bluetooth device, it cannot be determined that the connection performance of the Bluetooth device is normal. Failure to successfully establish a Bluetooth connection with a Bluetooth device may be due to abnormal connection performance of the Bluetooth device, or it may be caused by accidental factors. Therefore, it is necessary to re-determine whether the connection performance of the Bluetooth device is normal, and then determine whether the receiving and transmitting performance of the Bluetooth device is normal. For this situation, the test content can be found in Figure 2C .
[0080] In step S209, a reconnection test is performed on the Bluetooth device to retest the connection status of the Bluetooth device.
[0081] Depending on whether the Bluetooth device passes the reconnection test, step S210 or step S211 may be performed.
[0082] In step S210, if the Bluetooth device passes the reconnection test, a specified instruction is sent to the Bluetooth device and whether the Bluetooth device is qualified is determined based on the response of the Bluetooth device.
[0083] The Bluetooth device can determine that the connection performance of the Bluetooth device is normal through the reconnection test, and needs to send a command to the Bluetooth device to determine whether the Bluetooth device's transceiver performance is normal. According to the response of the Bluetooth device to the command, step S202 or step S203 described above can be performed, which will not be repeated here.
[0084] Alternatively, in step S211 , if the Bluetooth device fails the reconnection test, it is determined that the Bluetooth device is unqualified.
[0085] If the Bluetooth device fails the reconnection test, it indicates that the connection performance of the Bluetooth device is abnormal. Therefore, it can be determined that the Bluetooth device is unqualified.
[0086] It should be noted that in Figure 1 In the method shown, step S110 may be performed for each Bluetooth device one by one, or may be performed for multiple Bluetooth devices simultaneously.
[0087] In this application, a Bluetooth connection can be automatically established for each Bluetooth device and a test step can be performed. During the test step, the different qualification levels of the Bluetooth device are determined based on the Bluetooth connection status and the response to the command. After the test step is completed, the Bluetooth connection is disconnected. Based on this, automatic testing of Bluetooth devices can be achieved, which helps to improve the testing efficiency of Bluetooth devices.
[0088] Optionally, in step S201, sending a specified instruction to the Bluetooth device may include repeatedly sending the instruction to the Bluetooth device multiple times.
[0089] There is no limit on the number of times the instruction is repeatedly sent. For example, the instruction may be repeatedly sent to the Bluetooth device 10 times.
[0090] It should be noted that, if there are multiple specified instructions, sending the instruction once may refer to sending all of the multiple instructions. If there is only one specified instruction, sending the instruction once may refer to sending that instruction.
[0091] Accordingly, in step S202, if the Bluetooth device successfully responds to the instruction sent to it, determining that the Bluetooth device is first-class qualified may include: if the Bluetooth device successfully responds to the instruction sent to it multiple times, determining that the Bluetooth device is first-class qualified.
[0092] Exemplarily, the Bluetooth device successfully responding to the instruction multiple times may mean that a response from the Bluetooth device can be received within a fixed time interval after the Bluetooth device sends an instruction each time.
[0093] Alternatively, in step S203, if the Bluetooth device fails to respond to the instruction sent to it, performing a retransmission test on the Bluetooth device may include: if the Bluetooth device fails to respond to the instruction sent to it at least once, performing a retransmission test on the Bluetooth device.
[0094] Exemplarily, the failure of the Bluetooth device to respond to at least one instruction may refer to no response from the Bluetooth device within a fixed time interval after the Bluetooth device sends an instruction once.
[0095] If the Bluetooth device responds to multiple commands, it can be determined that the Bluetooth device's transceiver performance is normal. If the Bluetooth device fails to respond to one of the multiple commands, it cannot be determined that the Bluetooth device's transceiver performance is normal, so a retransmission test is required.
[0096] Based on this, when testing the transceiver performance of a Bluetooth device, you can send instructions multiple times, which helps improve the accuracy of the test.
[0097] Optionally, the retransmission test may include repeatedly sending instructions to the Bluetooth device multiple times at fixed time intervals. Exemplarily, the instructions sent here may be designated instructions previously sent to the Bluetooth device.
[0098] The fixed time interval is not limited, and can be fixed at 2 seconds, for example. In other words, a command can be sent to the Bluetooth device every 2 seconds.
[0099] There is no limit on the number of times the message is sent repeatedly, for example, the message can be sent repeatedly 10 times.
[0100] Accordingly, if the Bluetooth device successfully responds to the command multiple times, it is determined that the Bluetooth device has passed the retransmission test. For example, the Bluetooth device successfully responding to the command multiple times may mean that a response from the Bluetooth device can be received within a fixed time interval (the time interval may be the same as the time interval for sending the multiple commands) after each command is sent by the Bluetooth device.
[0101] Alternatively, if the Bluetooth device fails to respond to the command at least once, it is determined that the Bluetooth device has failed the retransmission test. For example, the failure of the Bluetooth device to respond to the command at least once may refer to the absence of a response from the Bluetooth device within a fixed time interval (which may be the same as the time interval for sending multiple commands) after the Bluetooth device sends the command once.
[0102] In other words, if the Bluetooth device responds to multiple commands sent during the retransmission test, it can be determined that the Bluetooth device's transceiver performance is normal, meaning that the Bluetooth device has passed the retransmission test. If the Bluetooth device fails to respond even once, it can be determined that the Bluetooth device's transceiver performance is abnormal, meaning that the Bluetooth device has failed the retransmission test.
[0103] Based on the retransmission test, it is possible to re-determine whether the transmitting and receiving performance of the Bluetooth device is normal when the Bluetooth device fails to respond to a command, which helps to improve the accuracy of the test.
[0104] Optionally, Figure 1 The method shown may further include: recording a response log of the Bluetooth device during the retransmission test, where the response log may include a response status of each instruction.
[0105] For example, the response log may include a media access control (MAC) address of the Bluetooth device, the number of times a command is sent to the Bluetooth device, and the number of times the Bluetooth device successfully responds to the command.
[0106] The response log can be used as a basis for studying abnormal performance of Bluetooth devices and helps to locate abnormalities in Bluetooth devices.
[0107] Optionally, the reconnection and retransmission test may include repeating the operations of re-establishing the Bluetooth connection, sending instructions, and automatically disconnecting the Bluetooth connection multiple times at fixed time intervals.
[0108] The fixed time interval is not limited, for example, it can be fixed to 3 seconds. In other words, the Bluetooth device can be re-established once every 3 seconds, the Bluetooth connection is sent, and the Bluetooth connection is automatically disconnected.
[0109] There is no limit on the number of times the above operation is repeated on the Bluetooth device, for example, it can be repeated 20 times.
[0110] It should be noted that the reconnection and retransmission test can be performed based on the MAC address of the Bluetooth device. The MAC address of the Bluetooth device can be obtained and saved when the Bluetooth connection is first established with the Bluetooth device. If the Bluetooth connection with the Bluetooth device is disconnected, the Bluetooth connection with the Bluetooth device can be re-established based on the MAC address of the Bluetooth device.
[0111] In the case where multiple Bluetooth connections are successfully established, if the Bluetooth connection is not interrupted for multiple consecutive times and the Bluetooth device successfully responds to multiple commands, it is determined that the Bluetooth device has passed the reconnection and retransmission test.
[0112] Alternatively, in the case where multiple Bluetooth connections are successfully established, if the Bluetooth connection is not interrupted for multiple consecutive times, but the Bluetooth device fails to respond to at least one instruction, it is determined that the Bluetooth device fails the reconnection and retransmission test.
[0113] Alternatively, in the case where multiple Bluetooth connections are successfully established, if the Bluetooth connection is interrupted at least once, it is determined that the Bluetooth device has failed the reconnection and retransmission test.
[0114] Or, if at least one Bluetooth connection is not successfully established, it is determined that the Bluetooth device fails a reconnection retransmission test.
[0115] That is to say, in the reconnection and retransmission test, if the Bluetooth connections are not interrupted multiple times and the Bluetooth device successfully responds to multiple commands, it can be determined that the connection performance and transceiver performance of the Bluetooth device are normal, that is, the Bluetooth device passes the reconnection and retransmission test.
[0116] Conversely, if at least one of the multiple Bluetooth connections is interrupted or at least one Bluetooth connection is not successfully established, it can be determined that the Bluetooth device's connection performance is abnormal, that is, the Bluetooth device has failed the reconnection and retransmission test. Furthermore, if the Bluetooth device does not respond to even one of the multiple commands, it can be determined that the Bluetooth device's transceiver performance is abnormal, that is, the Bluetooth device has failed the reconnection and retransmission test.
[0117] It should be noted that the meanings of the Bluetooth device successfully responding to multiple instructions and the Bluetooth device failing to respond to at least one instruction here may be the same as those in the above retransmission test, and will not be repeated here.
[0118] Based on the reconnection and retransmission test, when the Bluetooth connection with the Bluetooth device is interrupted, it is possible to re-determine whether the connection performance and the sending and receiving performance of the Bluetooth device are normal, which helps to improve the accuracy of the test.
[0119] Optionally, Figure 1 The method shown may further include: recording a connection and response log of the Bluetooth device during the reconnection and retransmission test, wherein the connection and response log includes a connection status of each Bluetooth connection and a response status of each instruction.
[0120] For example, the connection and response log may include the MAC address of the Bluetooth device, the number of Bluetooth connection interruptions with the Bluetooth device, the time node, the number of instructions sent to the Bluetooth device, and the number of times the Bluetooth device successfully responds to instructions.
[0121] Connection and response logs can be used as a basis for studying Bluetooth device performance anomalies and help locate Bluetooth device anomalies.
[0122] Optionally, the reconnection test may include repeatedly re-establishing a Bluetooth connection to the Bluetooth device and automatically disconnecting the Bluetooth connection at regular time intervals.
[0123] The fixed time interval is not limited, for example, it can be fixed to 3 seconds. In other words, the Bluetooth device can be re-established and automatically disconnected from the Bluetooth connection every 3 seconds.
[0124] There is no limit on the number of times the above operation can be repeated on the Bluetooth device, for example, it can be repeated three times.
[0125] It should be noted that the reconnection test can also be performed based on the MAC address of the Bluetooth device. The MAC address of the Bluetooth device can be obtained and saved when the Bluetooth connection is first established with the Bluetooth device. If the Bluetooth connection with the Bluetooth device fails, the Bluetooth connection can be re-established with the Bluetooth device based on the MAC address of the Bluetooth device.
[0126] Accordingly, if the Bluetooth connection is successfully established multiple times in succession without interruption, it is determined that the Bluetooth device passes the reconnection test.
[0127] Alternatively, if at least one of the multiple Bluetooth connections fails to be successfully established, or at least one of the multiple successfully established Bluetooth connections is interrupted, it is determined that the Bluetooth device fails the reconnection test.
[0128] That is to say, in the reconnection test, if multiple Bluetooth connections with the Bluetooth device are successfully established and not interrupted, it can be determined that the connection performance of the Bluetooth device is normal, that is, the Bluetooth device passes the reconnection test.
[0129] On the contrary, if one of the multiple Bluetooth connections with the Bluetooth device fails to be successfully established or one Bluetooth connection is interrupted, it can be determined that the connection performance of the Bluetooth device is abnormal, that is, the Bluetooth device fails the reconnection test.
[0130] Based on the reconnection test, when a Bluetooth connection cannot be successfully established with a Bluetooth device, it is possible to re-determine whether the connection performance of the Bluetooth device is normal, which helps to improve the accuracy of the test.
[0131] Optionally, Figure 1 The method shown may further include: recording a connection log of the Bluetooth device during the reconnection test, where the connection log includes connection status of each Bluetooth connection.
[0132] For example, the connection log may include the MAC address of the Bluetooth device, the number of times a Bluetooth connection is established with the Bluetooth device, and whether the Bluetooth connection is successful.
[0133] Connection logs can be used as a basis for studying Bluetooth device performance anomalies and help locate Bluetooth device anomalies.
[0134] The following combination Figure 3 , the automatic testing method of the Bluetooth device of the embodiment of the present application is introduced by way of example. For example, the user can implement the automatic testing method of the Bluetooth device through the APP in the mobile phone. The steps of the method can be found in Figure 3 .
[0135] In step S310, the app scans for surrounding Bluetooth devices and automatically connects to a Bluetooth device with a specified name. Depending on the connection status of the Bluetooth device, the app proceeds to one of steps S320, S330, and S340.
[0136] If a Bluetooth connection is successfully established with the Bluetooth device, the APP may proceed to step S320 .
[0137] In step S320, the APP sends a specified instruction to the Bluetooth device and continues to send and receive the instruction 10 times.
[0138] If the Bluetooth device successfully responds to each instruction, the APP can determine that the Bluetooth device is first-class qualified and can accordingly enter step S360.
[0139] If the Bluetooth device fails to respond to the instruction at least once, the process proceeds to step S350.
[0140] In step S350, the APP resends the instruction to the Bluetooth device 10 times at a time interval of 2 seconds (ie, performs a retransmission test) and records a retransmission log.
[0141] If the Bluetooth device successfully responds to each instruction, that is, the Bluetooth device passes the retransmission test, the APP can determine that the Bluetooth device is second-class qualified and can accordingly enter step S360.
[0142] If the Bluetooth device fails to respond to the instruction at least once, that is, the Bluetooth device fails the retransmission test, the APP may determine that the Bluetooth device is unqualified and accordingly may proceed to step S360.
[0143] Alternatively, if the Bluetooth connection is disconnected after successfully establishing a Bluetooth connection with the Bluetooth device, the APP may proceed to step S330.
[0144] In step S330, the APP performs 20 operations of re-establishing the Bluetooth connection, sending instructions, and automatically disconnecting the Bluetooth connection for the Bluetooth device at intervals of 3 seconds (i.e., performing a reconnection and retransmission test), and records a reconnection and retransmission log.
[0145] If the Bluetooth connection is not interrupted for 20 times and the Bluetooth device successfully responds to the command 20 times, that is, the Bluetooth device passes the reconnection and retransmission test, the APP can determine that the Bluetooth device is second-class qualified and accordingly proceed to step S360.
[0146] If at least one of the 20 Bluetooth connections is interrupted, or the Bluetooth device does not respond to at least one instruction in 20 instructions, that is, the Bluetooth device fails the reconnection and retransmission test, the APP can determine that the Bluetooth device is unqualified and can enter step S360 accordingly.
[0147] Alternatively, if the Bluetooth connection with the Bluetooth device is not successfully established, the APP may proceed to step S340.
[0148] In step S340 , the APP re-establishes the Bluetooth connection and automatically disconnects the Bluetooth connection for the Bluetooth device 10 times at 2-second intervals (ie, performs a reconnection test), and records a reconnection log.
[0149] If the Bluetooth connection is successfully established and not interrupted for 10 times, that is, the Bluetooth device passes the reconnection test, the APP can determine that the Bluetooth device is second-class qualified and accordingly proceed to step S360.
[0150] If at least one of the 10 Bluetooth connections fails to be established, or at least one of the 10 Bluetooth connections is interrupted, that is, the Bluetooth device fails the reconnection test, the APP may determine that the Bluetooth device is unqualified and accordingly proceed to step S360.
[0151] At this point, the APP has completed the test of the Bluetooth device.
[0152] In step S360, the APP disconnects the Bluetooth connection with the Bluetooth device and connects to the next Bluetooth device.
[0153] Following the above steps, the APP can complete the test of each Bluetooth device. It should be noted that the APP can test multiple Bluetooth devices at the same time, or test multiple Bluetooth devices one by one.
[0154] based on Figure 3 The method shown can realize automatic testing of Bluetooth devices, avoid tedious testing steps, help improve testing efficiency and reduce labor costs.
[0155] The method provided in the embodiment of the present application is described in detail above. The device provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0156] An embodiment of the present application provides an electronic device, which may include a module for executing the steps in the above-mentioned various method embodiments.
[0157] The present application also provides an electronic device. Figure 4 As shown, the electronic device 400 includes: at least one processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the at least one processor 401. When the processor 401 executes the computer program 403, the method provided in this application is implemented.
[0158] For example, computer program 403 may be divided into one or more modules / units, one or more of which are stored in memory 402 and executed by processor 401 to implement the present application. One or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in electronic device 400.
[0159] Those skilled in the art will understand that Figure 4 It is only an example of the electronic device 400 and does not constitute a limitation of the electronic device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 400 may also include input and output devices, network access devices, buses, etc.
[0160] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0161] Memory 402 can be an internal storage unit of electronic device 400, such as a hard drive or memory of electronic device 400. Memory 402 can also be an external storage device of electronic device 400, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 400. Furthermore, memory 402 can include both an internal storage unit of electronic device 400 and an external storage device. Memory 402 is used to store computer programs and other programs and data required by electronic device 400. Memory 402 can also be used to temporarily store data that has been output or is about to be output.
[0162] The electronic device 400 provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated here.
[0163] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0164] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0165] If the integrated unit is implemented as a software functional unit and sold or used as a standalone product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application can implement all or part of the processes in the above-mentioned method embodiments by using a computer program to instruct the relevant hardware. This computer program can be stored in a computer-readable storage medium. When executed by a processor, this computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, an executable file, or some intermediate form. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a camera / electronic device, a recording medium, computer memory, ROM (read-only memory), RAM (random access memory), CD-ROM (compact disc read-only memory), magnetic tape, floppy disk, and optical data storage device. The computer-readable storage medium mentioned in this application can be a non-volatile storage medium, in other words, a non-transitory storage medium.
[0166] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0167] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0168] In the embodiments provided in this application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0169] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0170] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0171] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0172] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0173] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for automatically testing a Bluetooth device, characterized in that: For each Bluetooth device, the method includes: Automatically establishing a Bluetooth connection with the Bluetooth device and performing a test step, and disconnecting the Bluetooth connection after completing the test step; The testing steps include: When the Bluetooth connection is successfully established: Sending a specified instruction to the Bluetooth device; If the Bluetooth device successfully responds to the instruction, the Bluetooth device is determined to be first-class qualified; If the Bluetooth device fails to respond to the instruction, retest the Bluetooth device to retest the instruction response of the Bluetooth device; If the Bluetooth device passes the retransmission test, the Bluetooth device is determined to be second-class qualified; If the Bluetooth device fails the retransmission test, determining that the Bluetooth device is unqualified; In the event that the Bluetooth connection is disconnected after being established: Performing a reconnection and retransmission test on the Bluetooth device to retest the connection status and instruction response status of the Bluetooth device; If the Bluetooth device passes the reconnection and retransmission test, the Bluetooth device is determined to be second-class qualified; If the Bluetooth device fails the reconnection and retransmission test, determining that the Bluetooth device is unqualified; In the event that the Bluetooth connection cannot be successfully established: Performing a reconnection test on the Bluetooth device to retest the connection status of the Bluetooth device; If the Bluetooth device passes the reconnection test, sending the instruction to the Bluetooth device and determining whether the Bluetooth device is qualified according to the response of the Bluetooth device; If the Bluetooth device fails the reconnection test, it is determined that the Bluetooth device is unqualified.
2. The method according to claim 1, characterized in that The sending of a specified instruction to the Bluetooth device includes: Repeating sending the instruction to the Bluetooth device multiple times; If the Bluetooth device successfully responds to the instruction, determining that the Bluetooth device is first-class qualified includes: If the Bluetooth device successfully responds to the command multiple times, the Bluetooth device is determined to be first-class qualified; If the Bluetooth device fails to respond to the instruction, performing a retransmission test on the Bluetooth device includes: If the Bluetooth device fails to respond to the instruction at least once, a retransmission test is performed on the Bluetooth device.
3. The method according to claim 1 or 2, characterized in that The retransmission test includes repeatedly sending the instruction to the Bluetooth device multiple times at fixed time intervals; If the Bluetooth device successfully responds to the instruction multiple times, it is determined that the Bluetooth device passes the retransmission test; Alternatively, if the Bluetooth device fails to respond to the instruction at least once, it is determined that the Bluetooth device fails the retransmission test.
4. The method according to claim 3, characterized in that The method further comprises: A response log of the Bluetooth device is recorded in the retransmission test, where the response log includes the response status of each instruction.
5. The method according to claim 1 or 2, characterized in that The reconnection and retransmission test includes repeating the operations of re-establishing the Bluetooth connection, sending the instruction, and automatically disconnecting the Bluetooth connection multiple times at fixed time intervals; If the Bluetooth connection is not interrupted for multiple consecutive times and the Bluetooth device successfully responds to the instructions multiple times, it is determined that the Bluetooth device has passed the reconnection and retransmission test; Alternatively, if the Bluetooth connection is not interrupted for multiple consecutive times, but the Bluetooth device fails to respond to the instruction at least once, it is determined that the Bluetooth device fails the reconnection and retransmission test; Alternatively, if the Bluetooth connection is interrupted at least once, it is determined that the Bluetooth device fails the reconnection and retransmission test.
6. The method according to claim 5, characterized in that The method further comprises: The connection and response log of the Bluetooth device is recorded in the reconnection and retransmission test, and the connection and response log includes the connection status of each Bluetooth connection and the response status of each instruction.
7. The method according to claim 1 or 2, characterized in that The reconnection test includes: Repeat the operations of re-establishing the Bluetooth connection and automatically disconnecting the Bluetooth connection multiple times at fixed time intervals; If the Bluetooth connection is successfully established multiple times without interruption, it is determined that the Bluetooth device has passed the reconnection test; Alternatively, if at least one of the multiple Bluetooth connections fails to be successfully established, or at least one of the multiple successfully established Bluetooth connections is interrupted, it is determined that the Bluetooth device fails the reconnection test.
8. The method according to claim 7, characterized in that The method further comprises: The connection log of the Bluetooth device is recorded in the reconnection test, and the connection log includes the connection status of each Bluetooth connection.
9. An electronic device, characterized in that: The method comprises a module for executing the automatic testing method of a Bluetooth device according to any one of claims 1 to 8.
10. An electronic device comprising a memory, at least one processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the automatic testing method for a Bluetooth device according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Testing method and testing device
CN106255141A
Test method, Bluetooth device, control method, test device and test system
CN111106883A
Bluetooth test method and device of intelligent glasses, medium and electronic equipment
CN116709380A
Bluetooth earphone performance test method based on audio analysis and related device
CN118450309A
Method for testing connection stability of Bluetooth headset
CN119485090A