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

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

Info

Publication number
CN117098106B
CN117098106B CN202311350317.3A CN202311350317A CN117098106B CN 117098106 B CN117098106 B CN 117098106B CN 202311350317 A CN202311350317 A CN 202311350317A CN 117098106 B CN117098106 B CN 117098106B
Authority
CN
China
Prior art keywords
tested
control instruction
function
test
equipment
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
CN202311350317.3A
Other languages
Chinese (zh)
Other versions
CN117098106A (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.)
Hefei Lianbao Information Technology Co Ltd
Original Assignee
Hefei Lianbao 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 Hefei Lianbao Information Technology Co Ltd filed Critical Hefei Lianbao Information Technology Co Ltd
Priority to CN202311350317.3A priority Critical patent/CN117098106B/en
Publication of CN117098106A publication Critical patent/CN117098106A/en
Application granted granted Critical
Publication of CN117098106B publication Critical patent/CN117098106B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • H04BTRANSMISSION
    • H04B17/00Monitoring; Testing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/08Testing, supervising or monitoring using real traffic

Abstract

The method comprises the steps of obtaining a first control instruction and a second control instruction based on a Bluetooth network of equipment to be tested, wherein the first control instruction and the second control instruction are respectively used for realizing a first peripheral function and a second peripheral function of the equipment to be tested under the Bluetooth network; responding to the first control instruction and the second control instruction to respectively obtain first target data and second target data; based on the first target data, obtaining a test result of whether the first peripheral function of the device to be tested is normal or not; based on the second target data, obtaining a test result of whether the second external function and the transmission function are normal or not; and determining whether the Bluetooth function of the device to be tested is normal or not based on the test results of the first peripheral function, the second peripheral function and the transmission function of the device to be tested. The method can efficiently and accurately detect whether the Bluetooth function of the device to be detected is normal.

Description

