Bluetooth-based one-way communication method and system, electronic equipment and storage medium
By adopting a one-way communication method in Bluetooth communication, after the controller establishes a binding relationship with the terminal device, it sends broadcast data in one direction and automatically shuts down, solving the high power consumption problem caused by bidirectional connection of traditional Bluetooth communication methods, and achieving the effect of significantly extending the battery power supply time of the device.
Patent Information
- Application Number
- CN202510161393.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-05-13
Smart Images

Figure CN119996982A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless communications, and in particular to a one-way communication method, system, electronic device and storage medium based on Bluetooth. Background Art
[0002] Bluetooth plays a key role in data transmission between personal consumer electronics and IoT devices. However, the limitations of traditional Bluetooth technology in power consumption and communication efficiency are gradually becoming apparent, especially in small wearable devices or IoT applications that require long battery life. The introduction of Bluetooth 4.0, especially the introduction of Bluetooth Low Energy (BLE), not only greatly reduces device power consumption, but also improves the flexibility and security of communication, opening up a new path for the design of IoT devices.
[0003] BLE introduces a broadcast mode, which allows devices to send data without establishing a two-way connection, which reduces power consumption to a certain extent. However, in the existing technology, BLE communication still mainly relies on the complete process of search, connection, and data transmission. Especially when data is frequently exchanged between devices, this connection-based communication mode inevitably leads to higher power consumption. For devices such as riding handle controllers that need to run for a long time but are limited by battery capacity, reducing power consumption and extending working time have become technical problems that need to be solved urgently.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The present application provides a one-way communication method, system, electronic device and storage medium based on Bluetooth, so as to at least solve the technical problem that the existing Bluetooth communication mode is a two-way connection communication mode, and the success of data transmission must rely on the communicating parties to always maintain a connection, which leads to high power consumption in the data communication process.
[0006] According to one aspect of the present application, a one-way communication method based on Bluetooth is provided, including: when a binding relationship is successfully established between a controller and a terminal device having a Bluetooth communication function, the controller sends target broadcast data to the terminal device in a one-way direction according to a target protocol, wherein after the terminal device identifies the target broadcast data from all the broadcast data obtained by scanning, the target broadcast data is parsed to obtain a parsing result; after the target broadcast data is successfully sent, the controller automatically enters a shutdown state.
[0007] Optionally, before sending the target broadcast data to the terminal device in a unidirectional manner through the controller according to the target protocol, the method also includes: sending a binding request to the controller through the controller, and establishing a data connection between the terminal device and the controller after the controller successfully receives the binding request; after the identity information and data processing authority of the controller are fully verified by the terminal device, receiving the public key generated by the terminal device through the controller; the controller randomly generates a piece of plaintext data, and encrypts the plaintext data into a reply message according to the public key; and sending the reply message to the terminal device through the controller.
[0008] Optionally, after sending the reply message to the terminal device through the controller, the method also includes: receiving through the controller the target plaintext after the terminal device decrypts the reply message using a private key, and disconnecting the data connection between the terminal device and the controller; the controller verifies whether the target plaintext is the same as the plaintext data to obtain a verification result.
[0009] Optionally, the target broadcast data is sent to the terminal device in a unidirectional manner through the controller according to the target protocol, including: generating a function instruction through the controller; encrypting the function instruction into the target broadcast data according to the public key; and sending the target broadcast data to the terminal device in a unidirectional manner through the controller according to the target protocol.
[0010] According to another aspect of the present application, a one-way communication method is also provided, including: scanning the broadcast data sent by at least one Bluetooth communication device through a terminal device with a Bluetooth communication function; after the terminal device identifies the target broadcast data sent by the controller from all the broadcast data according to the target protocol, parsing the target broadcast data to obtain a parsing result; wherein a binding relationship is successfully established between the controller and the terminal device, and the controller sends the target broadcast data to the terminal device in a unidirectional manner according to the target protocol, and automatically shuts down after the target broadcast data is successfully sent.
[0011] Optionally, before the terminal device identifies the target broadcast data sent by the controller from all broadcast data according to the target protocol, the method also includes: establishing a data connection between the terminal device and the controller when the terminal device scans the binding request sent by the controller; the terminal device verifies the identity information and data processing authority of the controller based on the data connection; after the identity information and data processing authority of the controller are all verified, the terminal device generates a public key and sends it to the controller; and receiving a reply message sent by the controller according to the public key through the terminal device.
[0012] Optionally, after receiving a reply message sent by the controller based on a public key through the terminal device, the one-way communication method also includes: the terminal device decrypts the reply message based on a private key corresponding to the public key to obtain a target plaintext; the terminal device sends the target plaintext to the controller, and disconnects the data connection between the terminal device and the controller after the controller receives the target plaintext; the terminal device receives a verification result of the target plaintext by the controller, wherein the verification result is used to characterize whether the target plaintext is the same as the plaintext data used when the controller generates the reply message.
[0013] Optionally, the terminal device identifies the target broadcast data sent by the controller from all the broadcast data according to the target protocol, including: the terminal device detects the communication identifier carried in each broadcast data according to the target protocol, wherein the communication identifier is used to represent the identity information of the device that generates the broadcast data; when the communication identifier carried in the i-th broadcast data represents that the device that generates the i-th broadcast data is the controller, the i-th broadcast data is decrypted according to the private key agreed upon by the terminal device and the controller, wherein the i-th broadcast data is any broadcast data scanned by the terminal device; when the i-th broadcast data is decrypted successfully, it is determined that the i-th broadcast data is the target broadcast data sent by the controller; when the communication identifier carried in the i-th broadcast data represents that the device that generates the i-th broadcast data is not the controller, or, when the i-th broadcast data is decrypted unsuccessfully according to the private key agreed upon by the terminal device and the controller, it is determined that the i-th broadcast data is not the target broadcast data sent by the controller.
[0014] Optionally, after parsing the target broadcast data to obtain a parsing result, the method further includes: extracting a function instruction generated by the controller from the parsing result; and executing a function operation corresponding to the function instruction in a target application on the terminal device.
[0015] According to another aspect of the present application, a one-way communication system is also provided, including: a controller, used to send target broadcast data to a terminal device in a one-way direction according to a target protocol, and automatically enter a shutdown state after the target broadcast data is successfully sent, wherein a binding relationship is successfully established between the controller and the terminal device; a terminal device, used to scan the broadcast data sent by at least one Bluetooth communication device, and after identifying the target broadcast data sent by the controller from all the broadcast data, parse the target broadcast data to obtain a parsing result.
[0016] According to another aspect of the present application, a riding handle device is also provided, including: the riding handle device at least includes a controller in the above-mentioned Bluetooth-based one-way communication method, and the controller is used to execute the above-mentioned Bluetooth-based one-way communication method.
[0017] Optionally, the riding handle device further includes at least a sensing device and an energy storage device, wherein the sensing device is used to receive touch commands from the user and control the controller to generate function commands according to the touch commands, and the energy storage device is used to provide electrical energy for the riding handle device.
[0018] According to another aspect of the present application, a one-way communication device based on Bluetooth is also provided, including: a sending unit, which is used to send target broadcast data to the terminal device in a one-way direction according to the target protocol through the controller when a binding relationship is successfully established between the controller and the terminal device with Bluetooth communication function, wherein the terminal device identifies the target broadcast data from all the broadcast data obtained by scanning, and then parses the target broadcast data to obtain the parsing result; a processing unit, which is used to automatically shut down the controller after the target broadcast data is successfully sent.
[0019] According to another aspect of the present application, a one-way communication device is also provided, including: a first communication unit, used to scan the broadcast data sent by at least one Bluetooth communication device through a terminal device with a Bluetooth communication function; a second communication unit, used to parse the target broadcast data to obtain a parsing result after the terminal device identifies the target broadcast data sent by the controller from all the broadcast data according to the target protocol; wherein a binding relationship has been successfully established between the controller and the terminal device, and the controller sends the target broadcast data to the terminal device in a unidirectional manner according to the target protocol, and automatically shuts down after the target broadcast data is successfully sent.
[0020] According to another aspect of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed, the device where the computer-readable storage medium is located executes the above-mentioned one-way communication method based on Bluetooth.
[0021] According to another aspect of the present application, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned Bluetooth-based one-way communication method.
[0022] In the present application, first, when a binding relationship is successfully established between the controller and a terminal device with a Bluetooth communication function, the controller sends target broadcast data to the terminal device in a unidirectional manner according to the target protocol, wherein, after the terminal device identifies the target broadcast data from all the broadcast data obtained by scanning, the target broadcast data is parsed to obtain the parsing result, and then after the target broadcast data is successfully sent, the controller automatically enters the shutdown state, that is, after the controller and the terminal device successfully establish a binding relationship, when the controller needs to send the target broadcast data to the terminal device, it is no longer necessary to establish a data connection with the terminal device, and the target broadcast data can be directly sent to the terminal device in a unidirectional manner. After sending, the controller can automatically shut down to reduce the energy consumption of the controller. At the same time, the terminal device only needs to identify the target broadcast data sent by the controller from all the broadcast data, and then the target broadcast data can be parsed, thereby achieving the purpose of effectively reducing the energy consumption in the non-communication state, thereby achieving the technical effect of significantly extending the power supply time of the device battery, and then solving the technical problem that the existing Bluetooth communication method is a two-way connection communication method, and the successful data transmission must rely on the communication parties to always maintain a connection, resulting in high power consumption in the data communication process. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0024] Figure 1 is a flowchart of an optional one-way communication method based on Bluetooth according to an embodiment of the present application;
[0025] Figure 2 is a schematic diagram of an optional BLE broadcast data packet structure according to an embodiment of the present application;
[0026] Figure 3 is a schematic diagram of an optional AD Structure according to an embodiment of the present application;
[0027] Figure 4 is a flow chart of an optional one-way communication method according to an embodiment of the present application;
[0028] Figure 5 is a schematic diagram of an optional appearance structure of a riding handle controller according to an embodiment of the present application;
[0029] Figure 6 is a schematic diagram of an optional binding between a handle controller and an APP according to an embodiment of the present application;
[0030] Figure 7is a schematic diagram of an optional bound handle controller and APP communication according to an embodiment of the present application;
[0031] Figure 8 is a schematic diagram of an optional one-way communication method based on Bluetooth according to an embodiment of the present application;
[0032] Fig. 9 It is a schematic diagram of an optional one-way communication method according to an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] It should be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.
[0036] According to an embodiment of the present application, a method embodiment of a one-way communication method based on Bluetooth is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0037] Figure 1 is a flowchart of an optional one-way communication method based on Bluetooth according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0038] Step S101, when a binding relationship is successfully established between the controller and a terminal device having a Bluetooth communication function, the controller sends target broadcast data to the terminal device in a unidirectional manner according to a target protocol.
[0039] In step S101, after the terminal device identifies target broadcast data from all broadcast data obtained by scanning, it parses the target broadcast data to obtain a parsing result.
[0040] It should be noted that the controller (such as a riding handle controller) can be used as the execution subject of the Bluetooth-based one-way communication method in the embodiment of the present application. It is understandable that the Bluetooth-based one-way communication method provided in the embodiment of the present application can also be executed by other systems or devices, and the embodiment of the present application does not specifically limit this.
[0041] Optionally, the terminal device refers to a device having a Bluetooth communication function and capable of receiving BLE broadcasts, such as a smart phone, a smart watch, etc.
[0042] Optionally, the target protocol refers to a communication protocol agreed upon between the controller and the terminal device, which defines the format, encryption method, and parsing rules of the data, such as the BLE broadcast protocol.
[0043] Optionally, the target broadcast data refers to data generated and sent by the controller according to user instructions, and its content corresponds to the button function triggered by the user on the controller, such as playing music, adjusting the volume, etc.
[0044] Optionally, the terminal device continuously scans the surrounding broadcast signals through its BLE module, obtains the broadcast data sent by all visible BLE devices, filters out the data matching the controller from all the broadcast data, and parses the matching broadcast data (target broadcast data).
[0045] It should be noted that BLE is a new wireless communication standard introduced in Bluetooth 4.0. It is mainly aimed at devices that require long-term operation, long battery life, and relatively low data transmission, such as wearable devices, health monitoring devices, smart home devices, etc. By introducing the broadcast mode, BLE devices can directly broadcast their status information or a small amount of data without establishing a direct connection with another device, and then quickly return to a low-power state. This mechanism enables BLE devices to operate for months to years using button batteries, greatly extending the battery life of the device and reducing maintenance costs. When more frequent or larger amounts of data exchange are required, BLE devices can enter connection mode and establish a data link with another device. The connection process is simple and efficient. Devices are paired and connected only when needed, reducing unnecessary energy consumption. In connection mode, the data transmission rate is relatively increased, but compared with traditional Bluetooth, it still maintains a lower power consumption level.
[0046] Optionally, Figure 2 is a schematic diagram of an optional BLE broadcast data packet structure according to an embodiment of the present application, such as Figure 2 As shown, the structure includes: preamble, access address, header, length, data and checksum. Figure 2 The PDU in the BLE broadcast data refers to the basic unit (protocol data unit) of BLE broadcast data. PDU contains all the information required to complete a wireless transmission, including control information and data content; the preamble is a byte-sized field (corresponding to 8 bits). Its function is to help the receiving device synchronize and detect the start of the signal before the data packet is officially transmitted, so as to correctly receive and process subsequent data; the access address is a fixed-size field of four bytes (corresponding to 32 bits) used to identify the wireless transmission frequency and modulation mode of the BLE broadcast data frame. The access address is at the beginning of each Bluetooth broadcast data frame to help the receiving device determine the transmission format of the data; the header is a byte field used to carry control information of the data packet, such as the transmission direction and CR C check configuration; the length field is also one byte, which indicates the size of the subsequent data field, that is, the length of the payload; the data field is the core of the broadcast data packet, which can contain 0 to 37 bytes (0-296 bits) of information, which is used to transmit the actual broadcast content, including device identification, service information and custom data, etc. In this embodiment, this field contains the control instructions generated by the riding handle controller, which are encrypted according to user operations to ensure the security and privacy of the data; the check field consists of three bytes (24 bits) and is used to detect whether an error occurs during data transmission. BLE uses CRC check to improve the reliability of data transmission. The receiving device decides whether to accept the data packet by verifying the integrity of the data.
[0047] Optionally, the data that needs to be communicated in the embodiment of the present application is mainly filled in Figure 2 In the PDU corresponding data field, this segment is called AdvData, which consists of a valid data part and an invalid data part. The valid data part: contains N ADStructures, each AD Structure consists of Length, AD Type and AD Data. Among them: Length: the length of AD Type and AD Data; AD Type: indicates the meaning of AD Data data, and this embodiment uses 0xFF; AD Data: This part is filled data. Take the controller sending a recording instruction as an example, Figure 3 is a schematic diagram of an optional ADStructure structure according to an embodiment of the present application, such as Figure 3 As shown, its AD Structure consists of data length (Length, such as 0x04), data type (AD Type, such as 0xFF, which is customized by the manufacturer), and recording instructions (AD Data, such as 0xOF, 0x21, 0xEF).
[0048] Optionally, the controller sends the target broadcast data to the terminal device (bound terminal) in a unidirectional manner according to the target protocol.
[0049] Step S102: After the target broadcast data is sent successfully, the controller automatically enters a shutdown state.
[0050] Optionally, after the controller has successfully sent the target broadcast data and the terminal device is able to receive the data, in order to save energy, the controller does not wait for the reception feedback of the terminal device, but automatically shuts down immediately.
[0051] It can be known from the contents of step S101 to step S102 that in the present application, firstly, when the controller successfully establishes a binding relationship with a terminal device having a Bluetooth communication function, the controller sends target broadcast data to the terminal device in a unidirectional manner according to the target protocol, wherein, after the terminal device identifies the target broadcast data from all the broadcast data obtained by scanning, the target broadcast data is parsed to obtain the parsing result, and then after the target broadcast data is successfully sent, the controller automatically enters the shutdown state, that is, after the controller and the terminal device successfully establish a binding relationship, when the controller needs to send the target broadcast data to the terminal device, it is no longer necessary to establish a data connection with the terminal device, and the target broadcast data can be directly sent to the terminal device in a unidirectional manner. After sending, the controller can be automatically shut down to reduce the energy consumption of the controller. At the same time, the terminal device only needs to identify the target broadcast data sent by the controller from all the broadcast data, and then the target broadcast data can be parsed, thereby achieving the purpose of effectively reducing the energy consumption in the non-communication state, thereby achieving the technical effect of significantly extending the battery life of the device, and further solving the technical problem that the existing Bluetooth communication method is a two-way connection communication method, and the successful data transmission must rely on the communication parties to always maintain a connection, resulting in high power consumption in the data communication process.
[0052] In an optional embodiment, a binding request is first sent to the controller through the controller, and after the controller successfully receives the binding request, a data connection is established between the terminal device and the controller, and then after the identity information and data processing authority of the controller are fully verified by the terminal device, the public key generated by the terminal device is received through the controller, and then the controller randomly generates a piece of plaintext data, and encrypts the plaintext data into a reply message according to the public key, and finally sends the reply message to the terminal device through the controller.
[0053] Optionally, first, the user long presses a specific button on the controller to trigger the controller to enter pairing mode. At this time, the controller sends a binding request through BLE broadcast, which contains the basic information of the controller and the pairing intention, and establishes a data connection between the terminal device and the controller. Then the terminal device authenticates the controller through a series of protocol processes, including verifying the identity information of the controller and confirming its data processing authority. Among them, the identity information verification ensures that the paired device is the expected controller, and the confirmation of the data processing authority ensures that the controller can perform the functions required by the terminal device, such as controlling music playback, adjusting the volume, etc. After successful authentication, the terminal device will generate a public key and send it to the controller. After receiving the public key, the controller will store the public key and randomly generate a piece of plaintext data. Then, the controller uses the received public key to encrypt the plaintext data and generate an encrypted reply message. This encryption process ensures the security of the data during transmission. Only the terminal device holding the matching private key can decrypt it. Finally, the controller sends the encrypted reply message to the terminal device. Among them, the sending of the reply message completes the data interaction during the pairing process. The terminal device can verify whether the pairing process of the controller is successful by decrypting the reply message.
[0054] As can be seen from the above content, the above implementation method realizes a secure and low-power binding process between the controller and the terminal device, which ensures unique identification and secure data transmission between devices. In addition, through the public key encryption and private key decryption mechanism, the security of data transmission is improved, preventing the access of unauthorized devices and the risk of data theft.
[0055] In an optional embodiment, the controller receives the target plaintext after the terminal device decrypts the reply message using a private key, and disconnects the data connection between the terminal device and the controller. The controller then verifies whether the target plaintext is the same as the plaintext data to obtain a verification result.
[0056] Optionally, after the controller generates and sends an encrypted reply message, the terminal device will use its private key to decrypt the reply message, obtain the target plaintext, and send the target plaintext to the controller. After the controller receives the target plaintext decrypted by the terminal device, the terminal device will disconnect the data connection with the controller. The purpose of disconnecting the data connection is to protect data security and avoid security risks that may be caused by continuous data transmission during the pairing process. In addition, disconnection also helps to reduce device power consumption, especially in miniaturized, low-power devices such as controllers. Disconnection can quickly enter power saving mode and extend battery life. The controller will then verify the target plaintext to confirm whether it is exactly the same as the originally generated plaintext data. If the target plaintext is exactly the same as the originally generated plaintext data, the controller will confirm the binding relationship with the terminal device. On the contrary, if the target plaintext is different from the originally generated plaintext data, the controller will interrupt the current pairing process and wait for retry or fault diagnosis.
[0057] From the above content, it can be seen that the above verification method realizes the secure pairing process between the controller and the terminal device based on encrypted communication, as well as the accuracy verification of data transmission. By using the public key encryption and private key decryption mechanism, the privacy and security of data during transmission are ensured, and the risk of data being monitored or tampered with by a third party is effectively prevented. In addition, by disconnecting the connection immediately after successful verification and performing data verification, this implementation method also greatly reduces the energy consumption of the device during the pairing process and improves the overall energy efficiency of the system.
[0058] In an optional embodiment, a function instruction is first generated by a controller, and then the function instruction is encrypted into target broadcast data according to a public key, and then the target broadcast data is sent to the terminal device in a unidirectional manner according to a target protocol by the controller.
[0059] Optionally, when the user uses buttons on the controller (such as touch buttons, touch, pressure, gesture and other sensing devices) to trigger specific functions during riding, the processor or controller built into the controller generates corresponding function instructions according to the user instructions, where the function instructions can be operations such as controlling music playback, volume adjustment, answering calls, etc. The generated function instructions are then encrypted based on the public key obtained during the previous binding process with the terminal device. The encrypted function instructions are the target broadcast data, which contains an encrypted representation of the user's operation, ensuring the privacy of the data during wireless transmission. Even if the data is intercepted, a third party cannot interpret the information therein. The controller then uses the BLE broadcast feature to send the target broadcast data to the terminal device in a unidirectional manner based on the target protocol.
[0060] From the above content, we can see that the controller uses public key encryption technology to fully protect the function instructions during the transmission process, ensuring user privacy and data security. At the same time, the one-way data transmission mechanism based on BLE broadcasting greatly reduces the power consumption of the controller, allowing the device to maintain operation for a long time when the battery capacity is limited.
[0061] According to an embodiment of the present application, another method embodiment of a one-way communication method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0062] Figure 4 is a flow chart of an optional one-way communication method according to an embodiment of the present application, such as Figure 4 As shown, the method comprises the following steps:
[0063] Step S401: Scan broadcast data sent by at least one Bluetooth communication device through a terminal device with Bluetooth communication function.
[0064] It should be noted that the terminal device (such as a smart phone, a smart watch, etc.) can be used as the execution subject of the one-way communication method of the embodiment of the present application. It is understandable that the one-way communication method provided in the embodiment of the present application can also be executed by other systems or devices, and the embodiment of the present application does not specifically limit this.
[0065] Optionally, the terminal device scans the broadcast data sent by surrounding Bluetooth communication devices through its built-in BLE module, wherein the broadcast data is sent by the Bluetooth device through wireless broadcasting and is used for information to be discovered and identified by other devices. The terminal device continuously scans in order to capture target broadcast data that may be sent by the riding handle controller.
[0066] Step S402: After the terminal device identifies the target broadcast data sent by the controller from all the broadcast data according to the target protocol, the target broadcast data is parsed to obtain a parsing result.
[0067] In step S402, the controller successfully establishes a binding relationship with the terminal device, and the controller sends target broadcast data to the terminal device in a unidirectional manner according to the target protocol, and automatically shuts down after the target broadcast data is successfully sent.
[0068] Optionally, among all broadcast data, the terminal device identifies the target broadcast data sent by the controller according to the target protocol, wherein the target protocol defines the format and encryption strategy of the data, ensuring that only the terminal device that has established a binding relationship with the controller can correctly parse the data. The identification process can be based on the unique identifier between the controller and the terminal device (such as MAC address (Media Access Control), UUID (Universally Unique Identifier), etc.) and encryption method. Once the identification is successful, the terminal device will decrypt and parse the target broadcast data to obtain the parsing result, thereby obtaining the information sent by the controller.
[0069] Optionally, before the terminal device scans the broadcast data sent by at least one Bluetooth communication device, it needs to establish a binding relationship with the corresponding controller. After the controller successfully sends the target broadcast data, the controller will automatically enter the shutdown state.
[0070] In an optional embodiment, when the terminal device scans the binding request sent by the controller, a data connection is established between the terminal device and the controller. The terminal device then verifies the identity information and data processing authority of the controller based on the data connection. After the identity information and data processing authority of the controller are all verified, the terminal device generates a public key and sends it to the controller. Finally, the terminal device receives a reply message sent by the controller based on the public key.
[0071] Optionally, the controller first sends a binding request via BLE broadcast, which includes basic information of the controller and pairing intention. Then the APP (Application) of the terminal device can identify these broadcast signals through its BLE scanning function. When the terminal device APP receives the binding request, it will establish a data connection with the controller for subsequent authentication and key exchange processes. Through the previously established data connection, the terminal device will perform a series of identity authentication and permission checks to confirm whether the controller is a trusted device. After the identity information and data processing authority of the controller are verified, the terminal device will generate a public key and send the public key to the controller through the established data connection. Finally, the terminal device receives a reply message sent by the controller based on the public key.
[0072] As can be seen from the above content, the above binding mechanism ensures secure binding and data transmission between the controller and the terminal device. Specifically, this implementation allows the terminal device to verify the identity and authority of the controller by broadcasting binding requests and data connections at the initial stage of pairing, thereby improving the security and reliability of the overall system. Subsequently, through public key encryption and the sending of reply messages, the privacy and integrity of the data during transmission are ensured, preventing unauthorized devices from accessing the system.
[0073] In an optional embodiment, the terminal device first decrypts the reply message according to the private key corresponding to the public key to obtain the target plaintext, and then the terminal device sends the target plaintext to the controller, and disconnects the data connection between the terminal device and the controller after the controller receives the target plaintext. Finally, the terminal device receives the verification result of the target plaintext from the controller, wherein the verification result is used to indicate whether the target plaintext is the same as the plaintext data used by the controller when generating the reply message.
[0074] Optionally, the terminal device first decrypts the reply message (the message after the controller uses the public key to encrypt the plaintext data (the original data or function instructions generated by the controller before encryption)) according to the private key corresponding to the public key to obtain the target plaintext, and then the terminal device sends the decrypted target plaintext back to the controller for verification by the controller. After the target plaintext is successfully sent, the terminal device actively disconnects the data connection with the controller. This mechanism helps to reduce unnecessary power consumption and extend the battery life of the device. Finally, the terminal device receives the verification result of the target plaintext from the controller, that is, whether the target plaintext is consistent with the plaintext data.
[0075] From the above content, it can be seen that the terminal device realizes secure data exchange between the controller and the terminal device through the public key encryption and private key decryption mechanism. At the same time, the accuracy of data transmission is ensured through the sending of target plaintext and the verification feedback of the controller, which effectively prevents the data from being tampered with or damaged during the transmission process. It is worth noting that the mechanism of automatically disconnecting the data connection and shutting down the controller in this process significantly reduces the power consumption of the device during operation and prolongs the battery life.
[0076] In an optional embodiment, the terminal device detects a communication identifier carried in each broadcast data according to a target protocol, wherein the communication identifier is used to represent the identity information of a device generating the broadcast data; when the communication identifier carried in the i-th broadcast data represents that the device generating the i-th broadcast data is a controller, the i-th broadcast data is decrypted according to a private key agreed upon by the terminal device and the controller, wherein the i-th broadcast data is any broadcast data scanned by the terminal device; when the i-th broadcast data is decrypted successfully, it is determined that the i-th broadcast data is the target broadcast data sent by the controller; when the communication identifier carried in the i-th broadcast data represents that the device generating the i-th broadcast data is not a controller, or, when the i-th broadcast data fails to be decrypted according to the private key agreed upon by the terminal device and the controller, it is determined that the i-th broadcast data is not the target broadcast data sent by the controller.
[0077] Optionally, the terminal device continuously runs its Bluetooth scanning function and detects the communication identifier carried in each broadcast data received from the surrounding environment according to the target protocol, wherein the communication identifier is a unique piece of data used to identify the identity information of the device that generates the broadcast data, such as a MAC address, UUID or other form of device logo. The terminal device determines whether the data source device is a controller through this identifier. When the terminal device detects that the communication identifier in the i-th broadcast data indicates that the data comes from the riding handle controller, the terminal device will use the private key agreed with the riding handle controller to decrypt the i-th broadcast data. Here, the i-th broadcast data is any broadcast data scanned by the terminal device, and the private key is obtained by the controller in the previous binding process, which is used to decrypt the data sent by the controller and encrypted with the terminal device public key. In addition, if the decryption is successful, the terminal device determines that the i-th broadcast data is the target broadcast data sent by the riding handle controller, which means that the data source is correct and has not been tampered with. If the detected communication identifier indicates that the device is not a riding handle controller, or the decryption process fails, the terminal device will determine that the broadcast data is not the target broadcast data and will not execute any functional instructions.
[0078] From the above content, it can be seen that the terminal device can identify the source device of the broadcast data by detecting the communication identifier and decrypting it with the private key. The terminal device ensures the privacy and integrity of the data. Only the correct combination of data source and encryption key can be successfully decrypted, avoiding the misprocessing of non-target data and potential security risks. This mechanism is particularly suitable for low-power device application scenarios because it reduces unnecessary power consumption while maintaining high efficiency and security of communication, providing a reliable and secure solution for wireless communication between controllers and terminal devices.
[0079] In an optional embodiment, the function instruction generated by the controller is firstly extracted from the parsing result, and then the function operation corresponding to the function instruction is executed in the target application of the terminal device.
[0080] Optionally, after the terminal device successfully parses the target broadcast data sent by the riding handle controller according to the target protocol, it will extract the function instruction generated by the controller from the parsing result. After the terminal device recognizes the function instruction in the target application, it will perform the corresponding operation according to the instruction content, where the target application refers to the mobile phone APP or other application bound to the controller, which can receive and process the function instruction. For example, if the function instruction is to switch to the next song, the target application will control the music player to switch to the next track.
[0081] From the above content, it can be seen that by extracting and executing the functional instructions sent by the riding handle controller on the terminal device, the user can achieve a seamless control experience during the riding process. Specifically, the accurate extraction of functional instructions ensures that the user operation can be correctly parsed, and the instant response in the target application ensures the real-time and efficiency of the operation, allowing users to focus on riding while easily controlling the mobile phone application. This mechanism not only simplifies the interaction between the user and the terminal device and improves the convenience of operation, but also further improves the security and stability of the system based on low-power Bluetooth communication.
[0082] In an optional embodiment, a controller (hereinafter referred to as a riding handle controller) is fixed to the handlebar of a bicycle or motorcycle device, and the battery level of the device is kept above 5%. The broadcast (with agreed protocol instructions or data) is triggered by pressing a button on the riding handle controller (which has been bound to the main device). The device automatically shuts down after a period of time after the broadcast. Then the main device (here refers to a device with a BLE scanning function, such as a smart phone) scans the surrounding BLE devices, filters devices with specified broadcast content (according to the agreed protocol, useless BLE broadcasts can be filtered out and matching devices can be accurately found), and then the captured device broadcast content is parsed to obtain useful information.
[0083] Optionally, Figure 5 is a schematic diagram of an optional riding handle controller appearance structure according to an embodiment of the present application, such as Figure 5 As shown, the riding handle controller includes multiple buttons, and different buttons correspond to different functions. Among them, the buttons include but are not limited to touch buttons, touch, pressure, gesture and other sensing devices. The buttons are used for the functions of mobile phone APP, such as music up / down, play / pause, volume increase / decrease, answer / hang up the phone, grab the microphone, BLE pairing, etc. In addition, the riding handle controller also needs to include at least one BLE processor or controller and an energy storage device (such as a button battery, a rechargeable lithium battery, etc.).
[0084] Optionally, you need to bind the riding handle controller to the APP in the main device before using it for the first time. The specific steps are as follows: first, press and hold the button on the riding handle controller (a specific button is triggered to enter a specific broadcast mode to facilitate connection with the mobile phone APP) to trigger the riding handle controller to enter BLE broadcast, then the APP scans and connects the riding handle controller, after the connection, the riding handle controller shakes hands with the APP, the APP sends the public key to the riding handle controller, and then after the riding handle controller obtains the public key, it can confirm with the APP and disconnect from the APP. At this time, the riding handle controller has completed pairing with the APP, and there is no need to match and connect in subsequent use. If you need to match with a new device, repeat the above steps.
[0085] Optionally, open the paired mobile phone APP, and the APP will keep scanning nearby broadcast packets, and filter devices according to MAC, UUID or broadcast information among the scanned devices.
[0086] Optionally, when a button on the riding handle controller is pressed, the riding handle controller will start up and send broadcast package information corresponding to the button function. Then the broadcast package information sent by the riding handle controller will be encrypted according to the public key of the previously bound APP, so that only the bound APP can decrypt it with the private key. Then the APP uses the private key to parse specific fields in the broadcast package, and finally decrypts and parses the data in the broadcast package to obtain the final protocol button command data.
[0087] From the above content, it can be seen that this data communication method mainly utilizes the characteristics of BLE broadcasting, and then adds some encryption and decryption processes. It is no longer the same as the existing Bluetooth communication method, which requires three steps of scanning-establishing connection-data transmission, and the data connection needs to be successfully established to complete the data transmission. In this embodiment, after the controller and the terminal device successfully establish a binding relationship, if the controller needs to send target broadcast data to the terminal device, there is no need to re-establish a data connection with the terminal device. The target broadcast data can be directly sent in one direction, and then the power will be automatically shut down to minimize the energy consumption of the main controller. The terminal device only needs to identify the target broadcast data sent by the controller from all the broadcast data according to the target protocol, and then it can parse the target broadcast data to obtain the parsing result, thereby completing normal communication data transmission, that is, on the basis of satisfying data transmission, the power consumption is greatly reduced.
[0088] In an optional embodiment, for an Android device, the device is scanned and data is extracted by the following steps:
[0089] 1) The APP running on the Android side starts broadcast scanning through the following function:
[0090] bluetoothLeScanner.startScan(filters,settings,scanCallback);
[0091] Filters is the filtering condition, which can be filtered by Bluetooth name through setDeviceName("YourDeviceName"), and filtered by service UUID through setServiceUuid(uuid). Settings is the scan parameter configuration, and scanCallback is the result callback.
[0092] 2) Receive the scanned device in the above scanCallback through the following callback function:
[0093] onScanResult(int callbackType,@NonNull ScanResult result), where the broadcast data can be obtained in result byte[]scanRecord = result.getScanRecord().getBytes();
[0094] 3) Parsing broadcast data:
[0095] Get the custom data through result.getScanRecord().getManufacturerSpecificData(), which is an AD Structure.
[0096] In an optional embodiment, for an iOS device, scanning and data extraction of the device are performed through the following steps:
[0097] 1) The APP running on the IOS system uses the following function to scan the device:
[0098] centralManager.scanForPeripherals(withServices:nil,options:nil) where withServices can specify the device to scan for a specific UUID, and options are used to control the scanning behavior, such as whether to allow repeated device discovery events.
[0099] 2) Receive the scanned device through the callback function func centralManager(_central:CBCentralManager,didDiscover peripheral:CBPeripheral,advertisementData:[String:Any],rssi RSSI:NSNumber) and get the broadcast data in advertisementData.
[0100] 3) Parsing broadcast data:
[0101] The required data is obtained through advertisementData[CBAdvertisementDataManufacturerDataKey], which is an AD Structure.
[0102] In an optional embodiment, Figure 6is a schematic diagram of an optional handle controller and APP binding according to an embodiment of the present application, such as Figure 6 As shown, the user first needs to long press a specific button on the handle controller to trigger the controller to enter a special BLE broadcast mode. In this mode, the controller will send a series of broadcast data containing its device information and pairing requests. Then, the user opens the mobile phone APP and starts scanning the surrounding Bluetooth broadcast signals (broadcast packets) through its built-in BLE module. When the APP detects the special broadcast of the handle controller, it will establish a temporary Bluetooth connection with the controller for subsequent pairing and data exchange. After the connection is established, the APP will perform an authentication process with the handle controller to confirm whether the two correspond to the correct products. This step is an important means to ensure device security and prevent unauthorized device pairing. After successful authentication, the mobile phone APP will generate a public key and send it to the handle controller. At the same time, the handle controller The machine generates a plaintext message and encrypts it with the public key obtained from the APP. After generating the ciphertext, it sends it to the mobile phone APP. After receiving the ciphertext from the handle controller, the APP will use the private key corresponding to the public key to decrypt the ciphertext, and then send the decrypted content back to the handle controller to confirm the integrity and correctness of the data transmission. Subsequently, after receiving the data sent back by the APP, the handle controller performs a verification to compare the plaintext information generated by itself with the content decrypted by the APP. If they are consistent, the pairing process is successful. If they are inconsistent, you may need to re-pair and send the verification result to the mobile phone APP. At this time, regardless of the pairing result, the handle controller and APP will disconnect the BLE connection to reduce unnecessary power consumption. Finally, the handle controller will automatically enter a low power or shutdown state.
[0103] In an optional embodiment, Figure 7 is a schematic diagram of an optional bound handle controller and APP communication according to an embodiment of the present application, such as Figure 7As shown, the user triggers a certain function by operating the buttons on the handle controller, such as adjusting the volume, playing music, answering the phone, etc. Once the button is pressed, the handle controller wakes up immediately and generates a broadcast data packet containing the function instruction. At this time, the user has also opened the mobile phone APP and starts scanning the surrounding Bluetooth broadcast signals (broadcast packets) through its built-in BLE module. Then the handle controller uses the public key received from the APP during the binding process to encrypt the broadcast packet. Among them, the encryption function ensures that only the specific APP bound to it can decrypt and understand these instructions, which improves the security and privacy of the transmission. Then, on the mobile phone APP side, if the scanned broadcast packet corresponds to the bound APP, that is, the source device ID or public key information in the data packet matches the binding information stored in the APP, the APP will execute the next step. If the APP is not matched and bound, the decryption will fail, that is, no response. If the APP is matched and bound, the encrypted broadcast packet sent by the handle controller is decrypted with the private key corresponding to the public key. Once the decryption is successful, the APP can understand the meaning of the instruction and execute the corresponding function, such as adjusting the volume, playing music, etc., and then the handle controller will automatically shut down to save power.
[0104] According to an embodiment of the present application, an embodiment of a one-way communication system is also provided. The system includes: a controller, which is used to send target broadcast data to a terminal device in a one-way manner according to a target protocol, and automatically enters a shutdown state after the target broadcast data is successfully sent, wherein the controller and the terminal device successfully establish a binding relationship; the terminal device, which is used to scan the broadcast data sent by at least one Bluetooth communication device, and after identifying the target broadcast data sent by the controller from all the broadcast data, parse the target broadcast data to obtain a parsing result.
[0105] According to an embodiment of the present application, an embodiment of a riding handle device is also provided. The device includes: the riding handle device at least includes a controller in the above-mentioned one-way communication method based on Bluetooth, and the controller is used to execute the above-mentioned one-way communication method based on Bluetooth.
[0106] Optionally, the riding handle device further includes at least a sensing device and an energy storage device, wherein the sensing device is used to receive touch commands from the user and control the controller to generate function commands according to the touch commands, and the energy storage device is used to provide electrical energy for the riding handle device.
[0107] The embodiment of the present application also provides a one-way communication device based on Bluetooth. It should be noted that the one-way communication device based on Bluetooth in the embodiment of the present application can be used to execute the one-way communication method based on Bluetooth provided in the embodiment of the present application. The one-way communication device based on Bluetooth provided in the embodiment of the present application is introduced below.
[0108] According to an embodiment of the present application, a one-way communication device based on Bluetooth is also provided. Figure 8 is a schematic diagram of an optional Bluetooth-based one-way communication device according to an embodiment of the present application, such as Figure 8 As shown, the device includes: a sending unit 801 and a processing unit 802.
[0109] Optionally, the sending unit 801 is used to send target broadcast data to the terminal device in a unidirectional manner according to the target protocol through the controller when a binding relationship is successfully established between the controller and the terminal device with Bluetooth communication function, wherein the terminal device identifies the target broadcast data from all the broadcast data obtained by scanning, and then parses the target broadcast data to obtain the parsing result; the processing unit 802 is used to automatically enable the controller to enter a shutdown state after the target broadcast data is successfully sent.
[0110] Optionally, the Bluetooth-based one-way communication device further includes: a first sending unit, a first generating unit, a second generating unit, and a second sending unit. The first sending unit is used to send a binding request to the controller through the controller, and establish a data connection between the terminal device and the controller after the controller successfully receives the binding request; the first generating unit is used to receive a public key generated by the terminal device through the controller after the identity information and data processing authority of the controller are fully verified by the terminal device; the second generating unit is used for the controller to randomly generate a piece of plaintext data, and encrypt the plaintext data into a reply message according to the public key; the second sending unit is used to send the reply message to the terminal device through the controller.
[0111] Optionally, the Bluetooth-based one-way communication device further includes: a first receiving unit and a first verification unit. The first receiving unit is used to receive, through the controller, the target plaintext after the terminal device decrypts the reply message using the private key, and disconnect the data connection between the terminal device and the controller; the first verification unit is used for the controller to verify whether the target plaintext is the same as the plaintext data to obtain a verification result.
[0112] Optionally, the sending unit 801 includes: a first generating subunit, a first encrypting subunit, and a first sending subunit. The first generating subunit is used to generate a function instruction through a controller; the first encrypting subunit is used to encrypt the function instruction into target broadcast data according to a public key; and the first sending subunit is used to send the target broadcast data to the terminal device in a unidirectional manner according to the target protocol through the controller.
[0113] The embodiment of the present application also provides a one-way communication device. It should be noted that the one-way communication device of the embodiment of the present application can be used to execute the one-way communication method provided by the embodiment of the present application. The one-way communication device provided by the embodiment of the present application is introduced below.
[0114] According to an embodiment of the present application, a one-way communication device is also provided. Fig. 9 is a schematic diagram of an optional one-way communication device according to an embodiment of the present application, such as Fig. 9 As shown, the device includes: a first communication unit and a second communication unit.
[0115] Optionally, the first communication unit 901 is used to scan the broadcast data sent by at least one Bluetooth communication device through a terminal device with Bluetooth communication function; the second communication unit 902 is used to parse the target broadcast data to obtain a parsing result after the terminal device identifies the target broadcast data sent by the controller from all the broadcast data according to the target protocol; wherein a binding relationship has been successfully established between the controller and the terminal device, and the controller sends the target broadcast data to the terminal device in a unidirectional manner according to the target protocol, and automatically shuts down after the target broadcast data is successfully sent.
[0116] Optionally, the one-way communication device further includes: a first establishing unit, a first verifying unit, a first generating unit, and a first receiving unit. The first establishing unit is used to establish a data connection between the terminal device and the controller when the terminal device scans a binding request sent by the controller; the first verifying unit is used for the terminal device to verify the identity information and data processing authority of the controller based on the data connection; the first generating unit is used for the terminal device to generate a public key and send it to the controller after the identity information and data processing authority of the controller are all verified; the first receiving unit is used to receive a reply message sent by the controller based on the public key through the terminal device.
[0117] Optionally, the one-way communication device further includes: a first decryption unit, a first sending unit, and a second receiving unit. The first decryption unit is used for the terminal device to decrypt the reply message according to the private key corresponding to the public key to obtain the target plaintext; the first sending unit is used for the terminal device to send the target plaintext to the controller, and disconnect the data connection between the terminal device and the controller after the controller receives the target plaintext; the second receiving unit is used for the terminal device to receive the verification result of the controller for the target plaintext, wherein the verification result is used to indicate whether the target plaintext is the same as the plaintext data used by the controller when generating the reply message.
[0118] Optionally, the second communication unit 902 includes: a first detection subunit, a first decryption subunit, a first determination subunit, and a second determination subunit. The first detection subunit is used for the terminal device to detect the communication identifier carried in each broadcast data according to the target protocol, wherein the communication identifier is used to represent the identity information of the device generating the broadcast data; the first decryption subunit is used to decrypt the i-th broadcast data according to the private key agreed upon by the terminal device and the controller when the communication identifier carried in the i-th broadcast data represents that the device generating the i-th broadcast data is the controller, wherein the i-th broadcast data is any broadcast data scanned by the terminal device; the first determination subunit is used to determine that the i-th broadcast data is the target broadcast data sent by the controller when the i-th broadcast data is successfully decrypted; the second determination subunit is used to determine that the i-th broadcast data is not the target broadcast data sent by the controller when the communication identifier carried in the i-th broadcast data represents that the device generating the i-th broadcast data is not the controller, or when the i-th broadcast data fails to be decrypted according to the private key agreed upon by the terminal device and the controller.
[0119] Optionally, the one-way communication device further includes: a first extraction unit and a first execution unit, wherein the first extraction unit is used to extract the function instruction generated by the controller from the parsing result; and the first execution unit is used to execute the function operation corresponding to the function instruction in the target application of the terminal device.
[0120] According to another aspect of an embodiment of the present application, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed, the device where the computer-readable storage medium is located executes the above-mentioned Bluetooth-based one-way communication method or one-way communication method.
[0121] According to another aspect of an embodiment of the present application, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned Bluetooth-based one-way communication method or one-way communication method.
[0122] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0123] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0124] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0125] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0126] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0127] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0128] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A one-way communication method based on Bluetooth, characterized in that: include: When a binding relationship is successfully established between the controller and a terminal device having a Bluetooth communication function, the controller sends target broadcast data to the terminal device in a unidirectional manner according to a target protocol, wherein after the terminal device identifies the target broadcast data from all the broadcast data scanned, it parses the target broadcast data to obtain a parsing result; After the target broadcast data is sent successfully, the controller automatically enters a shutdown state.
2. The one-way communication method based on Bluetooth according to claim 1, characterized in that: Before sending the target broadcast data to the terminal device in one direction according to the target protocol through the controller, the method further includes: sending a binding request to the controller through the controller, and establishing a data connection between the terminal device and the controller after the controller successfully receives the binding request; After the identity information and data processing authority of the controller are all verified by the terminal device, receiving the public key generated by the terminal device through the controller; The controller randomly generates a piece of plaintext data, and encrypts the plaintext data into a reply message according to the public key; The reply message is sent to the terminal device through the controller.
3. The one-way communication method based on Bluetooth according to claim 2, characterized in that: After sending the reply message to the terminal device through the controller, the method further includes: Receiving, by the controller, the target plaintext after the terminal device decrypts the reply message using the private key, and disconnecting the data connection between the terminal device and the controller; The controller verifies whether the target plaintext is the same as the plaintext data, and obtains a verification result.
4. The one-way communication method based on Bluetooth according to claim 2, characterized in that: Sending target broadcast data to the terminal device in a unidirectional manner according to the target protocol by the controller includes: generating a function instruction by the controller; encrypting the function instruction into the target broadcast data according to the public key; The target broadcast data is sent to the terminal device in a unidirectional manner through the controller according to the target protocol.
5. A one-way communication method, characterized in that: include: Scanning broadcast data sent by at least one Bluetooth communication device through a terminal device having a Bluetooth communication function; After the terminal device identifies the target broadcast data sent by the controller from all the broadcast data according to the target protocol, the target broadcast data is parsed to obtain a parsing result; The controller successfully establishes a binding relationship with the terminal device, and the controller sends the target broadcast data to the terminal device in a unidirectional manner according to the target protocol, and automatically shuts down after the target broadcast data is successfully sent.
6. The one-way communication method according to claim 5, characterized in that: Before the terminal device identifies the target broadcast data sent by the controller from all the broadcast data according to the target protocol, the method further includes: When the terminal device scans the binding request sent by the controller, establishing a data connection between the terminal device and the controller; The terminal device verifies the identity information and data processing authority of the controller based on the data connection; After the identity information and data processing authority of the controller are all verified, the terminal device generates a public key and sends it to the controller; A reply message sent by the controller according to the public key is received through the terminal device.
7. The one-way communication method according to claim 6, characterized in that: After receiving, through the terminal device, a reply message sent by the controller according to the public key, the one-way communication method further includes: The terminal device decrypts the reply message according to the private key corresponding to the public key to obtain the target plaintext; The terminal device sends the target plaintext to the controller, and disconnects the data connection between the terminal device and the controller after the controller receives the target plaintext; The terminal device receives a verification result of the target plaintext by the controller, wherein the verification result is used to indicate whether the target plaintext is the same as the plaintext data used by the controller when generating the reply message.
8. The one-way communication method according to claim 5, characterized in that: The terminal device identifies the target broadcast data sent by the controller from all broadcast data according to the target protocol, including: The terminal device detects the communication identifier carried in each broadcast data according to the target protocol, wherein the communication identifier is used to represent the identity information of the device that generates the broadcast data; In the case where the communication identifier carried in the i-th broadcast data indicates that the device generating the i-th broadcast data is the controller, decrypting the i-th broadcast data according to the private key agreed upon by the terminal device and the controller, wherein the i-th broadcast data is any broadcast data scanned by the terminal device; In the case where the i-th broadcast data is successfully decrypted, determining that the i-th broadcast data is the target broadcast data sent by the controller; When the communication identifier carried in the i-th broadcast data indicates that the device generating the i-th broadcast data is not the controller, or when decryption of the i-th broadcast data fails according to the private key agreed upon by the terminal device and the controller, it is determined that the i-th broadcast data is not the target broadcast data sent by the controller.
9. The one-way communication method according to claim 5, characterized in that: After parsing the target broadcast data to obtain the parsing result, the method further includes: Extracting the function instructions generated by the controller from the analysis results; A functional operation corresponding to the functional instruction is executed in a target application on the terminal device.
10. A one-way communication system, characterized in that: include: A controller, used to send target broadcast data to a terminal device in a unidirectional manner according to a target protocol, and automatically enter a shutdown state after the target broadcast data is successfully sent, wherein a binding relationship is successfully established between the controller and the terminal device; The terminal device is used for scanning the broadcast data sent by at least one Bluetooth communication device, and after identifying the target broadcast data sent by the controller from all the broadcast data, parsing the target broadcast data to obtain the parsing result.
11. A riding handle device, characterized in that: The riding handle device at least includes the controller in claims 1 to 4, and the controller is used to execute the Bluetooth-based one-way communication method in any one of claims 1 to 4.
12. The riding handle device according to claim 11, characterized in that: The riding handle device also includes at least a sensing device and an energy storage device. The sensing device is used to receive a touch command from a user and control the controller to generate a function command according to the touch command. The energy storage device is used to provide electrical energy for the riding handle device.
13. A one-way communication device based on Bluetooth, characterized in that: include: A sending unit, configured to send target broadcast data to the terminal device in a unidirectional manner according to a target protocol through the controller when a binding relationship is successfully established between the controller and the terminal device having a Bluetooth communication function, wherein after the terminal device identifies the target broadcast data from all the broadcast data obtained by scanning, the terminal device parses the target broadcast data to obtain a parsing result; The processing unit is used to enable the controller to automatically enter a shutdown state after the target broadcast data is successfully sent.
14. A one-way communication device, characterized in that: include: A first communication unit, configured to scan broadcast data sent by at least one Bluetooth communication device through a terminal device having a Bluetooth communication function; A second communication unit is used to parse the target broadcast data sent by the controller from all the broadcast data according to the target protocol after the terminal device identifies the target broadcast data sent by the controller from all the broadcast data to obtain a parsing result; The controller has successfully established a binding relationship with the terminal device before, and the controller sends the target broadcast data to the terminal device in a unidirectional manner according to the target protocol, and automatically shuts down after the target broadcast data is successfully sent.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located executes the Bluetooth-based one-way communication method described in any one of claims 1 to 4 or the one-way communication method described in any one of claims 5 to 9.
16. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the one-way communication method described in any one of claims 1 to 4 or the one-way communication method described in any one of claims 5 to 9.
Citation Information
Patent Citations
Intelligent processing module of OBD system
CN103970114A
Bluetooth device control method and device
CN104318741A
Bluetooth pairing method and system
CN108738008A
Popup window function control method and device and computer readable storage medium
CN114500730A
Intelligent unlocking method and device, equipment and storage medium
CN114885405A