A method for preventing malicious connection of Bluetooth sensors

By periodically sending legal control instructions and analyzing sub-device data packets in the Bluetooth sensor system, detecting legality and operating status, the problem of Bluetooth sensors being easily maliciously connected is solved, and a safe and reliable data transmission and user-friendly user experience is achieved.

CN116489653BActive Publication Date: 2025-08-26BEIJING YAHUA WULIAN TECH DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310430999.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-20
Publication Date
2025-08-26
Estimated Expiration
2043-04-20

AI Technical Summary

Technical Problem

Bluetooth sensors are easily maliciously connected by illegal devices without a security authentication mechanism, resulting in data stolen and cracked, and poor user experience.

Method used

Through communication control, the main device periodically sends legal control instructions, receives and parses feedback data packets from the sub-device, controls the connection status based on the analysis results, realizes detection of legality and operating status, and disconnects the connection of illegal or abnormal devices from timeout.

Benefits of technology

Effectively prevent illegal connections, reduce the risks of data theft and cracking, improve user experience, and do not increase user operation complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116489653B_ABST
    Figure CN116489653B_ABST
Patent Text Reader

Abstract

This application provides a method for preventing malicious connections in Bluetooth sensors, comprising: periodically sending legitimate control instructions to a target sub-device and receiving a target data packet from the target sub-device in response to the legitimate control instructions; performing a legitimacy analysis on the target data packet and obtaining the analysis result; and controlling the connection status between the communication control main device and the target sub-device based on the analysis result. This method can effectively prevent illegally connected devices from affecting the normal use of the communication control main device, while reducing the risk of data theft and hacking on the communication control main device. It can be applied without upgrading the sub-devices, thus improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data security technology, and in particular to a method for preventing malicious connections of Bluetooth sensors. Background Art

[0002] Bluetooth wireless sensors are mainly used to transmit collected field signals to other Bluetooth devices wirelessly through the Bluetooth wireless communication protocol.

[0003] Currently, Bluetooth sensors typically use two connection technologies: wireless mesh and traditional Bluetooth. While mesh technology offers a relatively comprehensive security authentication mechanism, it is complex, takes time to build, and is complex to configure. Bluetooth sensors using traditional Bluetooth technology lack a security authentication mechanism. If pairing is used for security authentication, manual authentication is required on both the primary device and the Bluetooth sensor, resulting in a complex and poor user experience. Therefore, Bluetooth sensors typically don't use pairing for security authentication.

[0004] In the above scheme, due to the complex pairing method, most Bluetooth sensors usually use unencrypted transparent communication, which is easy to be intercepted and cracked. If an illegal device maliciously connects to the main device through Bluetooth Low Energy (BLE) technology, it can intercept the device data packet, crack the data format, and then achieve the purpose of tampering with the data, the consequences will be very serious. Summary of the Invention

[0005] The present application provides a method for preventing malicious connections of Bluetooth sensors, which can effectively prevent illegally connected devices from affecting the normal use of the communication control main device, while reducing the risk of data theft and cracking of the communication control main device. The technical solution is as follows.

[0006] In one aspect, a method for preventing malicious connection of a Bluetooth sensor is provided. The method is executed by a communication control master device in a Bluetooth sensor anti-malicious connection system, the system further comprising at least one sub-device; the communication control master device is in communication connection with the sub-device;

[0007] The method comprises:

[0008] Periodically sending a legal control instruction to a target sub-device; the target sub-device is any sub-device among the at least one sub-device;

[0009] receiving a target data packet fed back by the target sub-device according to the legal control instruction;

[0010] Performing a validity analysis on the target data packet and obtaining the analysis result;

[0011] According to the analysis result, the connection state between the communication control main device and the target sub-device is controlled.

[0012] In another aspect, a Bluetooth sensor anti-malicious connection system is provided, the system comprising: a communication control main device and at least one sub-device; the communication control main device is communicatively connected to the sub-device;

[0013] The communication control master device is used to:

[0014] Periodically sending a legal control instruction to a target sub-device; the target sub-device is any sub-device among the at least one sub-device;

[0015] receiving a target data packet fed back by the target sub-device according to the legal control instruction;

[0016] Performing a validity analysis on the target data packet and obtaining the analysis result;

[0017] According to the analysis result, the connection state between the communication control main device and the target sub-device is controlled.