Bluetooth testing method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of data processing, and in particular relates to a Bluetooth testing method, a Bluetooth testing device, electronic equipment and a storage medium.
Background
The detection of software and hardware of electronic devices, such as computers, is required before they are shipped to prevent the shipment of bad products, and bluetooth detection is one of the important contents. Conventionally, bluetooth detection detects whether a data transmission function and a peripheral connection function of an electronic device performed through bluetooth are normal.
At present, bluetooth detection is performed in a manual mode. The device to be tested is connected with another device through Bluetooth manually, and then whether the data transmission of files, pictures and the like can be normally performed is checked. Detecting peripheral connection function, need the manual work to be connected equipment that awaits measuring through external equipment such as bluetooth mouse, bluetooth keyboard, then detect whether external equipment such as bluetooth mouse, bluetooth keyboard can normal use. The manual detection mode is long in time consumption, low in efficiency and high in manpower waste.
Disclosure of Invention
The disclosure provides a Bluetooth testing method, a Bluetooth testing device, electronic equipment and a storage medium, so as to at least solve the technical problems in the prior art.
According to a first aspect of the present disclosure, there is provided a bluetooth test method, the method being applied to a device under test, the method comprising:
Based on a Bluetooth network of the equipment to be tested, a first control instruction and a second control instruction are obtained, wherein the first control instruction is used for realizing a first peripheral function of the equipment to be tested under the Bluetooth network, and the second control instruction is used for realizing a second peripheral function of the equipment to be tested under the Bluetooth network;
responding to the first control instruction, and obtaining first target data generated based on the first peripheral function;
responding to the second control instruction, and obtaining second target data generated based on the second external function;
based on the first target data, obtaining a test result of whether a first peripheral function of the device to be tested is normal or not under the Bluetooth network;
based on the second target data, obtaining a test result of whether a second external function and a transmission function of the device to be tested are normal or not under the Bluetooth network;
and determining whether the Bluetooth function of the device to be tested is normal or not based on the test result of whether the first peripheral function, the second peripheral function and the transmission function of the device to be tested are normal or not.
In an implementation manner, the device to be tested and the test device are connected through the Bluetooth network; the obtaining, based on the bluetooth network of the device to be tested, a first control instruction and a second control instruction includes: and under the Bluetooth network, receiving a human-computer interface (HID) data packet from test equipment, wherein the HID data packet comprises the first control instruction and the second control instruction.
In an embodiment, the responding to the first control instruction, obtaining the first target data generated based on the first peripheral function includes: executing the first control instruction to obtain a first execution result; and identifying the first execution result to obtain the first target data.
In an embodiment, the responding to the second control instruction, obtaining second target data generated based on the second external function includes: executing the second control instruction to obtain a second execution result; screenshot is carried out on the second execution result, and an image to be tested is obtained and is used for being identified by the test equipment; and determining the identification result of the test equipment on the image to be tested as the second target data.
In an embodiment, the obtaining, based on the first target data, a test result of whether the first peripheral function of the device under test is normal in the bluetooth network includes: comparing whether the first target data are identical to first preset data or not, and if so, obtaining a test result that the first peripheral function of the device to be tested is normal under the Bluetooth network; and if the first peripheral function of the equipment to be tested is abnormal under the Bluetooth network, obtaining a test result of abnormal first peripheral function of the equipment to be tested under the Bluetooth network.
In an embodiment, the obtaining, based on the second target data, a test result of whether the second external function and the transmission function of the device under test are normal in the bluetooth network includes: if the second target data from the test equipment are received, a test result with normal transmission function of the equipment to be tested under the Bluetooth network is obtained; and comparing whether the second target data is the same as second preset data or not, and if so, obtaining a test result that the second external function of the device to be tested is normal under the Bluetooth network.
In an embodiment, the determining whether the bluetooth function of the device under test is normal based on the test result that whether the first peripheral function, the second peripheral function, and the transmission function of the device under test are normal includes: and if the test results of the first peripheral function, the second peripheral function and the transmission function of the equipment to be tested are all normal, determining that the Bluetooth function of the equipment to be tested is normal.
According to a second aspect of the present disclosure, there is provided a bluetooth testing apparatus for use in a device under test, the apparatus comprising:
The receiving module is used for obtaining a first control instruction and a second control instruction based on a Bluetooth network of the equipment to be tested, wherein the first control instruction is used for realizing a first peripheral function of the equipment to be tested under the Bluetooth network, and the second control instruction is used for realizing a second peripheral function of the equipment to be tested under the Bluetooth network;
the first response module is used for responding to the first control instruction and obtaining first target data generated based on the first peripheral function;
the second response module is used for responding to the second control instruction and obtaining second target data generated based on the second external function;
the first acquisition module is used for acquiring a test result of whether a first peripheral function of the equipment to be tested is normal or not under the Bluetooth network based on the first target data;
the second acquisition module is used for acquiring a test result of whether a second external function and a transmission function of the equipment to be tested are normal or not under the Bluetooth network based on the second target data;
and the determining module is used for determining whether the Bluetooth function of the equipment to be tested is normal or not based on the test result of whether the first peripheral function, the second peripheral function and the transmission function of the equipment to be tested are normal or not.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods described in the present disclosure.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of the present disclosure.
According to the Bluetooth testing method, the Bluetooth testing device, the electronic equipment and the storage medium, under the condition that equipment to be tested is connected with a Bluetooth network, a first control instruction and a second control instruction are obtained; responding to the first control instruction and the second control instruction to respectively obtain first target data and second target data; based on the first target data, obtaining a test result of whether the first peripheral function of the device to be tested is normal or not; based on the second target data, obtaining a test result of whether the second external function and the transmission function are normal or not; and determining whether the Bluetooth function of the device to be tested is normal or not based on the test results of the first peripheral function, the second peripheral function and the transmission function of the device to be tested. The method can automatically detect the Bluetooth function of the device to be detected, and realizes high-efficiency and accurate Bluetooth detection.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present disclosure will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. Several embodiments of the present disclosure are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings, in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Fig. 1 shows a schematic diagram of an implementation flow of a bluetooth test method according to an embodiment of the disclosure;
FIG. 2 shows a schematic diagram of an image to be measured in accordance with an embodiment of the present disclosure;
fig. 3 is a schematic implementation flow diagram of a pentagon detection method according to an embodiment of the disclosure;
FIG. 4 shows a schematic diagram of one implementation scenario of an embodiment of the present disclosure;
fig. 5 shows a second implementation flow diagram of a bluetooth test method according to an embodiment of the disclosure;
fig. 6 is a schematic diagram showing a composition structure of a bluetooth test device according to an embodiment of the present disclosure;
Fig. 7 shows a schematic diagram of a composition structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, features and advantages of the present disclosure more comprehensible, the technical solutions in the embodiments of the present disclosure will be clearly described in conjunction with the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only some embodiments of the present disclosure, but not all embodiments. Based on the embodiments in this disclosure, all other embodiments that a person skilled in the art would obtain without making any inventive effort are within the scope of protection of this disclosure.
Fig. 1 shows a schematic implementation flow diagram of a bluetooth test method according to an embodiment of the disclosure. As shown in fig. 1, according to a first aspect of an embodiment of the present disclosure, there is provided a bluetooth testing method, which is applied to a device under test, and the method includes:
step 101, obtaining a first control instruction and a second control instruction based on a Bluetooth network of a device to be tested, wherein the first control instruction is used for realizing a first peripheral function of the device to be tested under the Bluetooth network, and the second control instruction is used for realizing a second peripheral function of the device to be tested under the Bluetooth network.
The device to be tested receives a first control instruction and a second control instruction from the test device through the Bluetooth network. The device to be tested is an electronic device, such as a smart phone, a tablet computer, a notebook computer, etc., which has a bluetooth function and can be connected with a peripheral device and perform file transmission through the bluetooth function. The device to be tested is an upper computer deployed with Bluetooth test service. Bluetooth test services mainly include human-computer interaction (Human Interface Device, HID) test services and Object Exchange (OBEX) test services. The HID testing service includes sending a first control instruction, a second control instruction, etc. to the device under test. The OBEX service includes exchanging objects such as images and files with the device under test.
The first peripheral function is a bluetooth keyboard function. Correspondingly, the first control instruction is used for controlling the equipment to be tested to realize the preset keyboard operation on the equipment to be tested. The preset keyboard operation may be to type out a preset character, such as "type out 'abcde'", "type out 'test'", etc., and the disclosure is not limited with respect to the specific content of the preset character. If the preset keyboard operation is "make 'abcde'", the first control instruction includes: HID codes mapped by each character in abcde, which keys in the keyboard are required to be pressed, released, etc. to make these characters.
The second external function is a bluetooth mouse function. Accordingly, the second control instruction is configured to control the device to be tested to implement a preset mouse operation on the device to be tested, where the preset mouse operation may be to draw a preset pattern, such as "square", "pentagon", etc., through a mouse function, and specific content of the preset pattern is not limited herein. The second control instruction comprises information such as mouse movement, clicking and releasing required in the preset mouse operation.
Specifically, the bluetooth address of the test device is preset in the device to be tested. After the test is started, if the device to be tested searches the Bluetooth address of the test device, the device to be tested is automatically connected with the test device through Bluetooth. After the test equipment receives the message of successful connection of the Bluetooth, starting an HID test service in the Bluetooth test service, sending a first control instruction and a second control instruction to the equipment to be tested, and receiving the first control instruction and the second control instruction by the equipment to be tested.
Step 102, in response to the first control instruction, obtaining first target data generated based on the first peripheral function.
After receiving the first control instruction, the device to be tested analyzes the first control instruction, understands which keys are pressed or released, and then operates on a corresponding application program or interface to obtain first target data, for example, corresponding characters are input in the notepad according to the first control instruction, and the recognition result of the input characters is the first target data.
And step 103, responding to the second control instruction, and obtaining second target data generated based on a second external function.
After receiving the second control instruction, the device to be tested analyzes the second control instruction, understands information such as the position of the mouse cursor, clicking and releasing the mouse, applies corresponding operation to the user interface, for example, if the analyzed data represents mouse movement, the device to be tested updates the position of the mouse cursor, if the analyzed data represents button clicking, the device to be tested responds to a corresponding button event, and therefore second target data is obtained, for example, corresponding patterns are drawn in a drawing program according to the second control instruction, and the recognition result of the drawn patterns is the second target data.
It will be appreciated that, in practical applications, the present disclosure does not limit the execution sequence of step 102 and step 103, i.e. step 102 may be executed first or step 103 may be executed first after receiving the first control instruction and the second control instruction.
Step 104, based on the first target data, obtaining a test result of whether the first peripheral function of the device to be tested is normal or not in the Bluetooth network.
Specifically, comparing the obtained first target data with preset characters in preset keyboard operation, and if the first target data is consistent with the preset characters, obtaining a test result that the first peripheral function of the device to be tested in the Bluetooth network is normal. If the first target data is inconsistent with the preset character, a test result that the first peripheral function of the device to be tested in the Bluetooth network is abnormal is obtained.
Step 105, based on the second target data, obtaining a test result of whether the second external function and the transmission function of the device to be tested are normal or not in the bluetooth network.
Specifically, comparing the obtained second target data with a preset pattern in a preset mouse operation, and if the second target data is consistent with the preset pattern, obtaining a test result that the second external function of the device to be tested under the Bluetooth network is normal. If the second target data is inconsistent with the preset pattern, a test result that the second external function of the device to be tested under the Bluetooth network is abnormal is obtained.
And sending the second target data to the test equipment in the form of a file through the Bluetooth network. If the file returned by the test equipment is successfully received, a test result that the transmission function of the equipment to be tested is normal under the Bluetooth network is obtained. If the file returned by the test equipment is not successfully received, a test result that the transmission function of the equipment to be tested is abnormal under the Bluetooth network is obtained.
And step 106, determining whether the Bluetooth function of the device to be tested is normal or not based on the test result of whether the first peripheral function, the second peripheral function and the transmission function of the device to be tested are normal or not.
And if the first peripheral function, the second peripheral function and the transmission function of the equipment to be tested are all normal, indicating that the Bluetooth function of the equipment to be tested is normal. And under the condition that other links in the test are normal, if at least one of the first peripheral function, the second peripheral function and the transmission function of the equipment to be tested is abnormal, indicating that the Bluetooth function of the equipment to be tested is abnormal.
The method comprises the steps of firstly obtaining a first control instruction and a second control instruction, and responding to the first control instruction and the second control instruction to respectively obtain first target data and second target data; then, based on the first target data, a test result of whether the first peripheral function of the device to be tested is normal or not is obtained; based on the second target data, obtaining a test result of whether the second external function and the transmission function are normal or not; and finally, determining whether the Bluetooth function of the equipment to be tested is normal or not based on the test results of the first peripheral function, the second peripheral function and the transmission function of the equipment to be tested. The Bluetooth function of the equipment to be tested is automatically detected efficiently and accurately, the whole testing process is automatic operation, and the testing information is easy to reserve and difficult to lose. The method has good flexibility and expandability, and if other Bluetooth functions of the equipment to be tested need to be detected, the corresponding test service is only needed to be added in the test equipment.
In one embodiment of the present disclosure, a device under test and a test device are connected through a bluetooth network; based on a Bluetooth network of the device to be tested, obtaining a first control instruction and a second control instruction comprises: and under the Bluetooth network, receiving a human-computer interface HID data packet from the test equipment, wherein the HID data packet comprises a first control instruction and a second control instruction.
The HID data packet is a data packet obtained by encapsulating data of a preset peripheral operation into a format specified by the HID protocol. The HID data packet includes a first control command and a second control command. Specifically, after the test is started, the test equipment starts the Bluetooth test service, and after the test equipment establishes connection with the equipment to be tested through the Bluetooth network, the test equipment sends an HID data packet to the equipment to be tested through an HID protocol, and the equipment to be tested receives and responds to the first control instruction and the second control instruction.
In one embodiment of the present disclosure, in response to a first control instruction, obtaining first target data generated based on a first peripheral function includes: executing the first control instruction to obtain a first execution result; and identifying the first execution result to obtain first target data.
The method comprises the steps that a first control instruction is analyzed by a device to be tested, which keys are specified to be pressed or released in the first control instruction, corresponding operation is executed on an application interface, and a first execution result is obtained, wherein the first execution result is a character which is beaten on the application interface according to the first control instruction, then character recognition is carried out on the first execution result through a character recognition program deployed in the device to be tested, and the recognition result is used as first target data.
In one embodiment of the present disclosure, based on first target data, obtaining a test result of whether a first peripheral function of a device to be tested is normal in a bluetooth network, includes: comparing whether the first target data are identical to the first preset data or not, and if so, obtaining a test result that the first peripheral function of the device to be tested is normal under the Bluetooth network; if the first peripheral function of the device to be tested is abnormal under the Bluetooth network, the test result is obtained.
The first preset data are preset characters in the preset keyboard operation in the first control instruction, after the equipment to be tested obtains the first target data, the first target data are compared with the first preset data, if the first target data are the same, the first peripheral function of the equipment to be tested is normal, and if the first peripheral function is not the same, the first peripheral function is abnormal.
In one embodiment of the present disclosure, in response to a second control instruction, obtaining second target data generated based on a second external function includes: executing the second control instruction to obtain a second execution result; screenshot is carried out on the second execution result, an image to be tested is obtained, and the image to be tested is used for being identified by test equipment; and determining the identification result of the test equipment on the image to be tested as second target data.
The device to be tested analyzes the second control instruction to obtain a mouse operation corresponding to the second control instruction, executes corresponding mouse operation on the application interface to obtain a second execution result, then captures an application interface comprising the second execution result to obtain an image to be tested, sends the image to be tested to the testing device through the OBEX protocol, deploys an image recognition service in the testing device, recognizes the image to be tested through the image recognition service after receiving the image to be tested, and obtains the second execution result, and then sends the second execution result to the device to be tested.
For example, the second control instruction is "drawing a pentagon", after the device to be tested analyzes the second control instruction, the second control instruction is executed in the drawing software, and a second execution result is obtained after drawing, where the second execution result is a graph drawn in the drawing software according to the second control instruction, then the interface of the drawing software including the second execution result is subjected to screenshot, so as to obtain an image to be tested as shown in fig. 2, and then the image to be tested is sent to the testing device through an OBEX protocol.
Under the condition, the test equipment identifies the image to be tested through a graph detection algorithm, wherein the graph detection algorithm comprises image preprocessing, edge detection and contour extraction, feature matching, classification, decision and the like, the identification result of the obtained image to be tested is what type of graph is included in the image to be tested, and the identification result is the second target data.
In another case, the test device identifies the image to be tested according to an algorithm corresponding to the second control instruction, for example, if the second control instruction is "draw a pentagon", then a pentagon detection algorithm is invoked to identify the image to be tested, as shown in fig. 3, and the specific identification process includes the following steps:
step 301: reading an image to be detected and converting the image to be detected into a gray image;
step 302: and carrying out binarization processing on the gray level image to obtain a binarized image. This helps to emphasize the edges of the object, making the profile of the second execution result easier to detect;
step 303: detecting the outline of the binarized image by using a Canny operator to obtain a Canny edge image;
step 304: and detecting straight lines in the Canny edge image through Hough transformation, and obtaining the angle and the length of each straight line. The hough transform is used to detect a straight line in an image, it transforms the edge coordinates to find the intersection in the parameter space, thus obtaining the angle and length of the straight line;
step 305: for each angle, sequencing all straight lines from long to short according to the length of each straight line;
step 306: and circularly traversing the ordered straight lines, and checking whether the error between the degree of the included angle between the adjacent straight lines and 72 degrees is within a first preset error range. Wherein, the first preset error range can be set to be 2 degrees, the specific numerical value can be set according to the actual situation, if the straight lines are stored in an array to be used as the sides of the potential pentagon;
Step 307: five potential straight lines are selected from the array, the straight lines may form pentagonal edges, distances between five vertexes are calculated according to the endpoints of the edges, and if the error of the ratio of each pair of distances to the golden ratio (1:0.618) is within a second preset error range. The second preset error range may be set to ±0.03, and the specific value may be set according to the actual situation, and a line segment formed by a shorter distance in each pair of distances is considered to be a pentagonal edge;
step 308: if five pentagon edges are found in step 307, then the pentagon is considered to exist in the image to be detected; if no sides of the five pentagons are found in step 307, then it is considered that no pentagons exist in the image to be measured.
Through the steps, the identification result is that pentagons exist or do not exist in the image to be detected.
In one embodiment of the present disclosure, based on the second target data, obtaining a test result of whether a second external function and a transmission function of a device to be tested are normal in a bluetooth network includes: if second target data from the test equipment are received, a test result with normal transmission function of the equipment to be tested under the Bluetooth network is obtained; and comparing whether the second target data is the same as the second preset data or not, and if so, obtaining a test result that the second external function of the device to be tested is normal under the Bluetooth network.
After the test equipment obtains the second target data, the Bluetooth test service sends the second target data to the equipment to be tested in the form of a file through an OBEX protocol, if the equipment to be tested does not receive the second target data sent by the test equipment, the transmission function of the equipment to be tested is abnormal, and if the second target data sent by the test equipment is successfully received, the transmission function of the equipment to be tested is normal.
The second preset data is a preset pattern in the mouse operation preset in the second control instruction, if the second target data is received, the second target data is compared with the second preset data, if the second target data is consistent with the second preset data, the second external function of the equipment to be tested is normal, and if the second target data is inconsistent with the second preset data, the second external function of the equipment to be tested is abnormal.
In an embodiment of the present disclosure, a graphics detection algorithm may also be configured in the device under test, where when the device under test fails to receive the second target data from the test device, that is, the transmission function of the device under test is abnormal, the device under test may detect the image under test through its own image detection algorithm, so as to achieve a test result of the second external function under the condition that the transmission function of the device under test is abnormal.
For better understanding of the foregoing embodiments, a specific implementation scenario is provided below, where, as shown in fig. 4, the device under test includes at least an automated test tool, and the test device includes at least a bluetooth test service and an image recognition service, and a specific test procedure is described in detail in conjunction with fig. 5:
step 501, after the test begins, an automated test tool of the device under test opens the local drawing and notepad.
Step 502, the device to be tested automatically performs bluetooth connection with the test device by searching for the bluetooth address of the test device.
In step 503, the test device starts a bluetooth test service and sends an HID data packet to the device under test.
Step 504, the test device receives and responds to the HID data packet to obtain a first execution result and a second execution result. Specifically, after receiving the HID data packet, the test equipment analyzes to obtain a first control instruction and a second control instruction, and according to the first control instruction, corresponding characters are drawn out on a notepad interface, and the drawn-out characters are a first execution result; drawing a picture on the local drawing interface according to the second control instruction, wherein the drawn picture is a second execution result.
Step 505, performing screenshot on a local drawing interface including the second execution result to obtain an image to be tested, and sending the image to be tested to the test equipment through the OBEX protocol.
Step 506, after receiving the image to be tested, the testing device identifies the image to be tested and sends the identification result to the device to be tested.
Step 507, if the device to be tested receives the identification result of the image to be tested, characterizing that the transmission function of the device to be tested under the bluetooth network is normal, and taking the identification result as second target data; if the identification result of the image to be tested is not received in step 507, it is indicated that the transmission function of the device to be tested under the bluetooth network is abnormal.
Step 508, the device to be tested identifies the first execution result in the notepad, and obtains the first target data.
Step 509, comparing the first target data and the second target data with the first preset data and the second preset data, respectively, to obtain a bluetooth test result of the device to be tested; specifically, if the first target data is the same as the first preset data, the first peripheral function of the device to be tested under the bluetooth network is normal, and if the first target data is different, the first peripheral function of the device to be tested under the bluetooth network is abnormal. Similarly, if the second target data is the same as the second preset data, the second external function of the device to be tested under the Bluetooth network is normal, and if the second target data is different, the second external function of the device to be tested under the Bluetooth network is abnormal. And determining the Bluetooth test result of the device to be tested according to the specific content of the step 105 based on the test results of the first peripheral function, the second peripheral function and the transmission function.
According to another aspect of the present disclosure, there is provided a bluetooth testing apparatus, fig. 6 shows a schematic diagram of a composition structure of a bluetooth testing apparatus according to an embodiment of the present disclosure, as shown in fig. 6, the apparatus includes:
the receiving module 601 is configured to obtain a first control instruction and a second control instruction based on a bluetooth network of a device to be tested, where the first control instruction is used to implement a first peripheral function of the device to be tested under the bluetooth network, and the second control instruction is used to implement a second peripheral function of the device to be tested under the bluetooth network;
a first response module 602, configured to respond to the first control instruction, and obtain first target data generated based on the first peripheral function;
a second response module 603, configured to respond to a second control instruction, and obtain second target data generated based on a second external function;
a first obtaining module 604, configured to obtain a test result of whether a first peripheral function of the device to be tested is normal under the bluetooth network based on the first target data;
a second obtaining module 605, configured to obtain a test result of whether the second external function and the transmission function of the device to be tested are normal under the bluetooth network based on the second target data;
a determining module 606, configured to determine whether the bluetooth function of the device under test is normal based on the test result that whether the first peripheral function, the second peripheral function, and the transmission function of the device under test are normal.
In one embodiment of the present disclosure, the receiving module 601 is further configured to receive, under the bluetooth network, a human interface HID data packet from the test device, where the HID data packet includes a first control instruction and a second control instruction.
In one embodiment of the present disclosure, the first response module 602 is further configured to execute the first control instruction to obtain a first execution result; and identifying the first execution result to obtain first target data.
In one embodiment of the present disclosure, the second response module 603 is further configured to execute a second control instruction to obtain a second execution result; screenshot is carried out on the second execution result, an image to be tested is obtained, and the image to be tested is used for being identified by test equipment; and determining the identification result of the test equipment on the image to be tested as second target data.
In one embodiment of the present disclosure, the first obtaining module 604 is further configured to compare whether the first target data is the same as the first preset data, and if so, obtain a test result that the first peripheral function of the device to be tested is normal in the bluetooth network; if the first peripheral function of the device to be tested is abnormal under the Bluetooth network, the test result is obtained.
In one embodiment of the present disclosure, the second obtaining module 605 is further configured to obtain a test result that the transmission function of the device to be tested is normal in the bluetooth network if second target data from the test device is received; and comparing whether the second target data is the same as the second preset data or not, and if so, obtaining a test result that the second external function of the device to be tested is normal under the Bluetooth network.
In one embodiment of the present disclosure, the determining module 606 is further configured to determine that the bluetooth function of the device under test is normal if the test results of the first peripheral function, the second peripheral function, and the transmission function of the device under test are all normal.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
Fig. 7 illustrates a schematic block diagram of an example electronic device 700 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the apparatus 700 includes a computing unit 701 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 may also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in device 700 are connected to I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, etc.; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, an optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 701 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as a bluetooth test method. For example, in some embodiments, a Bluetooth test method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 700 via ROM 702 and/or communication unit 709. When a computer program is loaded into RAM 703 and executed by computing unit 701, one or more steps of one of the bluetooth test methods described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform a bluetooth test method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems-on-a-chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
The foregoing is merely specific embodiments of the disclosure, but the protection scope of the disclosure is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the disclosure, and it is intended to cover the scope of the disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (7)

1. A bluetooth testing method, wherein the method is applied to a device under test, the method comprising:
based on a Bluetooth network of the equipment to be tested, a first control instruction and a second control instruction are obtained, wherein the first control instruction is used for realizing a first peripheral function of the equipment to be tested under the Bluetooth network, and the second control instruction is used for realizing a second peripheral function of the equipment to be tested under the Bluetooth network;
responding to the first control instruction, and obtaining first target data generated based on the first peripheral function;
responding to the second control instruction, and obtaining second target data generated based on the second external function;
based on the first target data, obtaining a test result of whether a first peripheral function of the device to be tested is normal or not under the Bluetooth network;
based on the second target data, obtaining a test result of whether a second external function and a transmission function of the device to be tested are normal or not under the Bluetooth network;
determining whether a Bluetooth function of the device to be tested is normal or not based on a test result of whether the first peripheral function, the second peripheral function and the transmission function of the device to be tested are normal or not;
The equipment to be tested and the test equipment are connected through the Bluetooth network; the obtaining, based on the bluetooth network of the device to be tested, a first control instruction and a second control instruction includes: under the Bluetooth network, receiving a human-computer interface (HID) data packet from test equipment, wherein the HID data packet comprises the first control instruction and the second control instruction;
the responding to the first control instruction, obtaining first target data generated based on the first peripheral function, includes: executing the first control instruction to obtain a first execution result; identifying the first execution result to obtain the first target data;
the responding to the second control instruction, obtaining second target data generated based on the second external function, includes: executing the second control instruction to obtain a second execution result; screenshot is carried out on the second execution result, and an image to be tested is obtained and is used for being identified by test equipment; and determining the identification result of the test equipment on the image to be tested as the second target data.
2. The method according to claim 1, wherein the obtaining, based on the first target data, a test result of whether the first peripheral function of the device under test is normal in the bluetooth network includes:
Comparing whether the first target data are identical to first preset data or not, and if so, obtaining a test result that the first peripheral function of the device to be tested is normal under the Bluetooth network;
and if the first peripheral function of the equipment to be tested is abnormal under the Bluetooth network, obtaining a test result of abnormal first peripheral function of the equipment to be tested under the Bluetooth network.
3. The method according to claim 1, wherein the obtaining, based on the second target data, a test result of whether the second external function and the transmission function of the device under test are normal in the bluetooth network includes:
if the second target data from the test equipment are received, a test result with normal transmission function of the equipment to be tested under the Bluetooth network is obtained;
and comparing whether the second target data is the same as second preset data or not, and if so, obtaining a test result that the second external function of the device to be tested is normal under the Bluetooth network.
4. The method of claim 1, wherein determining whether the bluetooth function of the device under test is normal based on the test result of whether the first peripheral function, the second peripheral function, and the transmission function of the device under test are normal comprises:
And if the test results of the first peripheral function, the second peripheral function and the transmission function of the equipment to be tested are all normal, determining that the Bluetooth function of the equipment to be tested is normal.
5. A bluetooth testing apparatus, wherein the apparatus is applied to a device under test, the apparatus comprising:
the receiving module is used for obtaining a first control instruction and a second control instruction based on a Bluetooth network of the equipment to be tested, wherein the first control instruction is used for realizing a first peripheral function of the equipment to be tested under the Bluetooth network, and the second control instruction is used for realizing a second peripheral function of the equipment to be tested under the Bluetooth network;
the first response module is used for responding to the first control instruction and obtaining first target data generated based on the first peripheral function;
the second response module is used for responding to the second control instruction and obtaining second target data generated based on the second external function;
the first acquisition module is used for acquiring a test result of whether a first peripheral function of the equipment to be tested is normal or not under the Bluetooth network based on the first target data;
the second acquisition module is used for acquiring a test result of whether a second external function and a transmission function of the equipment to be tested are normal or not under the Bluetooth network based on the second target data;
The determining module is used for determining whether the Bluetooth function of the equipment to be tested is normal or not based on the test result of whether the first peripheral function, the second peripheral function and the transmission function of the equipment to be tested are normal or not;
the receiving module is further configured to receive, under the bluetooth network, a human interface HID data packet from a test device, where the HID data packet includes the first control instruction and the second control instruction, where the device to be tested and the test device are connected through the bluetooth network;
the first response module is further configured to execute the first control instruction to obtain a first execution result; identifying the first execution result to obtain the first target data;
the second response module is further configured to execute the second control instruction to obtain a second execution result; screenshot is carried out on the second execution result, and an image to be tested is obtained and is used for being identified by test equipment; and determining the identification result of the test equipment on the image to be tested as the second target data.
6. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
7. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-4.
CN202311350317.3A 2023-10-18 2023-10-18 Bluetooth testing method and device, electronic equipment and storage medium Active CN117098106B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311350317.3A CN117098106B (en) 2023-10-18 2023-10-18 Bluetooth testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311350317.3A CN117098106B (en) 2023-10-18 2023-10-18 Bluetooth testing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117098106A CN117098106A (en) 2023-11-21
CN117098106B true CN117098106B (en) 2023-12-29

