Bluetooth communication method and unlocking system

By continuously writing and querying the data in the buffer in the Bluetooth communication module, the reception duration is dynamically adjusted, which solves the timeout problem caused by the slowdown of Bluetooth communication and ensures the integrity and security of data transmission.

CN118736710AActive Publication Date: 2024-10-01XIAMEN HUASHU ELECTRIC POWER SCI & TECH CO LTD
View PDF 15 Cites 0 Cited by

Patent Information

Application Number
CN202410910345.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-10-01
Estimated Expiration
2044-07-08

AI Technical Summary

Technical Problem

In security control scenarios, Bluetooth communication slows down, causing communication to time out and causing data transmission failure.

Method used

By continuously writing the received Bluetooth data to the buffer in the Bluetooth communication module, and querying the data in the buffer at preset time intervals, the actual frame reception duration is determined. If the preset duration is exceeded, the preset duration is updated to Ensures all data is received within the new duration and generates notifications or warning signals if necessary.

Benefits of technology

It effectively avoids Bluetooth communication timeout and data loss, ensures the integrity and success of data transmission, and improves the reliability and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736710A_ABST
    Figure CN118736710A_ABST
Patent Text Reader

Abstract

The invention discloses a Bluetooth communication method and an unlocking system, relates to the technical field of locks, and solves the problem that the Bluetooth communication speed is slowed down due to the fact that two pieces of equipment performing Bluetooth communication have different communication processing or operation time at present. The method comprises the following steps: establishing a Bluetooth connection with a terminal, continuously writing received Bluetooth data into a buffer area of an electronic key, then carrying out frame start character detection on the buffer area, when the frame start character is detected, determining frame receiving start time, then querying the continuously written Bluetooth data from the buffer area at preset time intervals, and sending the queried Bluetooth data to the terminal. And if the current query time exceeds the preset frame receiving time, updating the preset frame receiving time to replace the preset frame receiving time, so as to receive all the Bluetooth data about the lock permission information within the updated preset frame receiving time, and if the actual frame receiving time corresponding to the current query time exceeds the preset frame receiving time, replacing the preset frame receiving time by using the updated preset frame receiving time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of locks, and in particular to a Bluetooth communication method and unlocking system. Background Art

[0002] With the development of smart locks, passive electronic locks have emerged. Passive electronic locks are often used in security control scenarios. Since the use of public networks or wireless LANs is prohibited in security control scenarios, Bluetooth technology, as a short-range wireless communication technology, can be used for local communication in security control scenarios. For example, in a factory equipped with a server involved in the operation of the power grid system, since the server is crucial to the safe operation of the power grid system, only authorized personnel can enter. Therefore, passive electronic locks are often installed on the entrance door of the factory to further improve security. Corresponding to the passive electronic lock is an electronic key. The electronic key needs to establish a Bluetooth connection with the terminal first and receive the work ticket transmitted by the terminal. The work ticket usually includes the address, name, permission type, permission time and other information of the passive electronic lock. According to the work ticket, the passive electronic lock is powered and communicated, and then the switch lock command can be issued to the passive smart lock. If there is permission, the lock responds to the switch lock command operation. However, in actual applications, since the two devices performing Bluetooth communication often have different communication processing or running times, the Bluetooth communication speed slows down, causing communication timeouts and data transmission failures. Summary of the invention

[0003] The embodiments of the present application provide a Bluetooth communication method and unlocking system, the main purpose of which is to solve the current problem that the two devices performing Bluetooth communication often have different communication processing or running times, which causes the Bluetooth communication speed to slow down, causes communication timeouts, and causes data transmission failures.

[0004] According to a first aspect of the present application, a Bluetooth communication method is provided, which is applied to a Bluetooth communication module of an electronic key, comprising:

[0005] Establishing a Bluetooth connection with a terminal, and in the process of continuously receiving Bluetooth data about lock authority information transmitted by the terminal, continuously writing the received Bluetooth data into the buffer of the electronic key, wherein the Bluetooth data includes a frame data length, a frame start character and frame data;

[0006] Performing frame start character detection on the buffer, and when the frame start character is detected from the buffer, determining the time when the frame start character is detected as the frame reception start time;

[0007] querying the continuously written Bluetooth data from the buffer at every preset time interval and determining a corresponding query time, and determining an actual frame reception duration based on the frame reception start time, the query time and the continuously written Bluetooth data;

[0008] If it is determined that the actual frame reception duration corresponding to the current query time exceeds the preset frame reception duration, the updated preset frame reception duration is obtained, and the preset frame reception duration is used to replace the preset frame reception duration, so as to receive all Bluetooth data about lock authority information within the updated preset frame reception duration, wherein the time interval between the current query time and the frame reception start time is an integer multiple of the preset time interval.

