CN112312434B - Bluetooth function testing method and device, electronic equipment and storage medium - Google Patents

Bluetooth function testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112312434B
CN112312434B CN202011156435.7A CN202011156435A CN112312434B CN 112312434 B CN112312434 B CN 112312434B CN 202011156435 A CN202011156435 A CN 202011156435A CN 112312434 B CN112312434 B CN 112312434B
Authority
CN
China
Prior art keywords
bluetooth
radio transceiver
function
database
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011156435.7A
Other languages
Chinese (zh)
Other versions
CN112312434A (en
Inventor
邱日升
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Wingtech Information Technology Co Ltd
Original Assignee
Shanghai Wingtech Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Wingtech Information Technology Co Ltd filed Critical Shanghai Wingtech Information Technology Co Ltd
Priority to CN202011156435.7A priority Critical patent/CN112312434B/en
Publication of CN112312434A publication Critical patent/CN112312434A/en
Application granted granted Critical
Publication of CN112312434B publication Critical patent/CN112312434B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention provides a Bluetooth function testing method and device, electronic equipment and a storage medium, and relates to the field of function testing. The method comprises the steps of obtaining characteristic information of a radio transceiver by responding to a test command, starting the corresponding radio transceiver based on the characteristic information so that the radio transceiver searches for Bluetooth equipment, storing the searched equipment information of the Bluetooth equipment in a Bluetooth equipment database, and inquiring the Bluetooth equipment database according to the characteristic information of the radio transceiver to obtain a target database after the radio transceiver is searched, so as to detect whether the Bluetooth function of the electronic equipment is normal or not according to the target database and a pre-stored configuration file. The wireless transceiver can be directly started by using the test instruction, so that the wireless transceiver searches the Bluetooth device and acquires the device information of the Bluetooth device, the Bluetooth function test can be completed without manual operation of a user, the automatic degree of the whole process is high, and the human resources and the material resources are saved.

Description

Bluetooth function testing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the field of function testing, in particular to a Bluetooth function testing method and device, electronic equipment and a storage medium.
Background
Generally, in the field of notebook computer development, the notebook computer performs an automatic verification test on the functions of the notebook computer before shipment. An important step in the testing tool is to perform a connectivity (disconnection and reconnection) stress test on the bluetooth drivers of the system and the peripheral bluetooth devices.
In the prior art, connectivity of peripheral bluetooth devices can be tested through bluetooth win32 API, but this method has a problem that, after the system is started, if the system does not perform bluetooth search enumeration operation (i.e. the user needs to manually perform operations such as system setting- > bluetooth- > adding bluetooth devices or restarting bluetooth switches), the retrieval data returned by the API (Application Programming Interface) is always null, and thus, the bluetooth function test cannot be completed. This results in an automated testing process, which requires a large amount of human and material resources.
Disclosure of Invention
In view of the above, the present invention provides a bluetooth function testing method, apparatus, electronic device and storage medium to solve the above problems.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present application provides a bluetooth function testing method, which is applied to an electronic device, where the electronic device includes a radio transceiver, and the bluetooth function testing method includes:
acquiring a test instruction, and acquiring characteristic information of the radio transceiver in response to the test instruction;
enabling the corresponding radio transceiver based on the feature information to enable the radio transceiver to search for a Bluetooth device and store device information of the searched Bluetooth device in a Bluetooth device database;
after the radio transceiver is searched, inquiring a target database from the Bluetooth device database according to the characteristic information of the radio transceiver, wherein the target database comprises the device information of the Bluetooth device searched by the radio transceiver;
and detecting whether the Bluetooth function of the electronic equipment is normal or not according to the target database and a pre-stored configuration file.
In an alternative embodiment, the device information includes a device name of the bluetooth device, and the pre-stored configuration file includes an object name of the test auxiliary device, and the object name is associated with the device name;
the step of detecting whether the Bluetooth function of the electronic equipment is normal or not according to the target database and the pre-stored configuration file comprises the following steps:
retrieving the device name of the Bluetooth device in the target database according to the object name of the pre-stored configuration file;
if the device name of the Bluetooth device is not retrieved in the target database according to the object name of the pre-stored configuration file, generating a detection result of the abnormal Bluetooth function;
and if the device name of the Bluetooth device is retrieved in the target database according to the object name of the pre-stored configuration file, generating a detection result that the Bluetooth function is normal.
In an alternative embodiment, the feature information comprises an API interface handle of the corresponding radio transceiver;
the step of enabling the corresponding radio transceiver based on the feature information to cause the radio transceiver to search for a bluetooth device and store device information of the searched bluetooth device in a bluetooth device database includes:
and enabling the peripheral device discovery function and the peripheral device connection function of the corresponding radio transceiver by using the API handle so as to enable the radio transceiver to search the Bluetooth device and store the device information of the searched Bluetooth device in a Bluetooth device database.
In an alternative embodiment, the electronic device includes a plurality of radio transceivers, the method further comprising:
invoking a Bluetooth search interface when any one of the plurality of radio transceivers is enabled;
generating a search completion notification when a search of any one of the plurality of radio transceivers is completed;
and if the search completion notification is captured, closing the Bluetooth search interface.
In an alternative embodiment, the electronic device comprises a plurality of radio transceivers, and the step of querying the bluetooth device database for the target database according to the feature information of the radio transceivers comprises:
inquiring from the Bluetooth equipment database according to each piece of characteristic information to obtain a corresponding target sub-database;
and summarizing each target sub-database to obtain the target database.
In a second aspect, an embodiment of the present application further provides a bluetooth function testing apparatus, which is applied to an electronic device, where the electronic device includes a radio transceiver, and the bluetooth function testing apparatus includes:
the information acquisition module is used for acquiring a test instruction and responding to the test instruction to acquire the characteristic information of the radio transceiver;
a control module for enabling the corresponding radio transceiver based on the feature information to enable the radio transceiver to search for a Bluetooth device and store device information of the searched Bluetooth device in a Bluetooth device database;
the data query module is used for querying a target database from the Bluetooth equipment database according to the characteristic information of the radio transceiver after the radio transceiver is searched, wherein the target database comprises the equipment information of the Bluetooth equipment searched by the radio transceiver;
and the function detection module is used for detecting whether the Bluetooth function of the electronic equipment is normal or not according to the target database and the pre-stored configuration file.
In an alternative embodiment, the device information includes a device name of the bluetooth device, and the pre-stored configuration file includes an object name of the test auxiliary device, the object name being associated with the device name;
the function detection module is used for searching the device name of the Bluetooth device in the target database according to the object name of the pre-stored configuration file;
the function detection module is also used for generating a detection result of the Bluetooth function abnormity if the device name of the Bluetooth device is not retrieved from the target database;
the function detection module is further configured to generate a detection result that the bluetooth function is normal if the device name of the bluetooth device is retrieved from the target database.
In an alternative embodiment, the feature information comprises an API interface handle of the corresponding radio transceiver;
the control module is used for utilizing the API handle to start the peripheral equipment discovery function and the peripheral equipment connection function of the corresponding radio transceiver so as to enable the radio transceiver to search the Bluetooth equipment and store the equipment information of the searched Bluetooth equipment in a Bluetooth equipment database.
In a third aspect, an embodiment of the present application further provides an electronic device, which includes a processor and a memory, where the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the steps of the bluetooth function testing method according to any one of the foregoing implementation manners.
In a fourth aspect, an embodiment of the present application further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the bluetooth function testing method according to any one of the foregoing embodiments.
According to the Bluetooth function testing method, the device, the electronic equipment and the storage medium provided by the embodiment of the invention, after the testing instruction is obtained, the characteristic information of the radio transceiver can be obtained in response to the testing instruction, the corresponding radio transceiver is started based on the characteristic information, so that the radio transceiver searches the Bluetooth equipment and stores the searched equipment information of the Bluetooth equipment in the Bluetooth equipment database, and after the radio transceiver is searched, the target database is obtained by inquiring from the Bluetooth equipment database according to the characteristic information of the radio transceiver, so that whether the Bluetooth function of the electronic equipment is normal or not is detected according to the target database and the pre-stored configuration file. The wireless transceiver can be directly started by using the test instruction, so that the wireless transceiver searches the Bluetooth device and acquires the device information of the Bluetooth device, the Bluetooth function test can be completed without manually adding the Bluetooth device or restarting a Bluetooth switch by a user, the automatic degree of the whole process is high, and the human resources and the material resources are saved.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows a diagram of an application environment provided by an embodiment of the present invention.
Fig. 2 shows a flowchart of a bluetooth function testing method according to an embodiment of the present invention.
Fig. 3 shows a further flowchart of a bluetooth function testing method according to an embodiment of the present invention.
Fig. 4 is a flowchart illustrating another bluetooth function testing method according to an embodiment of the present invention.
Fig. 5 is a functional block diagram of a bluetooth function testing apparatus according to an embodiment of the present invention.
Fig. 6 shows an internal structure diagram of an electronic device according to an embodiment of the present invention.
Icon: 10-a test system; 100-an electronic device; 110-a processor; 120-a non-volatile storage medium; 122 — an operating system; 124-a computer program; 130-an internal memory; 140-a communication interface; 150-a display screen; 160-an input device; 170-a radio transceiver; 200-test aids; 300-a bluetooth function testing device; 310-an information acquisition module; 320-a control module; 330-data query module; 340-function detection module.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The Bluetooth function testing method provided by the application can be applied to the application environment shown in figure 1. The bluetooth function testing method is applied to the testing system 10. The test system 10 includes an electronic device 100 and a test assistant device 200. Wherein, the electronic device 100 and the test assisting device 200 may communicate via bluetooth. The electronic device 100 and the test assisting device 200 may be, but are not limited to, devices having a bluetooth function, such as various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
The following will describe embodiments of the present application in detail.
Referring to fig. 2, a flowchart of a bluetooth function testing method according to an embodiment of the present application is shown, where an execution main body of a processing flow described in the embodiment is the electronic device 100. Specifically, the bluetooth function testing method comprises the following steps:
s201, obtaining the test command, and obtaining the feature information of the radio transceiver 170 in response to the test command.
The test instruction may be sent to the electronic device 100 by another device, or generated by the electronic device 100 in response to an operation of a user. The test command is used to instruct the electronic device 100 to perform a bluetooth function test.
In an alternative embodiment, an intelligent terminal is communicatively connected to the electronic device 100, and a user may interact with the intelligent terminal to enable the intelligent terminal to generate a test instruction and transmit the test instruction to the electronic device 100. In another alternative embodiment, the electronic device 100 may include an input device 160 (e.g., a keyboard), and the user may input the test instructions through the input device 160.
Referring to fig. 6, the electronic device 100 may include a radio transceiver 170, and the radio transceiver 170 may be used to discover surrounding bluetooth devices. The electronic device 100 is configured with feature information of the radio transceiver 170 in advance, where the feature information includes, but is not limited to, API interface handle, MAC Address (Media Access Control Address), device name, device class, and manufacturer of the radio transceiver 170.
Wherein the API interface handle contains an API interface that can call the radio transceiver 170 so that the radio transceiver 170 can be operated using the API interface handle.
It should be noted that the number of the radio transceivers 170 included in the electronic device 100 is not limited. That is, the electronic device 100 may include one radio transceiver 170 or may include a plurality of radio transceivers 170. When the electronic device 100 includes multiple radio transceivers 170, the API interface handles, MAC addresses, and device names for different radio transceivers 170 are different. Also, in a typical case, the search frequency bands of different transceivers 170 may be different, so that the bluetooth devices that can be searched are different.
S202, the corresponding radio transceiver 170 is enabled based on the feature information, so that the radio transceiver 170 searches for the bluetooth device and stores the device information of the searched bluetooth device in the bluetooth device database.
In an alternative embodiment, the electronic device 100 may enable the peripheral device discovery function and the peripheral device connection function of the corresponding radio transceiver 170 using the API interface handle, so that the radio transceiver 170 searches for the bluetooth device and stores the device information of the searched bluetooth device in the bluetooth device database.
In an alternative embodiment, the bluetooth enabled discovery function of the radio transceiver 170 may be enabled by using the bluetooth enabled discovery function in the API interface handle, and the bluetooth enabled connectivity function of the radio transceiver 170 may be enabled by using the bluetooth enabled discovery function in the API interface handle, after the peripheral discovery function and the peripheral access function are turned on, the radio transceiver 170 may search for the peripheral bluetooth devices, and acquire and store the device information of the peripheral devices after the bluetooth devices are searched.
The device information may include information such as the name of the bluetooth device, the MAC address of the bluetooth device, the device name of the radio transceiver 170 searched for the bluetooth device, the MAC address of the radio transceiver 170 searched for the bluetooth device, the API interface handle of the radio transceiver 170 searched for the bluetooth device, the device identification, the device class, etc.
S203, after the radio transceiver 170 finishes searching, the target database is obtained by inquiring from the Bluetooth device database according to the characteristic information of the radio transceiver 170.
Wherein the target database includes device information of bluetooth devices searched by the radio transceiver 170.
It will be appreciated that the bluetooth device database may include historical search records of the electronic device 100, i.e., device information of previously searched bluetooth devices. In order to reduce the workload of subsequent functional tests, the target database needs to be inquired from the Bluetooth device database.
If the electronic device 100 includes only one radio transceiver 170, the target database can be queried from the bluetooth device database directly using the characteristic information of the radio transceiver 170. In an alternative embodiment, the API interface handle may be used to query the target database from the bluetooth device database, for example, the bluetooth findfirstdevice function call in the API interface handle may be used to obtain the corresponding target database.
If the electronic device 100 includes a plurality of radio transceivers 170, after the plurality of radio transceivers 170 are all searched, the corresponding target sub-database is obtained by querying from the bluetooth device database according to each feature information, and then each target sub-database is summarized to obtain the target database.
S204, detecting whether the Bluetooth function of the electronic device 100 is normal according to the target database and the pre-stored configuration file.
It should be noted that the pre-stored configuration file includes the object names of the test assistance apparatuses 200 (which are bluetooth apparatuses) arranged around the electronic apparatus 100 in advance, and the object names are associated with the apparatus names.
Please refer to fig. 3, which is a detailed flowchart of S204. The S204 includes:
s2041, retrieving the device name of the bluetooth device in the target database according to the object name of the pre-stored configuration file.
S2042, if the device name of the bluetooth device is not retrieved from the target database according to the object name of the pre-stored configuration file, generating a result of detecting the bluetooth dysfunction.
If the device name of the bluetooth device is not retrieved from the target database according to the object name of the pre-stored configuration file, it indicates that the object name of the configuration file is not included in the target database, that is, the electronic device 100 does not search the test auxiliary devices 200 arranged around, which indicates that there is a problem in the bluetooth function thereof, thereby generating a detection result of the bluetooth function abnormality.
S2043, if the device name of the Bluetooth device is searched in the target database according to the object name of the pre-stored configuration file, generating a detection result that the Bluetooth function is normal.
If the device name of the bluetooth device is successfully retrieved in the target database according to the object name of the pre-stored configuration file, it indicates that the object name in the configuration file is included in the target database, that is, the electronic device 100 successfully searches the test auxiliary devices 200 arranged around, which indicates that the bluetooth function of the test auxiliary devices is normal, and thus generates a detection result that the bluetooth function is normal.
It can be understood that, in the embodiment of the present application, after acquiring the test command, the electronic device 100 may acquire the feature information of the radio transceiver 170 in response to the test command, and enable the corresponding radio transceiver 170 based on the feature information, so that the radio transceiver 170 searches for the bluetooth device and stores the device information of the searched bluetooth device in the bluetooth device database, and after the search of the radio transceiver 170 is completed, query the bluetooth device database according to the feature information of the radio transceiver 170 to obtain the target database, thereby detecting whether the bluetooth function of the electronic device 100 is normal according to the target database and the pre-stored configuration file. Because the radio transceiver 170 can be directly started by using the test instruction, the radio transceiver 170 searches the bluetooth device and acquires the device information of the bluetooth device, the bluetooth function test can be completed without manually adding the bluetooth device or restarting a bluetooth switch by a user, the automatic degree of the whole process is high, and the human resources and the material resources are saved.
In order to facilitate a user to monitor a testing process in real time, another embodiment of the present application further provides a bluetooth function testing method, referring to fig. 4, the bluetooth function testing method further includes:
s205, when any one of the plurality of radio transceivers 170 is enabled, a bluetooth search interface is invoked.
That is, each of the plurality of radio transceivers 170, when enabled, invokes the bluetooth search interface to alert the user that the electronic device 100 is searching for bluetooth devices.
S206, when the search by any one of the plurality of radio transceivers 170 is completed, a search completion notification is generated.
And for each radio transceiver 170, a search complete notification is generated once its search is complete.
And S207, if the search completion notification is captured, closing the Bluetooth search interface.
For example, if the electronic device 100 includes two radio transceivers 170, namely a first radio transceiver 170 and a second radio transceiver 170, the bluetooth test procedure may be as follows:
the first radio transceiver 170 may be activated first, at which time the bluetooth search interface is invoked, and after the search of the first radio transceiver 170 is completed, a search completion notification is generated and the bluetooth search interface is closed; the second radio transceiver 170 is then re-enabled, at which point the bluetooth search interface is re-invoked, and after the search by the second radio transceiver 170 is complete, a search complete notification is generated and the bluetooth search interface is closed. After the first radio transceiver 170 and the second radio transceiver 170 are searched, a first target sub-database is obtained by querying from the bluetooth device database according to the characteristic information of the first radio transceiver 170, a second target sub-database is obtained by querying from the bluetooth device database according to the characteristic information of the second radio transceiver 170, the first target sub-database and the second target sub-database are summarized to obtain a target database, and then whether the bluetooth function of the electronic device 100 is normal is detected according to the target database and a pre-stored configuration file.
It should be understood that, although the steps in the flowcharts of fig. 2 to 4 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
In order to execute the corresponding steps in the above embodiments and various possible manners, an implementation manner of the bluetooth function testing apparatus 300 is given below. Referring to fig. 5, fig. 5 is a functional block diagram of a bluetooth function testing apparatus 300 according to an embodiment of the present invention. It should be noted that the basic principle and the generated technical effects of the bluetooth function testing apparatus 300 provided in the present embodiment are the same as those of the above embodiments, and for the sake of brief description, no part of the present embodiment is mentioned, and corresponding contents in the above embodiments may be referred to. This bluetooth function test device 300 includes: an information acquisition module 310, a control module 320, a data query module 330, and a function detection module 340.
The information obtaining module 310 is configured to obtain a test instruction, and obtain the feature information of the radio transceiver 170 in response to the test instruction.
In an alternative embodiment, the information obtaining module 310 may be configured to execute S201 to implement the corresponding function.
The control module 320 is configured to enable the corresponding radio transceiver 170 based on the feature information, so that the radio transceiver 170 searches for a bluetooth device and stores device information of the searched bluetooth device in a bluetooth device database.
The feature information includes, but is not limited to, API interface handle of the radio transceiver 170, MAC Address (Media Access Control Address), device name, device class, and manufacturer information.
The control module 320 is configured to enable the peripheral device discovery function and the peripheral device connection function of the corresponding radio transceiver 170 using the API interface handle, so that the radio transceiver 170 searches for the bluetooth device and stores the device information of the searched bluetooth device in the bluetooth device database.
In an alternative embodiment, the control module 320 may be configured to execute S202 to implement the corresponding function.
The data query module 330 is configured to query the bluetooth device database according to the feature information of the radio transceiver 170 to obtain a target database after the radio transceiver 170 completes the search.
In an alternative embodiment, the data query module 330 may be configured to execute S203 to implement the corresponding function.
The function detecting module 340 is configured to detect whether the bluetooth function of the electronic device 100 is normal according to the target database and a pre-stored configuration file.
Specifically, the function detecting module 340 is configured to retrieve the device name of the bluetooth device in the target database according to the object name of the pre-stored configuration file, generate a detection result that the bluetooth function is abnormal if the device name of the bluetooth device is not retrieved in the target database according to the object name of the pre-stored configuration file, and generate a detection result that the bluetooth function is normal if the device name of the bluetooth device is retrieved in the target database according to the object name of the pre-stored configuration file.
In an alternative embodiment, the function detecting module 340 may be configured to execute the steps S204, S2041, S2042, and S2043 to implement the corresponding functions.
The control module 320 is also configured to invoke the bluetooth search interface when any one of the plurality of radio transceivers 170 is enabled.
In an alternative embodiment, the control module 320 may be configured to execute S205 to implement the corresponding function.
The control module 320 is further configured to generate a search completion notification when the search by any one of the plurality of radio transceivers 170 is completed.
In an alternative embodiment, the control module 320 may be configured to execute S206 to implement the corresponding function.
The control module 320 is further configured to close the bluetooth search interface if the search completion notification is captured.
In an alternative embodiment, the control module 320 may be configured to execute S207 to implement the corresponding function.
For specific limitations of the bluetooth function testing apparatus 300, reference may be made to the above limitations of the bluetooth function testing method, which will not be described herein again. The various modules in the bluetooth function testing apparatus 300 may be implemented in whole or in part by software, hardware, and a combination thereof. The modules may be embedded in the electronic device 100 in a hardware manner or may be independent of the processor 110 in the electronic device 100, or may be stored in a memory in the electronic device 100 in a software manner, so that the processor 110 can call and execute operations corresponding to the modules.
In one embodiment, an electronic device 100 is provided, and the electronic device 100 may be a terminal, and the internal structure thereof may be as shown in fig. 6. The electronic device 100 includes a processor 110, memory, a communication interface 140, a display 150, an input device 160, and a radio transceiver 170 connected by a system bus. Wherein the processor 110 of the electronic device 100 is configured to provide computing and control capabilities. The memory of the electronic device 100 includes a nonvolatile storage medium 120 and an internal memory 130. The non-volatile storage medium 120 stores an operating system 122 and computer programs 124. The internal memory 130 provides an environment for the operating system 122 and the computer programs 124 in the non-volatile storage medium 120 to run. The communication interface 140 of the electronic device 100 is used for performing wired or wireless communication with an external terminal, and the wireless communication may be implemented through WIFI, an operator network, near Field Communication (NFC), or other technologies. The computer program 124 is executed by the processor 110 to implement a bluetooth functionality test method. The display 150 of the electronic device 100 may be a liquid crystal display 150 or an electronic ink display 150, and the input device 160 of the electronic device 100 may be a touch layer covered on the display 150, a key, a trackball or a touch pad arranged on a housing of the electronic device 100, or an external keyboard, a touch pad or a mouse. The radio transceiver 170 may be used to discover and connect bluetooth devices around the electronic device 100.
Those skilled in the art will appreciate that the structure shown in fig. 6 is a block diagram of only a portion of the structure relevant to the present application, and does not constitute a limitation on the electronic device 100 to which the present application is applied, and that a particular electronic device 100 may include more or less components than those shown in the drawings, or combine certain components, or have a different arrangement of components.
In one embodiment, the bluetooth function testing apparatus 300 provided in the present application may be implemented in the form of a computer program 124, and the computer program 124 may be run on the electronic device 100 as shown in fig. 6. The memory of the electronic device 100 may store various program modules constituting the bluetooth function test apparatus 300, such as the information obtaining module 310, the control module 320, the data querying module 330, and the function detecting module 340 shown in fig. 5. The computer program 124 constituted by the respective program modules causes the processor 110 to execute the steps in the bluetooth function testing method of the respective embodiments of the present application described in the present specification.
For example, the electronic device 100 shown in fig. 6 may perform S201 through the information acquisition module 310 in the bluetooth function testing apparatus 300 shown in fig. 5. The electronic device 100 may perform S202 through the control module 320. The electronic device 100 may perform step S203 through the data query module 330. The electronic device 100 may perform step S204 through the function detection module 340.
In one embodiment, an electronic device 100 is provided, comprising a memory storing a computer program 124 and a processor 110, the processor 110 implementing the following steps when executing the computer program 124: s201, acquiring a test instruction, and acquiring characteristic information of the radio transceiver 170 in response to the test instruction; s202, enabling the corresponding radio transceiver 170 based on the feature information, so that the radio transceiver 170 searches for the bluetooth device and stores the device information of the searched bluetooth device in the bluetooth device database; s203, after the radio transceiver 170 finishes searching, inquiring from the Bluetooth equipment database according to the characteristic information of the radio transceiver 170 to obtain a target database; s204, detecting whether the Bluetooth function of the electronic device 100 is normal according to the target database and the pre-stored configuration file.
In one embodiment, the processor 110, when executing the computer program 124, further performs the steps of: s2041, retrieving the device name of the Bluetooth device in a target database according to the object name of the pre-stored configuration file; s2042, if the device name of the Bluetooth device is not retrieved in the target database according to the object name of the pre-stored configuration file, generating a detection result of the Bluetooth function abnormality; s2043, if the device name of the Bluetooth device is searched in the target database according to the object name of the pre-stored configuration file, generating a detection result that the Bluetooth function is normal.
In one embodiment, the processor 110, when executing the computer program 124, further performs the steps of: s205, when any one of the plurality of radio transceivers 170 is enabled, a bluetooth search interface is invoked.
In one embodiment, the processor 110, when executing the computer program 124, further performs the steps of: s206, when the search by any one of the plurality of radio transceivers 170 is completed, generating a search completion notification.
In one embodiment, the processor 110, when executing the computer program 124, further performs the steps of: and S207, if the search completion notification is captured, closing the Bluetooth search interface.
After the test command is obtained, the feature information of the radio transceiver 170 can be obtained in response to the test command, and the corresponding radio transceiver 170 is enabled based on the feature information, so that the radio transceiver 170 searches for the bluetooth device and stores the device information of the searched bluetooth device in the bluetooth device database, and after the search of the radio transceiver 170 is completed, the target database is obtained by querying the bluetooth device database according to the feature information of the radio transceiver 170, and thus whether the bluetooth function of the electronic device 100 is normal is detected according to the target database and the pre-stored configuration file. Because the radio transceiver 170 can be directly started by using the test instruction, the radio transceiver 170 searches the bluetooth device and acquires the device information of the bluetooth device, the bluetooth function test can be completed without manually adding the bluetooth device or restarting a bluetooth switch by a user, the automatic degree of the whole process is high, and the human resources and the material resources are saved.
In one embodiment, a computer-readable storage medium is provided, on which a computer program 124 is stored, the computer program 124 realizing the following steps when executed by the processor 110: s201, obtaining a test command, and obtaining characteristic information of the radio transceiver 170 in response to the test command; s202, enabling the corresponding radio transceiver 170 based on the feature information, so that the radio transceiver 170 searches for the bluetooth device and stores the device information of the searched bluetooth device in the bluetooth device database; s203, after the radio transceiver 170 finishes searching, inquiring from the Bluetooth equipment database according to the characteristic information of the radio transceiver 170 to obtain a target database; s204, detecting whether the Bluetooth function of the electronic device 100 is normal according to the target database and the pre-stored configuration file.
In one embodiment, the computer program 124, when executed by the processor 110, further implements the steps of: s2041, retrieving the device name of the Bluetooth device in a target database according to the object name of a pre-stored configuration file; s2042, if the device name of the Bluetooth device is not retrieved in the target database according to the object name of the pre-stored configuration file, generating a detection result of the Bluetooth function abnormality; s2043, if the device name of the Bluetooth device is searched in the target database according to the object name of the pre-stored configuration file, generating a detection result that the Bluetooth function is normal.
In one embodiment, the computer program 124, when executed by the processor 110, further implements the steps of: s205, when any one of the plurality of radio transceivers 170 is enabled, a bluetooth search interface is invoked.
In one embodiment, the computer program 124, when executed by the processor 110, further implements the steps of: s206, when the search by any one of the plurality of radio transceivers 170 is completed, a search completion notification is generated.
In one embodiment, the computer program 124, when executed by the processor 110, further implements the steps of: and S207, if the search completion notification is captured, closing the Bluetooth search interface.
To sum up, the method, the apparatus, the electronic device and the storage medium for testing bluetooth function according to embodiments of the present invention may, after obtaining the test command, obtain the feature information of the radio transceiver in response to the test command, and enable the corresponding radio transceiver based on the feature information, so that the radio transceiver searches for the bluetooth device and stores the device information of the searched bluetooth device in the bluetooth device database, and after completing the search of the radio transceiver, query the bluetooth device database according to the feature information of the radio transceiver to obtain the target database, thereby detecting whether the bluetooth function of the electronic device is normal according to the target database and the pre-stored configuration file. Because the radio transceiver can be directly started by using the test instruction, the radio transceiver searches the Bluetooth device and acquires the device information of the Bluetooth device, the Bluetooth function test can be completed without manually adding the Bluetooth device or restarting a Bluetooth switch by a user, the automatic degree of the whole process is high, and the human resources and the material resources are saved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM is available in many forms, such as Static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), and the like.
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.