[0018] On the other hand, a Bluetooth sensor anti-malicious connection device is provided, which is applied to a communication control main device, a communication control main device and at least one sub-device in a Bluetooth sensor anti-malicious connection system; the communication control main device is communicatively connected with the sub-device;

[0019] The device comprises:

[0020] a legal control instruction sending module, configured to periodically send legal control instructions to a target sub-device; the target sub-device being any sub-device among the at least one sub-device;

[0021] A target data packet receiving module, configured to receive a target data packet fed back by the target sub-device according to the legal control instruction;

[0022] The parsing result acquisition module is used to perform a legality analysis on the target data packet and obtain the parsing result;

[0023] A connection status control module is used to control the connection status between the communication control main device and the target sub-device according to the analysis result.

[0024] In a possible implementation, the communication control main device includes a gateway, and the target sub-device includes the Bluetooth sensor.

[0025] In a possible implementation, the legal control instruction is used to instruct the target sub-device to feed back a target data packet that complies with a message transmission protocol to the communication control main device; the legal control instruction includes identifier information, control information, and verification information.

[0026] In a possible implementation, the parsing result acquisition module is further configured to:

[0027] The legitimacy of the target data packet is verified according to the verification information in the legal control instruction.

[0028] In a possible implementation manner, the connection state control is further used to:

[0029] When the parsed result of the target data packet is a legal data packet, controlling the connection state between the communication control main device and the target sub-device according to the time interval between the two most recent communication times of the target sub-device;

[0030] When the parsing result of the target data packet is an illegal data packet, the connection between the communication control main device and the target sub-device is disconnected.

[0031] In a possible implementation, the connection status control module is further configured to:

[0032] Obtaining the last communication time of the target sub-device according to the communication record of the target sub-device;

[0033] Obtaining the difference between the current communication time and the previous communication time of the target sub-device;

[0034] When the difference exceeds a target time threshold, the connection between the communication control master device and the target sub-device is disconnected.

[0035] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the above-mentioned method for preventing malicious connection of a Bluetooth sensor.

[0036] On the other hand, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned method for preventing malicious connection of a Bluetooth sensor.

[0037] In another aspect, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform.

[0038] The technical solution provided by this application may have the following beneficial effects:

[0039] The present application achieves correct identification of legitimate sub-devices by periodically sending legitimate control instructions to the target sub-device and receiving the target data packet fed back by the target sub-device based on the legitimate control instructions. At the same time, the operating status of the sub-device is also detected. If the correct and legitimate target database is received, the sub-device is regarded as a legitimate sub-device. If no feedback information from the legitimate sub-device is received after the target time threshold, the legitimate sub-device is regarded as an abnormal working state, thereby realizing that the communication control main device actively disconnects the communication with the illegal device and the legitimate sub-device in the abnormal working state.

[0040] This application only modifies the software on the communication control main device side, does not add any user or Bluetooth sensor operations, does not require software modifications to the legitimate sub-devices connected to the communication control main device, and uses legal data communication and timeout check mechanisms to identify illegal devices, thereby minimizing user difficulties. It can effectively prevent illegally connected devices from affecting the normal use of the communication control main device, while reducing the risk of data theft and cracking of the communication control main device. The user experience is the same as that of existing Bluetooth sensors, thereby improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the specific implementation methods or the description of the prior art. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0042] Figure 1 The figure is a schematic structural diagram of a Bluetooth sensor anti-malicious connection system according to an exemplary embodiment.

[0043] Figure 2 The present invention is a flowchart of a method for preventing malicious connection of a Bluetooth sensor according to an exemplary embodiment.

[0044] Figure 3 The present invention is a flowchart of a method for preventing malicious connection of a Bluetooth sensor according to an exemplary embodiment.

[0045] Figure 4 The present invention is a flowchart of a method for preventing malicious connection of a Bluetooth sensor according to an exemplary embodiment.

[0046] Figure 5 The figure is a structural block diagram of a device for preventing malicious connection of a Bluetooth sensor according to an exemplary embodiment.

[0047] Figure 6 A structural block diagram of a computer device shown in an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION

[0048] The following will clearly and completely describe the technical solution of this application in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.

[0049] It should be understood that the "indication" mentioned in the embodiments of this application can be a direct indication, an indirect indication, or an indication of an association. For example, "A indicates B" can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association between A and B.

[0050] In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between the two, or an association relationship between the two, or a relationship between indication and being indicated, configuration and being configured, etc.

[0051] Figure 1 This is a schematic diagram of a Bluetooth sensor anti-malicious connection system according to an exemplary embodiment. The system includes: a communication control main device and at least one sub-device; the communication control main device is in communication connection with the sub-device;

[0052] The communication control master device is used to:

[0053] Periodically sending a legal control instruction to a target sub-device; the target sub-device is any sub-device among the at least one sub-device;

[0054] receiving a target data packet fed back by the target sub-device according to the legal control instruction;

[0055] Perform a validity analysis on the target data packet and obtain the analysis result;

[0056] According to the analysis result, the connection state between the communication control main device and the target sub-device is controlled.

[0057] Further, such as Figure 1 As shown, in actual application, the system may include multiple sub-devices, and the target sub-device may be any of the multiple sub-devices. Each sub-device is a BLE sub-device (such as a Bluetooth sensor), that is, each sub-device is connected to a communication control main device using Bluetooth low energy technology (BLE). The communication control main device is a device with connection and data processing functions (such as a gateway). When the communication control main device is a gateway and the target sub-device is a Bluetooth sensor, the sub-device is connected to the cloud platform through the communication control main device, and the sub-device data is reported to the cloud platform. The mobile terminal (such as a mobile phone) obtains the real-time data of the sub-device from the cloud platform. The sub-device is connected to the communication control main device using universal Bluetooth communication technology. Bluetooth communication technology has the advantages of low power consumption, low cost, wide application, and can be directly connected to mobile phones.

[0058] To sum up, the present application achieves correct identification of legitimate sub-devices by periodically sending legitimate control instructions to the target sub-device and receiving the target data packet feedback by the target sub-device based on the legitimate control instructions. At the same time, the operating status of the sub-device is also detected. If the correct and legitimate target database is received, the sub-device is regarded as a legitimate sub-device. If the feedback information of the legitimate sub-device is not received after the target time threshold, the legitimate sub-device is regarded as an abnormal working state, thereby realizing the active disconnection of communication between the communication control main device side and the illegal device and the legitimate sub-device in the abnormal working state.

[0059] This application only modifies the software on the communication control main device side, does not add any user or Bluetooth sensor operations, does not require software modifications to the legitimate sub-devices connected to the communication control main device, and uses legal data communication and timeout check mechanisms to identify illegal devices, thereby minimizing user difficulties. It can effectively prevent illegally connected devices from affecting the normal use of the communication control main device, while reducing the risk of data theft and cracking of the communication control main device. The user experience is the same as that of existing Bluetooth sensors, thereby improving user experience.

[0060] Figure 2 This is a flowchart of a method for preventing malicious connection of a Bluetooth sensor according to an exemplary embodiment. Figure 1 The communication control master device in the Bluetooth sensor anti-malicious connection system shown is executed. The system also includes at least one sub-device; the communication control master device is in communication connection with the sub-device. Figure 2 As shown, the method may include the following steps:

[0061] Step S201: Periodically send a legal control instruction to a target sub-device, where the target sub-device is any sub-device among the at least one sub-device.

[0062] In one possible implementation, in order to identify the legitimacy of the identity of each sub-device, the communication control main device periodically sends legal control instructions to the target sub-device connected to itself. The legal control instructions are used to issue control instructions to the target sub-device, so that the target sub-device feeds back a data packet according to the control instruction. In addition, the legal control instructions specify the legal format of the data packet fed back by the target sub-device to authenticate the legitimacy of the identity of the target sub-device. The target sub-device is the sub-device to be authenticated that is connected to the communication control main device.

[0063] Step S202: Receive the target data packet fed back by the target sub-device according to the legal control instruction.

[0064] In one possible implementation, after the communication control master device sends a legitimate control instruction to the target sub-device, the target sub-device will feedback the legitimate control instruction, that is, the target sub-device will send a target data packet to the communication control master device connected to it according to the legitimate control instruction, and the communication control master device will monitor the target data packet fed back by the target sub-device in real time.

[0065] Furthermore, the target data packet is a data packet with a legal format that is fed back by the target sub-device according to the legal control instruction. For example, if the communication control main device is connected to a Bluetooth sub-device of a temperature sensor, the communication control main device sends an instruction to query the current temperature to the temperature sensor sub-device (legal instructions have corresponding data format and content). The temperature sensor sub-device will respond to the instruction and reply with a data packet carrying the current temperature information to the communication control main device. Based on the format and content of the data packet, the legality of the data packet can be confirmed and the legality of the temperature sensor sub-device can be judged.

[0066] Step S203: perform a validity analysis on the target data packet and obtain the analysis result.

[0067] In a possible implementation, in order to achieve real-time monitoring of the target data packet fed back by the target sub-device, the communication control master device needs to parse the legitimacy of the target data packet to identify whether the target sub-device is a legitimate sub-device or an illegitimate sub-device.

[0068] Step S204: Control the connection status between the communication control main device and the target sub-device according to the analysis result.

[0069] In one possible implementation, when the parsing result of the target data packet is legal, that is, when the target sub-device is a legal sub-device, the current communication time of the target sub-device is recorded, and the time difference (i.e., the difference) between the current communication time of the target sub-device and the previous communication time of the target sub-device is calculated, and the connection status of the target sub-device is controlled according to the difference. If the time difference exceeds the target time threshold, it indicates that the target sub-device is in an abnormal working state. At this time, the communication control master device actively disconnects the communication control master device from the target sub-device; when the time difference is within the target time threshold range, it indicates that the target sub-device is in a normal working state. At this time, the communication control master device maintains the connection with the target sub-device.

[0070] To sum up, the present application achieves correct identification of legitimate sub-devices by periodically sending legitimate control instructions to the target sub-device and receiving the target data packet feedback by the target sub-device based on the legitimate control instructions. At the same time, the operating status of the sub-device is also detected. If the correct and legitimate target database is received, the sub-device is regarded as a legitimate sub-device. If the feedback information of the legitimate sub-device is not received after the target time threshold, the legitimate sub-device is regarded as an abnormal working state, thereby realizing the active disconnection of communication between the communication control main device side and the illegal device and the legitimate sub-device in the abnormal working state.

[0071] This application only modifies the software on the communication control main device side, does not add any user or Bluetooth sensor operations, does not require software modifications to the legitimate sub-devices connected to the communication control main device, and uses legal data communication and timeout check mechanisms to identify illegal devices, thereby minimizing user difficulties. It can effectively prevent illegally connected devices from affecting the normal use of the communication control main device, while reducing the risk of data theft and cracking of the communication control main device. The user experience is the same as that of existing Bluetooth sensors, thereby improving user experience.

[0072] Figure 3 This is a flowchart of a method for preventing malicious connection of a Bluetooth sensor according to an exemplary embodiment. Figure 1 The communication control master device in the Bluetooth sensor anti-malicious connection system shown is executed. The system also includes at least one sub-device; the communication control master device is in communication connection with the sub-device. Figure 3 As shown, the method may include the following steps:

[0073] Step S301: Periodically send a legal control instruction to a target sub-device; the target sub-device is any sub-device among the at least one sub-device.

[0074] In one possible implementation, the communication control main device includes a gateway, and the target sub-device includes the Bluetooth sensor; the legal control instruction is used to instruct the target sub-device to feedback a target data packet that complies with a message transmission protocol to the communication control main device; the legal control instruction includes identifier information, control information, and verification information.

[0075] Furthermore, the sub-device can be any sub-device among the multiple sub-devices, each sub-device being a BLE sub-device (such as a Bluetooth sensor), and the communication control master device periodically sends legal control instructions to the BLE sub-device connected to itself, and the legal control instructions are used to instruct the target sub-device to feedback the target data packet that complies with the message transmission protocol to the communication control master device, that is, the legal control instructions include instructions instructing the target sub-device to feedback legal reply information to the communication control master device.

[0076] Exemplarily, the cycle length can be 1 minute, and the instruction format of the legal control instruction can be: 6F (start identifier) ​​+ basic information of the packet header + information content + check code + 6F (end identifier); 6F in the control instruction is a unique identifier implemented by escaping, which makes it easy for the sub-device to identify the correct message body and thus provide legal message feedback.

[0077] Among them, 6F represents the start identifier or end identifier. After receiving the data, the sub-device or communication control main device needs to confirm the starting position of the legal data. The identifier is the starting (ending) position of the legal data agreed upon by the communication parties, and the data between two adjacent identifiers is considered to be legal data; the basic information of the packet header generally includes the purpose of the packet data, data length, communication time, and some special-purpose packet identifiers, etc., so that the recipient can quickly understand the purpose of the packet; the information content is used to achieve the communication purpose of the packet; the verification code is used to verify the legitimacy of the identity and prevent malicious cracking, etc.

[0078] This embodiment periodically sends legal control instructions and regularly detects feedback information from each sub-device to achieve correct identification of each sub-device. At the same time, it also detects the operating status of each sub-device in disguise (if a correct legal data packet is received, the target sub-device is considered to be in a normal working state, and if no legal data packet is received within the timeout period, the sub-device is considered to be in an abnormal working state). In this way, active communication disconnection with illegal devices and sub-devices in abnormal working states is achieved.

[0079] Step S302: Receive the target data packet fed back by the target sub-device according to the legal control instruction.

[0080] In a possible implementation, the communication control master device monitors in real time the received target data packet that complies with the message transmission protocol (following the example of the above instruction format, the target data packet is a data packet with 6F as the identifier).

[0081] Step S303: parse the target data packet for legitimacy and obtain the parsing result.

[0082] In a possible implementation, the legitimacy of the target data packet is verified according to the verification information in the legal control instruction.

[0083] Step S304: When the parsed result of the target data packet is a legal data packet, the difference between the current communication time and the previous communication time of the target sub-device is obtained. When the difference exceeds the target time threshold, the connection between the communication control main device and the target sub-device is disconnected.

[0084] In a possible implementation, obtaining the last communication time of the target sub-device according to the communication record of the target sub-device;

[0085] Get the difference between the current communication time and the previous communication time of the target sub-device;

[0086] When the difference exceeds the target time threshold, the connection between the communication control master device and the target sub-device is disconnected.

[0087] For further information, please refer to Figure 4 The present invention provides a method flow chart for preventing malicious connections of Bluetooth sensors. When the parsing result of a target data packet is illegal, the target sub-device is identified as an illegal sub-device. Since the illegal device cannot send a legitimate target data packet to the communication control main device, it will be actively disconnected by the communication control main device, thus preventing malicious connections by the illegal device. When the parsing result of the target data packet is legitimate, the target sub-device is a legitimate sub-device. The communication control main device then periodically detects the difference between the current communication time of the target sub-device and the last communication time. When the difference exceeds a target time threshold (the target time threshold is a predetermined timeout period, typically three times the heart cycle heart_cycle), it indicates that the target sub-device is in an abnormal operating state. At this time, the communication control main device actively disconnects the communication control main device from the target sub-device, achieving active disconnection with the lost device. When the difference does not exceed the target time threshold, it indicates that the target sub-device is in a normal operating state. At this time, the communication control main device maintains the connection between the communication control main device and the target sub-device.

[0088] Step S305: When the parsing result of the target data packet is an illegal data packet, disconnect the communication control main device from the target sub-device.

[0089] Furthermore, after receiving the target data packet sent by the target sub-device via Bluetooth Low Energy (BLE), the communication control master device analyzes the legitimacy of the target data packet and verifies the legitimacy of the target data packet using the checksum in the legitimate control instruction. After confirming legitimacy, it updates and records the current communication time of the target sub-device. If the target data packet verifies as illegal, it actively disconnects the communication control master device from the target sub-device. This prevents illegally connected devices from affecting the normal use of the communication control master device and reduces the risk of data theft and hacking on the communication control master device.

[0090] The above embodiment only implements active security detection on the side of the communication control master device. That is to say, the above embodiment only modifies the software on the communication control master device side, does not add any user or Bluetooth sensor operations, and does not require software modifications to each slave device connected to the communication control master device. Illegal devices can be identified only through legal data communication and timeout check mechanism, which minimizes the user's difficulty in use and improves user experience.

[0091] To sum up, the present application achieves correct identification of legitimate sub-devices by periodically sending legitimate control instructions to the target sub-device and receiving the target data packet feedback by the target sub-device based on the legitimate control instructions. At the same time, the operating status of the sub-device is also detected. If the correct and legitimate target database is received, the sub-device is regarded as a legitimate sub-device. If the feedback information of the legitimate sub-device is not received after the target time threshold, the legitimate sub-device is regarded as an abnormal working state, thereby realizing the active disconnection of communication between the communication control main device side and the illegal device and the legitimate sub-device in the abnormal working state.

[0092] This application only modifies the software on the communication control main device side, does not add any user or Bluetooth sensor operations, does not require software modifications to the legitimate sub-devices connected to the communication control main device, and uses legal data communication and timeout check mechanisms to identify illegal devices, thereby minimizing user difficulties. It can effectively prevent illegally connected devices from affecting the normal use of the communication control main device, while reducing the risk of data theft and cracking of the communication control main device. The user experience is the same as that of existing Bluetooth sensors, thereby improving user experience.

[0093] Figure 5 This is a block diagram of a Bluetooth sensor anti-malicious connection device according to an exemplary embodiment. The device is applied to a communication control master device in a Bluetooth sensor anti-malicious connection system, a communication control master device and at least one sub-device; the communication control master device is in communication with the sub-device;

[0094] The device includes:

[0095] A legal control instruction sending module 501 is configured to periodically send legal control instructions to a target sub-device; the target sub-device is any sub-device among the at least one sub-device;

[0096] A target data packet receiving module 502 is configured to receive a target data packet fed back by the target sub-device according to the legal control instruction;

[0097] The parsing result acquisition module 503 is used to perform a validity analysis on the target data packet and obtain the parsing result;

[0098] The connection status control module 504 is configured to control the connection status between the communication control master device and the target sub-device according to the analysis result.

[0099] In a possible implementation, the communication control main device includes a gateway, and the target sub-device includes the Bluetooth sensor.

[0100] In a possible implementation, the legal control instruction is used to instruct the target sub-device to feed back a target data packet that complies with a message transmission protocol to the communication control main device; the legal control instruction includes identifier information, control information, and verification information.

[0101] In a possible implementation, the parsing result acquisition module 503 is further configured to:

[0102] The legitimacy of the target data packet is verified according to the verification information in the legal control instruction.

[0103] In a possible implementation, the connection state control module 504 is further configured to:

[0104] When the parsed result of the target data packet is a legal data packet, controlling the connection state between the communication control main device and the target sub-device according to the time interval between the two most recent communication times of the target sub-device;

[0105] When the parsing result of the target data packet is an illegal data packet, the connection between the communication control main device and the target sub-device is disconnected.

[0106] In a possible implementation, the connection state control module 504 is further configured to:

[0107] Obtaining the last communication time of the target sub-device according to the communication record of the target sub-device;

[0108] Obtaining the difference between the current communication time and the previous communication time of the target sub-device;

[0109] When the difference exceeds a target time threshold, the connection between the communication control master device and the target sub-device is disconnected.

[0110] To sum up, the present application achieves correct identification of legitimate sub-devices by periodically sending legitimate control instructions to the target sub-device and receiving the target data packet feedback by the target sub-device based on the legitimate control instructions. At the same time, the operating status of the sub-device is also detected. If the correct and legitimate target database is received, the sub-device is regarded as a legitimate sub-device. If the feedback information of the legitimate sub-device is not received after the target time threshold, the legitimate sub-device is regarded as an abnormal working state, thereby realizing the active disconnection of communication between the communication control main device side and the illegal device and the legitimate sub-device in the abnormal working state.

[0111] This application only modifies the software on the communication control main device side, does not add any user or Bluetooth sensor operations, does not require software modifications to the legitimate sub-devices connected to the communication control main device, and uses legal data communication and timeout check mechanisms to identify illegal devices, thereby minimizing user difficulties. It can effectively prevent illegally connected devices from affecting the normal use of the communication control main device, while reducing the risk of data theft and cracking of the communication control main device. The user experience is the same as that of existing Bluetooth sensors, thereby improving user experience.

[0112] See also Figure 6 , which is a schematic diagram of a computer device provided according to an exemplary embodiment of the present application, the computer device includes a memory and a processor, the memory is used to store a computer program, and when the computer program is executed by the processor, the above-mentioned method for preventing malicious connection of a Bluetooth sensor is implemented.

[0113] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0114] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods described in the embodiments of the present invention. The processor executes the non-transitory software programs, instructions, and modules stored in the memory to perform various processor functions and data processing, thereby implementing the methods described in the aforementioned method embodiments.

[0115] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0116] In an exemplary embodiment, a computer-readable storage medium is further provided, storing at least one computer program, which is loaded and executed by a processor to implement all or part of the steps of the above method. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, or an optical data storage device.