[0009] Optionally, determining the actual frame reception duration based on the frame reception start time, the query time, and the continuously written Bluetooth data includes:

[0010] Extracting current frame data and the frame data length from the continuously written Bluetooth data;

[0011] Determine the current frame data length based on the current frame data, and calculate the difference between the frame data length and the current frame data length to obtain the length of the frame data to be received;

[0012] Calculating the time interval between the query time and the frame reception start time, and calculating the ratio of the current frame data length to the time interval to obtain a reception rate;

[0013] The ratio between the length of the frame data to be received and the receiving rate is calculated to obtain the remaining frame receiving time, and the sum of the remaining frame receiving time and the time interval is calculated to obtain the actual frame receiving time.

[0014] Optionally, if it is determined that the actual frame reception duration corresponding to the current query time exceeds the preset frame reception duration, before obtaining and updating the preset frame reception duration, the method further includes:

[0015] Obtaining adjacent continuously written Bluetooth data corresponding to a previous adjacent query time, extracting adjacent frame data from the adjacent continuously written Bluetooth data, and counting the number of first bytes of the adjacent frame data, wherein the time interval between the current query time and the previous adjacent query time is the preset time interval;

[0016] Determine the Bluetooth data currently being continuously written corresponding to the current query time, extract the current frame data from the Bluetooth data currently being continuously written, and count the number of second bytes of the current data;

[0017] Calculating a difference between the second number of bytes and the first number of bytes, and calculating a ratio of the difference to the preset time interval to obtain a byte transmission rate, wherein the second number of bytes is greater than the first number of bytes;

[0018] If the byte transmission rate does not reach the transmission rate threshold, the target update preset frame reception time is obtained, and the preset frame reception time is replaced with the target update preset frame reception time, so as to receive all Bluetooth data about the lock authority information within the target update preset frame reception time;

[0019] If the byte transmission rate reaches the transmission rate threshold, the actual frame reception duration corresponding to the current query time is compared with the preset frame reception duration.

[0020] Optionally, before calculating the difference between the second number of bytes and the first number of bytes, the method further includes:

[0021] When it is detected that the second byte number is equal to the first byte number, it is determined that the Bluetooth connection with the terminal is interrupted, and a notification signal for indicating the interruption of the Bluetooth connection is generated, and the notification signal is sent to the control module of the electronic key, so that when the control module receives the notification signal, it controls the early warning module of the electronic key to issue a sound warning.

[0022] Optionally, the method of replacing the preset frame reception duration with the updated preset frame reception duration, so as to receive all Bluetooth data about the lock authority information within the updated preset frame reception duration, further comprises:

[0023] When it is determined that all Bluetooth data about the lock authority information is received within the update preset frame reception time, extracting final frame data from all Bluetooth data about the lock authority information, summing all bytes in the final frame data to obtain a current check value;

[0024] Determine a target check value, if the current check value is inconsistent with the target check value, determine that the received Bluetooth data has a data anomaly, generate an early warning signal for indicating the data anomaly, and send the early warning signal to the control module of the electronic key, so that when the control module receives the early warning signal, it controls the early warning module of the electronic key to issue a sound early warning;

[0025] If the current check value is consistent with the target check value, all the Bluetooth data related to the lock authority information are decoded to obtain the lock authority information in the target format.

[0026] According to a second aspect of the present application, there is provided an unlocking system, comprising: an electronic key provided with an electronic tag, a radio frequency identification device and a terminal, wherein the electronic key comprises a Bluetooth communication module and a processing module;

[0027] The radio frequency identification device is arranged at a preset position around the passive electronic lock, and is used to identify the electronic tag of the electronic key, determine the key information of the electronic key, obtain the electronic lock information of the passive electronic lock, and transmit the key information and the electronic lock information to the terminal in a Bluetooth communication manner when the unlocking person holding the electronic key enters the target area;

[0028] The terminal is used to, upon receiving the key information and the electronic lock information, obtain lock authority information corresponding to the electronic lock information, convert the lock authority information corresponding to the electronic lock information into Bluetooth data about the lock authority information, and send the Bluetooth data to the electronic key indicated by the key information;

[0029] The Bluetooth communication module of the electronic key is configured to execute the Bluetooth communication method described in any one of the first aspects above upon receiving the Bluetooth data, and send the obtained lock authority information in the target format to the processing module;

[0030] The processing module of the electronic key is used to generate an unlocking instruction based on the lock authority information in the target format, and send the unlocking instruction to the passive electronic lock through the Bluetooth communication module, so that when the passive electronic lock receives the unlocking instruction, it extracts the key authority information from the unlocking instruction and determines whether to unlock based on the key authority information.