Claims (10)

1. A Bluetooth function testing method is applied to an electronic device, the electronic device comprises a radio transceiver, and the Bluetooth function testing method comprises the following steps:
acquiring a test instruction, and acquiring characteristic information of the radio transceiver in response to the test instruction;
enabling the corresponding radio transceiver based on the feature information to enable the radio transceiver to search for a Bluetooth device and store device information of the searched Bluetooth device in a Bluetooth device database;
after the radio transceiver is searched, inquiring a target database from the Bluetooth device database according to the characteristic information of the radio transceiver, wherein the target database comprises the device information of the Bluetooth device searched by the radio transceiver;
and detecting whether the Bluetooth function of the electronic equipment is normal or not according to the target database and a pre-stored configuration file.
2. The bluetooth function testing method according to claim 1, wherein the device information includes a device name of the bluetooth device, the pre-stored profile includes an object name of the test auxiliary device, and the object name is associated with the device name;
the step of detecting whether the Bluetooth function of the electronic equipment is normal or not according to the target database and the pre-stored configuration file comprises the following steps:
retrieving the device name of the Bluetooth device in the target database according to the object name of the pre-stored configuration file;
if the device name of the Bluetooth device is not retrieved in the target database according to the object name of the pre-stored configuration file, generating a detection result of the Bluetooth function abnormality;
and if the device name of the Bluetooth device is retrieved in the target database according to the object name of the pre-stored configuration file, generating a detection result that the Bluetooth function is normal.
3. The bluetooth function testing method according to claim 1, wherein the feature information includes an API interface handle of the corresponding radio transceiver;
the step of enabling the corresponding radio transceiver based on the feature information to cause the radio transceiver to search for a bluetooth device and store device information of the searched bluetooth device in a bluetooth device database includes:
and enabling the peripheral device discovery function and the peripheral device connection function of the corresponding radio transceiver by using the API handle so as to enable the radio transceiver to search the Bluetooth device and store the device information of the searched Bluetooth device in a Bluetooth device database.
4. The method of any of claims 1-3, wherein the electronic device includes a plurality of radio transceivers, the method further comprising:
invoking a Bluetooth search interface when any one of the plurality of radio transceivers is enabled;
generating a search completion notification when a search of any one of the plurality of radio transceivers is completed;
and if the search completion notification is captured, closing the Bluetooth search interface.
5. The method according to any one of claims 1-3, wherein the electronic device comprises a plurality of radio transceivers, and the step of querying the Bluetooth device database for a target database according to the feature information of the radio transceivers comprises:
inquiring a corresponding target sub-database from the Bluetooth equipment database according to each piece of characteristic information;
and summarizing each target sub-database to obtain the target database.
6. A Bluetooth function testing device applied to an electronic device including a radio transceiver, the Bluetooth function testing device comprising:
the information acquisition module is used for acquiring a test instruction and responding to the test instruction to acquire the characteristic information of the radio transceiver;
a control module for enabling the corresponding radio transceiver based on the feature information to make the radio transceiver search for a Bluetooth device and store device information of the searched Bluetooth device in a Bluetooth device database;
the data query module is used for querying a target database from the Bluetooth equipment database according to the characteristic information of the radio transceiver after the radio transceiver is searched, wherein the target database comprises the equipment information of the Bluetooth equipment searched by the radio transceiver;
and the function detection module is used for detecting whether the Bluetooth function of the electronic equipment is normal or not according to the target database and the pre-stored configuration file.
7. The bluetooth function testing apparatus according to claim 6, wherein the device information includes a device name of the bluetooth device, the pre-stored configuration file includes an object name of the test auxiliary device, and the object name is associated with the device name;
the function detection module is used for searching the device name of the Bluetooth device in the target database according to the object name of the pre-stored configuration file;
the function detection module is also used for generating a detection result of the Bluetooth function abnormity if the device name of the Bluetooth device is not retrieved from the target database;
the function detection module is further configured to generate a detection result that the bluetooth function is normal if the device name of the bluetooth device is retrieved from the target database.
8. The Bluetooth function test apparatus of claim 6, wherein the feature information includes an API interface handle of the corresponding radio transceiver;
the control module is used for utilizing the API handle to start the peripheral equipment discovery function and the peripheral equipment connection function of the corresponding radio transceiver so as to enable the radio transceiver to search the Bluetooth equipment and store the equipment information of the searched Bluetooth equipment into a Bluetooth equipment database.
9. An electronic device comprising a processor and a memory, the memory storing a computer program executable by the processor, the processor being operable to execute the computer program to perform the steps of the bluetooth functionality testing method of any one of claims 1-5.
10. A storage medium having stored thereon a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the bluetooth functionality testing method according to one of the claims 1 to 5.
CN202011156435.7A 2020-10-26 2020-10-26 Bluetooth function testing method and device, electronic equipment and storage medium Active CN112312434B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011156435.7A CN112312434B (en) 2020-10-26 2020-10-26 Bluetooth function testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011156435.7A CN112312434B (en) 2020-10-26 2020-10-26 Bluetooth function testing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112312434A CN112312434A (en) 2021-02-02
CN112312434B true CN112312434B (en) 2022-10-28

