CN114666438A - Bluetooth communication method, data receiving terminal, Bluetooth communication system, medium, and device - Google Patents

Bluetooth communication method, data receiving terminal, Bluetooth communication system, medium, and device Download PDF

Info

Publication number
CN114666438A
CN114666438A CN202011538265.9A CN202011538265A CN114666438A CN 114666438 A CN114666438 A CN 114666438A CN 202011538265 A CN202011538265 A CN 202011538265A CN 114666438 A CN114666438 A CN 114666438A
Authority
CN
China
Prior art keywords
data
bluetooth
sending end
receiving end
data sending
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.)
Granted
Application number
CN202011538265.9A
Other languages
Chinese (zh)
Other versions
CN114666438B (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.)
Yidu Cloud Beijing Technology Co Ltd
Original Assignee
Yidu Cloud Beijing 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 Yidu Cloud Beijing Technology Co Ltd filed Critical Yidu Cloud Beijing Technology Co Ltd
Priority to CN202011538265.9A priority Critical patent/CN114666438B/en
Priority claimed from CN202011538265.9A external-priority patent/CN114666438B/en
Publication of CN114666438A publication Critical patent/CN114666438A/en
Application granted granted Critical
Publication of CN114666438B publication Critical patent/CN114666438B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones
    • H04M1/727Identification code transfer arrangements
    • 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

Landscapes

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

Abstract

The disclosure relates to the technical field of information processing, and provides a Bluetooth communication method, a data receiving end, a Bluetooth communication system, a computer readable storage medium and an electronic device. Wherein, the method comprises the following steps: detecting the screen brightness of a data receiving end in response to the application of the data sending end being in a background mode; and if the screen brightness of the data receiving end is greater than zero, receiving the Bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end. The scheme solves the problem that the Bluetooth data cannot be scanned and received when the application of the data sending end is in a background mode.

Description