[0031] Optionally, the electronic key further includes a power supply module and a control module, and the control module is connected to the power supply module;

[0032] The control module is used to control the power supply module to dock and supply power to the passive electronic lock when receiving a power supply signal.

[0033] Optionally, the electronic key further includes an early warning module;

[0034] The early warning module is used to respond to the unlocking result, generate voice information indicating the unlocking result, and broadcast the voice information. The unlocking result is generated and returned by the passive electronic lock when it is determined that the unlocking is successful or failed.

[0035] Optionally, it also includes an identity recognition device;

[0036] The identity recognition device is arranged at a target position around the passive electronic lock, and is used to identify the unlocking person who enters the target area and obtain an identification result. When the identification result indicates that the unlocking person's identity is abnormal, a target warning signal indicating the identity abnormality is generated, and the target warning signal is sent to the electronic key via Bluetooth communication, so that the warning module of the electronic key performs a sound warning based on the target warning signal.

[0037] By means of the above technical solution, the present application provides a Bluetooth communication method and an unlocking system. The present application enables the Bluetooth communication module to receive Bluetooth data while writing the received Bluetooth data into the buffer. This can prevent blocking and prevent the previously received data from being overwritten by the later received data and causing data loss. At the same time, by querying the continuously written Bluetooth data from the buffer at preset time intervals, the actual frame reception duration corresponding to each query can be determined. By comparing the actual frame reception duration with the preset frame reception duration, it can be determined whether the preset frame reception duration needs to be reset. If necessary, the preset frame reception duration is replaced by the updated preset frame reception duration. This ensures that all Bluetooth data about the lock authority information is received, avoiding the problem of transmission failure. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A flowchart of a Bluetooth communication method provided by an embodiment of the present application is shown;

[0039] Figure 2 A flowchart of another Bluetooth communication method provided by an embodiment of the present application is shown;

[0040] Figure 3 A schematic structural diagram of an unlocking system provided in an embodiment of the present application is shown;

[0041] Figure 4 A schematic structural diagram of an electronic key of an unlocking system provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0042] Various aspects and features of the present application are described herein with reference to the accompanying drawings.

[0043] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.

[0044] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0045] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.

[0046] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.

[0047] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.

[0048] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.

[0049] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.

[0050] The present application embodiment provides a Bluetooth communication method, which is applied to a Bluetooth communication module of an electronic key, such as Figure 1 As shown, including:

[0051] 101. Establish a Bluetooth connection with a terminal, and in the process of continuously receiving Bluetooth data about lock authority information transmitted by the terminal, continuously write the received Bluetooth data into a buffer of the electronic key.

[0052] In the embodiment of the present application, in order to realize the unlocking operation of the passive electronic lock by the electronic key, the electronic key needs to obtain the lock authority information, that is, the execution subject of the present application is the Bluetooth communication module of the electronic key, and the Bluetooth communication module can execute the Bluetooth communication method of the present application. In order to realize the Bluetooth connection, the terminal also needs to be configured with a Bluetooth communication module. The terminal establishes a connection relationship with the Bluetooth communication module of the electronic key through its Bluetooth communication module, that is, the pairing is successful. At this time, the terminal can transmit the Bluetooth data about the lock authority information to the Bluetooth communication module of the electronic key. The Bluetooth data here includes the frame data length, the frame start character and the frame data. It should be clear that the Bluetooth data transmission requires a transmission time and is a continuous process. Therefore, the Bluetooth communication module also continuously receives the Bluetooth data, and in this receiving process, the received Bluetooth data is continuously written into the buffer of the electronic key. That is to say, the Bluetooth communication module receives the Bluetooth data while writing the received Bluetooth data into the buffer. The purpose of temporarily storing the data in the buffer is that the Bluetooth data can be received through interruption, releasing the CPU or single-chip microcomputer in the Bluetooth communication module to process other programs to prevent blocking. At the same time, the data can also be written into the buffer to prevent the previously received data from being overwritten by the later received data, resulting in data loss.

[0053] It should be noted that the Bluetooth communication module is an existing technology, which is usually composed of a Bluetooth chip, a crystal oscillator, a radio frequency amplifier, a filter and other circuits. The Bluetooth chip is the core component of the Bluetooth communication module and is mainly used to realize the wireless data transmission function. The Bluetooth chip includes a single-chip microcomputer, which can control the wireless connection of the Bluetooth chip and realize some communication protocols and related functions.

[0054] 102. Detect a frame start character in the buffer. When the frame start character is detected in the buffer, determine the time when the frame start character is detected as the frame reception start time.