[0117] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0118] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for preventing malicious connection of a Bluetooth sensor, characterized in that: The method is performed by a communication control main device in a Bluetooth sensor anti-malicious connection system, wherein the system further comprises at least one sub-device; the communication control main device is in communication connection with the sub-device; The method comprises: Periodically sending a legal control instruction to a target sub-device; the target sub-device is any sub-device among the at least one sub-device; receiving a target data packet fed back by the target sub-device according to the legal control instruction; the legal control instruction is used to instruct the target sub-device to feed back a target data packet that complies with a message transmission protocol to the communication control master device; the legal control instruction includes identifier information, control information, and verification information; Performing a validity analysis on the target data packet and obtaining the analysis result; According to the analysis result, controlling the connection state between the communication control main device and the target sub-device; The legitimacy analysis of the target data packet includes: Verifying the legitimacy of the target data packet according to the verification information in the legal control instruction; The controlling the connection state between the main device and the target sub-device according to the analysis result includes: When the parsed result of the target data packet is a legal data packet, controlling the connection state between the communication control main device and the target sub-device according to the time interval between the two most recent communication times of the target sub-device; When the parsing result of the target data packet is an illegal data packet, the connection between the communication control main device and the target sub-device is disconnected.

2. The method according to claim 1, characterized in that The communication control main device includes a gateway, and the target sub-device includes a Bluetooth sensor.

3. The method according to claim 1, characterized in that The controlling the connection state between the communication control main device and the target sub-device according to the time interval between the two most recent communication times of the target sub-device includes: Obtaining the last communication time of the target sub-device according to the communication record of the target sub-device; Obtaining the difference between the current communication time and the previous communication time of the target sub-device; When the difference exceeds a target time threshold, the connection between the communication control master device and the target sub-device is disconnected.

4. A Bluetooth sensor anti-malicious connection system, characterized in that: The system includes: a communication control main device and at least one sub-device; the communication control main device is communicatively connected with the sub-device; The communication control master device is used to: Periodically sending a legal control instruction to a target sub-device; the target sub-device is any sub-device among the at least one sub-device; receiving a target data packet fed back by the target sub-device according to the legal control instruction; the legal control instruction is used to instruct the target sub-device to feed back a target data packet that complies with a message transmission protocol to the communication control master device; the legal control instruction includes identifier information, control information, and verification information; Performing a validity analysis on the target data packet and obtaining the analysis result; According to the analysis result, controlling the connection state between the communication control main device and the target sub-device; The legitimacy analysis of the target data packet includes: Verifying the legitimacy of the target data packet according to the verification information in the legal control instruction; The controlling the connection state between the main device and the target sub-device according to the analysis result includes: When the parsed result of the target data packet is a legal data packet, controlling the connection state between the communication control main device and the target sub-device according to the time interval between the two most recent communication times of the target sub-device; When the parsing result of the target data packet is an illegal data packet, the connection between the communication control main device and the target sub-device is disconnected.

5. A Bluetooth sensor anti-malicious connection device, characterized in that: The device is applied to a communication control main device in a Bluetooth sensor anti-malicious connection system, a communication control main device and at least one sub-device; the communication control main device is communicatively connected with the sub-device; The device comprises: a legal control instruction sending module, configured to periodically send legal control instructions to a target sub-device; the target sub-device being any sub-device among the at least one sub-device; a target data packet receiving module, configured to receive a target data packet fed back by the target sub-device according to the legal control instruction; the legal control instruction is used to instruct the target sub-device to feed back a target data packet conforming to a message transmission protocol to the communication control master device; the legal control instruction includes identifier information, control information, and verification information; The parsing result acquisition module is used to perform a legality analysis on the target data packet and obtain the parsing result; a connection status control module, configured to control the connection status between the communication control master device and the target sub-device according to the analysis result; The parsing result acquisition module is further configured to verify the legitimacy of the target data packet according to the verification information in the legal control instruction; The connection status control module is also used to control the connection status between the communication control main device and the target sub-device according to the time interval between the two most recent communication times of the target sub-device when the parsing result of the target data packet is a legal data packet; and disconnect the connection between the communication control main device and the target sub-device when the parsing result of the target data packet is an illegal data packet.

6. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement a method for preventing malicious connection of a Bluetooth sensor according to any one of claims 1 to 3.

7. A computer-readable storage medium, characterized in that The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for preventing malicious connection of a Bluetooth sensor according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • BLE gateway communication method and system and computer equipment

    CN113645603A