Bluetooth communication method, data receiving terminal, Bluetooth communication system, medium, and device
Technical Field
The present disclosure relates to the field of information processing technologies, and in particular, to a bluetooth communication method, a data receiving end, a bluetooth communication system, and a computer readable medium and an electronic device for implementing the bluetooth communication method.
Background
Data exchange via bluetooth communication is a convenient short-range communication method, and can also be used as a close contact (short for close contact) tracking method, and has attracted much attention due to its low cost. For example, during epidemic situations caused by new coronavirus, close tracking can be conveniently realized by using a low-power Bluetooth communication mode.
In the prior art, when a device equipped with a first type of operating system is used as a data sending end, if a related application performs bluetooth broadcast in a background mode, because bluetooth broadcast data is placed in a special overflow area, the data broadcasted by the application through bluetooth cannot be scanned and read by any data receiving end (including devices of the same type of operating system as the data sending end and devices of different types of operating systems as the data sending end). Therefore, it is necessary to provide a new bluetooth communication method to solve the above problems.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a bluetooth communication method, a data receiving end, a bluetooth communication system, a computer-readable storage medium, and an electronic device, and further to a method for solving a problem that data broadcasted through bluetooth cannot be scanned and read by other devices when an application of a device equipped with a first type of operating system is in a background mode when the device is used as a data transmitting end.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a bluetooth communication method, the method comprising:
detecting the screen brightness of a data receiving end in response to the application of the data sending end being in a background mode;
and if the screen brightness of the data receiving end is greater than zero, receiving the Bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the method further includes:
and if the screen brightness of the signal receiving end is equal to zero, the screen brightness of the data receiving end is larger than zero by calling an application interface of local notification.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the receiving bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end includes:
if the data receiving end is configured to be the first type of operating system, performing directional scanning based on the service UUID of the Bluetooth data sent by the data sending end to obtain the Bluetooth data sent by the data sending end.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the determining a data receiving manner based on the system type of the data receiving end and the service differentiating code of the data sending end includes:
if the data receiving end is configured to be an operating system of a second type, carrying out global scanning to obtain a Bluetooth data packet; and performing first screening on the Bluetooth data packet according to the service UUID of the data sending end to obtain Bluetooth data sent by the data sending end.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the performing a first screening on the bluetooth packet according to the service UUID of the data sending end includes:
determining the position information of the target character according to the service UUID of the data sending end to obtain standard position information; acquiring the position information of the target character in the Bluetooth data packet to obtain candidate position information; and screening the Bluetooth data packet by comparing the standard position information with the candidate position information.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, before the first screening is performed on the bluetooth packet according to the service UUID of the data sending end, the method further includes: and performing second screening on the Bluetooth data packet by judging whether the Bluetooth data packet contains the identifier of the data sending end or not so as to obtain the data of the overflow area in the data sending end.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the target character is a binary character, where obtaining the position information of the target character in the bluetooth data packet to obtain candidate position information includes: and converting the data of the overflow area in the data sending end into intermediate data in a binary form, and acquiring the position information of the target character in the intermediate data to obtain the candidate position information.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the application of the data sending end is in a background mode, including: the data sending end is in a desktop state, other applications installed on the data sending end are in a foreground mode, or the data sending end is in a black screen state.
According to a second aspect of the present disclosure, there is provided a data receiving end, including:
a detection module configured to: detecting the screen brightness of a data receiving end in response to the application of the data sending end being in a background mode; a receiving module configured to: and if the screen brightness of the data receiving end is greater than zero, receiving the Bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end.
According to a third aspect of the present disclosure, there is provided a bluetooth communication system comprising: a data receiving end and a data transmitting end; wherein the data transmitting end is configured to: bluetooth sends Bluetooth data; the data receiving end is configured to: detecting the screen brightness of a data receiving end in response to the application of the data sending end being in a background mode; and if the screen brightness of the data receiving end is larger than zero, receiving the Bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end.
According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the bluetooth communication method as described in the first aspect of the embodiments above.
According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; and storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the bluetooth communication method as described in the first aspect of the embodiments above.
As can be seen from the foregoing technical solutions, the bluetooth communication method, the data receiving end, the bluetooth communication system, and the computer-readable storage medium and the electronic device for implementing the bluetooth communication method in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
in the technical solutions provided in some embodiments of the present disclosure, when the application of the data sending end installed with the first type of operating system is in the background mode, the screen brightness of the data receiving end is detected first, and then, when it is determined that the screen brightness is greater than zero, the bluetooth data is received based on the system type of the data receiving end and the service UUID of the data sending end. Therefore, the problem that the Bluetooth data cannot be scanned and received when the application of the data sending end is in a background mode is solved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 shows a flow diagram of a bluetooth communication method in an exemplary embodiment of the present disclosure;
FIG. 2 illustrates a schematic diagram of a Bluetooth communication scenario in an exemplary embodiment of the present disclosure;
fig. 3 is a schematic flow chart illustrating a method for receiving bluetooth data according to an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating a method for screening bluetooth data according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating a screening method of bluetooth data according to another embodiment of the present disclosure;
fig. 6 is a schematic diagram illustrating a structure of a data receiving end in an exemplary embodiment of the present disclosure;
fig. 7 shows a schematic structural diagram of a bluetooth communication system in an exemplary embodiment of the present disclosure;
FIG. 8 shows a schematic structural diagram of a computer-readable storage medium in an exemplary embodiment of the present disclosure; and the number of the first and second groups,
fig. 9 shows a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
The terms "a," "an," "the," and "said" are used in this specification to denote the presence of one or more elements/components/parts/etc.; the terms "comprising" and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. other than the listed elements/components/etc.; the terms "first" and "second", etc. are used merely as labels, and are not limiting on the number of their objects.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
In the bluetooth communication process, the method generally includes: a data sending end (also called a peripheral end and a broadcasting end) and a data receiving end (also called a central end and a scanning end). Wherein, the data sending end mainly broadcasts (sends) data; the central end mainly performs data scanning (reception). For example, if bluetooth of the mobile phone is used to implement the contact tracking, the mobile phone will start broadcasting and scanning simultaneously, i.e. the peripheral end and the central end.
In the prior art, because the device installed with the first type of operating system is used as a data sending end, and when the related application performs bluetooth broadcasting in the background mode, data broadcasted by the application through bluetooth cannot be scanned and read by any data receiving end (including devices of the same type of operating system as the data sending end and devices of different types of operating systems as the data sending end). An Operating System (OS) is a computer program that manages hardware and software resources in a related device. In the devices with different types of operating systems, different management modes are respectively adopted to manage hardware and software resources in the respective devices.
For example, according to the actual measurement situation, the peripheral operating system is the mobile phone a of the first type operating system, and when the application is in the background mode for performing bluetooth broadcasting, the central operating system is the mobile phone B of the first type operating system, which cannot scan and normally acquire data in the black screen state. The central-end operating system is the mobile phone C of the second type of operating system, and cannot scan and normally acquire data even in the black screen state. If global scanning is performed on the mobile phone D whose central-end operating system is the first type of operating system, data cannot be normally acquired. If the service UUID of the peripheral end is adopted for directional scanning, the data cannot be normally acquired.
The Service UUID (Service universal Unique Identifier, Service differentiating code) is a Service differentiating code used when the peripheral (data sending end) performs bluetooth broadcast, and the length of the Service differentiating code is generally 16 bits and is generally represented as 4 hexadecimal characters, such as "FE 35". The method comprises the following steps that a central terminal (a data receiving terminal) uses Bluetooth scanning with a Service UUID as directional scanning, and only Bluetooth broadcast information containing the Service UUID can be scanned; the central end (data receiving end) uses the Bluetooth scanning without the Service UUID as global scanning, and can scan all Bluetooth broadcast information around the central end (data receiving end).
In an embodiment of the present disclosure, a bluetooth communication method is first provided, which overcomes, at least to some extent, the above-mentioned drawbacks of the related art.
The bluetooth communication method provided by the embodiment of the present disclosure may be executed by a server, for example, the server acquires whether an application of a data sending end is in a background mode, and if so, detects screen brightness of a data receiving end; and under the condition that the screen brightness of the data receiving end is greater than zero, performing related processing according to the system type of the data receiving end and the service distinguishing code of the data sending end, so that the data receiving end can receive the Bluetooth data sent by the data sending end.
The bluetooth communication method provided by the embodiment of the present disclosure may also be executed by a mobile terminal serving as a data receiving end in bluetooth communication. Fig. 1 is a flowchart illustrating a bluetooth communication method in an exemplary embodiment of the present disclosure, where the bluetooth communication method provided in this embodiment is applied to a terminal device serving as a data receiving end in a bluetooth communication process. Referring to fig. 1, the method includes:
step S110, responding to the application of the data sending end in a background mode, and detecting the screen brightness of the data receiving end;
step S120, judging whether the screen brightness of the data receiving end is greater than zero; and (c) a second step of,
and executing step S130 when the screen brightness of the data receiving end is greater than zero, and receiving the bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end.
In the technical solution provided in the embodiment shown in fig. 1, under the condition that the application of the data sending end is in the background mode, the screen brightness of the data receiving end is detected first, and then, under the condition that the screen brightness is judged to be greater than zero, the bluetooth data is received based on the system type of the data receiving end and the service UUID of the data sending end. Therefore, the problem that the Bluetooth data cannot be scanned and received when the application of the data sending end is in a background mode is solved.
In an exemplary embodiment, the data transmitting end refers to a mobile terminal installed with a first type of operating system. Therefore, the technical scheme can effectively solve the problem that the Bluetooth data cannot be scanned and received by other terminals when the application of the mobile terminal provided with the first type of operating system is in the background mode.
In an exemplary embodiment, the application of the data sender is in a background mode, which includes the following situations: the data sending end is in a desktop state, other applications installed on the data sending end are in a foreground mode, and the data sending end is in a black screen state. The foreground mode refers to a state that a target App in the mobile terminal is in a full-screen running state or is directly used by a user.
That is, the target application performing bluetooth communication is not running in the foreground of the data transmitting end. Referring to fig. 2, for example, a user wants to share voice played in the multimedia player software a1 installed in the data sender 21 to other terminals (such as the terminal 22 installed with the second type of operating system and the terminal 23 installed with the first type of operating system) through bluetooth, but the multimedia player software a1 is in a background mode, such as the data sender 21 is in a desktop state, other applications B1 installed in the data sender 21 are in a foreground mode, or the data sender 21 is in a black screen state. As can be seen from the foregoing, the terminal 23 equipped with the first type of operating system cannot be scanned and cannot normally acquire the voice data shared by the data transmitting terminal 21 in the black screen state, and the terminal 22 equipped with the second type of operating system cannot be scanned and cannot normally acquire the data in the black screen state. The following describes a specific technical solution to solve the technical problem:
in an exemplary embodiment, in response to the application at the data sending end being in the background mode, for example, when the data receiving end cannot scan the target bluetooth data, the screen brightness at the data receiving end is detected. In order to realize that the bluetooth data is smoothly scanned and received by the data receiving end, the data receiving end needs to be regularly lightened. That is, if the screen brightness of the signal receiving end is equal to zero, step S140 is executed: and the screen brightness of the data receiving end is larger than zero by calling an application interface of the local notification.
In an exemplary embodiment, the manner of the screen-brightening process may be directly calling an API (Application Programming Interface) implementation for realizing the screen-brightening. For the mobile terminal installed with the first type of operating system not containing the directly-invokable API for realizing the bright screen, the local notification API can be invoked. For example, sending a local notification message may effect a bright screen on the data receiving end. However, to avoid the local notification message disturbing the user, the API may be called again after a short time (e.g., no more than 1 second) to undo. Wherein, the local notification means that if the notification bar message directly sent by the App is a local notification in the first type operating system or the second type operating system; correspondingly, the notification bar message sent by the App's backend server is a remote notification.
For example, after the screen-up process, the data receiving end performs bluetooth scanning to scan the bluetooth data broadcast by the data sending end and realize data reading.
In an exemplary embodiment, after the screen-up process, the scan reception manner of the bluetooth data is different according to the operating system. Fig. 3 is a flowchart illustrating a method for receiving bluetooth data according to an embodiment of the present disclosure, and referring to fig. 3, the method includes the following steps:
in step S310, the operation type of the data receiving end is determined. If the operating system is the same as the operating system of the first type of the data sending end, step S320 is executed, and directional scanning is performed based on the service UUID of the bluetooth data sent by the data sending end, so as to obtain the bluetooth data sent by the data sending end. Referring to fig. 2, that is, for the terminal 23 installed with the first type of operating system, if its screen brightness is greater than zero (indicating a non-black screen state), bluetooth scanning may be performed in a directional scanning manner with a Service UUID. The Service UUID is a Service UUID of the bluetooth data broadcast by the data sending end 21. Through the directional scanning, the terminal 23 can receive the voice played in the multimedia playing software a1 in the data sending end 21.
Therefore, even if the application of the data sending end is in the background mode, the data receiving end provided with the first type of operating system can successfully receive the Bluetooth data based on the technical scheme, and the technical problem that the equipment provided with the first type of operating system cannot successfully receive the Bluetooth data when the equipment serves as the data sending end and the related application is used for Bluetooth broadcasting in the background mode.
In an exemplary embodiment, if the data receiving end is installed with a second type of operating system different from the data transmitting end, steps S330 to S360 are performed.
In step S330, the data receiving end performs global scanning to obtain a bluetooth data packet. Since the data receiving end performs scanning without the service UUID, the data receiving end scans all bluetooth broadcast information around the terminal. Further, these bluetooth broadcast messages need to be filtered to obtain the bluetooth data sent by the data sending end. In this embodiment, the bluetooth packets (i.e. all bluetooth broadcast information around the terminal) are screened by determining whether the identifier of the data sending end is included in the bluetooth packets (referred to as "second screening").
Referring to fig. 3, in step S340, it is determined whether the identifier of the data sender is included in the bluetooth packet. And discarding the bluetooth data not containing the identifier of the data sending end, i.e. executing step S360: the current bluetooth packet is discarded and the next bluetooth packet is processed. Therefore, the number of the Bluetooth data after global scanning is effectively reduced, the speed of determining the target Bluetooth data is accelerated, and the data processing efficiency is improved.
In an exemplary embodiment, the bluetooth data containing the identifier of the data sender is further filtered (denoted as "first filter"). Namely, step S350 is executed: and performing first screening on the Bluetooth data packet according to the service UUID of the data sending end to obtain Bluetooth data sent by the data sending end.
Exemplarily, fig. 4 shows a schematic flow chart of performing the first screening according to an embodiment of the present disclosure, and referring to fig. 4, the embodiment of performing the first screening may include:
step S410, determining the position information of the target character according to the service UUID of the data sending end to obtain standard position information; step S420, acquiring the position information of the target character in the Bluetooth data packet to obtain candidate position information; and step S430, screening the Bluetooth data packet by comparing the standard position information with the candidate position information.
In an exemplary embodiment, the data sending end is installed with a first type of operating system, and an application in the device for performing bluetooth communication is in a background mode, and meanwhile, when the data receiving end is a device with a different type of operating system from the data sending end, a corresponding bluetooth communication specific implementation manner is as follows (i.e., a specific implementation manner of step S330 to step S360):
1. the data receiving end installed with the second type of operating system performs global scanning, and the called API obtains a binary bluetooth packet (step S330). Binary data may first be converted to a hexadecimal string format.
Referring to fig. 5, a hexadecimal character string such as a certain bluetooth data packet may be represented as "02011 a020A0C0BFF4C001006031E2B5BA39F 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".
2. In the hexadecimal string representing the bluetooth packet acquired in the previous step, it is determined whether the identifier of the data transmitting end is included (step S340). For example, the identifier of the data sending end may be denoted as "FF 4C 001", and then it is checked whether the sub-string "FF 4C 001" is included in the hexadecimal string used to represent the bluetooth packet.
For example, the bluetooth packet includes an identifier of the sender (i.e., the substring), which indicates that the bluetooth packet is bluetooth data broadcast by the sender, and further, in view of that when the application performs bluetooth broadcast in the background mode, the bluetooth broadcast data may be placed in a special overflow area of the sender, the overflow area is further located in the substring to obtain the target bluetooth data.
In this embodiment, the overflow (overflow) area is located in the following manner: acquiring 32 characters behind the identifier of the data sending end, wherein the data in the overflow area in the hexadecimal character string of the bluetooth data packet is as follows: 006031E2B5BA39F 00000000000000000. Further, the content of the overflow area is further filtered according to the service UUID of the data sender (step S350).
Still taking the bluetooth packet listed in the above step as an example, 32 characters after the identifier "FF 4C 001" of the data transmitting end are "006031E 2B5BA39F 00000000000000000".
For example, if there is no other character or the number of characters is less than 32 bits after the identifier of the transmitting end (i.e. the above-mentioned substring) in the bluetooth packet, it indicates that the overflow (overflow) area has no valid information. I.e., there is no 32-bit character after "FF 4C 001", the bluetooth packet is screened out and the next bluetooth packet is processed (step S360). Therefore, the number of the Bluetooth data is further reduced, the speed of determining the target Bluetooth data is accelerated, and the data processing efficiency is improved.
3. In view of that the service UUID of the bluetooth broadcast performed by the data sending end can be used to uniquely determine the bluetooth data broadcasted, this embodiment may further screen the data in the overflow area scanned by the data receiving end according to the service UUID of the data sending end.
For example, in the present embodiment, if the binary character "1" is used as the target character, the character of the overflow (overflow) area needs to be represented in binary form. For example, 32 characters of the overflow area obtained in the previous step are converted into a binary character string, and referring to fig. 5, the obtained binary string is "11000000011000111100010101101011011101000111001111100000000000000000000000000000000000000000000000000000000000000000000".
In addition, the position information of the target character "1" in the service UUID broadcasted by the data sending end through bluetooth is also determined as the standard position information (step S410). For example, if the service UUID is "CAFE", bit 37 is "1".
4. Acquiring the positions of all target characters "1" in the binary character string obtained in the last step (i.e. the binary character string obtained by conversion according to the overflow area), obtaining candidate position information (step S420), and further comparing the standard position information with the candidate position information (step S430) to determine whether the position of "1" in the binary character string obtained by conversion according to the overflow area is the same as the position of "1" in the corresponding service UUID. If the Bluetooth data packets are the same, the Bluetooth data packets are the data to be received; otherwise, the current Bluetooth data packet is abandoned, and the next Bluetooth data packet is processed continuously.
For example, the target character is still exemplified by a two-level system character "1", and the present embodiment provides a method for acquiring the target character and its position information (standard position information):
1) and installing an application for sharing information through Bluetooth communication on the mobile phone (data sending end) provided with the first type of operating system, starting Bluetooth broadcast, and enabling the application to be in a background mode, such as setting the mobile phone to be in a black screen state. And ensures that no other devices in the surrounding environment of the handset are bluetooth broadcasting.
2) Connecting the operating mobile phone with the second type to a computer, starting an application on the mobile phone (data receiving end) by using a Debug mode, and starting a Bluetooth scanning function. And at the position of reading the Bluetooth broadcast signal codes, converting the read data into hexadecimal character strings, and extracting the character strings (the breakpoint debugging function or direct screen printing can be used).
3) The sub-string 'FF 4C 001' (the identifier of the first type of operating system) is searched for the character string obtained in the last step, the sub-string with the length of 32 characters behind the character string is extracted, and the sub-string is converted into a binary character string.
4) Recording the positions of all binary characters '1' in the binary character string obtained in the previous step, and obtaining the target position information.
5. And after determining the data to be received, calling a Bluetooth API of the second type of operating system for connection, then acquiring the data, and continuing to process the next Bluetooth data packet based on the steps 1-5.
Therefore, even if the application of the data sending end is in the background mode, the data receiving end of the second type operating system can successfully receive the bluetooth data based on the technical scheme provided in the steps 1 to 5, and the technical problem that the data receiving end of the second type operating system cannot successfully receive the bluetooth data in the related art is solved.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. The computer program, when executed by the CPU, performs the functions defined by the method provided by the present invention. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the method according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily appreciated that the processes illustrated in the above figures are not intended to indicate or limit the temporal order of the processes. In addition, it is also readily understood that these processes may be performed, for example, synchronously or asynchronously in multiple modules.
Fig. 6 shows a schematic structure diagram of a data receiving end in an exemplary embodiment of the present disclosure. Referring to fig. 6, the apparatus includes:
a detection module 601 configured to: detecting the screen brightness of a data receiving end in response to the application of the data sending end being in a background mode;
a receiving module 602 configured to: and if the screen brightness of the data receiving end is greater than zero, receiving the Bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the data receiving end 600 further includes: and a screen lightening module 603.
Wherein the bright screen module 603 is configured to: and if the screen brightness of the signal receiving end is equal to zero, the screen brightness of the data receiving end is larger than zero by calling an application interface of local notification.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the receiving module 602 is specifically configured to:
if the data receiving end is configured to be the first type of operating system, performing directional scanning based on the service UUID of the Bluetooth data sent by the data sending end to obtain the Bluetooth data sent by the data sending end.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the receiving module 602 includes: a scanning unit 6021 and a first screening unit 6022.
Wherein the scanning unit 6021 is configured to: if the data receiving end is configured to be an operating system of a second type, carrying out global scanning to obtain a Bluetooth data packet; the first screening unit 6022 is configured to: and performing first screening on the Bluetooth data packet according to the service UUID of the data sending end to obtain Bluetooth data sent by the data sending end.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the first screening unit 6022 includes: a standard location subunit, a candidate location subunit, and a ratio subunit.
Wherein the standard location subunit is configured to: determining the position information of the target character according to the service UUID of the data sending end to obtain standard position information; the candidate location subunit is configured to: acquiring the position information of the target character in the Bluetooth data packet to obtain candidate position information; and, the above-mentioned ratio pair subunit is configured as: and screening the Bluetooth data packet by comparing the standard position information with the candidate position information.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the receiving module 602 further includes: a second screening unit 6023.
Wherein the second screening unit 6023 is configured to: and before the first screening is carried out on the Bluetooth data packet according to the service UUID of the data sending end, carrying out second screening on the Bluetooth data packet by judging whether the Bluetooth data packet contains the identifier of the data sending end or not so as to obtain the data of an overflow area in the data sending end.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the target character is a binary character, wherein the candidate position subunit is specifically configured to: and converting the data of the overflow area in the data sending end into intermediate data in a binary form, and acquiring the position information of the target character in the intermediate data to obtain the candidate position information.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the application of the data sending end is in a background mode, including:
the data sending end is in a desktop state, other applications installed on the data sending end are in a foreground mode, or the data sending end is in a black screen state.
The details of each unit in the data receiving end are already described in detail in the corresponding bluetooth communication method, and therefore are not described herein again.
Fig. 7 shows a schematic structural diagram of a bluetooth communication system in an exemplary embodiment of the present disclosure. Referring to fig. 7, the bluetooth communication system 700 includes: a data receiving end 701 and a data transmitting end 600.
Wherein the data transmitting end 701 is configured to: and transmitting the Bluetooth data.
The data receiving end 600 is configured to: detecting the screen brightness of a data receiving end in response to the application of the data sending end 701 being in a background mode; and if the screen brightness of the data transmitter is greater than zero, receiving the bluetooth data sent by the data transmitter based on the system type of the data transmitter and the service distinguishing code of the data transmitter 701.
The details of each unit in the bluetooth communication system are already described in detail in the corresponding bluetooth communication method and the data receiving end shown in fig. 6, and therefore, the details are not repeated here.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, and may also be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium capable of implementing the above method. On which a program product capable of implementing the above-described method of the present specification is stored. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the "exemplary methods" section above of this specification, when the program product is run on the terminal device.
Referring to fig. 8, a program product 800 for implementing the above method according to an embodiment of the present disclosure is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 900 according to this embodiment of the disclosure is described below with reference to fig. 9. The electronic device 900 shown in fig. 9 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present disclosure.
As shown in fig. 9, the electronic device 900 is embodied in the form of a general purpose computing device. Components of electronic device 900 may include, but are not limited to: the at least one processing unit 910, the at least one memory unit 920, and a bus 930 that couples various system components including the memory unit 920 and the processing unit 910.
Wherein the storage unit stores program code that is executable by the processing unit 910 to cause the processing unit 910 to perform steps according to various exemplary embodiments of the present disclosure described in the above section "exemplary method" of the present specification. For example, the processing unit 910 may perform the following as shown in fig. 1: step S110, responding to the application of the data sending end being in a background mode, and detecting the screen brightness of the data receiving end; step S120, judging whether the screen brightness of the data receiving end is greater than zero; and, when the screen brightness of the data receiving end is greater than zero, executing step S130, and receiving the bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end.
The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM)9201 and/or a cache memory unit 9202, and may further include a read only memory unit (ROM) 9203.
Storage unit 920 may also include a program/utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 930 can be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 900 may also communicate with one or more external devices 1000 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 900, and/or with any device (e.g., router, modem, etc.) that enables the electronic device 900 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 950. Further, the I/O interface 950 is connected with the display unit 940 to transmit the content to be displayed to the display unit 940 through the I/O interface 950 for the user to view.
Also, the electronic device 900 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via the network adapter 960. As shown, the network adapter 960 communicates with the other modules of the electronic device 900 via the bus 930. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (12)