[0055] In an embodiment of the present application, after the Bluetooth communication module writes the received Bluetooth data into the buffer, the frame start character detection can be performed on the buffer. When the frame start character is detected from the buffer, it indicates that the Bluetooth data is successfully written into the buffer, and the time when the frame start character is detected can be used as the frame reception start time.

[0056] 103. Query the continuously written Bluetooth data from the buffer at every preset time interval, and determine the corresponding query time, and determine the actual frame reception duration based on the frame reception start time, the query time and the continuously written Bluetooth data;

[0057] In the embodiment of the present application, since Bluetooth data is continuously transmitted, the Bluetooth communication module receives Bluetooth data while writing Bluetooth data into the buffer. Therefore, the buffer can be queried at preset time intervals, for example, the continuously written Bluetooth data can be queried from the buffer every 1 second, and the time of each query can also be determined, for example, 8:00:01, 8:00:02, 8:00:03. For each query, the actual frame reception duration can be determined based on the frame reception start time, the query time, and the continuously written Bluetooth data. That is, each query can obtain the corresponding actual frame reception duration.

[0058] 104. If it is determined that the actual frame reception duration corresponding to the current query time exceeds the preset frame reception duration, the updated preset frame reception duration is obtained, and the preset frame reception duration is replaced with the updated preset frame reception duration to receive all Bluetooth data about the lock authority information within the updated preset frame reception duration.

[0059] In an embodiment of the present application, for each query, the corresponding actual frame reception duration can be compared with the preset frame reception duration, where the preset frame reception duration is set in advance in the Bluetooth communication module. If a certain query time, that is, the actual frame reception duration corresponding to the current query time exceeds the preset frame reception duration, the updated preset frame reception duration is obtained, and the preset frame reception duration is replaced with the updated preset frame reception duration, that is, the Bluetooth communication module can reset the preset frame reception duration, and the purpose of doing so is to receive all Bluetooth data about lock authority information within the updated preset frame reception duration. It should also be noted that the time interval between the current query time and the frame reception start time is an integer multiple of the preset time interval.

[0060] Furthermore, the above-mentioned updated preset frame reception duration can be determined according to the frame reception start time, the query time and the continuously written Bluetooth data, that is, the frame data and the frame data length are extracted from the continuously written Bluetooth data, and the current frame length can be determined based on the frame data (including many bytes with time sequence), and the time interval between the query time and the frame reception start time is calculated. The ratio of the current frame length to the time interval is calculated to obtain a transmission rate, and then the ratio of the frame data length to the transmission rate is calculated to obtain a duration. This duration plus a preset time interval (which can be summarized based on experience and written into the relevant program in the Bluetooth communication module) is used as the updated preset frame reception duration.

[0061] It should be noted that if the preset frame reception duration is reset at the current query time, it is still necessary to query the continuously written Bluetooth data from the buffer at preset time intervals. In the future, the actual frame reception duration may exceed the preset frame reception duration. At this time, a new preset frame reception duration is obtained, and the previously updated preset frame reception duration is replaced, and the query operation is repeated until all Bluetooth data is received. In other words, by continuous querying, when the actual frame reception duration exceeds the preset frame reception duration, the time for the Bluetooth communication module to receive data can be extended by resetting the preset frame reception duration, and the problem of slowing down the Bluetooth communication speed, causing communication timeout, and causing data transmission failure in the prior art will not occur. In other words, even if the communication speed slows down, the present application can extend the reception duration to allow all Bluetooth data to be transmitted.

[0062] The method provided by the embodiment of the present application enables the Bluetooth communication module to receive Bluetooth data while writing the received Bluetooth data into the buffer. This can prevent blocking and prevent the previously received data from being overwritten by the later received data and causing data loss. At the same time, by querying the continuously written Bluetooth data from the buffer at preset time intervals, the actual frame reception duration corresponding to each query can be determined. By comparing the actual frame reception duration with the preset frame reception duration, it can be determined whether the preset frame reception duration needs to be reset. If necessary, the preset frame reception duration is replaced by the updated preset frame reception duration. This ensures that all Bluetooth data about the lock authority information is received, avoiding the problem of transmission failure.

[0063] Further, as a refinement and expansion of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation of this embodiment, the embodiment of the present application provides another Bluetooth communication method, such as Figure 2 As shown, including:

[0064] 201. Establishing a Bluetooth connection with a terminal, and in the process of continuously receiving Bluetooth data about lock authority information transmitted by the terminal, continuously writing the received Bluetooth data into a buffer of the electronic key.

[0065] 202. Perform frame start character detection on the buffer, and when the frame start character is detected from the buffer, determine the time when the frame start character is detected as the frame reception start time.

