Bluetooth device test method, test system and storage medium

By obtaining target information in Bluetooth device testing and filtering appropriate test cases, the test complexity problems caused by interface and protocol differences are solved, and the testing efficiency and accuracy are improved.

CN120342519APending Publication Date: 2025-07-18SHENZHEN INJOINIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510501226.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

Existing Bluetooth device testing methods have complex test cases due to interface differences and protocol differences, low test efficiency and error-prone results.

Method used

Send test instructions to the Bluetooth device through the target interface, obtain target information and filter appropriate test cases, test based on target information and multiple test cases, and obtain test results.

Benefits of technology

Simplifies the design and implementation of test cases, improves the testing efficiency and accuracy of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120342519A_ABST
    Figure CN120342519A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of Bluetooth device testing, in particular to a Bluetooth device testing method and system and a storage medium, the method is applied to an electronic device, the electronic device is in communication connection with a target Bluetooth device through a target interface, and the method comprises the steps that a testing instruction is sent to the target Bluetooth device through the target interface, the method comprises the steps of sending a test instruction to a target Bluetooth device to enable the target Bluetooth device to send target information to an electronic device after the target Bluetooth device receives the test instruction, obtaining a plurality of test cases used for testing the target Bluetooth device, and testing the target Bluetooth device based on the target information and the plurality of test cases, and obtaining a test result of the target Bluetooth device. According to the embodiment of the invention, the target information is taken as a reference, the appropriate test case is screened to test the target Bluetooth equipment, and the design and implementation of the test case are simplified, so that the test efficiency of the target Bluetooth equipment is improved, and the accuracy of a test result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of Bluetooth device testing, and in particular, to a Bluetooth device testing method, a testing system, and a storage medium. Background Art

[0002] A Bluetooth controller is the core component for implementing Bluetooth communication, responsible for processing the transmission and reception of wireless signals, as well as the encoding and decoding of data. A host is a software stack that manages the communication between two or more devices. The Host Controller Interface (HCI) is the interface between the host and the Bluetooth controller, mainly responsible for sending commands from the host to the Bluetooth controller, receiving events from the Bluetooth controller, and sending and receiving data from the peer device. To ensure the reliability of Bluetooth devices in practical applications, a series of tests need to be performed on the Bluetooth controller.

[0003] Currently, based on various test scenarios, testers design different command combinations by writing a large number of test cases through scripting according to different scenarios. However, with the continuous development of Bluetooth technology, the functions and protocol stacks of Bluetooth controllers have become increasingly complex, resulting in a reduction in the generality of uniformly generated test cases. First, the Bluetooth controller can be connected to the host through multiple physical interfaces (such as UART and USB), and the characteristics and data transmission methods of different interfaces are different, making the design and implementation of test cases more complex. Second, with the evolution of multiple versions of Bluetooth protocols (such as Bluetooth 5.0, 5.1, etc.), there are some differences between the commands supported by different versions of Bluetooth protocols. Thus, due to interface differences, Bluetooth protocol differences, etc., the design and implementation of test cases become complex, reducing the test efficiency and making the test results prone to errors. Summary of the Invention

[0004] In view of this, an object of the embodiments of the present application is to provide a Bluetooth device testing method, a testing system, and a storage medium to solve the technical problem in the prior art that the test efficiency is reduced and the test results are incorrect due to the complex design and implementation of test cases.

[0005] To solve the above technical problem, the embodiments of the present application provide the following technical solutions:

[0006] In a first aspect, the embodiments of the present application provide a Bluetooth device testing method, which is applied to an electronic device. The electronic device is communicatively connected to a target Bluetooth device through a target interface. The method includes:

[0007] Send a test instruction to the target Bluetooth device through the target interface, so that after receiving the test instruction, the target Bluetooth device sends target information to the electronic device, where the target information is reference information required to test the target Bluetooth device;

[0008] Obtain a plurality of test cases for testing the target Bluetooth device;

[0009] Based on the target information and the plurality of test cases, test the target Bluetooth device to obtain a test result of the target Bluetooth device.

[0010] In some embodiments, the test case includes a test command and a test function, the target information includes a plurality of standard commands and a plurality of standard functions supported by the target Bluetooth device, and based on the target information and the plurality of test cases, testing the target Bluetooth device to obtain a test result of the target Bluetooth device includes:

[0011] Based on the target information and the plurality of test cases, determine a target test case, where the target test case is a test case in which the test command is the same as any one of the plurality of standard commands and the test function is the same as any one of the plurality of standard functions;

[0012] Execute the target test case on the target Bluetooth device to obtain an execution result corresponding to the target test case, and the execution result is the test result of the target Bluetooth device.

[0013] In some embodiments, the determining a target test case based on the target information and the plurality of test cases includes:

[0014] Compare the test command of the reference test case with the plurality of standard commands, and compare the test function of the reference test case with the plurality of standard functions to obtain a comparison result of the reference test case, where the reference test case is any one of the plurality of test cases;

[0015] Based on the comparison result of the reference test case, determine the target test case.

[0016] In some embodiments, the determining a target test case based on the comparison result of the reference test case includes:

[0017] If the comparison result is that the test command is the same as any one of the plurality of standard commands and the test function is the same as any one of the plurality of standard functions, determine the reference test case as the target test case.

[0018] In some embodiments, obtaining a plurality of test cases includes:

[0019] Screening out at least two first test cases from a preset test case library, and / or, in response to a generation instruction, generating at least two second test cases by using a writing script;

[0020] Using the at least two first test cases and / or the at least two second test cases as the plurality of test cases.

[0021] In some embodiments, before sending a test instruction to the target Bluetooth device through the target interface, the method further includes:

[0022] Obtaining a start command corresponding to the target Bluetooth device, and sending the start command to the target Bluetooth device through the target interface, so that after receiving the start command, the target Bluetooth device sends a connection success message to the electronic device, and the connection success message is used to indicate that the target Bluetooth device and the electronic device have successfully established a communication connection.

[0023] In a second aspect, an embodiment of the present application provides a Bluetooth device testing method, which is applied to a target Bluetooth device. The target Bluetooth device is communicatively connected to an electronic device through a target interface. The method includes:

[0024] In response to a received test instruction, obtaining target information of the target Bluetooth device, and sending the target information to the electronic device through the target interface, so that after receiving the target information, the electronic device obtains a plurality of test cases, and tests the target Bluetooth device based on the target information and the plurality of test cases to obtain a test result of the target Bluetooth device.

[0025] In some embodiments, the method further includes:

[0026] In response to a received start command, generating a connection success message, and sending the connection success message to the electronic device through the target interface, and the connection success message is used to indicate that the target Bluetooth device and the electronic device have successfully established a communication connection.

[0027] In a third aspect, an embodiment of the present application provides a test system, including:

[0028] An electronic device, a target Bluetooth device, and a plurality of types of interfaces. The electronic device is communicatively connected to the target Bluetooth device through the target interface, where the target interface is any one type of interface among the plurality of types of interfaces;

[0029] The electronic device is used to execute any of the Bluetooth device testing methods described in the first aspect, and the target Bluetooth device is used to execute any of the Bluetooth device testing methods described in the second aspect.

[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions executable by a processor are stored. The processor executes the computer program instructions to cause the computer to execute any of the Bluetooth device testing methods described in the first aspect or the second aspect.

[0031] The embodiment of the present application has the following beneficial effects: Different from the prior art, the Bluetooth device testing method provided by the embodiment of the present application is applied to an electronic device. The electronic device is communicatively connected to a target Bluetooth device through a target interface. The method includes: sending a test instruction to the target Bluetooth device through the target interface, so that after receiving the test instruction, the target Bluetooth device sends target information to the electronic device. The target information is reference information required for testing the target Bluetooth device, obtaining a plurality of test cases for testing the target Bluetooth device, and based on the target information and the plurality of test cases, testing the target Bluetooth device to obtain a test result of the target Bluetooth device.

[0032] The embodiment of the present application uses the target information required for testing the target Bluetooth device as a reference, screens appropriate test cases to test the target Bluetooth device, simplifies the design and implementation of the test cases, thereby improving the testing efficiency of the target Bluetooth device and the accuracy of the test results. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the prior art or the embodiments. Obviously, the following-described drawings only show some embodiments of the present application and should not be regarded as limiting the scope of protection. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0034] Figure 1 is a schematic structural diagram of a test system provided by some embodiments of the present application;

[0035] Figure 2a is Figure 1 a schematic structural diagram of the electronic device in the test system shown in the embodiment;

[0036] Figure 2b is Figure 1 a schematic structural diagram of the target Bluetooth device in the test system shown in the embodiment;

[0037] Figure 3It is a schematic flowchart of a Bluetooth device testing method provided by some embodiments of the present application. Among them, the Bluetooth device testing method is applied to an electronic device;

[0038] Figure 4 It is an interaction schematic diagram of the testing process between an electronic device and a target Bluetooth device provided by some embodiments of the present application;

[0039] Figure 5 It is a schematic flowchart of a Bluetooth device testing method provided by some embodiments of the present application. Among them, the Bluetooth device testing method is applied to a target Bluetooth device. Detailed implementation manners

[0040] To make the objectives and advantages of the embodiments of the present application easier to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments. The detailed description of the embodiments of the present application in the following drawings does not limit the scope claimed by the present application, but only represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present application.

[0041] It should be noted that if there is no conflict, the various technical features involved in the embodiments of the present application described below can be combined with each other and are all within the protection scope of the present application. In addition, although functional module division is performed in the device or structure schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from the module division in the device or the flowchart. Moreover, the "first", "second", "third" and other similar expressions used herein do not limit the data and the execution order, but are only for the purpose of facilitating description and distinguishing the same items or similar items with basically the same functions and effects, and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of technical features.

[0042] Unless otherwise defined, the technical terms and scientific terms used in this specification have the same meanings as those commonly understood by those of ordinary skill in the technical field to which the present application belongs. The terms used in this specification are only for the purpose of describing specific implementation manners and are not used to limit the present application. It should be understood that the term "and / or" used in this specification includes any and all combinations of one or more of the listed items.

[0043] Please refer to Figure 1 , Figure 1 which schematically shows the structural schematic diagram of a testing system provided by some embodiments of the present application.

[0044] Specifically, asFigure 1 As shown in Figure 1 , the test system 1000 includes an electronic device 100, a target Bluetooth device 300, and multiple types of interfaces 200. Each type of interface includes one or more, for example Figure 1 As shown in Figure 1 , the first type of interface 210 includes three interfaces of this type, namely the first interface 211, the second interface 212, and the third interface 213.

[0045] The electronic device 100 is communicatively connected to the target Bluetooth device 300 through a target interface, where the target interface is any one type of interface among the multiple types of interfaces 200. For example, the target interface can be the first interface 211 in the first type of interface 210 or the sixth interface 223 in the second type of interface 220. It can be understood that the multiple types of interfaces 200 include at least two types of interfaces among USB interfaces, UART interfaces, Thunderbolt interfaces, and any other suitable types of interfaces. In some embodiments, the target Bluetooth device 300 includes a Bluetooth device under test and a paired Bluetooth device for testing. The Bluetooth device under test is a Bluetooth device whose functions, performance, stability, etc. are to be tested and evaluated. The paired Bluetooth device for testing is a Bluetooth device determined to be a qualified product through testing and serves as a reference device for testing the Bluetooth device under test. By comparing the test data of the paired Bluetooth device for testing and the test data of the Bluetooth device under test, the functions, performance, stability, etc. of the Bluetooth device under test are evaluated.

[0046] It should be noted that the electronic device 100 can be any suitable type of device such as a desktop computer, a tablet computer, a laptop computer, etc., or the electronic device 100 can also be any suitable type of device or component such as a single-chip microcomputer, a controller, or a control chip. Those skilled in the art can select any suitable device, device, or component as the electronic device according to actual needs, and the embodiments of the present application do not make any specific limitations on this.

[0047] In the embodiments of the present application, in order to ensure the reliability of the target Bluetooth device in actual applications, a series of tests need to be performed on the target Bluetooth device. Among them, the main purposes of the tests include function verification to ensure that the target Bluetooth device can execute various functional applications according to the design requirements, such as pairing, connection, and data transmission. Performance evaluation to evaluate the performance of the target Bluetooth device under different loads and environmental conditions, including connection time, data transmission rate, and power consumption. Stability to verify the performance of the target Bluetooth device under long-term operation and high-load conditions to ensure that it does not crash or exhibit abnormal behavior. During the implementation of the tests, considering factors such as different scenarios, the target Bluetooth device can be connected to the electronic device through various types of interfaces and Bluetooth communication protocols, etc., corresponding test cases need to be written to design various different command combinations, and these commands are sent to the target Bluetooth device through the interface, observing the performance and response of the target Bluetooth device, and the tester can evaluate the performance of the target Bluetooth device under different conditions, thereby verifying its functions, evaluating its performance, and stability, and achieving the test of the target Bluetooth device.

[0048] The inventors found that with the continuous development of Bluetooth technology, the functions and protocol stacks of the target Bluetooth device have become increasingly complex. The target Bluetooth device can be connected to the electronic device through various types of interfaces (such as UART, USB, etc.). Since the characteristics and data transmission methods of different interfaces are different, and with the evolution of multiple versions of the Bluetooth protocol (such as Bluetooth 5.0, 5.1), there are some differences in the commands supported by different versions of the Bluetooth protocol, which makes the design and implementation of test cases complicated, reduces the test efficiency, and the test results are prone to errors.

[0049] In view of this, the embodiments of the present application provide a method for testing a Bluetooth device, which is applied to an electronic device 100. The electronic device 100 is communicatively connected to the target Bluetooth device 300 through a target interface. The electronic device 100 first sends a test instruction to the target Bluetooth device 300 through the target interface to obtain the reference information (i.e., target information) required for testing the target Bluetooth device 300, and then obtains a plurality of test cases, and selects a test case that conforms to the target information from the plurality of test cases according to the target information, and uses the test case that conforms to the target information to test the target Bluetooth device 300 to obtain the test result of the target Bluetooth device 300, thereby simplifying the design and implementation of the test cases, improving the test efficiency, and improving the accuracy of the test results.

[0050] It is easy to understand that the electronic device 100 installs application programs that support various Bluetooth protocols and interfaces, simulates various different usage scenarios by setting the functions, parameters, and test methods of the application programs, selects test cases to test the target Bluetooth device 300, and obtains the test result of the target Bluetooth device 300.

[0051] It should be understood that Figure 1Only a schematic illustration shows a scenario in some embodiments of the present application where the electronic device 100 communicates with the target Bluetooth device 300 through the target interface and thus tests the target Bluetooth device 300, which does not impose any limitation on the structure, type, quantity, etc. of the electronic device 100, the interface 200, and the target Bluetooth device 300 in other embodiments. For example, in some other embodiments, the interface 200 may further include more types of interfaces.

[0052] To facilitate understanding of the Bluetooth device testing method provided in the first aspect embodiments of the present application, the electronic device provided in the embodiments of the present application will be introduced in detail first.

[0053] Please refer to Figure 2a , Figure 2a which schematically shows the structural diagram of the electronic device in the testing system provided in some embodiments of the present application.

[0054] As Figure 2a shown, the electronic device 100 includes at least one processor 110 and a memory 120 that are communicatively connected. Figure 2a In Figure 2a , a bus system 130 is used to connect and a single processor is taken as an example. Among them, each component in the electronic device 100 is coupled together through the bus system 130, and the bus system 130 is used to realize the connection and communication between each component. It is easy to understand that in addition to the data bus, the bus system 130 may further include a power bus, a control bus, a status signal bus, etc. However, for the sake of clear illustration and brevity of the description, in Figure 2a all kinds of buses are labeled as the bus system 130. It can be understood that Figure 2a the structure shown in the Figure 2a embodiment is only schematic and does not impose any limitation on the structure of the above-mentioned electronic device. For example, the above-mentioned electronic device may further include more or fewer components than the