1. A method of bluetooth communication, the method comprising:
detecting the screen brightness of a data receiving end in response to the application of the data sending end being in a background mode;
and if the screen brightness of the data receiving end is greater than zero, receiving the Bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end.
2. The method of claim 1, further comprising:
and if the screen brightness of the signal receiving end is equal to zero, the screen brightness of the data receiving end is larger than zero by calling an application interface of local notification.
3. The method according to claim 1 or 2, wherein the receiving the bluetooth data sent by the data sending end based on the system type of the data receiving end and the service differentiating code of the data sending end comprises:
if the data receiving end is configured to be the first type of operating system, performing directional scanning based on a service differentiating code UUID of the Bluetooth data sent by the data sending end so as to receive the Bluetooth data sent by the data sending end.
4. The method according to claim 1 or 2, wherein the determining a data receiving manner based on the system type of the data receiving end and the service differentiating code of the data transmitting end comprises:
if the data receiving end is configured to be an operating system of a second type, carrying out global scanning to obtain a Bluetooth data packet; and performing first screening on the Bluetooth data packet according to the service differentiating code UUID of the data sending end to obtain Bluetooth data sent by the data sending end.
5. The method of claim 4, wherein the first screening of the bluetooth packets according to the service UUID of the data sender comprises:
determining the position information of the target character according to the service UUID of the data sending end to obtain standard position information;
acquiring the position information of the target character in the Bluetooth data packet to obtain candidate position information;
and screening the Bluetooth data packet by comparing the standard position information with the candidate position information.
6. The method of claim 5, wherein before the first filtering the bluetooth packets according to the service UUID of the data sender, the method further comprises:
and performing second screening on the Bluetooth data packet by judging whether the Bluetooth data packet contains the identifier of the data sending end or not so as to obtain the data of the overflow area in the data sending end.
7. The method of claim 6, wherein the target character is a binary character, wherein,
obtaining the position information of the target character in the Bluetooth data packet to obtain candidate position information, wherein the obtaining of the position information comprises the following steps:
and converting the data of the overflow area in the data sending end into intermediate data in a binary form, and acquiring the position information of the target character in the intermediate data to obtain the candidate position information.
8. The method according to claim 1 or 2, wherein the application of the data sender is in a background mode, comprising:
the data sending end is in a desktop state, other applications installed on the data sending end are in a foreground mode, or the data sending end is in a black screen state.
9. A data receiving end, comprising:
a detection module configured to: detecting the screen brightness of a data receiving end in response to the application of the data sending end being in a background mode;
a receiving module configured to: and if the screen brightness of the data receiving end is greater than zero, receiving the Bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end.
10. A bluetooth communication system, the system comprising: a data receiving end and a data transmitting end; wherein the content of the first and second substances,
the data sender is configured to: transmitting Bluetooth data;
the data receiving end is configured to: detecting the screen brightness of a data receiving end in response to the application of the data sending end being in a background mode; and if the screen brightness of the data receiving end is larger than zero, receiving the Bluetooth data sent by the data sending end based on the system type of the data receiving end and the service distinguishing code of the data sending end.
11. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the bluetooth communication method according to any one of claims 1 to 8.
12. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the bluetooth communication method of any one of claims 1 to 8.
CN202011538265.9A 2020-12-23 Bluetooth communication method, data receiving end, bluetooth communication system, medium and device Active CN114666438B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011538265.9A CN114666438B (en) 2020-12-23 Bluetooth communication method, data receiving end, bluetooth communication system, medium and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011538265.9A CN114666438B (en) 2020-12-23 Bluetooth communication method, data receiving end, bluetooth communication system, medium and device

