CN114630364B - Bluetooth communication detection method, device, terminal and medium - Google Patents

Bluetooth communication detection method, device, terminal and medium Download PDF

Info

Publication number
CN114630364B
CN114630364B CN202210311309.7A CN202210311309A CN114630364B CN 114630364 B CN114630364 B CN 114630364B CN 202210311309 A CN202210311309 A CN 202210311309A CN 114630364 B CN114630364 B CN 114630364B
Authority
CN
China
Prior art keywords
analysis data
bluetooth communication
bluetooth
layer
controller layer
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
CN202210311309.7A
Other languages
Chinese (zh)
Other versions
CN114630364A (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.)
Goertek Inc
Original Assignee
Goertek Inc
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 Goertek Inc filed Critical Goertek Inc
Priority to CN202210311309.7A priority Critical patent/CN114630364B/en
Publication of CN114630364A publication Critical patent/CN114630364A/en
Application granted granted Critical
Publication of CN114630364B publication Critical patent/CN114630364B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/08Testing, supervising or monitoring using real traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/10Scheduling measurement reports ; Arrangements for measurement reports
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

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

Abstract

The application discloses a Bluetooth communication detection method, a device, a terminal and a medium, which are applied to the technical field of Bluetooth communication and comprise the following steps: acquiring a radio frequency signal received by a Bluetooth module of the debugging terminal in the process of Bluetooth communication between the debugging terminal and the test equipment; analyzing the radio frequency signal based on a preset Bluetooth protocol stack to obtain first Bluetooth communication analysis data; and carrying out communication quality analysis based on the first Bluetooth communication analysis data to obtain a Bluetooth communication detection result. That is, the radio frequency signal received by the bluetooth module is acquired at the debug terminal without using a third BT packet capturing tool, and the radio frequency signal is analyzed by presetting a bluetooth protocol stack to obtain analysis data, and then the communication quality analysis is performed to obtain a detection result, so that the bluetooth communication detection cost can be reduced, and the operation difficulty can be reduced.

Description