[0066] 203. Query the continuously written Bluetooth data from the buffer at every preset time interval and determine the corresponding query time, and determine the actual frame reception duration based on the frame reception start time, the query time and the continuously written Bluetooth data.

[0067] In an embodiment of the present application, based on the frame reception start time, the query time and the continuously written Bluetooth data, a specific method for determining the actual frame reception duration is as follows: first, extract the current frame data and the frame data length from the continuously written Bluetooth data; then, determine the current frame data length based on the current frame data, and calculate the difference between the frame data length and the current frame data length to obtain the length of the frame data to be received; then, calculate the time interval between the query time and the frame reception start time, and calculate the ratio of the current frame data length to the time interval to obtain the reception rate; finally, calculate the ratio between the length of the frame data to be received and the reception rate to obtain the remaining frame reception duration, and calculate the sum of the remaining frame reception duration and the time interval to obtain the actual frame reception duration.

[0068] 204. Perform byte detection on the continuously written Bluetooth data.

[0069] In an embodiment of the present application, before determining whether a timeout has occurred, the adjacent continuously written Bluetooth data corresponding to the previous adjacent query time can be first obtained, the adjacent frame data can be extracted from the adjacent continuously written Bluetooth data, and the first byte number of the adjacent frame data can be counted. It should be noted that the time interval between the current query time and the previous adjacent query time is the preset time interval; then the current continuously written Bluetooth data corresponding to the current query time is determined, the current frame data is extracted from the current continuously written Bluetooth data, and the second byte number of the current data is counted; then the difference between the second byte number and the first byte number is calculated, and the ratio of the difference to the preset time interval is calculated to obtain the byte transmission rate. It should be noted here that the second byte number is greater than the first byte number; if the byte transmission rate does not reach the transmission rate threshold, the target update preset frame reception duration is obtained, and the preset frame reception duration is replaced with the target update preset frame reception duration, so as to receive all Bluetooth data about the lock authority information within the target update preset frame reception duration, and if the byte transmission rate reaches the transmission rate threshold, the actual frame reception duration corresponding to the current query time is compared with the preset frame reception duration.

[0070] Furthermore, before calculating the difference between the second byte number and the first byte number, it is also possible to determine whether the second byte number is equal to the first byte number. For example, at 8:00:01, the first byte number is 20, and at 8:00:02, the second byte number is still 20. When it is detected that the second byte number is equal to the first byte number, it means that the Bluetooth data has not come in. In actual applications, Bluetooth data is transmitted in the form of Bluetooth packets. At this time, it can be determined that the Bluetooth connection with the terminal is interrupted, and a notification signal for indicating the interruption of the Bluetooth connection is generated, and the notification signal is sent to the control module of the electronic key, so that when the control module receives the notification signal, it controls the early warning module of the electronic key to issue a sound warning, for example, a broadcast is issued, that is, the Bluetooth connection is interrupted, please perform troubleshooting.

[0071] 205. If it is determined that the actual frame reception duration corresponding to the current query time exceeds the preset frame reception duration, the updated preset frame reception duration is obtained, and the preset frame reception duration is replaced with the updated preset frame reception duration to receive all Bluetooth data about the lock authority information within the updated preset frame reception duration.

[0072] 206. Verify all received Bluetooth data about lock authority information.

[0073] In an embodiment of the present application, when it is determined that all Bluetooth data about lock authority information is received within the update preset frame reception time, the final frame data can be extracted from all Bluetooth data about lock authority information, and all bytes in the final frame data are summed to obtain the current check value; then the target check value is determined, and if the current check value is inconsistent with the target check value, it is determined that a data abnormality occurs in the received Bluetooth data, and a warning signal for indicating the data abnormality is generated, and the warning signal is sent to the control module of the electronic key, so that when the control module receives the warning signal, it controls the warning module of the electronic key to issue a sound warning; if the current check value is consistent with the target check value, all Bluetooth data about the lock authority information is decoded to obtain the lock authority information in the target format.

[0074] It should be noted that the check byte information can be added to the end of the data frame, that is, the terminal calculates the frame data field of the entire frame data according to the agreed sum check algorithm to obtain the target check value, obtains the check byte information based on the target check value, and adds the check byte information to the end of the data frame. In other words, the Bluetooth data sent by the terminal will carry check byte information about the target check value at the end of the data frame. After receiving all Bluetooth data, the Bluetooth communication module can extract the target check value from it. In practical applications, the target check value can also be determined by algorithms such as CRC check. It should be noted that the Bluetooth communication module should use the same algorithm as the terminal.

[0075] The method provided by the embodiment of the present application enables the Bluetooth communication module to receive Bluetooth data while writing the received Bluetooth data into the buffer. This can prevent blocking and prevent the previously received data from being overwritten by the later received data and causing data loss. At the same time, by querying the continuously written Bluetooth data from the buffer at preset time intervals, the actual frame reception duration corresponding to each query can be determined. By comparing the actual frame reception duration with the preset frame reception duration, it can be determined whether the preset frame reception duration needs to be reset. If necessary, the preset frame reception duration is replaced by the updated preset frame reception duration. This ensures that all Bluetooth data about the lock authority information is received, avoiding the problem of transmission failure.

[0076] Furthermore, the locking process is the same as the above process and will not be described in detail here.

[0077] Furthermore, the present application embodiment provides a lock opening system, such as Figure 3 As shown, it includes: an electronic key provided with an electronic tag, a radio frequency identification device and a terminal, wherein the electronic key includes a Bluetooth communication module and a processing module;

[0078] The radio frequency identification device is arranged at a preset position around the passive electronic lock, and is used to identify the electronic tag of the electronic key, determine the key information of the electronic key, obtain the electronic lock information of the passive electronic lock, and transmit the key information and the electronic lock information to the terminal by Bluetooth communication when the unlocking personnel holding the electronic key enters the target area;

[0079] The terminal is used to obtain lock authority information corresponding to the electronic lock information when receiving the key information and the electronic lock information, convert the lock authority information corresponding to the electronic lock information into Bluetooth data about the lock authority information, and send the Bluetooth data to the electronic key indicated by the key information;

[0080] A Bluetooth communication module of the electronic key is used to execute the Bluetooth communication method when receiving Bluetooth data, and send the obtained lock authority information in the target format to the processing module;

[0081] The processing module of the electronic key is used to generate an unlocking instruction based on the lock authority information in a target format, and send the unlocking instruction to the passive electronic lock through the Bluetooth communication module, so that when the passive electronic lock receives the unlocking instruction, it extracts the key authority information from the unlocking instruction and determines whether to unlock based on the key authority information.

[0082] It should be noted that the unlocking command is encrypted. After receiving the unlocking command, the passive smart lock first decrypts the command information and checks whether there is operation permission. If there is permission, the lock drives the motion mechanism to open the lock. Otherwise, the operation is not performed and a failure signal is returned.

[0083] It should also be noted that the radio frequency identification device is composed of a reader and a data management system. It can be understood that the electronic tag, reader and data management system together constitute the RFID system. The reader, also called a reader, is mainly used to read the information in the electronic tag or write the required information into the tag; the main task of the data management system is to process the electronic tag data transmitted by the reader for analysis and complete the functions required by the user; the electronic tag is mainly used to store certain data information, and it will receive signals from the reader and send the required data back to the reader. The electronic tag is generally attached to or fixedly installed on the object.

[0084] Specifically, Figure 4As shown, in addition to the Bluetooth communication module and the processing module, the electronic key also includes a control module, a power supply module, and an early warning module. The control module can be connected to the power supply module. When the control module receives the power supply signal, it controls the power supply module to dock and supply power to the passive electronic lock. The early warning module can respond to the unlocking result, generate a voice message indicating the unlocking result, and broadcast the voice message. It should be noted that the unlocking result is generated and returned by the passive electronic lock when it determines that the unlocking is successful or failed, and is directly returned to the Bluetooth communication module. The Bluetooth communication module sends the unlocking result to the early warning module. This power supply signal can be generated when the unlocking personnel triggers the power switch of the electronic key, and this power supply signal can also be generated when the Bluetooth communication module receives the Bluetooth data.

[0085] It should be noted that the passive electronic lock is usually in a passive and non-working state, and includes a wireless carrier power supply communication unit. When the power supply module included in the electronic key interacts wirelessly with the wireless carrier power supply communication unit, the wireless carrier power supply communication unit can use the power supply module to power the passive electronic lock, thereby enabling the passive electronic lock to start working. This docking power supply between the electronic key and the passive electronic lock is a prior art. At the same time, passive electronic locks, such as electrical coded locks, are also prior art and can be easily obtained by those skilled in the art, so they will not be described in detail here.

[0086] Specifically, Figure 3 As shown, the unlocking system also includes an identity recognition device, which is set at a target position around the passive electronic lock, and is used to identify the unlocking personnel entering the target area, and obtain an identification result. When the identification result indicates that the unlocking personnel's identity is abnormal, a target warning signal for indicating the abnormal identity is generated, and the target warning signal is sent to the electronic key in a Bluetooth communication mode, and the Bluetooth communication module of the electronic key sends the target warning signal to the warning module of the electronic key. The warning module generates a voice message based on the target warning signal and broadcasts the voice message, so that the unlocking personnel holding the electronic key know that they are not qualified to unlock. It should be noted that in order to realize Bluetooth communication, a Bluetooth communication module needs to be set in the identity recognition device, and data needs to be sent or received through the Bluetooth communication module. In other words, the identity recognition device can be used to determine whether the relevant personnel entering the target area are in the white list, and the relevant personnel who are not in the white list are reported in time, which further improves the safety of unlocking.

[0087] It should be noted that the identity recognition device is preferably a face recognition device. The face images of the people in the white list are collected in advance. In order to avoid networking and increase security, the relevant information can be directly stored in the storage module in the face recognition device. The image acquisition module of the face recognition device can collect face images, and then perform image recognition through the image recognition module to identify the identity information. Then, the processing module can determine the recognition result based on the white list. It should be noted that the image recognition algorithm in the image recognition module is the optimal algorithm trained in advance and used directly.

[0088] The system provided by the embodiment of the present application can automatically identify the electronic tag on the electronic key through the radio frequency identification device, and then obtain the key information of the electronic key. At the same time, since each radio frequency identification device corresponds to a passive electronic lock, that is, the electronic lock information about the passive electronic lock is set in advance in the radio frequency identification device, and then the electronic lock information of the passive electronic lock can be directly obtained, and the key information and the electronic lock information are sent to the terminal in a Bluetooth communication mode. The terminal can obtain the lock authority information corresponding to the electronic lock information, and directly send it to the electronic key indicated by the key information in a Bluetooth communication mode, and there will be no communication failure, and finally obtain the lock authority information in the target format. The electronic key will power the passive electronic lock, and then generate an unlocking instruction based on the lock authority information in the target format, and send it to the passive electronic lock in a Bluetooth communication mode. When the passive electronic lock receives the unlocking instruction, it extracts the key authority information from the unlocking instruction and determines whether to unlock based on the key authority information. The unlocking process is completed automatically, which greatly improves the unlocking efficiency.

[0089] The above application serial numbers are for description only and do not represent the advantages or disadvantages of the implementation scenarios.

[0090] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.

Claims

1. A Bluetooth communication method, applied to a Bluetooth communication module of an electronic key, characterized in that: include: Establishing a Bluetooth connection with a terminal, and in the process of continuously receiving Bluetooth data about lock authority information transmitted by the terminal, continuously writing the received Bluetooth data into the buffer of the electronic key, wherein the Bluetooth data includes a frame data length, a frame start character and frame data; Performing frame start character detection on the buffer, and when the frame start character is detected from the buffer, determining the time when the frame start character is detected as the frame reception start time; querying the continuously written Bluetooth data from the buffer at every preset time interval and determining a corresponding query time, and determining an actual frame reception duration based on the frame reception start time, the query time and the continuously written Bluetooth data; If it is determined that the actual frame reception duration corresponding to the current query time exceeds the preset frame reception duration, the updated preset frame reception duration is obtained, and the preset frame reception duration is used to replace the preset frame reception duration, so as to receive all Bluetooth data about lock authority information within the updated preset frame reception duration, wherein the time interval between the current query time and the frame reception start time is an integer multiple of the preset time interval.

2. The Bluetooth communication method according to claim 1, characterized in that: The determining the actual frame reception duration based on the frame reception start time, the query time, and the continuously written Bluetooth data includes: Extracting current frame data and the frame data length from the continuously written Bluetooth data; Determine the current frame data length based on the current frame data, and calculate the difference between the frame data length and the current frame data length to obtain the length of the frame data to be received; Calculating the time interval between the query time and the frame reception start time, and calculating the ratio of the current frame data length to the time interval to obtain a reception rate; The ratio between the length of the frame data to be received and the receiving rate is calculated to obtain the remaining frame receiving time, and the sum of the remaining frame receiving time and the time interval is calculated to obtain the actual frame receiving time.

3. The Bluetooth communication method according to claim 1, characterized in that: If it is determined that the actual frame reception duration corresponding to the current query time exceeds the preset frame reception duration, before obtaining and updating the preset frame reception duration, the method further includes: Obtaining adjacent continuously written Bluetooth data corresponding to a previous adjacent query time, extracting adjacent frame data from the adjacent continuously written Bluetooth data, and counting the number of first bytes of the adjacent frame data, wherein the time interval between the current query time and the previous adjacent query time is the preset time interval; Determine the Bluetooth data currently being continuously written corresponding to the current query time, extract the current frame data from the Bluetooth data currently being continuously written, and count the number of second bytes of the current data; Calculating a difference between the second number of bytes and the first number of bytes, and calculating a ratio of the difference to the preset time interval to obtain a byte transmission rate, wherein the second number of bytes is greater than the first number of bytes; If the byte transmission rate does not reach the transmission rate threshold, the target update preset frame reception time is obtained, and the preset frame reception time is replaced with the target update preset frame reception time, so as to receive all Bluetooth data about the lock authority information within the target update preset frame reception time; If the byte transmission rate reaches the transmission rate threshold, the actual frame reception duration corresponding to the current query time is compared with the preset frame reception duration.