[0055] Specifically, the processor 110 is used to provide computing and control capabilities to control the electronic device 100 to execute corresponding tasks. For example, it controls the above-mentioned electronic device 100 to execute any one of the Bluetooth device testing methods provided in the embodiments of the first aspect of this application, or to execute the steps in any possible implementation manner of any one of the Bluetooth device testing methods provided in the embodiments of the first aspect of this application. Those skilled in the art can understand that the processor 110 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be 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.

[0056] The memory 120, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, instructions, and modules. For example, the programs, instructions, and modules corresponding to the Bluetooth device testing method provided in the embodiments of the first aspect of this application. In some embodiments, the memory 120 may include a program storage area and a data storage area. The program storage area can store an operating system and application programs required for at least one function. The data storage area can store data created according to the use of the processor 110, etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the non-transitory software programs, instructions, and modules stored in the memory 120, so as to implement any one of the Bluetooth device testing methods provided in the embodiments of the first aspect of this application, or to execute the steps in any possible implementation manner of any one of the Bluetooth device testing methods provided in the embodiments of the first aspect of this application. In some embodiments, the memory 120 may include a high-speed random access memory and may also include non-transitory memory. For example, at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory 120 may further include a memory remotely set relative to the processor 110, and these remotely set memories can be connected to the processor 110 through a communication network. It can be understood that examples of the above communication network include but are not limited to the Internet, an enterprise internal network, a local area network, a mobile communication network, and combinations thereof.

[0057] To facilitate the understanding of the Bluetooth device testing method provided in the embodiments of the second aspect of this application, the target Bluetooth device provided in the embodiments of this application will be introduced in detail first.

[0058] Please refer to Figure 2b , Figure 2b which schematically shows the structural diagram of the target Bluetooth device in the test system provided by some embodiments of the present application.

[0059] As Figure 2b shown, the target Bluetooth device 300 includes at least one processor 310 and a memory 320 that are communicatively connected. Figure 2b Taking one processor connected by a bus system 330 as an example. Among them, each component in the target Bluetooth device 300 is coupled together through the bus system 330, and the bus system 330 is used to realize the connection and communication between each component. It is easy to understand that in addition to the data bus, the bus system 330 may also include a power bus, a control bus, a status signal bus, etc. However, for the sake of clear illustration and brevity of the space, in Figure 2b all kinds of buses are labeled as the bus system 330. It can be understood that Figure 2b the structure shown in the embodiment is only schematic and does not impose any limitation on the structure of the above-mentioned electronic device. For example, the above-mentioned electronic device may also include more or fewer components than Figure 2b the structure shown, or have a configuration different from Figure 2b the structure shown.

[0060] Specifically, the processor 310 is used to provide computing and control capabilities to control the target Bluetooth device 300 to execute corresponding tasks. For example, to control the above-mentioned target Bluetooth device 300 to execute any one of the Bluetooth device test methods provided in the second aspect embodiments of the present application, or to execute the steps in any possible implementation manner of any one of the Bluetooth device test methods provided in the second aspect embodiments of the present application. Those skilled in the art can understand that the processor 310 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be 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.

[0061] The memory 320, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, instructions, and modules, such as the programs, instructions, and modules corresponding to the Bluetooth device testing method provided in the embodiments of the second aspect of this application. In some embodiments, the memory 320 may include a program storage area and a data storage area. The program storage area can store an operating system and application programs required for at least one function. The data storage area can store data created according to the use of the processor 310, etc. By running the non-transitory software programs, instructions, and modules stored in the memory 320, the processor 310 executes various functional applications and data processing of the target Bluetooth device 300 to implement any one of the Bluetooth device testing methods provided in the embodiments of the second aspect of this application, or to execute the steps in any possible implementation manner of any one of the Bluetooth device testing methods provided in the embodiments of the second aspect of this application. In some embodiments, the memory 320 may include a high-speed random access memory and may also include non-transitory memory. For example, at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory 320 may further include a memory remotely provided with respect to the processor 310, and these remotely provided memories can be connected to the processor 310 through a communication network. It can be understood that examples of the above communication network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0062] As can be understood from the above, the execution subject of any one of the Bluetooth device testing methods provided in the embodiments of the first and second aspects of this application can be any suitable type of electronic device and target Bluetooth device with certain computing and control capabilities. For example, it can be implemented by the above-mentioned electronic device 100 and target Bluetooth device 300. In some feasible implementation manners, any one of the Bluetooth device testing methods provided in the embodiments of the first and second aspects of this application can be implemented by a processor executing computer program instructions stored in a memory.

[0063] Next, the Bluetooth device testing methods provided in the embodiments of the first and second aspects of this application will be described in detail in combination with the exemplary applications and implementations of the electronic device and the target Bluetooth device provided in the embodiments of this application.

[0064] First, the Bluetooth device testing method provided in the embodiments of the first aspect of this application will be described in detail.

[0065] Please refer to Figure 3 , Figure 3 which schematically shows a flowchart of the Bluetooth device testing method provided in some embodiments of this application.