Family

ID=74330825

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011156435.7A Active CN112312434B (en) 2020-10-26 2020-10-26 Bluetooth function testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112312434B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553328B (en) * 2022-02-22 2023-10-20 深圳市冠旭电子股份有限公司 Bluetooth device testing method and device, electronic device and storage medium
CN114390502B (en) * 2022-03-23 2022-12-20 荣耀终端有限公司 Bluetooth communication method, device and storage medium
CN115150921A (en) * 2022-07-01 2022-10-04 合肥美菱物联科技有限公司 Production test method of wireless communication module with Bluetooth

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662530A (en) * 2008-08-25 2010-03-03 深圳富泰宏精密工业有限公司 Mobile phone with Bluetooth function and test method thereof
CN105589808A (en) * 2016-02-23 2016-05-18 惠州Tcl移动通信有限公司 Test method and test system for mobile phone and vehicle-mounted Bluetooth
CN109890019A (en) * 2018-07-05 2019-06-14 深圳贝仕达克技术股份有限公司 A kind of bluetooth test method, test equipment and the storage medium of terminal
CN111083017A (en) * 2019-12-31 2020-04-28 深圳Tcl新技术有限公司 Air conditioner distribution network testing method, air conditioner distribution network testing terminal and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100744297B1 (en) * 2006-02-17 2007-07-30 삼성전자주식회사 Apparatus and method for searching and communicating with bluetooth device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662530A (en) * 2008-08-25 2010-03-03 深圳富泰宏精密工业有限公司 Mobile phone with Bluetooth function and test method thereof
CN105589808A (en) * 2016-02-23 2016-05-18 惠州Tcl移动通信有限公司 Test method and test system for mobile phone and vehicle-mounted Bluetooth
CN109890019A (en) * 2018-07-05 2019-06-14 深圳贝仕达克技术股份有限公司 A kind of bluetooth test method, test equipment and the storage medium of terminal
CN111083017A (en) * 2019-12-31 2020-04-28 深圳Tcl新技术有限公司 Air conditioner distribution network testing method, air conditioner distribution network testing terminal and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
蓝牙设备的测试方案探析;沈亮;《现代信息科技》;20180125;第2卷(第1期);全文 *