4. The Bluetooth communication method according to claim 3, characterized in that: Before calculating the difference between the second number of bytes and the first number of bytes, the method further includes: When it is detected that the second byte number is equal to the first byte number, it is determined that the Bluetooth connection with the terminal is interrupted, and a notification signal for indicating the interruption of the Bluetooth connection is generated, and the notification signal is sent to the control module of the electronic key, so that when the control module receives the notification signal, it controls the early warning module of the electronic key to issue a sound warning.

5. The Bluetooth communication method according to claim 1, characterized in that: The method of replacing the preset frame reception duration with the updated preset frame reception duration, so as to receive all Bluetooth data related to the lock authority information within the updated preset frame reception duration, further comprises: When it is determined that all Bluetooth data about the lock authority information is received within the update preset frame reception time, extracting final frame data from all Bluetooth data about the lock authority information, summing all bytes in the final frame data to obtain a current check value; Determine a target check value, if the current check value is inconsistent with the target check value, determine that the received Bluetooth data has a data anomaly, generate an early warning signal for indicating the data anomaly, and send the early warning signal to the control module of the electronic key, so that when the control module receives the early warning signal, it controls the early warning module of the electronic key to issue a sound early warning; If the current check value is consistent with the target check value, all the Bluetooth data related to the lock authority information are decoded to obtain the lock authority information in the target format.

6. A lock opening system, characterized in that: include: An electronic key, a radio frequency identification device and a terminal are provided with an electronic tag, wherein the electronic key includes a Bluetooth communication module and a processing module; The radio frequency identification device is arranged at a preset position around the passive electronic lock, and is used to identify the electronic tag of the electronic key, determine the key information of the electronic key, obtain the electronic lock information of the passive electronic lock, and transmit the key information and the electronic lock information to the terminal in a Bluetooth communication manner when the unlocking person holding the electronic key enters the target area; The terminal is used to, upon receiving the key information and the electronic lock information, obtain lock authority information corresponding to the electronic lock information, convert the lock authority information corresponding to the electronic lock information into Bluetooth data about the lock authority information, and send the Bluetooth data to the electronic key indicated by the key information; The Bluetooth communication module of the electronic key is used to execute the Bluetooth communication method according to any one of claims 1 to 5 upon receiving the Bluetooth data, and send the obtained lock authority information in a target format to the processing module; The processing module of the electronic key is used to generate an unlocking instruction based on the lock authority information in the target format, and send the unlocking instruction to the passive electronic lock through the Bluetooth communication module, so that when the passive electronic lock receives the unlocking instruction, it extracts the key authority information from the unlocking instruction and determines whether to unlock based on the key authority information.

7. The unlocking system according to claim 6, characterized in that: The electronic key further comprises a power supply module and a control module, wherein the control module is connected to the power supply module; The control module is used to control the power supply module to dock and supply power to the passive electronic lock when receiving a power supply signal.

8. The unlocking system according to claim 6, characterized in that: The electronic key also includes an early warning module; The early warning module is used to respond to the unlocking result, generate voice information indicating the unlocking result, and broadcast the voice information. The unlocking result is generated and returned by the passive electronic lock when it is determined that the unlocking is successful or failed.

9. The unlocking system according to claim 8, characterized in that: Also includes an identification device; The identity recognition device is arranged at a target position around the passive electronic lock, and is used to identify the unlocking person who enters the target area and obtain an identification result. When the identification result indicates that the unlocking person's identity is abnormal, a target warning signal indicating the identity abnormality is generated, and the target warning signal is sent to the electronic key via Bluetooth communication, so that the warning module of the electronic key performs a sound warning based on the target warning signal.

Citation Information

Patent Citations

  • Data receiving method capable of conducting dynamic timeout control based on count change

    CN103116557A

  • Remote-authorization unlocking method of passive labeled electronic lock

    CN104112306A

  • Passive intelligent lock cylinder system and implementation method thereof

    CN106296922A

  • Intelligent Bluetooth electronic lock

    CN106600794A

  • Bluetooth unlocking performance detection system, method and apparatus

    CN107948013A