Bluetooth communication detection method, device, terminal and medium
Technical Field
The present application relates to the field of bluetooth communication technologies, and in particular, to a bluetooth communication detection method, device, terminal, and medium
Background
Due to the complex factory product environment, the influence on wireless signals is large, especially on BT (bluetooth) signals. When BT detection anomalies are encountered, it is often necessary to quickly locate the problem point. In addition to checking error logs, analysis of the BT communication protocol stack may help locate problems more quickly.
Currently, in the process of bluetooth communication detection, a third party BT packet capturing tool is required to capture, the packet capturing tool is connected to a debugging PC, and when the test equipment transmits data through BT, the third party BT packet capturing tool serves as a third party, and can capture the air packet data of BT communication. In this scheme, the requirements on the testing environment are high, a BT packet capturing tool, for example ellisys, is required, the third party BT packet capturing tool needs corresponding hardware dependence, the tool is expensive, and as a third party for BT communication, a link key (i.e. a communication key) of BT communication needs to be input, so that the operation difficulty is increased.
Disclosure of Invention
Accordingly, the present application is directed to a method, apparatus, terminal and medium for bluetooth communication detection, which reduce bluetooth communication detection cost and operation difficulty. The specific scheme is as follows:
In a first aspect, the present application discloses a bluetooth communication detection method, applied to a debug terminal, including:
Acquiring a radio frequency signal received by a Bluetooth module of the debugging terminal in the process of Bluetooth communication between the debugging terminal and the test equipment;
analyzing the radio frequency signal based on a preset Bluetooth protocol stack to obtain first Bluetooth communication analysis data;
and carrying out communication quality analysis based on the first Bluetooth communication analysis data to obtain a Bluetooth communication detection result.
Optionally, the preset bluetooth protocol stack includes a controller layer and a host layer, and the first bluetooth communication analysis data includes first controller layer analysis data and first host layer analysis data;
Correspondingly, the analyzing the radio frequency signal based on the preset bluetooth protocol stack to obtain first bluetooth communication analysis data includes:
Analyzing the radio frequency signals based on the controller layer to obtain analysis data of the first controller layer;
The target controller layer analysis data is sent to the host layer through a preset virtual HCI interface; the target controller layer analysis data are final output data of the controller layer;
And analyzing the target controller layer analysis data based on the host layer to obtain the first host layer analysis data.
Optionally, after the parsing the radio frequency signal based on the controller layer to obtain the first controller layer parsed data, the method further includes:
the target controller layer analysis data are put into a shared memory;
correspondingly, the sending the target controller layer analysis data to the host layer through the preset virtual HCI interface includes:
and reading the target controller layer analysis data from the shared memory through a preset virtual HCI interface, and sending the target controller layer analysis data to the host layer.
Optionally, before the reading the target controller layer analysis data from the shared memory through the preset virtual HCI interface, the method further includes:
reading the unique identifier of the Bluetooth module through a preset virtual HCI interface;
and if the unique identifier is successfully read, locking the unique identifier, and starting the step of reading the target controller layer analysis data from the shared memory through a preset virtual HCI interface.
Optionally, the method further comprises:
Sending target data to the test equipment, and analyzing the target data based on a preset Bluetooth protocol stack to obtain second Bluetooth communication analysis data; the second Bluetooth communication analysis data comprises second host layer analysis data and second controller layer analysis data;
Correspondingly, the communication quality analysis is performed based on the first bluetooth communication analysis data to obtain a bluetooth communication detection result, including:
and carrying out communication quality analysis based on the first Bluetooth communication analysis data and the second Bluetooth communication analysis data to obtain a Bluetooth communication detection result.
Optionally, the analyzing the target data based on the preset bluetooth protocol stack to obtain second bluetooth communication analysis data includes:
Analyzing the target data based on the host layer to obtain analysis data of the second host layer;
The target host layer analysis data is sent to the controller layer through a preset virtual HCI interface; the target host layer analysis data is final output data of the host layer;
and analyzing the target host layer analysis data based on the controller layer to obtain second controller layer analysis data.
Optionally, before the sending the target host layer analysis data to the controller layer through the preset virtual HCI interface, the method further includes:
judging whether the length of the data packet of the target host layer analysis data is larger than a preset threshold value, if so, splitting the data packet.
In a second aspect, the present application discloses a bluetooth communication detection device, applied to a debug terminal, comprising:
the system comprises a radio frequency signal acquisition module, a test device and a test terminal, wherein the radio frequency signal acquisition module is used for acquiring a radio frequency signal received by the Bluetooth module of the test terminal in the process of Bluetooth communication between the test device and the test terminal;
the radio frequency signal analysis module is used for analyzing the radio frequency signal based on a preset Bluetooth protocol stack to obtain first Bluetooth communication analysis data;
And the communication quality analysis module is used for carrying out communication quality analysis based on the first Bluetooth communication analysis data to obtain a Bluetooth communication detection result.
In a third aspect, the application discloses a debug terminal, comprising a processor and a memory; wherein,
The memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the aforementioned bluetooth communication detection method.
In a fourth aspect, the present application discloses a computer readable storage medium storing a computer program, where the computer program when executed by a processor implements the aforementioned bluetooth communication detection method.
In the process of Bluetooth communication between the debugging terminal and the testing equipment, the radio frequency signal received by the Bluetooth module of the debugging terminal is obtained, then the radio frequency signal is analyzed based on a preset Bluetooth protocol stack to obtain first Bluetooth communication analysis data, and finally communication quality analysis is carried out based on the first Bluetooth communication analysis data to obtain a Bluetooth communication detection result. That is, the application does not need to resort to a third BT packet grabbing tool, but obtains the radio frequency signal received by the Bluetooth module at the debugging terminal, presets the Bluetooth protocol stack to analyze the radio frequency signal to obtain analysis data, and then carries out communication quality analysis to obtain a detection result, thus being capable of reducing the Bluetooth communication detection cost and the operation difficulty.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a bluetooth communication detection method provided by the present application;
FIG. 2 is a diagram of a system architecture employed by a prior art Bluetooth communication detection scheme;
Fig. 3 is a system architecture diagram adopted by a bluetooth communication detection scheme provided by the present application;
fig. 4 is a schematic diagram of a specific bluetooth communication detection software framework provided in the present application;
FIG. 5 is a flowchart of a specific data distribution method according to the present application;
FIG. 6 is a schematic diagram of a software state machine according to the present application;
Fig. 7 is a schematic structural diagram of a bluetooth communication detection device according to the present application;
Fig. 8 is a diagram of a debug terminal according to the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Currently, in the process of bluetooth communication detection, a third party BT packet capturing tool is required to capture, the packet capturing tool is connected to a debugging PC, and when the test equipment transmits data through BT, the third party BT packet capturing tool serves as a third party, and can capture the air packet data of BT communication. In addition, the solution has high requirements on the test environment, requires a BT packet capturing tool, such as ellisys, which is expensive, and as a third party for BT communication, requires inputting link key of BT communication, thus increasing the operation difficulty. Therefore, the application provides a Bluetooth communication detection scheme, which can reduce the Bluetooth communication detection cost and the operation difficulty.
Referring to fig. 1, the embodiment of the application discloses a bluetooth communication detection method, which is applied to a debug terminal and comprises the following steps:
Step S11: and acquiring a radio frequency signal received by a Bluetooth module of the debugging terminal in the process of Bluetooth communication between the debugging terminal and the testing equipment.
Wherein the debug terminal includes, but is not limited to, a debug PC (i.e. Personal Computer, personal computer), the test equipment includes, but is not limited to, a Bluetooth headset, etc.
It can be understood that the application realizes the packet grabbing of the bluetooth protocol stack at the debug terminal without using a local BT packet grabbing tool, as shown in fig. 2, fig. 2 is a system architecture diagram adopted by a bluetooth communication detection scheme in the prior art, and the third party BT packet grabbing tool grabs the air data packet when the PC and the test device communicate. Referring to fig. 3, fig. 3 is a system architecture diagram adopted by the bluetooth communication detection scheme provided by the application, so that a third party BT packet capturing tool is optimized, and the original three-party communication is changed into two-party communication.
Step S12: and analyzing the radio frequency signal based on a preset Bluetooth protocol stack to obtain first Bluetooth communication analysis data.
The preset Bluetooth protocol stack comprises a controller layer and a host layer, wherein the controller layer and the host layer both comprise a plurality of Bluetooth protocols and specifications, and the first Bluetooth communication analysis data comprises first controller layer analysis data and first host layer analysis data. In a specific embodiment, the radio frequency signal is analyzed based on the controller layer, so as to obtain the first controller layer analysis data; the target controller layer analysis data is sent to the host layer through a preset virtual HCI interface; the target controller layer analysis data are final output data of the controller layer; and analyzing the target controller layer analysis data based on the host layer to obtain the first host layer analysis data. The first controller layer analysis data comprise analysis data corresponding to each Bluetooth protocol or specification in the controller layer, and the first host layer analysis data comprise analysis data corresponding to each Bluetooth protocol and specification in the host layer.
That is, the bluetooth Protocol stack in the present application includes a controller layer and a host layer, where the controller layer includes an underlying BB (i.e., baseband), LMP (i.e., LINK MANAGER Protocol, link management Protocol), RF (i.e., radio Frequency), AVDTP (AUDIO/VIDEO DIST RIBUTION TRANSPORT PROTOCOL ), AVRCP (i.e., AUDIO vidoe remote control Protocol, AUDIO/video control transport Protocol), L2CAP (i.e., the Logical Link Control and Adaptation Layer Protocol, logical connection control and adaptation Protocol), ACL (i.e., asynchronousConnectionless, asynchronous connectionless link), SCO (i.e., synchronous Connection Oriented, facing synchronous connection). Host layers including GAP (i.e., GENERIC ACCESS Profile universal access application specification), SDP (i.e., service Discovery Protocol, service discovery Protocol), SDAP (Service Discovery Application Profile, service discovery application specification), OPP (i.e., object Push Profile, object storage specification), FTP (i.e., FILE TRANSFER Protocol, file transfer Protocol), A2DP (i.e., advanced Audio Distribution Profile, bluetooth audio transfer model Protocol audio link), HFP (i.e., hands-free Profile, telephone link). The embodiment of the application records the analysis data corresponding to each protocol or specification, thereby realizing the communication quality analysis.
It should be noted that, in the embodiment of the present application, bluetooth communication detection software may be implemented by using software, and bluetooth communication detection is performed by using the software, for example, as shown in fig. 4, fig. 4 is a schematic diagram of a specific bluetooth communication detection software framework provided in the embodiment of the present application. It should be noted that the protocols and specifications in fig. 4 are only exemplary of a portion of the protocols in the controller layer and the host layer, where RFCOMM is a serial linear emulation protocol. In one embodiment, the baseband and the resolution data corresponding to the LMP may be directly obtained by reading the bluetooth module, and other protocols and specifications of the bluetooth protocol stack may be implemented by writing software.
In a specific embodiment, the target controller layer analysis data may be put into the shared memory first; correspondingly, reading the target controller layer analysis data from the shared memory through a preset virtual HCI interface, and sending the target controller layer analysis data to the host layer.
In addition, before the target controller layer analysis data is read from the shared memory through a preset virtual HCI interface, the method further includes: reading the unique identifier of the Bluetooth module through a preset virtual HCI interface; and if the unique identifier is successfully read, locking the unique identifier, and starting the step of reading the target controller layer analysis data from the shared memory through a preset virtual HCI interface.
The unique identifier may be a handle, and if the unique identifier cannot be read, the current bluetooth module is occupied, and abnormal information is returned.
In addition, after the unique identifier is successfully read, the attribute information of the Bluetooth module is read, wherein the attribute information comprises functions supported by Bluetooth, such as music, communication and the like, and if the current data is not the data corresponding to the functions supported by Bluetooth, abnormal information is returned.
Step S13: and carrying out communication quality analysis based on the first Bluetooth communication analysis data to obtain a Bluetooth communication detection result.
In a specific embodiment, target data may be sent to the test device, and the target data may be parsed based on a preset bluetooth protocol stack to obtain second bluetooth communication parsed data; the second Bluetooth communication analysis data comprises second host layer analysis data and second controller layer analysis data; correspondingly, the embodiment of the application can carry out communication quality analysis based on the first Bluetooth communication analysis data and the second Bluetooth communication analysis data to obtain a Bluetooth communication detection result.
For example, referring to fig. 5, fig. 5 is a specific data issuing flowchart disclosed in an embodiment of the present application. In the process of data transmission, firstly, a packet function corresponding to GAP, SDP, headset, rfcomm of a host layer is utilized: gap_send_msg_to_l2cap, dp_write_req, header_check_send_ packet, rfcomm _check_send_packet, and then call the preset virtual HCI interface. virtual_HCI_ DATAWRITE, firstly searching the unique identification (cid) of the Bluetooth module, then searching the corresponding Bluetooth module attribute information (ccb) according to the cid, and returning to L2CAP_CH_FAILED when abnormality occurs. Bluetooth communication is based on cid implementation. If no abnormality exists, the MTU (i.e. Max Transmit Unit, the maximum transmission unit) is detected, and when the data packet sent by the application layer is too long, the data packet is split according to the MTU. And then, judging whether the channel of the current Bluetooth module is crowded or not by checking a L2CAP- > cong _send field, and if so, returning abnormal information, for example, the abnormal information is defined as L2CAP_CH_FAILED. The embodiment of the application can judge whether the current Channel is crowded or not based on the condition of the crowding of the current Channel when the data of the Bluetooth module bottom layer is read, and assign a value to the l2cap- > cong _send field based on the condition of the crowding of the current Channel, so that the field can be read when the data is issued, and whether the current Channel is crowded or not is judged. If not, the data can be sent, the data is sent to the controller layer through the L2CAP_ DATAWRITE function, and the data is directly interacted with computer hardware through the controller layer). Entering the L2cap_ DATAWRITE function marks that the data has been successfully delivered to the L2CAP for processing, and has no relation to the upper layers. After the running of the L2CAP_ DATAWRITE function is finished. The l2cap- > cong _send field is checked again to see if the data was sent successfully. If l2cap- > cong _send is l2cap_ch_ CONGESTED, then l2cap_ch_ CONGESTED is returned, indicating that the current channel is congested, and if l2cap- > cong _send is l2cap_ch_success, l2cap_ch_success is returned, indicating that the data has been successfully transmitted. It should be noted that after the bluetooth module successfully sends out the radio frequency signal, the corresponding signal successful sending information is returned, and the embodiment of the application can assign a value to the l2cap- > cong _send field based on the signal successful sending information.
Further, referring to fig. 6, fig. 6 is a schematic diagram of a software state machine according to an embodiment of the present application, that is, the following states may be defined for the bluetooth communication detection software: CLOSED state (off state), representing an event in which BT Channel is in CLOSED state. This state exists only during Link initial setup of the L2 CAP. Assuming that the L2CAP_CH_DISCONNECT_IND returned by the bottom layer is received, the current Link has been disconnected. The ccb of the current Channel needs to be released. In the open state, if the event is l2cap_ch_connect_cfm, the connection is established, the configuration is completed, and the data stream is being transmitted. That is, embodiments of the present application represent the current communication state by an event. The configuration state, the state machine that the configuration state has realized is as follows: wait_config (i.e., WAIT for configuration), wait_send_config (i.e., SEND configuration WAIT), wait_config_req_rsp (i.e., request for WAIT for acknowledgement), wait_config_rsp (i.e., configure WAIT for acknowledgement), wait_config_req (i.e., configure request), wait_control_ind (i.e., configure CONTROL field). Waiting for a broken link state: when CloseChannelReq (i.e., a close channel request) is received, the wait_disconnect state is entered from the configure state.
It should be noted that, the scheme provided by the embodiment of the application can be applied to BT2.3 protocol and BT4.0 protocol, that is, support classical bluetooth protocol and BLE (that is Bluetooh Low Energy, bluetooth low energy) protocol, etc.
It can be seen that in the process of performing bluetooth communication between a debug terminal and test equipment, the embodiment of the application obtains a radio frequency signal received by a bluetooth module of the debug terminal, then analyzes the radio frequency signal based on a preset bluetooth protocol stack to obtain first bluetooth communication analysis data, and finally performs communication quality analysis based on the first bluetooth communication analysis data to obtain a bluetooth communication detection result. That is, in the embodiment of the application, the radio frequency signal received by the bluetooth module is acquired at the debug terminal without a third BT packet capturing tool, and the radio frequency signal is analyzed by the preset bluetooth protocol stack to obtain analysis data, and then the communication quality analysis is performed to obtain a detection result, so that the bluetooth communication detection cost can be reduced, and the operation difficulty can be reduced.
Referring to fig. 7, an embodiment of the present application discloses a bluetooth communication detection device, which is applied to a debug terminal, and includes:
the radio frequency signal acquisition module 11 is used for acquiring radio frequency signals received by the Bluetooth module of the debugging terminal in the process of Bluetooth communication between the debugging terminal and the test equipment;
The radio frequency signal analysis module 12 is configured to analyze the radio frequency signal based on a preset bluetooth protocol stack to obtain first bluetooth communication analysis data;
And the communication quality analysis module 13 is configured to perform communication quality analysis based on the first bluetooth communication analysis data, so as to obtain a bluetooth communication detection result.
It can be seen that in the process of performing bluetooth communication between a debug terminal and test equipment, the embodiment of the application obtains a radio frequency signal received by a bluetooth module of the debug terminal, then analyzes the radio frequency signal based on a preset bluetooth protocol stack to obtain first bluetooth communication analysis data, and finally performs communication quality analysis based on the first bluetooth communication analysis data to obtain a bluetooth communication detection result. That is, in the embodiment of the application, the radio frequency signal received by the bluetooth module is acquired at the debug terminal without a third BT packet capturing tool, and the radio frequency signal is analyzed by the preset bluetooth protocol stack to obtain analysis data, and then the communication quality analysis is performed to obtain a detection result, so that the bluetooth communication detection cost can be reduced, and the operation difficulty can be reduced.
The preset Bluetooth protocol stack comprises a controller layer and a host layer, and the first Bluetooth communication analysis data comprises first controller layer analysis data and first host layer analysis data;
correspondingly, the radio frequency signal analysis module 12 includes:
the first controller layer analysis submodule is used for analyzing the radio frequency signals based on the controller layer to obtain analysis data of the first controller layer;
the target controller layer analysis data transmitting sub-module is used for transmitting the target controller layer analysis data to the host layer through a preset virtual HCI interface; the target controller layer analysis data are final output data of the controller layer;
And the first host layer analysis submodule is used for analyzing the target controller layer analysis data based on the host layer to obtain the first host layer analysis data.
Further, the apparatus further comprises:
The target analysis data storage module is used for placing the analysis data of the target controller layer into a shared memory;
Correspondingly, the target analysis data sending sub-module is specifically configured to read the target controller layer analysis data from the shared memory through a preset virtual HCI interface, and send the target controller layer analysis data to the host layer.
The unique identification reading module is used for reading the unique identification of the Bluetooth module through a preset virtual HCI interface; and if the unique identifier is successfully read, locking the unique identifier, and starting a target analysis data transmission submodule to execute the step of reading the target controller layer analysis data from the shared memory through a preset virtual HCI interface.
Further, the device further comprises:
the target data sending module is used for sending target data to the test equipment;
the target data analysis module is used for analyzing the target data based on a preset Bluetooth protocol stack to obtain second Bluetooth communication analysis data; the second Bluetooth communication analysis data comprises second host layer analysis data and second controller layer analysis data;
correspondingly, the communication quality analysis module 13 is specifically configured to:
and carrying out communication quality analysis based on the first Bluetooth communication analysis data and the second Bluetooth communication analysis data to obtain a Bluetooth communication detection result.
Further, the target data parsing module includes:
The second host layer analysis submodule is used for analyzing the target data based on the host layer to obtain second host layer analysis data;
The target host layer analysis data transmitting sub-module is used for transmitting the target host layer analysis data to the controller layer through a preset virtual HCI interface; the target host layer analysis data is final output data of the host layer;
And the second controller layer analysis module is used for analyzing the target host layer analysis data based on the controller layer to obtain the second controller layer analysis data.
Further, the device further includes a threshold value judging module, configured to judge, before the target host layer analysis data sending sub-module sends the target host layer analysis data to the controller layer through a preset virtual HCI interface, whether a packet length of the target host layer analysis data is greater than a preset threshold value, and if yes, split the packet.
Referring to fig. 8, an embodiment of the present application discloses a debug terminal 20 including a processor 21 and a memory 22; wherein the memory 22 is used for storing a computer program; the processor 21 is configured to execute the computer program, and the bluetooth communication detection method disclosed in the foregoing embodiment.
For the specific process of the bluetooth communication detection method, reference may be made to the corresponding content disclosed in the foregoing embodiment, and no further description is given here.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk or an optical disk, and the storage mode may be transient storage or permanent storage.
In addition, the debug terminal 20 further comprises a power supply 23, a communication interface 24, an input-output interface 25 and a communication bus 26; wherein, the power supply 23 is used for providing working voltage for each hardware device on the debug terminal 20; the communication interface 24 can create a data transmission channel between the debug terminal 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
Further, the embodiment of the application also discloses a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to realize the Bluetooth communication detection method disclosed in the previous embodiment.
For the specific process of the bluetooth communication detection method, reference may be made to the corresponding content disclosed in the foregoing embodiment, and no further description is given here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The method, the device, the terminal and the medium for detecting Bluetooth communication provided by the application are described in detail, and specific examples are applied to the description of the principle and the implementation mode of the application, and the description of the above examples is only used for helping to understand the method and the core idea of the application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (8)