Publications (2)

Publication Number Publication Date
CN114666438A true CN114666438A (en) 2022-06-24
CN114666438B CN114666438B (en) 2024-05-31

Family

ID=

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014080252A1 (en) * 2012-11-26 2014-05-30 Nokia Corporation Handling bluetooth low energy advertisement messages
US20180139576A1 (en) * 2016-11-16 2018-05-17 Institute For Information Industry Wireless device, server, index data providing method for wireless device, data providing method for server and wireless transmission system
CN108391237A (en) * 2018-01-29 2018-08-10 北京怡和嘉业医疗科技股份有限公司 The sending, receiving method of medical instrument data and transmission, receiving device
US20180249312A1 (en) * 2018-03-22 2018-08-30 Byung Mun Roh Mobile Device as a Form of Identification via Bluetooth
KR20200047457A (en) * 2020-03-30 2020-05-07 주식회사 올라운드 Trace system for Infectious people and trace method using it
CN111464957A (en) * 2020-03-31 2020-07-28 Oppo(重庆)智能科技有限公司 Bluetooth audio transmission method and device, electronic equipment and storage medium
US20200302452A1 (en) * 2012-05-17 2020-09-24 Pokos Communications Corp Method and system for using Bluetooth and other nearby-communications technologies to help governments and health agencies reduce the spread of novel corona viruses and other highly-contagious diseases, with user privacy and security central to the design
CN111918251A (en) * 2019-05-09 2020-11-10 厦门雅迅网络股份有限公司 Bluetooth transmission system and method based on UUID information channel
CN112069542A (en) * 2020-09-09 2020-12-11 北京清数智能科技有限公司 Method and device for tracking close contact person, storage medium and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200302452A1 (en) * 2012-05-17 2020-09-24 Pokos Communications Corp Method and system for using Bluetooth and other nearby-communications technologies to help governments and health agencies reduce the spread of novel corona viruses and other highly-contagious diseases, with user privacy and security central to the design
WO2014080252A1 (en) * 2012-11-26 2014-05-30 Nokia Corporation Handling bluetooth low energy advertisement messages
US20180139576A1 (en) * 2016-11-16 2018-05-17 Institute For Information Industry Wireless device, server, index data providing method for wireless device, data providing method for server and wireless transmission system
CN108391237A (en) * 2018-01-29 2018-08-10 北京怡和嘉业医疗科技股份有限公司 The sending, receiving method of medical instrument data and transmission, receiving device
US20180249312A1 (en) * 2018-03-22 2018-08-30 Byung Mun Roh Mobile Device as a Form of Identification via Bluetooth
CN111918251A (en) * 2019-05-09 2020-11-10 厦门雅迅网络股份有限公司 Bluetooth transmission system and method based on UUID information channel
KR20200047457A (en) * 2020-03-30 2020-05-07 주식회사 올라운드 Trace system for Infectious people and trace method using it
CN111464957A (en) * 2020-03-31 2020-07-28 Oppo(重庆)智能科技有限公司 Bluetooth audio transmission method and device, electronic equipment and storage medium
CN112069542A (en) * 2020-09-09 2020-12-11 北京清数智能科技有限公司 Method and device for tracking close contact person, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US8843895B2 (en) Debugger connection
CN111694674B (en) Message distribution processing method, device, equipment and storage medium
CN111818136A (en) Data processing method and device, electronic equipment and computer readable medium
US11936605B2 (en) Message processing method, apparatus and electronic device
CN108933968B (en) Message format conversion method and device, storage medium and android terminal
CN108462894B (en) Live broadcast room broadcast processing method and device and readable storage medium
CN111309617A (en) Application program control method and device, storage medium and electronic equipment
CN106454403B (en) Data display method, equipment and system
CN114666438B (en) Bluetooth communication method, data receiving end, bluetooth communication system, medium and device
CN115225881A (en) Data transmission method, device, equipment and storage medium
CN114666438A (en) Bluetooth communication method, data receiving terminal, Bluetooth communication system, medium, and device
US20230221828A1 (en) Content display method and apparatus, electronic device, andcomputer-readable storage medium
CN114980064A (en) Information association method and device, electronic equipment and storage medium
KR20200108348A (en) Data transfer
CN114443480A (en) Test method, test system, readable medium and electronic device
CN110548285B (en) Game communication control method and device, medium and electronic equipment
CN114025014A (en) Asset detection method and device, electronic equipment and storage medium
CN110120895B (en) Method, device, medium and electronic equipment for testing communication of mobile terminal
CN115391770A (en) Program monitoring method, device, electronic equipment and computer readable storage medium
WO2023131109A1 (en) Method and apparatus for registering broadcast
CN113360326B (en) Debugging log obtaining method and device
CN116974631B (en) Hardware telemetry data acquisition method, device, equipment and storage medium
CN113068252B (en) Positioning method, positioning device, terminal and storage medium
CN113141298B (en) Message processing method, message processing device, storage medium and electronic equipment
CN111193697B (en) Method, device and system for detecting credibility of social account

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