[0066] Those skilled in the art can understand that the Bluetooth device testing method provided in the first aspect embodiment of this application can be applied to the above-mentioned electronic device (such as electronic device 100). Specifically, the execution subject of this Bluetooth device testing method is one or at least two processors of the electronic device.

[0067] As Figure 3 shown, this Bluetooth device testing method includes but is not limited to the following steps S100 - S300:

[0068] S100: Send a test instruction to the target Bluetooth device through the target interface, so that after receiving the test instruction, the target Bluetooth device sends the target information to the electronic device.

[0069] In this step, the target information is the reference information required to test the target Bluetooth device, that is, the information that needs to be compared when testing the target Bluetooth device. The target information can be the communication link supported by the target Bluetooth device and the function verification requirements, etc.

[0070] Specifically, after establishing a communication connection with the target Bluetooth device through the target interface, the electronic device sends the test instruction to the target Bluetooth device through the target interface, so that after receiving the test instruction, the target Bluetooth device sends the target information to the electronic device. The target Bluetooth device receives the test instruction, responds to the test instruction, obtains device parameter information, supported communication links, function verification requirements, etc., and sends the device parameter information, supported communication links, function verification requirements, etc. as the target information to the electronic device.

[0071] It can be understood that the test command is generated by the electronic device based on the test requirements using conventional techniques in the art. For example, the user can touch and operate the interaction interface of the electronic device, click the test button, and trigger the electronic device to generate the test command.

[0072] In some embodiments, before sending the test instruction to the target Bluetooth device through the target interface, this Bluetooth device testing method further includes but is not limited to the following step S101:

[0073] S101: Obtain the startup command corresponding to the target Bluetooth device, and send the startup command to the target Bluetooth device through the target interface, so that after receiving the startup command, the target Bluetooth device sends the connection success information to the electronic device.

[0074] In this step, the connection success information is used to indicate that the target Bluetooth device and the electronic device have successfully established a communication connection. That is, after the electronic device sends the startup command to the target Bluetooth device, if it receives the connection success information returned by the target Bluetooth device, the communication connection between the electronic device and the target Bluetooth device is successfully established.

[0075] Specifically, after the target Bluetooth device is plugged into the electronic device through the target interface, the electronic device starts the target interface driver according to information such as the target interface type and port number, reads the parameter information of the target Bluetooth device, obtains the startup command corresponding to the target Bluetooth device, and sends the startup command to the target Bluetooth device through the target interface, so that after receiving the startup command, the target Bluetooth device sends a connection success message to the electronic device. The target Bluetooth device receives the startup command, responds to the startup command, generates a connection success message, and sends the connection success message to the electronic device. Among them, the connection success message is generated by the target Bluetooth device based on the startup command using conventional techniques in the art, and the connection success message can be an instruction, a message, a status value, etc.

[0076] It can be understood that before controlling the target Bluetooth device to perform Bluetooth test operations using standard HCI commands (i.e., test commands), it is necessary to first pre-configure the target Bluetooth device through a startup command, execute the corresponding startup (BOOT) process, correctly configure the target Bluetooth device, so that the target Bluetooth device can be connected to the electronic device and operate normally to ensure the effectiveness of subsequent tests.

[0077] It is easily understandable that the startup command of the target Bluetooth device can be stored in any suitable storage medium such as the local storage of the electronic device, the cloud, or the server. When the startup command of the target Bluetooth device is needed, the startup command corresponding to the target Bluetooth device can be obtained from the local storage, the cloud, or the server, etc.

[0078] S200: Obtain multiple test cases.

[0079] In this step, the test cases are used to test the target Bluetooth device. The test cases can be generated in advance based on different usage scenarios of the target Bluetooth device, and the test cases are stored in any suitable storage medium such as the local storage of the electronic device, the cloud, or the server. In the embodiments of the present application, multi-parameter traversal test cases for dozens of basic behaviors such as BLE (i.e., low-power Bluetooth) broadcast, scan, single connection, multi-connection, and extended broadcast are provided. When testing the target Bluetooth device, multiple provided test cases can be directly selected.

[0080] Specifically, when testing the target Bluetooth device, the electronic device can directly obtain multiple test cases from the local storage, the cloud, or the server, etc.

[0081] In some embodiments, obtaining multiple test cases specifically includes, but is not limited to, the following steps S210 - S220:

[0082] S210: Screen at least two first test cases from a preset test case library, and / or, in response to a generation instruction, generate at least two second test cases using a scripting script.

[0083] S220: Use at least two first test cases and / or at least two second test cases as multiple test cases.

[0084] In this step, multiple test cases are pre-generated based on different usage scenarios of the target Bluetooth device in advance and stored in a preset test case library such as the local storage of the electronic device, the cloud, or the server. The generation instruction is generated by the electronic device based on test requirements using conventional techniques in the art. For example, the user touches and operates the interaction interface of the electronic device, sets the generation rule of the test case in the application according to the target information of the target Bluetooth device, the test requirements, etc., and clicks the test case generation button to trigger the application to generate a generation command and send the generation command to the electronic device.

[0085] Specifically, when testing the target Bluetooth device, the electronic device filters out at least two first test cases from the preset test case library, and / or the electronic device receives a generation instruction. In response to the received generation instruction, at least two second test cases are generated using the writing script deployed on itself according to the generation rule of the test case. Then, use at least two first test cases and / or at least two second test cases as multiple test cases for testing the target Bluetooth device, thereby obtaining multiple test cases.

[0086] S300: Based on the target information and multiple test cases, test the target Bluetooth device to obtain the test result of the target Bluetooth device.

[0087] Specifically, compare the parameter information of each test case in the multiple test cases with the target information to determine whether the test case conforms to the target information. For example, whether the parameter information of the test case conforms to the communication link supported by the target Bluetooth device and the function verification requirements, etc. If it conforms to the target information, execute the test case on the target Bluetooth device to obtain the execution result of the test case, and include the execution result of the test case in the output file for subsequent analysis and evaluation. Combining the execution results of all test cases, the test result of the target Bluetooth device is obtained.

[0088] In some embodiments, to improve the reliability and accuracy of the test, the test case can be set to be executed multiple times, and the average value of the multiple execution results obtained by executing the test case multiple times is taken to obtain the final execution result of the test case. In other embodiments, the test start time can also be custom-set, and the test case can be automatically executed every day / week to obtain the execution result of the test case.

[0089] In some embodiments, based on the target information and multiple test cases, testing the target Bluetooth device to obtain the test result of the target Bluetooth device specifically includes but is not limited to the following steps S310 - S320:

[0090] S310: Determine a target test case based on the target information and multiple test cases.

[0091] In this step, the test cases include test commands and test functions, and the target information includes multiple standard commands and multiple standard functions supported by the target Bluetooth device. The target test case is a test case where the test command is the same as any one of the multiple standard commands and the test function is the same as any one of the multiple standard functions. That is, if the test command of a certain test case is the same as any one of the multiple standard commands supported by the target Bluetooth device and the test function is the same as any one of the multiple standard functions supported by the target Bluetooth device, then this test case is the target test case.

[0092] Specifically, compare the test commands of each of the multiple test cases with the multiple standard commands supported by the target Bluetooth device, and compare the test functions of each test case with the multiple standard functions supported by the target Bluetooth device. According to the comparison results, determine whether the test case is the target test case. If the test command of a certain test case is the same as any one of the multiple standard commands supported by the target Bluetooth device and the test function of this test case is the same as any one of the multiple standard functions supported by the target Bluetooth device, then determine that this test case is the target test case.

[0093] In some embodiments, determining the target test case based on the target information and multiple test cases specifically includes, but is not limited to, the following steps S3101 - S3102:

[0094] S3101: Compare the test command of the reference test case with the multiple standard commands, and compare the test function of the reference test case with the multiple standard functions, to obtain the comparison result of the reference test case.

[0095] In this step, the reference test case is any one of the multiple test cases.

[0096] Specifically, compare the test command of the reference test case with the multiple standard commands, and compare the test function of the reference test case with the multiple standard functions, to obtain the comparison result of the reference test case.

[0097] It should be understood that the comparison result can be that the test command is different from all of the multiple standard commands and the test function is different from all of the multiple standard functions. The comparison result can also be that the test command is the same as any one of the multiple standard commands and the test function is different from all of the multiple standard functions. The comparison result can also be that the test command is different from all of the multiple standard commands and the test function is the same as any one of the multiple standard functions. The comparison result can also be that the test command is different from any one of the multiple standard commands and the test function is the same as any one of the multiple standard functions.

[0098] S3102: Determine the target test case based on the comparison result of the reference test case.

[0099] Specifically, according to the comparison result of the reference test case, determine whether the reference test case is the target test case, and filter out the target test case from multiple test cases.

[0100] In some embodiments, determining the target test case based on the comparison result of the reference test case specifically includes, but is not limited to, the following steps S31021:

[0101] S31021: If the comparison result is that the test command is the same as any one of the multiple standard commands and the test function is the same as any one of the multiple standard functions, determine that the reference test case is the target test case.

[0102] Specifically, if the comparison result of the reference test case is that the test command is the same as any one of the multiple standard commands and the test function is the same as any one of the multiple standard functions, determine that the reference test case is the target test case, so as to filter out the target test case from multiple test cases.

[0103] S320: Execute the target test case on the target Bluetooth device to obtain the execution result corresponding to the target test case, and the execution result is the test result of the target Bluetooth device.

[0104] Specifically, start executing the target test case on the target Bluetooth device to test the functions, performance, stability, etc. of the target Bluetooth device, obtain the execution result corresponding to the target test case, the execution result is the test result of the target Bluetooth device, and analyze and evaluate the functions, performance, stability, etc. of the target Bluetooth device according to the test result to complete the test of the target Bluetooth device.

[0105] In an embodiment where the target Bluetooth device includes the Bluetooth device under test and the paired Bluetooth device, the test results of the Bluetooth device under test and the paired Bluetooth device can be compared to analyze and evaluate the functions, performance, stability, etc. of the Bluetooth device under test.

[0106] To elaborate in detail on the Bluetooth device testing method provided by the embodiments of the present application, the embodiments of the present application will make a detailed description of the interaction process between the electronic device 100 and the target Bluetooth device 300. Specifically, the Bluetooth device testing method includes the following steps: Figure 4 To elaborate in detail on the Bluetooth device testing method provided by the embodiments of the present application, the embodiments of the present application will make a detailed description of the interaction process between the electronic device 100 and the target Bluetooth device 300. Specifically, the Bluetooth device testing method includes the following steps:

[0107] S401: The electronic device 100 obtains the startup command corresponding to the target Bluetooth device 300 and sends the startup command to the target Bluetooth device 300 through the target interface.

[0108] S402: In response to the received startup command, the target Bluetooth device 300 generates connection success information and sends the connection success information to the electronic device 100 through the target interface.

[0109] S403: The electronic device 100 sends a test instruction to the target Bluetooth device 300 through the target interface.

[0110] S404: In response to the received test instruction, the target Bluetooth device 300 obtains the target information of the target Bluetooth device 300 and sends the target information to the electronic device 100 through the target interface.

[0111] S405: The electronic device 100 obtains multiple test cases.

[0112] S406: The electronic device 100 tests the target Bluetooth device 300 based on the target information and multiple test cases to obtain the test results of the target Bluetooth device 300.

[0113] The embodiments of the present application use the target information required for testing the target Bluetooth device as a reference to screen appropriate test cases to test the target Bluetooth device, simplifying the design and implementation of the test cases, thereby improving the testing efficiency of the target Bluetooth device and the accuracy of the test results.

[0114] Next, a detailed description will be given of the Bluetooth device testing method provided by the second aspect embodiments of the present application.

[0115] Please refer to Figure 5 , Figure 5 which schematically shows a flowchart of the Bluetooth device testing method provided by some embodiments of the present application.

[0116] Those skilled in the art can understand that the Bluetooth device testing method provided in the second aspect embodiments of this application can be applied to the above-mentioned target Bluetooth device (such as target Bluetooth device 300). Specifically, the execution subject of this Bluetooth device testing method is one or at least two processors of the target Bluetooth device.

[0117] As Figure 5 shown, this Bluetooth device testing method includes but is not limited to the following step S10:

[0118] S10: In response to the received test instruction, obtain the target information of the target Bluetooth device, and send the target information to the electronic device through the target interface, so that after receiving the target information, the electronic device obtains multiple test cases, and based on the target information and multiple test cases, test the target Bluetooth device to obtain the test result of the target Bluetooth device.

[0119] In this step, the test command is generated by the electronic device based on the test requirements using conventional techniques in the art. For example, the user can touch and operate the interaction interface of the electronic device, click the test button to trigger the electronic device to generate a test command, and the electronic device sends the test command to the target Bluetooth device.

[0120] Specifically, the target Bluetooth device receives the test instruction through the target interface, responds to the test instruction, obtains device parameter information, supported communication links, function verification requirements, etc., and uses the device parameter information, supported communication links, function verification requirements, etc. as target information and sends it to the electronic device, so that after receiving the target information, the electronic device obtains multiple test cases, and based on the target information and multiple test cases, test the target Bluetooth device to obtain the test result of the target Bluetooth device.

[0121] In some embodiments, this Bluetooth device testing method further includes but is not limited to the following step S20:

[0122] S20: In response to the received start command, generate connection success information, and send the connection success information to the electronic device through the target interface. The connection success information is used to indicate that the target Bluetooth device and the electronic device have successfully established a communication connection.

[0123] In this step, the connection success information is used to indicate that the target Bluetooth device and the electronic device have successfully established a communication connection. The start command of the target Bluetooth device is stored in any suitable storage medium such as the local storage of the electronic device, the cloud, or the server. When the start command of the target Bluetooth device is needed, the electronic device can obtain the start command corresponding to the target Bluetooth device from the local storage, the cloud, or the server, etc., and send the start command to the target Bluetooth device through the target interface.

[0124] Specifically, the target Bluetooth device receives a startup command through a target interface, responds to the startup command, generates a connection success message, and sends the connection success message to the electronic device through the target interface to notify the electronic device that the target Bluetooth device has successfully established a communication connection with it.

[0125] In the embodiments of the present application, by responding to obtain the target information of the target Bluetooth device and sending the target information to the electronic device, the electronic device can use the target information as a reference to screen appropriate test cases from multiple test cases to test the target Bluetooth device, simplifying the design and implementation of the test cases, thereby improving the test efficiency of the target Bluetooth device and the accuracy of the test results.

[0126] The embodiments of the present application provide a computer-readable storage medium, on which computer program instructions executable by a processor are stored. The processor executes the computer program instructions to enable the computer to execute any one of the Bluetooth device test methods provided by the embodiments of the present application, or execute the steps in any possible implementation manner of any one of the Bluetooth device test methods provided by the embodiments of the present application.

[0127] In some embodiments, the storage medium may be a flash memory, a hard disk, an optical disc, a register, a magnetic surface memory, a removable disk, a CD-ROM, a random access memory (RAM), a read-only memory (ROM), an electrically programmable ROM, and an electrically erasable programmable ROM, etc., or any other form of storage medium known in the technical field of the present application, or may also be various devices including one or any combination of the above storage media.

[0128] In some embodiments, the computer program instructions may be in the form of a program, software, a software module, a script, or code, and may be written in any form of programming language (including a compiled or interpreted language, or a declarative or procedural language), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, a component, a subroutine, or other units suitable for use in a computing environment.

[0129] As an example, the computer program instructions may or may not correspond to a file in the file system, and may be stored as part of a file that stores other programs or data. For example, they may be stored in one or more scripts in a hypertext markup language (HTML) document, stored in a single file dedicated to the program being discussed, or stored in multiple cooperating files (such as files that store one or more modules, subroutines, or code portions).