Family

ID=88777208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311350317.3A Active CN117098106B (en) 2023-10-18 2023-10-18 Bluetooth testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117098106B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105392110A (en) * 2015-11-25 2016-03-09 广东欧珀移动通信有限公司 Bluetooth connection reminding method and system for mobile terminal
CN106851678A (en) * 2017-02-15 2017-06-13 Tcl通力电子(惠州)有限公司 Blue tooth productses method of testing and device
CN109245832A (en) * 2018-09-29 2019-01-18 上海与德科技有限公司 Test method, system and the test equipment of bluetooth mould group
WO2019090454A1 (en) * 2017-11-07 2019-05-16 深圳市汇顶科技股份有限公司 Bluetooth test system and method
CN109803248A (en) * 2019-01-24 2019-05-24 深圳尚一互联技术有限公司 A kind of rapid automatized test method of Intelligent bracelet based on BLE4.0
WO2019144681A1 (en) * 2018-01-23 2019-08-01 网易(杭州)网络有限公司 Automated testing method and apparatus, storage medium and electronic device
WO2021119922A1 (en) * 2019-12-16 2021-06-24 深圳市汇顶科技股份有限公司 Bluetooth low energy ble product testing method and ble apparatus
CN114945188A (en) * 2022-05-23 2022-08-26 通力科技股份有限公司 Bluetooth device testing method and device, electronic device and readable storage medium
CN115086855A (en) * 2022-07-20 2022-09-20 荣耀终端有限公司 Test system, method and related device
CN115576829A (en) * 2022-10-26 2023-01-06 平安银行股份有限公司 Application program testing method and device, storage medium and computer equipment
CN115776648A (en) * 2022-11-21 2023-03-10 深圳凯晖电子科技有限公司 Bluetooth broadcasting method and device and computer equipment
CN116028367A (en) * 2023-01-10 2023-04-28 上海中通吉网络技术有限公司 Automatic test system and method
CN116028356A (en) * 2022-12-28 2023-04-28 上海哔哩哔哩科技有限公司 Bluetooth-based terminal software testing method and device
CN116709389A (en) * 2023-07-24 2023-09-05 Oppo广东移动通信有限公司 Test method, system, device and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8467735B2 (en) * 2009-03-23 2013-06-18 Apple Inc. Methods and apparatus for testing and integration of modules within an electronic device
US20120331343A1 (en) * 2011-06-23 2012-12-27 Qualcomm Incorporated Apparatus and method for electronic device testing

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105392110A (en) * 2015-11-25 2016-03-09 广东欧珀移动通信有限公司 Bluetooth connection reminding method and system for mobile terminal
CN106851678A (en) * 2017-02-15 2017-06-13 Tcl通力电子(惠州)有限公司 Blue tooth productses method of testing and device
WO2019090454A1 (en) * 2017-11-07 2019-05-16 深圳市汇顶科技股份有限公司 Bluetooth test system and method
WO2019144681A1 (en) * 2018-01-23 2019-08-01 网易(杭州)网络有限公司 Automated testing method and apparatus, storage medium and electronic device
CN109245832A (en) * 2018-09-29 2019-01-18 上海与德科技有限公司 Test method, system and the test equipment of bluetooth mould group
CN109803248A (en) * 2019-01-24 2019-05-24 深圳尚一互联技术有限公司 A kind of rapid automatized test method of Intelligent bracelet based on BLE4.0
WO2021119922A1 (en) * 2019-12-16 2021-06-24 深圳市汇顶科技股份有限公司 Bluetooth low energy ble product testing method and ble apparatus
CN114945188A (en) * 2022-05-23 2022-08-26 通力科技股份有限公司 Bluetooth device testing method and device, electronic device and readable storage medium
CN115086855A (en) * 2022-07-20 2022-09-20 荣耀终端有限公司 Test system, method and related device
CN115576829A (en) * 2022-10-26 2023-01-06 平安银行股份有限公司 Application program testing method and device, storage medium and computer equipment
CN115776648A (en) * 2022-11-21 2023-03-10 深圳凯晖电子科技有限公司 Bluetooth broadcasting method and device and computer equipment
CN116028356A (en) * 2022-12-28 2023-04-28 上海哔哩哔哩科技有限公司 Bluetooth-based terminal software testing method and device
CN116028367A (en) * 2023-01-10 2023-04-28 上海中通吉网络技术有限公司 Automatic test system and method
CN116709389A (en) * 2023-07-24 2023-09-05 Oppo广东移动通信有限公司 Test method, system, device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
蓝牙网络封装协议的应用及其测试;彭丽平, 鲁冬梅, 王沁;计算机应用研究(第09期);全文 *
蓝牙设备的测试方案探析;沈亮;;现代信息科技(第01期);全文 *