1. The Bluetooth communication detection method is characterized by being applied to a debugging terminal and comprising the following steps of:
Acquiring a radio frequency signal received by a Bluetooth module of the debugging terminal in the process of Bluetooth communication between the debugging terminal and the test equipment;
analyzing the radio frequency signal based on a preset Bluetooth protocol stack to obtain first Bluetooth communication analysis data;
carrying out communication quality analysis based on the first Bluetooth communication analysis data to obtain a Bluetooth communication detection result;
The preset Bluetooth protocol stack comprises a controller layer and a host layer, wherein the controller layer and the host layer both comprise a plurality of Bluetooth protocols and specifications; the first Bluetooth communication analysis data comprises first controller layer analysis data and first host layer analysis data; the first controller layer analysis data comprises analysis data corresponding to each Bluetooth protocol or specification in the controller layer, and the first host layer analysis data comprises analysis data corresponding to each Bluetooth protocol and specification in the host layer;
the analyzing the radio frequency signal based on the preset bluetooth protocol stack to obtain first bluetooth communication analysis data comprises the following steps:
Analyzing the radio frequency signals based on the controller layer to obtain analysis data of the first controller layer;
The target controller layer analysis data is sent to the host layer through a preset virtual HCI interface; the target controller layer analysis data are final output data of the controller layer;
And analyzing the target controller layer analysis data based on the host layer to obtain the first host layer analysis data.
2. The bluetooth communication detection method according to claim 1, further comprising, after the parsing of the radio frequency signal based on the controller layer, obtaining the first controller layer parsed data:
the target controller layer analysis data are put into a shared memory;
correspondingly, the sending the target controller layer analysis data to the host layer through the preset virtual HCI interface includes:
and reading the target controller layer analysis data from the shared memory through a preset virtual HCI interface, and sending the target controller layer analysis data to the host layer.
3. The bluetooth communication detection method according to claim 2, further comprising, before the reading the target controller layer resolution data from the shared memory through a preset virtual HCI interface:
reading the unique identifier of the Bluetooth module through a preset virtual HCI interface;
and if the unique identifier is successfully read, locking the unique identifier, and starting the step of reading the target controller layer analysis data from the shared memory through a preset virtual HCI interface.
4. The bluetooth communication detection method according to claim 1, further comprising:
Sending target data to the test equipment, and analyzing the target data based on a preset Bluetooth protocol stack to obtain second Bluetooth communication analysis data; the second Bluetooth communication analysis data comprises second host layer analysis data and second controller layer analysis data;
Correspondingly, the communication quality analysis is performed based on the first bluetooth communication analysis data to obtain a bluetooth communication detection result, including:
Carrying out communication quality analysis based on the first Bluetooth communication analysis data and the second Bluetooth communication analysis data to obtain a Bluetooth communication detection result;
Analyzing the target data based on a preset Bluetooth protocol stack to obtain second Bluetooth communication analysis data, wherein the method comprises the following steps:
Analyzing the target data based on the host layer to obtain analysis data of the second host layer;
The target host layer analysis data is sent to the controller layer through a preset virtual HCI interface; the target host layer analysis data is final output data of the host layer;
and analyzing the target host layer analysis data based on the controller layer to obtain second controller layer analysis data.
5. The bluetooth communication detection method according to claim 4, further comprising, before the sending the target host layer resolution data to the controller layer through a preset virtual HCI interface:
judging whether the length of the data packet of the target host layer analysis data is larger than a preset threshold value, if so, splitting the data packet.
6. A bluetooth communication detection device, characterized in that it is applied to a debug terminal, comprising:
the system comprises a radio frequency signal acquisition module, a test device and a test terminal, wherein the radio frequency signal acquisition module is used for acquiring a radio frequency signal received by the Bluetooth module of the test terminal in the process of Bluetooth communication between the test device and the test terminal;
the radio frequency signal analysis module is used for analyzing the radio frequency signal based on a preset Bluetooth protocol stack to obtain first Bluetooth communication analysis data;
the communication quality analysis module is used for carrying out communication quality analysis based on the first Bluetooth communication analysis data to obtain a Bluetooth communication detection result;
The preset Bluetooth protocol stack comprises a controller layer and a host layer, wherein the controller layer and the host layer both comprise a plurality of Bluetooth protocols and specifications; the first Bluetooth communication analysis data comprises first controller layer analysis data and first host layer analysis data; the first controller layer analysis data comprises analysis data corresponding to each Bluetooth protocol or specification in the controller layer, and the first host layer analysis data comprises analysis data corresponding to each Bluetooth protocol and specification in the host layer;
correspondingly, the radio frequency signal analysis module comprises:
the first controller layer analysis submodule is used for analyzing the radio frequency signals based on the controller layer to obtain analysis data of the first controller layer;
the target controller layer analysis data transmitting sub-module is used for transmitting the target controller layer analysis data to the host layer through a preset virtual HCI interface; the target controller layer analysis data are final output data of the controller layer;
And the first host layer analysis submodule is used for analyzing the target controller layer analysis data based on the host layer to obtain the first host layer analysis data.
7. A debug terminal, comprising a processor and a memory; wherein,
The memory is used for storing a computer program;
the processor for executing the computer program to implement the bluetooth communication detection method according to any one of claims 1 to 5.
8. A computer readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the bluetooth communication detection method according to any one of claims 1 to 5.
CN202210311309.7A 2022-03-28 2022-03-28 Bluetooth communication detection method, device, terminal and medium Active CN114630364B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210311309.7A CN114630364B (en) 2022-03-28 2022-03-28 Bluetooth communication detection method, device, terminal and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210311309.7A CN114630364B (en) 2022-03-28 2022-03-28 Bluetooth communication detection method, device, terminal and medium

Publications (2)

Publication Number Publication Date
CN114630364A CN114630364A (en) 2022-06-14
CN114630364B true CN114630364B (en) 2024-05-24

Family

ID=81904304

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210311309.7A Active CN114630364B (en) 2022-03-28 2022-03-28 Bluetooth communication detection method, device, terminal and medium

Country Status (1)

Country Link
CN (1) CN114630364B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105103618A (en) * 2012-10-22 2015-11-25 尼尔森(美国)有限公司 Systems and methods for wirelessly modifying detection characteristics of portable devices
CN110121163A (en) * 2019-04-30 2019-08-13 努比亚技术有限公司 Registration handling method, communication equipment and storage medium
CN111683357A (en) * 2020-05-25 2020-09-18 杭州寰星电子科技有限公司 Method, device and equipment for transmitting audio by using low-power-consumption Bluetooth
CN112969195A (en) * 2021-02-23 2021-06-15 深圳市汇顶科技股份有限公司 Signal quality detection method and related equipment
CN113285768A (en) * 2021-04-21 2021-08-20 思澈科技(上海)有限公司 Bluetooth development platform and testing method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743549B (en) * 2014-12-10 2019-02-01 展讯通信(上海)有限公司 User terminal and its audio bluetooth playback method, digital signal processor
TWI653848B (en) * 2018-05-04 2019-03-11 立創智能股份有限公司 Remote Bluetooth connection system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105103618A (en) * 2012-10-22 2015-11-25 尼尔森(美国)有限公司 Systems and methods for wirelessly modifying detection characteristics of portable devices
CN110121163A (en) * 2019-04-30 2019-08-13 努比亚技术有限公司 Registration handling method, communication equipment and storage medium
CN111683357A (en) * 2020-05-25 2020-09-18 杭州寰星电子科技有限公司 Method, device and equipment for transmitting audio by using low-power-consumption Bluetooth
CN112969195A (en) * 2021-02-23 2021-06-15 深圳市汇顶科技股份有限公司 Signal quality detection method and related equipment
CN113285768A (en) * 2021-04-21 2021-08-20 思澈科技(上海)有限公司 Bluetooth development platform and testing method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于嵌入式Linux蓝牙协议栈的应用研究-HCI分析与设计;宁禄乔;万方学位论文;论文第2-3章 *

Also Published As

Publication number Publication date
CN114630364A (en) 2022-06-14

Similar Documents

Publication Publication Date Title
CN113395687B (en) Reconnection method, reconnection device, electronic equipment and storage medium
US20210345081A1 (en) Extended connection method and extended connection system for bluetooth devices
US20180091581A1 (en) Method of switching download mode, control method thereof and control system thereof
CN112119673B (en) Electronic device supporting multiple wireless communication protocols and method thereof
US20230082566A1 (en) Data blind retransmission method and apparatus, storage medium, and terminal device
KR20210020541A (en) Electronic device for retransmitting data in bluetooth network environment and method thereof
CN112203179B (en) TWS earphone, automatic reconnection method and device thereof, and computer storage medium
CN111866997A (en) WPS connection-based network distribution method, network to be distributed equipment and storage medium
CN113473435B (en) Bluetooth-based device connection method and device, electronic device and storage medium
CN103413091B (en) The method for supervising of malicious act and device
CN114630364B (en) Bluetooth communication detection method, device, terminal and medium
CN112235677B (en) Master-slave switching method of wireless earphone, wireless earphone and readable storage medium
CN110891260A (en) Bluetooth connection method, equipment, terminal, system and storage medium
CN111586521A (en) Auxiliary playing device, control method and control device thereof, and readable storage medium
CN115580944A (en) Audio device connection method and device, storage medium and device
CN114050917A (en) Audio data processing method, device, terminal, server and storage medium
CN113453208A (en) Equipment screen saver unlocking method, device and system based on Bluetooth communication
US9504045B2 (en) Bluetooth service estimation apparatus and bluetooth service estimation method thereof
CN115134786A (en) Bluetooth connection blocking method, device, equipment and storage medium
CN116017201B (en) Lossless information monitoring method and device based on Bluetooth car key system
CN116131969A (en) Verification test platform and verification test method for Bluetooth TWS (time and wavelength service) function
CN116684467B (en) Data acquisition method, electronic device and storage medium
CN112866966B (en) Wireless communication and information processing method, system, equipment and storage medium
CN113938349B (en) Wireless industrial bus communication method and system
CN117061638B (en) Message transmission method, device, storage medium, equipment and system

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