[0130] As an example, computer program instructions can be deployed to execute on one computing device (including devices such as smart terminals and servers), or on multiple computing devices located at one location, or on multiple computing devices distributed at multiple locations and interconnected by a communication network. It is easy to understand that all or part of the steps of the methods described in the above embodiments provided by the present application can be directly implemented using electronic hardware or computer program instructions executable by a processor, or a combination of both.

[0131] Those skilled in the art can understand that the embodiments provided by the present application are only illustrative. The writing order of each step in the method of the embodiment does not mean a strict execution order and does not constitute any limitation to the implementation process. It can be adjusted, combined, and deleted according to actual needs. Modules or sub-modules, units or sub-units, etc. in the device or system of the embodiment can be combined, divided, and deleted according to actual needs. For example, the division of units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.

[0132] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Those skilled in the art can understand that all or part of the processes of implementing the above embodiment methods can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.

[0133] It should be noted that the above embodiments are used to illustrate the technical concept and characteristics of the present application. The purpose is to enable those familiar with this technology to understand the content of the present application and implement it accordingly, and it cannot be used to limit the scope of the patent protection of the present application. Those of ordinary skill in the art can understand all or part of the processes of implementing the above embodiments, modify them according to the technical solutions recorded in the embodiments of the present application, or perform equivalent replacements on some of the technical features. It can be understood that these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and should be regarded as equivalent changes and modifications based on the embodiments of the present application, and should all fall within the scope covered by the claims of the present application.

Claims

1. A Bluetooth device testing method, applied to an electronic device, characterized in that, The electronic device is communicatively connected to the target Bluetooth device through a target interface, and the method includes: Sending a test instruction to the target Bluetooth device through the target interface, so that after receiving the test instruction, the target Bluetooth device sends target information to the electronic device, where the target information is reference information required for testing the target Bluetooth device; Obtaining a plurality of test cases for testing the target Bluetooth device; Testing the target Bluetooth device based on the target information and the plurality of test cases to obtain a test result of the target Bluetooth device.

2. The method according to claim 1, wherein The test case includes a test command and a test function, and the target information includes a plurality of standard commands and a plurality of standard functions supported by the target Bluetooth device. Testing the target Bluetooth device based on the target information and the plurality of test cases to obtain a test result of the target Bluetooth device includes: Determining a target test case based on the target information and the plurality of test cases, where the target test case is a test case in which the test command is the same as any one of the plurality of standard commands and the test function is the same as any one of the plurality of standard functions; Executing the target test case on the target Bluetooth device to obtain an execution result corresponding to the target test case, and the execution result is the test result of the target Bluetooth device.

3. The method according to claim 2, wherein The determining the target test case based on the target information and the plurality of test cases includes: Comparing the test command of a reference test case with the plurality of standard commands, and comparing the test function of the reference test case with the plurality of standard functions to obtain a comparison result of the reference test case, where the reference test case is any one of the plurality of test cases; Determining the target test case based on the comparison result of the reference test case.

4. The method according to claim 3, characterized in that, The determining the target test case based on the comparison result of the reference test case includes: If the comparison result is that the test command is the same as any one of the plurality of standard commands and the test function is the same as any one of the plurality of standard functions, determining the reference test case as the target test case.

5. The method according to any one of claims 1-4, characterized in that, The obtaining a plurality of test cases includes: Screening out at least two first test cases from a preset test case library, and / or, in response to a generation instruction, generating at least two second test cases by using a writing script; Using the at least two first test cases and / or the at least two second test cases as the plurality of test cases.

6. The method according to any one of claims 1-4, characterized in that Before sending the test instruction to the target Bluetooth device through the target interface, the method further includes: Obtaining a start command corresponding to the target Bluetooth device, and sending the start command to the target Bluetooth device through the target interface, so that after receiving the start command, the target Bluetooth device sends a connection success message to the electronic device, and the connection success message is used to indicate that the target Bluetooth device and the electronic device have successfully established a communication connection.

7. A Bluetooth device testing method, applied to a target Bluetooth device, characterized in that The target Bluetooth device is communicatively connected to the electronic device through a target interface, and the method includes: In response to a received test instruction, obtain target information of the target Bluetooth device, and send the target information to the electronic device through the target interface, so that after receiving the target information, the electronic device obtains a plurality of test cases, and tests the target Bluetooth device based on the target information and the plurality of test cases to obtain a test result of the target Bluetooth device.

8. The method according to claim 7, wherein The method further includes: In response to a received start command, generate connection success information, and send the connection success information to the electronic device through the target interface, where the connection success information is used to indicate that the target Bluetooth device and the electronic device have successfully established a communication connection.

9. A test system, characterized in that, It includes: An electronic device, a target Bluetooth device, and a plurality of types of interfaces. The electronic device is communicatively connected to the target Bluetooth device through a target interface, where the target interface is any one type of interface among the plurality of types of interfaces; The electronic device is configured to execute the Bluetooth device testing method according to any one of claims 1-6, and the target Bluetooth device is configured to execute the Bluetooth device testing method according to claim 7 or 8.

10. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores computer program instructions executable by a processor, and the processor executes the computer program instructions to cause the computer to execute the Bluetooth device testing method according to any one of claims 1-8.