Also Published As

Publication number Publication date
CN117098106A (en) 2023-11-21

Similar Documents

Publication Publication Date Title
CN111553445B (en) Component identification method and device, storage medium and electronic equipment
CN113256583A (en) Image quality detection method and apparatus, computer device, and medium
CN112700440A (en) Object defect detection method and device, computer equipment and storage medium
CN116844177A (en) Table identification method, apparatus, device and storage medium
CN113821433A (en) Method, device, equipment, medium and product for testing cloud mobile phone application program
US20140033097A1 (en) Method and apparatus of testing a computer program
CN117098106B (en) Bluetooth testing method and device, electronic equipment and storage medium
CN113032071B (en) Page element positioning method, page testing method, device, equipment and medium
CN115272381A (en) Metal wire segmentation method and device, electronic equipment and storage medium
CN113313125A (en) Image processing method and device, electronic equipment and computer readable medium
CN116797513A (en) Defect detection method and device, electronic equipment and storage medium
CN114581711A (en) Target object detection method, apparatus, device, storage medium, and program product
CN113378958A (en) Automatic labeling method, device, equipment, storage medium and computer program product
CN113807391A (en) Task model training method and device, electronic equipment and storage medium
CN115953889B (en) Anti-disassembly function detection method, system, device, equipment and storage medium
CN115330869A (en) Visual modeling method, device, equipment and storage medium
CN113836291B (en) Data processing method, device, equipment and storage medium
CN115422555B (en) Back door program detection method and device, electronic equipment and storage medium
CN113344890B (en) Medical image recognition method, recognition model training method and device
CN116501637A (en) Printing test method and device, electronic equipment and storage medium
CN112785567B (en) Map detection method, map detection device, electronic equipment and storage medium
CN115937157A (en) Method and device for identifying test chip in wafer, electronic equipment and storage medium
CN117809064A (en) Equipment label detection method, device, equipment and storage medium
CN116309586A (en) Defect detection method, device, equipment and medium based on convolutional neural network
CN117312171A (en) Code testing method, device, electronic equipment and computer readable 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