Bluetooth transmission method and device of scanning pen, equipment and medium
By optimizing the Bluetooth heartbeat interval and hierarchical synchronization strategy, and combining it with the BLE 5.0+ protocol, the problems of unstable Bluetooth connection, high power consumption, and unreasonable data synchronization were solved, achieving low-power, high-stability data transmission for the scanning pen, and simplifying the pairing and reset process.
Patent Information
- Application Number
- CN202511791934.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-02-10
AI Technical Summary
Existing technologies suffer from unstable Bluetooth connections, high power consumption, unreasonable data synchronization, non-standard cache management, impact on device functionality during large file transfers, lack of power protection, and inconvenient Bluetooth pairing and reset operations.
The Bluetooth heartbeat interval is optimized using the BLE 5.0+ protocol to enable connection between the scanning pen and the client; a hierarchical synchronization strategy is used for data transmission; and a cache deletion mechanism is triggered after data transmission is completed.
The Bluetooth transmission power consumption of the scanning pen has been reduced, connection stability has been improved, data synchronization efficiency has been optimized, the battery life of the device has been ensured, and Bluetooth pairing and reset operations have been simplified.
Smart Images

Figure CN121509958A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of scanning equipment technology, and in particular to a Bluetooth transmission method, apparatus, device and storage medium for a scanning pen. Background Technology
[0002] Existing technologies face several unresolved issues in Bluetooth connectivity and data transmission scenarios. Firstly, regarding the balance between Bluetooth connection stability and power consumption, traditional technologies lack hardware layout optimization. Inappropriate Bluetooth antenna placement can lead to user hand obstruction, causing signal attenuation and frequent reconnections, significantly increasing power consumption. Simultaneously, short heartbeat detection intervals result in excessive unnecessary signal interaction, further exacerbating power consumption. Furthermore, insufficient signal penetration in metal casing scenarios affects connection reliability. Secondly, concerning background operation and reconnection mechanisms, apps struggle to quickly respond to Bluetooth device connection or data transmission requests after background processes are terminated. Traditional solutions lack system-level monitoring and wake-up mechanisms, resulting in the app failing to activate promptly when the device enters the connection range or needs to transmit data, impacting user experience.
[0003] Data synchronization strategies also have significant shortcomings. Traditional technologies lack clearly defined reasonable synchronization time ranges and triggering conditions, potentially leading to the indiscriminate transmission of large amounts of historical data. This wastes resources and impacts synchronization efficiency. Furthermore, the absence of a hardware-side mechanism to inform the hardware of file information (quantity and size) before synchronization prevents the software from anticipating the transmission load. Regarding cache management, the lack of standardized cache deletion authorization and verification processes can result in data loss due to cache deletion before synchronization is complete, or cache not being promptly cleared after synchronization, thus consuming hardware storage resources.
[0004] Furthermore, the large file transfer management mechanism is inadequate. Traditional technologies lack adaptation solutions for large file transfers (above 1GB), which can easily lead to disruptions to core device functions (such as scanning and recording) during transfers. Additionally, for long-duration transfers (over 30 minutes), battery life is not considered, and there is a lack of charging prompts and power-off protection mechanisms, potentially causing transfer interruptions and data corruption. Finally, Bluetooth pairing and reset operations are not convenient enough. Traditional solutions may require multiple pairing attempts, and the reset process after a hardware crash is unclear, lacking explicit operation instructions and status prompts, thus affecting user convenience. Summary of the Invention
[0005] The main objective of this invention is to provide a Bluetooth transmission method, apparatus, device, and storage medium for a scanning pen, aiming to solve the problems of high power consumption due to frequent Bluetooth reconnection, difficulty in reconnecting after killing background processes, blind data synchronization, impact on functionality during large file transfers, and difficulty in cache management in the prior art.
[0006] To achieve the above objectives, the present invention provides a Bluetooth transmission method for a scanning pen, comprising: The Bluetooth heartbeat interval of the scanner is pre-configured, and the scanner and the client are connected according to the configured Bluetooth BLE 5.0+ protocol; The system obtains the data transmission request from the scanning pen to the client, and transmits data using a hierarchical synchronization strategy via Bluetooth transmission protocol according to the data transmission request. Once data transmission is complete, the cache deletion mechanism is triggered, and the deletion operation is performed by the cache deletion mechanism.
[0007] Furthermore, to achieve the above objectives, the present invention provides a Bluetooth transmission device for a scanning pen, comprising: The Bluetooth pairing module is used to pre-configure the Bluetooth heartbeat interval of the scanning pen and connect the scanning pen and the client based on the configured Bluetooth BLE 5.0+ protocol. The data transmission module is used to acquire data transmission requests from the scanning pen to the client, and to transmit data using a hierarchical synchronization strategy via Bluetooth transmission protocol according to the data transmission requests. The cache deletion module is used to trigger the cache deletion mechanism after data transmission is completed, and the cache deletion mechanism performs the deletion operation.
[0008] Furthermore, to achieve the above objectives, the present invention also provides a computer device, the computer device including a memory, a processor, and a Bluetooth transmission program for a scanning pen stored in the memory and executable on the processor, wherein when the Bluetooth transmission program for the scanning pen is executed by the processor, it implements the steps of the Bluetooth transmission method for the scanning pen as described above.
[0009] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a Bluetooth transmission program for a scanning pen, wherein when the Bluetooth transmission program for the scanning pen is executed by a processor, it implements the steps of the Bluetooth transmission method for the scanning pen as described above.
[0010] Beneficial Effects: This invention relates to the field of scanning equipment technology and discloses a Bluetooth transmission method for a scanning pen, comprising: pre-configuring a Bluetooth heartbeat interval, and connecting the scanning pen and a client based on the configured Bluetooth BLE 5.0+ protocol; obtaining a data transmission request from the scanning pen to the client, and transmitting data using a hierarchical synchronization strategy via the Bluetooth transmission protocol according to the data transmission request; and triggering a cache deletion mechanism after data transmission is completed, which performs a deletion operation. This invention uses the BLE 5.0+ protocol as the core for data transmission and deletes the transmitted data, reducing the Bluetooth transmission power consumption of the scanning pen and improving stability. Attached Figure Description
[0011] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is a schematic diagram of an application environment for a Bluetooth transmission method of a scanning pen according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating an embodiment of the Bluetooth transmission method for the scanning pen of the present invention; Figure 3 This is a schematic diagram of the functional modules of a preferred embodiment of the Bluetooth transmission device of the scanning pen of the present invention. Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 5 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0012] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0013] The Bluetooth transmission method for the scanning pen provided in this embodiment of the invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can pre-configure the Bluetooth heartbeat interval and connect the scanner and client based on the configured Bluetooth BLE 5.0+ protocol. It then receives data transmission requests from the scanner to the client and transmits data using a hierarchical synchronization strategy via the Bluetooth transmission protocol. After data transmission is complete, a cache deletion mechanism is triggered, which performs the deletion operation. This invention uses the BLE 5.0+ protocol as its core for data transmission and deletes transmitted data, reducing Bluetooth transmission power consumption and improving stability. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.
[0014] Please see Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the Bluetooth transmission method for a scanning pen provided by the present invention. It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0015] S100: Pre-configures the Bluetooth heartbeat interval of the scanning pen, and connects the scanning pen and the client based on the configured Bluetooth BLE 5.0+ protocol; S200: Obtain the data transmission request from the scanning pen to the client, and transmit data using a hierarchical synchronization strategy via Bluetooth transmission protocol according to the data transmission request; S300. After the data transmission is completed, the cache deletion mechanism is triggered, and the cache deletion mechanism performs the deletion operation.
[0016] In this embodiment, firstly, the Bluetooth heartbeat interval of the scanning pen is pre-configured by setting the heartbeat detection interval of the scanning pen's Bluetooth module to 60 seconds. This reduces unnecessary signal interaction between the scanning pen and the client, thereby reducing Bluetooth connection power consumption from the hardware perspective. Next, based on the BLE 5.0+ protocol (i.e., Bluetooth Low Energy 5.0 and above, characterized by low power consumption and strong stability), the connection between the scanning pen and the client is achieved. After the initial pairing, automatic reconnection is supported in scenarios such as the scanning pen going to sleep, restarting after shutdown, and the client APP being closed (including background app termination). Furthermore, by placing the scanning pen's Bluetooth antenna on the top and using an aluminum casing, reliable connection within 10 meters is ensured.
[0017] The system then receives data transmission requests from the scanner to the client, analyzes the request type, and employs a tiered synchronization strategy for transmission: for default synchronization requests, it automatically retrieves unsynchronized data from the last 48 hours (batch limit of 100 files); for custom synchronization requests, it retrieves data within a time range specified by the client. Transmission uses a custom Bluetooth GATT protocol (a general attribute configuration file that supports synchronization status queries, progress updates, etc.), and the scanner informs the client of the number and size of files to be transmitted before transmission.
[0018] Once data transmission is complete, the cache deletion authorization mechanism (cache deletion mechanism) is triggered: After the client confirms that the data is fully synchronized, it sends a cache deletion command to the scanner via a custom Bluetooth GATT protocol. After the scanner verifies the legality of the command, it executes the deletion operation of the corresponding local cache file to ensure that the data is not stored repeatedly.
[0019] In one embodiment, S100 includes: S1011, Pre-configure the Bluetooth heartbeat interval of the scanning pen; S1012. Continuously monitor the Bluetooth signal of the scanning pen through the framework registration system of the client; S1013 monitors the simultaneous pressing time of the scan button and the record button when the scanner is in an unpaired state. S1014. The pressing time is compared with the pressing time threshold. When the pressing time is greater than the pressing time threshold, the Bluetooth indicator light of the scanning pen flashes and a Bluetooth pairing request is sent to the client. S1015. After the client confirms pairing, the scanner and the client will connect via Bluetooth BLE 5.0+ protocol according to the configured Bluetooth settings to complete the Bluetooth connection.
[0020] In this embodiment, the Bluetooth heartbeat interval of the scanner is pre-configured, meaning that the heartbeat detection interval of its Bluetooth module is set to 60 seconds during the scanner's manufacturing or initialization phase. This configuration reduces unnecessary signal interaction frequency between the scanner and the client, directly reducing Bluetooth connection power consumption from the hardware side, and is one of the core steps in achieving low-power design.
[0021] Secondly, the client-side framework registration system continuously monitors the Bluetooth signal of the scanner. The client-side framework specifically refers to the Core Bluetooth framework of the iOS system (the core Bluetooth framework used to implement system-level Bluetooth communication functions). After registering the system-level Bluetooth monitoring service through this framework, even if the client app is in the background or closed (i.e., killed from the background), the system can still continuously monitor the scanner's Bluetooth signal, laying the foundation for subsequent automatic wake-up and reconnection.
[0022] When the scanner is in an unpaired state, the simultaneous pressing time of the scan and record buttons needs to be monitored. This is a specific operation that triggers Bluetooth pairing, requiring both buttons to be pressed simultaneously, not individually. The pressing time is then compared to a pressing time threshold (e.g., 5 seconds). If the pressing time reaches 5 seconds, the scanner's Bluetooth indicator light will flash white rapidly to indicate pairing, and it will actively send a Bluetooth pairing request to the client, informing the client that pairing is possible.
[0023] Once the client (such as a mobile phone) receives the pairing request and the user confirms it, the scanner and the client will establish a connection based on the BLE 5.0+ protocol (i.e., Bluetooth Low Energy 5.0 and above, which has advantages such as low power consumption, strong signal stability, and support for long-distance communication), and finally complete Bluetooth pairing. After the initial successful pairing, subsequent times when the scanner goes to sleep, is powered off and restarted, or the client app is closed in the background, there is no need to repeat the pairing operation; it can automatically connect directly, further improving ease of use and connection stability.
[0024] In one embodiment, S200 includes: S2011. Obtain the data transmission request from the scanning pen to the client; S2012. Analyze the data transmission request to obtain the data transmission request type; S2013. When the data transmission type is the default synchronization request, the data to be transmitted for a predefined time is obtained and the data is transmitted via the Bluetooth transmission protocol. S2014. When the data transmission type is a custom synchronization request, the data to be transmitted is obtained according to the data request time of the data transmission request, and the data is transmitted via the Bluetooth transmission protocol.
[0025] In this embodiment, firstly, obtaining the data transmission request from the scanning pen to the client means that the client (such as a mobile APP) receives the notification of data to be synchronized sent by the scanning pen. After the scanning pen stores the files generated by scanning and recording locally, it will actively initiate a data transmission request to the connected client to inform the client that there are files that need to be synchronized.
[0026] Next, the data transmission request is analyzed to obtain the data transmission request type. The client will determine the request type according to preset rules, which are mainly divided into two categories: default synchronization request and custom synchronization request, so as to match different synchronization range strategies.
[0027] When the data transmission type is the default synchronization request, the predefined time is the most recent 48 hours. That is, the client automatically obtains the data to be transmitted that has not been synchronized by the scanner in the past 48 hours, and the maximum number of files that can be synchronized at one time is 100. The Bluetooth transmission protocol specifically refers to the custom Bluetooth GATT protocol (a general attribute configuration file that supports functions such as synchronization status query and transmission progress update). Data will be transmitted from the scanner to the client through this protocol to ensure that the transmission process can be monitored.
[0028] When the data transmission type is a custom synchronization request, the client needs to actively initiate and specify the data request time (i.e., the historical data time range selected by the user in the APP). The client requests the corresponding time period of the data to be transmitted from the scanning pen according to the time range, and the transmission is also completed through the custom Bluetooth GATT protocol. In addition, regardless of the request type, the scanning pen will send the number and size information of the files to be transmitted to the client before transmission to avoid resource waste caused by blind transmission.
[0029] In one embodiment, S200 further includes: S2021. Obtain the total amount of data to be transmitted, and calculate the estimated transmission time based on the total amount of data to be transmitted; S2022. Compare the total transmission amount with the total transmission threshold, and compare the estimated transmission time with the transmission time threshold; S2023. If the total transmission volume is greater than the total volume threshold and / or the estimated transmission time is greater than the transmission time threshold, the data transmission protection mechanism shall be activated.
[0030] In this embodiment, firstly, the total amount of data to be transmitted is obtained, and the estimated transmission time is calculated based on the total amount of data to be transmitted. This requires multiplying the number of files to be transmitted and the size of each file that the scanning pen has sent to the client in advance to obtain the total amount of data to be transmitted. Then, combined with the actual transmission rate of the BLE 5.0+ protocol (Bluetooth Low Energy 5.0 and above, with stable transmission rate), the estimated time required to complete all data transmission is calculated, providing data basis for subsequent management and control.
[0031] Next, the total amount of data to be transmitted is compared with the total amount threshold, and the estimated transmission time is compared with the transmission time threshold. The total amount threshold can be 1GB and the transmission time threshold can be 30 minutes. The client will compare these two dimensions simultaneously to determine whether special control needs to be activated for the current data transmission, so as to avoid the impact on the device's battery life or functional use due to long-term transmission of large files.
[0032] If the total transfer volume is greater than 1GB and / or the estimated transfer time is greater than 30 minutes, a data transmission protection mechanism will be activated: the client will pop up a notification prompting the user to connect the scanner to the charger; at the same time, the scanner's Bluetooth white light will start flashing to indicate that it needs to be charged; if the charger is disconnected during the transfer, the scanner will immediately pause synchronization, and the white light will flash rapidly for 1 second before turning off to prevent excessive power consumption when not charging; in addition, if the total transfer volume is less than 1GB, even if the transfer is activated, it will not affect the normal use of the scanner's core functions such as scanning and recording, balancing the transfer requirements with the device's usability.
[0033] In one embodiment, S300 includes: S3011. When all the data to be transmitted is synchronized to the client, the client sends a cache deletion command to the scanning pen via the Bluetooth transmission protocol; S3012. When the scanning pen receives a cache deletion command, it performs a valid calibration of the cache deletion command according to the verification rules. S3013. When the cache deletion command passes the validity calibration, the cache deletion mechanism performs a deletion operation on the corresponding cache file on the local scanner according to the cache deletion command.
[0034] In this embodiment, firstly, when all the data to be transmitted is synchronized to the client, the prerequisite of complete synchronization must be met. The client needs to confirm that all data within the specified range sent by the scanning pen (such as files within the default 48 hours or a custom time range) has been transmitted to the local machine or the cloud without omission or damage. This is the core condition for triggering subsequent operations and avoids accidental deletion due to incomplete data synchronization.
[0035] Next, the client sends a cache deletion command to the scanner via the Bluetooth transmission protocol. The Bluetooth transmission protocol specifically refers to the custom Bluetooth GATT protocol (General Attribute Profile, which supports attribute interaction and command transmission between devices). The client uses this protocol to encrypt and transmit the deletion command, ensuring the security and accuracy of the command transmission and preventing third-party interference.
[0036] Then, when the scanning pen receives a cache deletion command, it performs a valid calibration of the cache deletion command according to the verification rules. The verification rules here are based on the verification logic agreed upon by the custom Bluetooth GATT protocol. The scanning pen will verify the source of the command (confirm that it comes from a paired legitimate client) and the integrity of the command (check whether the command has lost data due to transmission) to avoid receiving illegal or incomplete commands that may lead to accidental deletion of the local cache.
[0037] Finally, when the cache deletion command passes the validity calibration, the cache deletion mechanism performs the deletion operation on the corresponding cache file on the local scanner according to the cache deletion command. The scanner will only delete cache files that match the synchronization range specified in the command (such as files that have been synchronized in the last 48 hours), and will not delete unsynchronized historical data, thus freeing up local storage space and ensuring data security.
[0038] In one embodiment, S300 further includes: S3021. When the data transmission is not completed, the scanning pen delays entering a deep sleep state. S3022. After the data transmission is completed and the deletion operation is executed, the scanning pen automatically enters a deep sleep state.
[0039] In this embodiment, when the data transmission is not completed, the scanning pen delays entering a deep sleep state. This is the core logic designed to ensure the integrity of data transmission. The deep sleep state of the scanning pen will greatly reduce hardware power consumption, but may interrupt the Bluetooth connection. Therefore, during the data synchronization process (such as when the file transfer is not finished), the device will actively delay entering this state to avoid transmission interruption and data loss due to sleep, and ensure that the data to be synchronized is completely transmitted to the client.
[0040] Once the data transmission is complete and the deletion operation is executed, the scanner automatically enters a deep sleep state. The client must confirm complete data synchronization before sending a valid cache deletion command to the scanner. The scanner verifies and executes the deletion operation before automatically entering deep sleep. This design further reduces Bluetooth connection and hardware standby power consumption through sleep mode, meeting the goal of 7 days of battery life on a single charge, while avoiding storage space occupation issues caused by sleep mode without cache deletion. After entering deep sleep, the scanner ensures that the device can still quickly respond to subsequent connection and synchronization requests from clients even in a low-power state.
[0041] In one embodiment, S100 further includes: S1021. When the scanning pen malfunctions, monitor the simultaneous pressing time of the scanning button and the recording button. S1022. The pressing time is compared with the fault time threshold. When the pressing time is greater than the fault time threshold, the scanning pen enters the reset state, performs the reset operation, and the indicator light turns on the breathing light state when the reset operation is performed. S1023. When the reset operation is completed, the indicator light goes out, and the scanner and the client are reconnected according to the configured Bluetooth based on the BLE 5.0+ protocol.
[0042] In this embodiment, firstly, when the scanning pen experiences an abnormal malfunction—specifically, a hardware crash—this is the only known fault scenario triggering the subsequent reset operation, rather than referring to all faults, ensuring the operation is targeted. At this time, it is necessary to monitor the simultaneous pressing time of the scan button and the record button; that is, both buttons must be pressed at the same time. Pressing either button alone will not trigger the subsequent process; this is the condition for initiating the reset operation.
[0043] Next, the pressing time is compared with a fault time threshold of 30 seconds. Only when the two buttons are pressed simultaneously for 30 seconds will the scanning pen enter the reset state and perform a reset operation. At the same time, during the reset process, the indicator light of the scanning pen will be in a breathing light state, and the indicator light will be yellow. The breathing flashing of the yellow light will intuitively inform the user that the device is in the process of resetting, thus avoiding user misoperation.
[0044] Finally, when the reset operation is complete, the indicator light goes out, which is a hardware indication signal that the reset is complete. The yellow light going out indicates that the scanning pen has returned to its initial state. Subsequently, the device will attempt to re-establish a Bluetooth connection with the client based on the pre-configured Bluetooth parameters (such as a 60-second heartbeat interval) and the BLE 5.0+ protocol (i.e., Bluetooth Low Energy 5.0 and above, which features low power consumption and high connection stability). If the client is within Bluetooth coverage (e.g., within 10 meters) and is in a connectable state, the reconnection will be completed, and normal data transmission and interaction functions will be restored.
[0045] In one embodiment, a Bluetooth transmission device for a scanning pen is provided, which corresponds one-to-one with the Bluetooth transmission method for the scanning pen in the above embodiments. (Refer to...) Figure 3 , Figure 3 This is a schematic diagram of the functional modules of a preferred embodiment of the Bluetooth transmission device of the scanning pen of the present invention. The modules include a Bluetooth pairing module 10, a data transmission module 20, and a cache deletion module 30. Detailed descriptions of each functional module are as follows: The Bluetooth pairing module 10 is used to pre-configure the Bluetooth heartbeat interval of the scanning pen and connect the scanning pen and the client based on the configured Bluetooth BLE 5.0+ protocol. Data transmission module 20 is used to acquire data transmission requests from the scanning pen to the client, and to transmit data using a hierarchical synchronization strategy via Bluetooth transmission protocol according to the data transmission requests. The cache deletion module 30 is used to trigger the cache deletion mechanism after data transmission is completed, and the cache deletion mechanism performs the deletion operation.
[0046] In one embodiment, the Bluetooth pairing module 10 includes: Pre-configure the Bluetooth heartbeat interval for the scanner; The client's framework registration system continuously monitors the Bluetooth signal of the scanning pen; When the scanner is in an unpaired state, monitor the simultaneous pressing time of the scan button and the record button. The pressing time is compared with a pressing time threshold. When the pressing time is greater than the pressing time threshold, the Bluetooth indicator light of the scanning pen flashes and a Bluetooth pairing request is sent to the client. Once the client confirms pairing, the scanner and the client will connect via Bluetooth BLE 5.0+ protocol according to the configured Bluetooth settings, thus completing the Bluetooth connection.
[0047] In one embodiment, the data transmission module 20 includes: Obtain the data transmission request from the scanning pen to the client; The data transmission request is analyzed to obtain the data transmission request type; When the data transmission type is the default synchronization request, the data to be transmitted at a predefined time is obtained and transmitted via the Bluetooth transmission protocol. When the data transmission type is a custom synchronization request, the data to be transmitted is obtained according to the data request time of the data transmission request, and the data is transmitted via the Bluetooth transmission protocol.
[0048] In one embodiment, the data transmission module 20 further includes: Obtain the total amount of data to be transmitted, and calculate the estimated transmission time based on the total amount of data to be transmitted; The total transmission amount is compared with the total transmission threshold, and the estimated transmission time is compared with the transmission time threshold; If the total transmission volume exceeds the total transmission threshold, and / or the estimated transmission time exceeds the transmission time threshold, the data transmission protection mechanism is activated.
[0049] In one embodiment, the cache deletion module 30 includes: When all the data to be transmitted is synchronized to the client, the client sends a cache deletion command to the scanning pen via the Bluetooth transmission protocol; When the scanning pen receives a cache deletion command, it performs a valid calibration of the cache deletion command according to the verification rules. When a cache deletion command passes the validity check, the cache deletion mechanism performs a deletion operation on the corresponding cache file on the local scanner according to the cache deletion command.
[0050] In one embodiment, the cache deletion module 30 further includes: If the data transmission is not completed, the scanning pen will enter a deep sleep state after a delay. Once the data transmission is complete and the deletion operation is executed, the scanning pen automatically enters a deep sleep state.
[0051] In one embodiment, the Bluetooth pairing module 10 further includes: When the scanning pen malfunctions, monitor the simultaneous pressing time of the scanning button and the recording button. The pressing time is compared with the fault time threshold. When the pressing time is greater than the fault time threshold, the scanning pen enters the reset state, performs a reset operation, and the indicator light turns on the breathing light state when the reset operation is performed. When the reset operation is complete, the indicator light goes out, and the scanner and client are reconnected according to the configured Bluetooth based on the BLE 5.0+ protocol.
[0052] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a Bluetooth transmission method for a scanning pen on the server side.
[0053] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the client-side functions or steps of a Bluetooth transmission method for a scanning pen. In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: The Bluetooth heartbeat interval of the scanner is pre-configured, and the scanner and the client are connected according to the configured Bluetooth BLE 5.0+ protocol; The system obtains the data transmission request from the scanning pen to the client, and transmits data using a hierarchical synchronization strategy via Bluetooth transmission protocol according to the data transmission request. Once data transmission is complete, the cache deletion mechanism is triggered, and the deletion operation is performed by the cache deletion mechanism.
[0054] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: The Bluetooth heartbeat interval of the scanner is pre-configured, and the scanner and the client are connected according to the configured Bluetooth BLE 5.0+ protocol; The system obtains the data transmission request from the scanning pen to the client, and transmits data using a hierarchical synchronization strategy via Bluetooth transmission protocol according to the data transmission request. Once data transmission is complete, the cache deletion mechanism is triggered, and the deletion operation is performed by the cache deletion mechanism.
[0055] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0056] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0057] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0058] It should be noted that if any software tools or components not belonging to this company appear in the embodiments of this application, they are merely illustrative examples and do not represent actual use. The embodiments described above are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A Bluetooth transmission method for a scanning pen, characterized in that, Includes the following steps: The Bluetooth heartbeat interval of the scanner is pre-configured, and the scanner and the client are connected according to the configured Bluetooth BLE 5.0+ protocol; The system obtains the data transmission request from the scanning pen to the client, and transmits data using a hierarchical synchronization strategy via Bluetooth transmission protocol according to the data transmission request. Once data transmission is complete, the cache deletion mechanism is triggered, and the deletion operation is performed by the cache deletion mechanism.
2. The Bluetooth transmission method for the scanning pen as described in claim 1, characterized in that, The pre-configured Bluetooth heartbeat interval of the scanning pen, and the connection between the scanning pen and the client based on the configured Bluetooth BLE 5.0+ protocol, includes: Pre-configure the Bluetooth heartbeat interval for the scanner; The client's framework registration system continuously monitors the Bluetooth signal of the scanning pen; When the scanner is in an unpaired state, monitor the simultaneous pressing time of the scan button and the record button. The pressing time is compared with a pressing time threshold. When the pressing time is greater than the pressing time threshold, the Bluetooth indicator light of the scanning pen flashes and a Bluetooth pairing request is sent to the client. Once the client confirms pairing, the scanner and the client will connect via Bluetooth BLE 5.0+ protocol according to the configured Bluetooth settings, thus completing the Bluetooth connection.
3. The Bluetooth transmission method for the scanning pen as described in claim 1, characterized in that, The step of obtaining the data transmission request from the scanning pen to the client, and transmitting data using a hierarchical synchronization strategy via Bluetooth transmission protocol according to the data transmission request, includes: Obtain the data transmission request from the scanning pen to the client; The data transmission request is analyzed to obtain the data transmission request type; When the data transmission type is the default synchronization request, the data to be transmitted at a predefined time is obtained and transmitted via the Bluetooth transmission protocol. When the data transmission type is a custom synchronization request, the data to be transmitted is obtained according to the data request time of the data transmission request, and the data is transmitted via the Bluetooth transmission protocol.
4. The Bluetooth transmission method for the scanning pen as described in claim 3, characterized in that, The step of obtaining the data transmission request from the scanning pen to the client, and transmitting data using a hierarchical synchronization strategy via Bluetooth transmission protocol according to the data transmission request, further includes: Obtain the total amount of data to be transmitted, and calculate the estimated transmission time based on the total amount of data to be transmitted; The total transmission amount is compared with the total transmission threshold, and the estimated transmission time is compared with the transmission time threshold; If the total transmission volume exceeds the total transmission threshold, and / or the estimated transmission time exceeds the transmission time threshold, the data transmission protection mechanism is activated.
5. The Bluetooth transmission method for the scanning pen as described in claim 1, characterized in that, After data transmission is complete, a cache deletion mechanism is triggered, which performs a deletion operation, including: When all the data to be transmitted is synchronized to the client, the client sends a cache deletion command to the scanning pen via the Bluetooth transmission protocol; When the scanning pen receives a cache deletion command, it performs a valid calibration of the cache deletion command according to the verification rules. When a cache deletion command passes the validity check, the cache deletion mechanism performs a deletion operation on the corresponding cache file on the local scanner according to the cache deletion command.
6. The Bluetooth transmission method for the scanning pen as described in claim 1, characterized in that, The step of triggering a cache deletion mechanism after data transmission is complete, and having the cache deletion mechanism perform a deletion operation, further includes: If the data transmission is not completed, the scanning pen will enter a deep sleep state after a delay. Once the data transmission is complete and the deletion operation is executed, the scanning pen automatically enters a deep sleep state.
7. The Bluetooth transmission method for the scanning pen as described in claim 1, characterized in that, The pre-configured Bluetooth heartbeat interval of the scanning pen, and the connection between the scanning pen and the client based on the configured Bluetooth BLE 5.0+ protocol, also includes: When the scanning pen malfunctions, monitor the simultaneous pressing time of the scanning button and the recording button. The pressing time is compared with the fault time threshold. When the pressing time is greater than the fault time threshold, the scanning pen enters the reset state, performs a reset operation, and the indicator light turns on the breathing light state when the reset operation is performed. When the reset operation is complete, the indicator light goes out, and the scanner and client are reconnected according to the configured Bluetooth based on the BLE 5.0+ protocol.
8. A Bluetooth transmission device for a scanning pen, characterized in that, The Bluetooth transmission device of the scanning pen includes: The Bluetooth pairing module is used to pre-configure the Bluetooth heartbeat interval of the scanning pen and connect the scanning pen and the client based on the configured Bluetooth BLE5.0+ protocol. The data transmission module is used to acquire data transmission requests from the scanning pen to the client, and to transmit data using a hierarchical synchronization strategy via Bluetooth transmission protocol according to the data transmission requests. The cache deletion module is used to trigger the cache deletion mechanism after data transmission is completed, and the cache deletion mechanism performs the deletion operation.
9. A computer device, characterized in that, The computer device includes a memory, a processor, and a Bluetooth transmission program for the scanning pen stored in the memory and executable on the processor. When the Bluetooth transmission program for the scanning pen is executed by the processor, it implements the steps of the Bluetooth transmission method for the scanning pen as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a Bluetooth transmission program for the scanning pen, which, when executed by a processor, implements the steps of the Bluetooth transmission method for the scanning pen as described in any one of claims 1-7.