Also Published As

Publication number Publication date
CN112312434A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
CN112312434B (en) Bluetooth function testing method and device, electronic equipment and storage medium
US10197422B2 (en) System and methods for interacting with a smart tool
CN106874174B (en) Method and device for realizing interface test and function test
CN108287917B (en) File opening method and device, storage medium and electronic equipment
CN112261635B (en) Bluetooth testing method and device, electronic equipment and computer readable storage medium
TWI590044B (en) Test system and test method thereof
US20140280262A1 (en) Electronic device with a funiction of applying applications of different operating systems and method thereof
US20110265175A1 (en) Graphical user interface tester
CN108255509B (en) Application deployment method, device, equipment and readable storage medium
CN111400179B (en) Method and device for terminal application program interaction, computer equipment and storage medium
CN108012031B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
US20140280263A1 (en) Electronic device with a funiction of applying applications of different operating systems and method thereof
CN110704311A (en) Application program testing method and device, electronic equipment and readable storage medium
CN108052437B (en) Restart positioning method, mobile terminal and computer readable storage medium
CN110442636B (en) Data reading and writing method and device and data reading and writing equipment
CN114077446B (en) Communication module calling system
CN110737593B (en) Intelligent capacity management method, device and storage medium
WO2021248310A1 (en) Method and apparatus for acquiring service calling information, and vulnerability test method for service
CN109683944B (en) Application function switch management method, device, equipment and readable storage medium
CN106484625A (en) A kind of method based on universal test Software Development Platform test subsystems
CN113138763A (en) Page construction method, device, equipment and computer readable storage medium
CN108038038B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN107220053B (en) BIOS management method and electronic equipment
CN107273328B (en) Interface management method and system
CN110502501B (en) Database operation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant