Data synchronization method, system, and computer-readable storage medium

By broadcasting synchronization trigger information in low-power Bluetooth communication mode and switching to high-power mode as needed, the problem of high power consumption and user operation dependence in data synchronization of health wearable devices is solved, and efficient and low-power data synchronization is achieved.

CN123164531APending Publication Date: 2026-11-24GEER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611260748.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing technologies, the data synchronization methods between health wearable devices and terminals suffer from high power consumption or reliance on user operation, making it difficult to guarantee battery life and data continuity.

Method used

The system broadcasts synchronization trigger information using low-power Bluetooth communication mode, dynamically adjusts the transmission interval based on device status and battery level, switches to high-power Bluetooth communication mode as needed for data transmission, and immediately returns to low-power mode upon completion, forming a closed-loop control.

Benefits of technology

It reduces the device's standby power consumption, reduces manual operation by users, achieves timely and continuous data processing, and improves battery life and synchronization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164531A_ABST
    Figure CN123164531A_ABST
Patent Text Reader

Abstract

This application discloses a data synchronization method, system, and computer-readable storage medium, relating to the field of data synchronization technology. The method includes: sending a broadcast signal in a first Bluetooth communication mode, wherein the broadcast signal carries synchronization trigger information, which is used to trigger a second device to decide whether to initiate a connection request; in response to a connection request returned by the second device based on the synchronization trigger information, establishing a data transmission connection with the second device in a second Bluetooth communication mode; sending data to be synchronized to the second device in the second Bluetooth communication mode; and in response to a synchronization completion confirmation information returned by the second device for the data to be synchronized, disconnecting the second Bluetooth communication mode and returning to the step of sending the broadcast signal in the first Bluetooth communication mode. This application achieves efficient data synchronization while reducing device power consumption and minimizing manual user operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data synchronization technology, and in particular to a data synchronization method, system and computer-readable storage medium. Background Technology

[0002] With the continuous development of Bluetooth communication technology, Bluetooth Low Energy (BLE) has been widely used in smart wearable devices, health monitoring sensors, and other products. These devices typically need to periodically synchronize the collected data to a mobile phone or the cloud for data display and analysis. The power consumption and ease of operation during data synchronization directly affect the user experience.

[0003] Currently, there are two main methods for data synchronization between wearable health devices and terminals. Method 1 is real-time push: The device and terminal maintain a constant Bluetooth connection, pushing new data in real-time. However, the device needs to continuously maintain the link, resulting in prolonged radio frequency operation and high standby power consumption. Method 2 is manual triggering: The device normally only stores data locally. Data transmission begins when the user actively opens the app and clicks the synchronization button. However, the synchronization process relies on user intervention, and forgetting to do so can lead to untimely data updates on the terminal.

[0004] However, all of the above methods have significant shortcomings. Real-time push methods consume a lot of power, which greatly affects battery life; manual trigger methods rely on user operation, and data continuity is difficult to guarantee. Therefore, how to achieve efficient data synchronization while reducing device power consumption and minimizing user manual operation has become an urgent problem to be solved. Summary of the Invention

[0005] The main objective of this application is to provide a data synchronization method, system, and computer-readable storage medium, aiming to solve the technical problem of how to achieve efficient data synchronization while reducing device power consumption and minimizing manual user operations.

[0006] To achieve the above objectives, this application provides a data synchronization method, which includes the following steps: A broadcast signal is sent in a first Bluetooth communication mode, wherein the broadcast signal carries synchronization trigger information, which is used to trigger a second device to decide whether to initiate a connection request; In response to the connection request returned by the second device according to the synchronization trigger information, a data transmission connection in the second Bluetooth communication mode is established with the second device, wherein the transmission rate of the first Bluetooth communication mode is lower than that of the second Bluetooth communication mode, and the power consumption of the second Bluetooth communication mode is higher than that of the first Bluetooth communication mode. In the second Bluetooth communication mode, send the data to be synchronized to the second device; In response to the synchronization completion confirmation information returned by the second device for the data to be synchronized, the second Bluetooth communication mode is disconnected, and the process returns to the step of sending a broadcast signal in the first Bluetooth communication mode.

[0007] In one embodiment, the step of sending a broadcast signal in a first Bluetooth communication mode includes: Obtain the data volume information, data priority information, and data timestamp information of the local data to be synchronized on the first device; The data volume information, the data priority information, and the data timestamp information are encapsulated into a custom data field of the broadcast signal; The encapsulated broadcast signal is transmitted in the first Bluetooth communication mode.

[0008] In one embodiment, the step of establishing a data transmission connection with the second device in a second Bluetooth communication mode in response to a connection request returned by the second device based on the synchronization trigger information includes: Receive the SPP connection request returned by the second device based on the synchronization trigger information; In response to the SPP connection request, the SPP communication module of the first device is woken up, and an SPP connection channel is established with the second device through the SPP communication module to transmit data in the second Bluetooth communication mode.

[0009] In one embodiment, the step of sending the data to be synchronized to the second device in the second Bluetooth communication mode includes: Obtain the starting cursor for this synchronization, wherein the starting cursor is used to represent the data node that has been synchronized in the last time; Based on the starting cursor, incremental data is selected from the locally stored data to be synchronized, wherein the incremental data is data whose data recording time is later than the time node corresponding to the starting cursor; The incremental data is sent to the second device as data to be synchronized using the second Bluetooth communication mode.

[0010] In one embodiment, the step of obtaining the starting cursor for this synchronization includes: If the first device and the second device are paired and synchronized for the first time, the starting cursor is set to empty so that full data synchronization can be performed in the step of sending the data to be synchronized to the second device in the second Bluetooth communication mode. If the first device and the second device are not synchronizing for the first time, the first device receives the historical synchronization cursor sent by the second device and uses the historical synchronization cursor as the starting cursor.

[0011] In one embodiment, the step of disconnecting the second Bluetooth communication mode in response to the synchronization completion confirmation information returned by the second device for the data to be synchronized includes: Receive synchronization completion confirmation information returned by the second device for the data to be synchronized; In response to the synchronization completion confirmation message, the local synchronization cursor is updated to the latest time node of the currently synchronized data; Send a disconnect command to the second device to disconnect the second Bluetooth communication mode.

[0012] In one embodiment, the transmission interval of the broadcast signal is dynamically adjusted according to the motion state of the first device, and / or the transmission interval of the broadcast signal is dynamically adjusted according to the remaining power of the first device; Specifically, the transmission interval is shortened when the first device is in motion; The transmission interval is extended when the first device is in a stationary state; The transmission interval is extended when the remaining battery power is lower than a preset battery power threshold.

[0013] In one embodiment, the synchronization trigger information includes data volume information, data priority information, and data timestamp information of the local data to be synchronized on the first device; the decision conditions for the second device to return the connection request based on the synchronization trigger information include at least one of the following: The amount of data to be synchronized reaches a preset data volume threshold; The data priority is a preset priority level; The time difference between the current time and the data timestamp reaches a preset duration.

[0014] In addition, to achieve the above objectives, this application also provides a data synchronization system, which includes a first device and a second device connected in communication. The first device is used to send a broadcast signal, wherein the broadcast signal carries synchronization trigger information, and the synchronization trigger information is used to trigger the second device to decide whether to initiate a connection request to the first device; The second device is configured to receive the broadcast signal, parse the synchronization trigger information, and decide whether to initiate a connection request to the first device based on the synchronization trigger information, and send a connection request to the first device when the decision result is yes; The first device is further configured to, in response to the connection request, establish a second Bluetooth communication mode with the second device, and send data to be synchronized to the second device in the second Bluetooth communication mode; The second device is also used to receive the data to be synchronized, and to return synchronization completion confirmation information to the first device after the data to be synchronized has been verified. The first device is further configured to, in response to the synchronization completion confirmation information returned by the second device for the data to be synchronized, disconnect the second Bluetooth communication mode and resend the broadcast signal in the first Bluetooth communication mode.

[0015] In addition, to achieve the above objectives, this application also provides a readable storage medium, which is a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the steps of the data synchronization method described above.

[0016] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the data synchronization method described above.

[0017] One or more technical solutions proposed in this application have at least the following technical effects: This embodiment of the application first continuously broadcasts a signal carrying synchronization trigger information in a low-speed, low-power first Bluetooth communication mode. This allows the device to maintain low RF power consumption during the synchronization period, unlike real-time push solutions which require a long-term high-power Bluetooth connection, thus reducing standby power consumption and improving battery life. Simultaneously, the synchronization trigger information in the broadcast gives the second device the ability to autonomously decide whether to initiate a connection, allowing data synchronization to be automatically started by the device based on the trigger information. This avoids data update delays caused by user forgetfulness or untimely operation in manual trigger solutions, ensuring the timeliness and continuity of terminal data. When the second device actively initiates a connection request based on the trigger information, the first device responds and establishes a second Bluetooth communication mode with a higher transmission rate but correspondingly higher power consumption. This high-speed link completes the transmission of the data to be synchronized. This on-demand switching method consumes higher energy during the data transmission window, ensuring synchronization efficiency while avoiding the additional power consumption caused by prolonged occupation of the high-speed link. After receiving the synchronization completion confirmation information from the second device, the first device disconnects the high-power second Bluetooth mode and returns to the low-power broadcast state, forming a closed-loop control that ensures the device operates in the optimal power consumption mode most of the time, effectively reducing overall energy consumption. Based on the above connection management mechanism, the entire synchronization process does not require user intervention to start, and the device always intelligently switches between optimal power consumption and transmission efficiency, thereby achieving efficient data synchronization while reducing device power consumption and user manual operation. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the first embodiment of the data synchronization method of this application; Figure 2 This is a schematic diagram of the broadcast signal transmission process involved in an embodiment of the data synchronization method of this application; Figure 3 This is a schematic diagram of the data transmission connection establishment process according to an embodiment of the data synchronization method of this application; Figure 4 This is a schematic diagram of the data transmission process to be synchronized according to an embodiment of the data synchronization method of this application; Figure 5 This is a schematic diagram of the system architecture of the data synchronization system in this application.

[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0022] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] Based on this, this application proposes a data synchronization method according to a first embodiment. In this embodiment, it is applied to a first device, as shown below. Figure 1 As shown, the data synchronization method includes the following steps S10~S40: Step S10: Send a broadcast signal in the first Bluetooth communication mode. The broadcast signal carries synchronization trigger information, which is used to trigger the second device to decide whether to initiate a connection request. A first device (e.g., a smart wearable device or a health monitoring sensor) transmits a broadcast signal in a first Bluetooth communication mode. This first Bluetooth communication mode is preferably a broadcast state of Bluetooth Low Energy (BLE), which has a low transmission rate (e.g., 1 Mbps or lower) but extremely low power consumption, making it suitable for long-term intermittent transmission.

[0024] The broadcast signal can use the standard BLE advertising packet format and carry synchronization trigger information in its custom data fields (such as manufacturer-specific data). The synchronization trigger information may include, but is not limited to, the device identifier of the first device, the size of the data to be synchronized, the data category (such as heart rate, blood oxygen, steps, etc.), and timestamps.

[0025] After scanning the broadcast signal, the second device (such as a mobile phone or cloud gateway) parses the synchronization trigger information and decides whether to initiate a connection request based on preset decision rules (such as whether the data volume exceeds the threshold, whether the device is paired, whether the current network is available, whether the user has set an automatic synchronization period, etc.), thereby avoiding the first device from maintaining a connection for a long time and eliminating the need for the user to manually trigger it.

[0026] Step S20: In response to the connection request returned by the second device according to the synchronization trigger information, establish a data transmission connection with the second device in the second Bluetooth communication mode, wherein the transmission rate of the first Bluetooth communication mode is lower than that of the second Bluetooth communication mode, and the power consumption of the second Bluetooth communication mode is higher than that of the first Bluetooth communication mode. When the second device determines that synchronization is required based on the decision rules and returns a connection request, the first device responds to the request and establishes a data transmission connection with the second device in the second Bluetooth communication mode. This second Bluetooth communication mode is preferably a BLE connected state, which has a higher transmission rate than the first mode (e.g., up to 2Mbps or more), but the corresponding power consumption is also significantly increased.

[0027] The connection establishment process includes the classic Bluetooth connection establishment process, such as sending a connection request, exchanging connection parameters (such as connection interval, latency, timeout retransmission count, etc.), and optionally performing security authentication and key negotiation to ensure the security of data transmission.

[0028] During this process, the first device adjusts its radio frequency transceiver status according to the parameters negotiated with the second device and enters high-speed transmission preparation.

[0029] Step S30: Send the data to be synchronized to the second device in the second Bluetooth communication mode; After the first device and the second device successfully establish a data transmission connection in the second Bluetooth communication mode, the first device sends the data to be synchronized to the second device in this high-speed mode. To improve transmission reliability and efficiency, the data to be synchronized can be divided into packets according to a preset data unit size, and an acknowledgment and retransmission mechanism is adopted. After each data packet is sent, it waits for the second device to receive and confirm receipt. If no confirmation is received within a timeout period, it will be automatically retransmitted.

[0030] Meanwhile, the first device can monitor signal strength and link quality during transmission, and dynamically adjust the transmission power or data packet size to adapt to different channel environments, ensuring that the data is transmitted to the second device completely and without error.

[0031] In addition, the data to be synchronized may include a data verification field (such as CRC or hash value) so that the second device can perform integrity verification after receiving the data.

[0032] Step S40: In response to the synchronization completion confirmation information returned by the second device for the data to be synchronized, disconnect the second Bluetooth communication mode and return to the step of sending a broadcast signal in the first Bluetooth communication mode.

[0033] Once the second device has fully received and verified all the data to be synchronized, it returns a synchronization completion confirmation message to the first device. Upon receiving this confirmation message, the first device immediately and proactively disconnects the data transmission connection in the second Bluetooth communication mode, releasing relevant radio frequency resources and memory cache.

[0034] Subsequently, the first device returns to step S10, that is, continues to send broadcast signals in the first Bluetooth communication mode and re-enters the low-power standby broadcast state.

[0035] Through this closed-loop process, the first device only briefly enters a high-power, high-speed transmission mode when there is a valid synchronization requirement, and otherwise remains in a very low-power broadcast standby state, thus achieving a balance between energy saving and high efficiency.

[0036] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description, and will not be repeated hereafter. On this basis, refer to Figure 2 As shown, the step of sending a broadcast signal in the first Bluetooth communication mode includes: Step A10: Obtain the data volume information, data priority information, and data timestamp information of the local data to be synchronized on the first device. Data volume information is used to characterize the total number of bytes or data packets of data to be synchronized, which can be used by the second device to assess the synchronization time and channel occupancy based on the data volume.

[0037] Data priority information is used to identify the importance or urgency of data to be synchronized. For example, heart rate abnormality warning data can be marked as high priority, and regular exercise step data can be marked as normal priority, so that when the second device receives broadcast signals from multiple devices at the same time, it will respond to the synchronization request of the high-priority device first.

[0038] Data timestamp information is used to record the generation time of the data to be synchronized or the most recent synchronization time, so that the second device can judge the timeliness of the data and avoid repeatedly synchronizing historical data that has already been transmitted.

[0039] Step A20: Encapsulate the data volume information, the data priority information, and the data timestamp information into a custom data field of the broadcast signal; The broadcast signal uses the standard BLE advertising packet format, and its Protocol Data Unit (PDU) has a reserved custom data segment (such as the Manufacturer Specific Data field). The first device writes the data volume information, data priority information, and data timestamp information into this custom field in accordance with the preset encapsulation protocol, according to the agreed byte length and arrangement order, and can add a check bit to ensure data integrity.

[0040] Through this encapsulation process, the aforementioned synchronization trigger information can be sent along with the broadcast signal for the second device at the scanning end to parse and identify.

[0041] Step A30: Transmit the encapsulated broadcast signal in the first Bluetooth communication mode.

[0042] The first device periodically transmits encapsulated broadcast signals at preset broadcast intervals (e.g., 100ms to 1000ms), entering a sleep state during the transmission intervals to further reduce power consumption. The second device receives the broadcast signal by scanning the channel and parses out data volume information, data priority information, and data timestamp information from it, using this as the basis for autonomously deciding whether to initiate a connection request.

[0043] In one possible implementation, refer to Figure 3 As shown, the step of establishing a data transmission connection with the second device in the second Bluetooth communication mode in response to the connection request returned by the second device according to the synchronization trigger information includes: Step B10: Receive the SPP connection request returned by the second device based on the synchronization trigger information; After parsing the synchronization trigger information carried in the broadcast signal, the second device, based on preset decision rules, determines that data synchronization needs to be initiated and sends an SPP (Serial Port Profile) connection request to the first device.

[0044] This SPP connection request is constructed based on the classic Bluetooth protocol stack. The request message contains the Bluetooth address of the second device, the supported SPP version number, and the expected connection parameters. The first device listens for and receives this connection request in broadcast mode, identifying its SPP protocol characteristics to distinguish it from other Bluetooth connection requests.

[0045] Step B20: In response to the SPP connection request, wake up the SPP communication module of the first device, and establish an SPP connection channel with the second device through the SPP communication module to transmit data in the second Bluetooth communication mode.

[0046] After receiving the SPP connection request, the first device first triggers a hardware-level wake-up signal to activate the SPP communication module, which is in low-power standby mode, to the working state. After the SPP communication module is woken up, it executes the classic Bluetooth underlying link establishment process, including frequency hopping synchronization, Link Manager Protocol (LMP) handshake, and data channel configuration at the Host Controller Interface (HCI) layer.

[0047] Subsequently, the first and second devices establish an RFCOMM (Radio Frequency Communication) channel via the SPP protocol, forming a bidirectional and reliable serial data transmission channel. This SPP connection channel is carried over a second Bluetooth communication mode, which corresponds to the classic Bluetooth ACL (Asynchronous Connection-Link) connection. Its transmission rate is higher than that of the first Bluetooth communication mode, enabling high-speed and reliable transmission of subsequent data to be synchronized.

[0048] In one possible implementation, refer to Figure 4 As shown, the step of sending the data to be synchronized to the second device in the second Bluetooth communication mode includes: Step C10: Obtain the starting cursor for this synchronization, wherein the starting cursor is used to represent the data node that has been synchronized in the previous time; The first device maintains a synchronization cursor record, which is updated after each successful synchronization. The starting cursor can be a timestamp, recording the time of the last synchronized data when the last synchronization was completed; or it can be a monotonically increasing sequence number, with the first device assigning a unique number to each data item sequentially during data generation. When the first device is ready for the current synchronization, it reads this cursor value from local storage as a reference point for filtering the data to be synchronized.

[0049] Step C20: Based on the starting cursor, filter out incremental data from the locally stored data to be synchronized, wherein the incremental data is data whose data recording time is later than the time node corresponding to the starting cursor; The first device iterates through the historical data records stored locally, comparing the timestamp of each data entry with the time node indicated by the starting cursor. If the record time of a data entry is later than the time node corresponding to the starting cursor, it is determined that the data entry is newly added incremental data; if the record time is equal to or earlier than the time node corresponding to the starting cursor, it is determined that the data entry has completed historical synchronization and will no longer be included in the current transmission range.

[0050] Through this filtering mechanism, the first device only extracts data newly generated after the last synchronization, avoiding the repeated transmission of the full amount of data and effectively reducing the amount of synchronized data.

[0051] Step C30: The incremental data is sent to the second device as data to be synchronized in the second Bluetooth communication mode.

[0052] The first device organizes the selected incremental data into a sequence of data packets to be synchronized according to a preset data format, and sends it to the second device through the established data transmission connection of the second Bluetooth communication mode.

[0053] During transmission, the first device can carry a data generation timestamp and an incrementing sequence number in each data packet, which the second device can use for sequence reassembly and integrity verification at the receiving end. After transmission is completed, the first device can update the timestamp or sequence number of the last data in the current synchronization data to a new cursor value based on the synchronization completion confirmation information returned by the second device, and persist it as the starting cursor reference for the next synchronization.

[0054] In one possible implementation, the step of obtaining the starting cursor for this synchronization includes: Step D10: If the first device and the second device are paired and synchronized for the first time, the starting cursor is set to empty so as to perform full data synchronization in the step of sending the data to be synchronized to the second device in the second Bluetooth communication mode. After establishing an SPP connection channel with the second device, the first device checks if a historical synchronization cursor record corresponding to the second device is stored locally. If no cursor record is found locally, or the device identifier of the second device in the cursor record does not match the currently connected second device, then this is determined to be the first pairing synchronization. In this case, the first device sets the starting cursor to a null value, which serves as the identifier information to trigger full synchronization.

[0055] When the initial cursor is empty, the first device does not apply time or serial number filtering conditions to the locally stored data in subsequent data filtering steps. Instead, it sends all locally stored historical data records as data to be synchronized to the second device via the second Bluetooth communication mode. Through this full synchronization mechanism, the second device, which is paired for the first time, can obtain the complete data history of the first device, which is beneficial to the integrity of data backup and the establishment of subsequent incremental synchronization benchmarks.

[0056] Step D20: If the first device and the second device are not synchronizing for the first time, then the historical synchronization cursor sent by the second device is received, and the historical synchronization cursor is used as the starting cursor.

[0057] After establishing an SPP connection channel with the second device, if the first device finds a historical cursor record that matches the current second device locally, it determines that this is not the first synchronization. In this case, the first device does not directly use the locally stored cursor value, but waits for and receives the latest historical synchronization cursor sent by the second device through the SPP connection channel.

[0058] The second device typically maintains the latest synchronization progress of each paired device in its local database. This progress information was confirmed and reported by the first device upon completion of the last synchronization. The first device uses the historical synchronization cursor issued by the second device as the starting cursor for the current synchronization, thereby filtering out incremental data newly generated since the last synchronization. This mechanism utilizes the second device to centrally manage the synchronization progress of each device, effectively avoiding data duplication or omission caused by the loss or tampering of the first device's local cursor, and ensuring the consistency of the synchronization status between the first and second devices.

[0059] Based on the first and / or second embodiments of this application, in the third embodiment of this application, the content that is the same as or similar to the first and second embodiments described above can be referred to the above description and will not be repeated hereafter. Based on this, the step of disconnecting the second Bluetooth communication mode in response to the synchronization completion confirmation information returned by the second device for the data to be synchronized includes: Step E10: Receive synchronization completion confirmation information returned by the second device for the data to be synchronized; After the second device has fully received and verified all the data to be synchronized, it returns a synchronization completion confirmation message to the first device through the established SPP connection channel. This confirmation message may include the start and end cursor range of the data received in this synchronization, the total number of data packets received, and the integrity verification result (such as the overall hash value).

[0060] The first device continuously monitors the response data from the second device through the SPP communication module. Upon receiving the confirmation information, it parses the data format to confirm that the synchronization operation has been successfully completed.

[0061] Step E20: In response to the synchronization completion confirmation information, update the local synchronization cursor to the latest time node of the currently synchronized data; After confirming successful synchronization, the first device extracts the timestamp or sequence number corresponding to the last piece of data from the incremental data sent this time. This value is then written as a new synchronization cursor to local non-volatile storage, replacing the original historical cursor record. If this synchronization is a full synchronization after the initial pairing, the latest time point is the timestamp of the last piece of data in the full data set; if this synchronization is an incremental synchronization, the latest time point is the timestamp of the last piece of data in the sent incremental data set. The updated cursor will serve as the benchmark for subsequent synchronizations, ensuring the accuracy of the next round of data filtering.

[0062] In addition, after the cursor update is completed, the first device can return cursor update confirmation information to the second device so that the second device can synchronously update the latest synchronization progress of the corresponding record in its database, ensuring that the cursor states of the two ends remain consistent.

[0063] Step E30: Send a disconnect command to the second device to disconnect the second Bluetooth communication mode.

[0064] After completing local synchronization cursor updates (and optionally returning cursor update confirmation to the second device), the first device actively sends a disconnect command to the second device via the SPP connection channel. This command is constructed based on the classic Bluetooth link release procedure, triggering the underlying protocol stacks of both devices to perform a disconnect operation. Upon receiving the command, the second device responds and releases its local SPP connection resources, and the first device also releases the radio frequency resources and memory cache occupied by its local SPP communication module.

[0065] After the disconnection operation is completed, the first device will switch the SPP communication module back to low-power standby mode and return to the step of sending a broadcast signal in the first Bluetooth communication mode, entering a new round of low-power broadcast cycle, waiting for the next synchronization trigger condition to be met.

[0066] In one possible implementation, the transmission interval of the broadcast signal is dynamically adjusted according to the motion state of the first device, and / or the transmission interval of the broadcast signal is dynamically adjusted according to the remaining power of the first device; wherein, the transmission interval is shortened when the first device is in motion; the transmission interval is extended when the first device is stationary; and the transmission interval is extended when the remaining power is below a preset power threshold.

[0067] The first device detects its own motion status in real time using built-in motion sensors (such as accelerometers, gyroscopes, or heart rate sensors). When motion is detected, indicating the user is active, the device generates new data more frequently, increasing the need for real-time synchronization. In this case, the first device shortens the broadcast signal transmission interval, for example, from the default 1000ms to 200ms, to increase the broadcast frequency, allowing the second device to discover and connect to the first device more promptly. When stationary, the device generates new data less frequently, and the real-time synchronization requirement is correspondingly lower. In this case, the first device extends the broadcast signal transmission interval, for example, to 2000ms, to reduce the broadcast frequency, decrease radio frequency activity, and thus save standby power consumption. The first device can combine data from multiple sensors to make a fusion decision on motion status. For example, when the accelerometer detects continuous motion signals and the heart rate is higher than the resting threshold, it is determined to be in motion; otherwise, it is determined to be stationary, to avoid frequent erroneous switching of the broadcast interval due to brief jitter or noise.

[0068] The first device also monitors the remaining battery power in real time through a power management module. When the remaining power is below a preset power threshold (e.g., 20%), it indicates that the device is in a low-power state. At this time, the first device extends the broadcast signal transmission interval, for example, to 3000ms, to reduce the broadcast frequency and RF power consumption, prioritizing the device's basic runtime and critical data acquisition capabilities. When the remaining power is above the preset power threshold, the first device maintains or restores the default broadcast interval to ensure timely synchronization response under normal conditions. When the power further recovers to a safe range (e.g., reaching above 50% during charging), the first device can restore the broadcast interval to the default value or a value dynamically adjusted based on the motion state.

[0069] When the first device adjusts the broadcast interval based on both motion status and remaining battery power, a priority rule can be preset. For example, when the remaining battery power is below the low battery threshold, the low battery protection strategy is prioritized, extending the broadcast interval to ensure battery life; when the battery power is sufficient, the broadcast interval is dynamically adjusted based on the motion status, achieving a balance between real-time performance and power consumption. Before the start of each broadcast cycle, the first device reassesses the current motion status and remaining battery power, dynamically calculates and applies the broadcast interval value for the next cycle, achieving adaptive adjustment.

[0070] In one possible implementation, the synchronization trigger information includes data volume information, data priority information, and data timestamp information of the local data to be synchronized on the first device; the decision conditions for the second device to return the connection request based on the synchronization trigger information include at least one of the following: The amount of data to be synchronized reaches a preset data volume threshold; The data priority is a preset priority level; The time difference between the current time and the data timestamp reaches a preset duration.

[0071] The synchronization trigger information includes the data volume, data priority, and data timestamp information of the local data to be synchronized on the first device. After receiving the broadcast signal, the second device parses the synchronization trigger information carried therein and determines whether to return a connection request to the first device based on at least one of the following decision conditions.

[0072] The first decision condition is that the amount of data to be synchronized reaches a preset data volume threshold. The second device extracts data volume information from the synchronization trigger information and compares it with the preset data volume threshold. If the current amount of data to be synchronized reaches or exceeds the threshold, it indicates that the first device has accumulated enough data locally, and it is necessary to initiate synchronization in a timely manner to avoid excessive data backlog or excessive storage space occupation on the device. The preset data volume threshold can be set by system default (e.g., 100KB or 500 records) or can be customized by the user according to actual needs.

[0073] The second decision condition is that the data priority is a preset priority level. The second device extracts data priority information from the synchronization trigger information to determine whether there is high-priority data that needs to be synchronized first. For example, when the first device collects high-priority health event data such as abnormal heart rate warnings, fall detection alarms, or sudden drops in blood oxygen, the data priority information is marked as high-priority. After the second device identifies this level, it immediately initiates a connection request to ensure that critical data can be uploaded to the terminal or cloud in a timely manner, so that users or medical staff can be informed of abnormal situations as soon as possible. If the data priority is at a normal level (such as regular exercise steps), the second device can make a comprehensive decision based on other conditions and may not necessarily trigger synchronization immediately.

[0074] The third decision condition is that the time difference between the current time and the data timestamp reaches a preset duration. The second device extracts the data timestamp information from the synchronization trigger information and compares this timestamp with the current system time to calculate the time difference between the two. If this time difference reaches the preset duration (e.g., 30 minutes, 1 hour, or 12 hours), it indicates that the first device has not synchronized data for a relatively long time. Even if the data volume has not reached the threshold and the priority is not high, it is necessary to actively trigger synchronization to ensure the continuity and timeliness of terminal data and avoid data gaps caused by long-term non-synchronization. The preset duration can be configured by system default or set separately according to different data types. For example, the forced synchronization interval for health monitoring data can be set to 1 hour, while the forced synchronization interval for exercise recording data can be set to 12 hours.

[0075] The three decision conditions mentioned above can be used independently or in any combination. When used in combination, the second device can preset logical rules, such as initiating a connection request when either the data volume reaches a threshold or the time difference reaches a preset duration, while unconditionally triggering synchronization for high-priority data. Through this multi-condition comprehensive decision-making mechanism, the second device can flexibly adapt to synchronization needs in different scenarios, achieving a dynamic balance between power consumption optimization and data timeliness.

[0076] For example, to help understand the technical concept or principle of the data synchronization method after combining this embodiment with the first and second embodiments described above, a specific embodiment is now listed. In this specific embodiment, the data synchronization process includes: 1. Low-power BLE broadcasting: The health wearable device operates in a low-power state under normal conditions, continuously sending BLE broadcasts without establishing any connections to minimize power consumption. Private fields are defined in the BLE broadcast data (Advertising Data), specifically including three core pieces of information: the amount of data to be synchronized, the synchronization priority, and the data timestamp. The 0xFF vendor-defined data field in the Bluetooth specification is used to carry this private information, ensuring that the total payload of the broadcast packet does not exceed 31 bytes, balancing low power consumption and information integrity.

[0077] 2. Mobile Broadcast Parsing and Connection Decision: The mobile app continuously scans for surrounding BLE broadcast signals. When a BLE broadcast from a target health wearable device is detected, it automatically parses the private fields in the broadcast packet to extract the amount of data to be synchronized, priority, and timestamp information. Based on preset rules (such as the amount of data to be synchronized reaching a threshold or the priority meeting requirements), it decides whether to initiate an SPP connection request, thus achieving intelligent judgment of the synchronization timing.

[0078] 3. SPP Connection Establishment and Incremental Synchronization: After the mobile device decides to initiate a connection, it sends an SPP connection request to the health wearable device. Upon receiving the request, the device automatically wakes up the SPP module and establishes an SPP connection. After the connection is established, both ends transmit only the health data that has not been synchronized since the last synchronization (incremental synchronization) based on the synchronization cursor. This avoids the power consumption waste and efficiency loss caused by full data transmission. Full synchronization is performed during the first synchronization, and incremental synchronization logic is used for subsequent synchronizations.

[0079] 4. Synchronization Confirmation and Connection Disconnection: After the health wearable device transmits incremental data to the mobile phone in batches, the mobile phone completes the data reception and storage, and sends a synchronization completion notification to the device through the BLE channel. After receiving the confirmation notification, the device and the mobile phone update the synchronization cursor (record the latest synchronization node), and then automatically disconnect the SPP connection. The device returns to the low-power state of BLE broadcast only, completing a complete automated synchronization process.

[0080] It should be noted that the above examples are only used to help understand this embodiment and do not constitute a limitation on the data synchronization process of this embodiment. Any simple modifications based on this technical concept are within the protection scope of this application.

[0081] Furthermore, embodiments of this application also propose a data synchronization system, referring to... Figure 5 As shown, the data synchronization system includes a first device and a second device connected by communication. The first device is used to send a broadcast signal, wherein the broadcast signal carries synchronization trigger information, and the synchronization trigger information is used to trigger the second device to decide whether to initiate a connection request to the first device; The second device is configured to receive the broadcast signal, parse the synchronization trigger information, and decide whether to initiate a connection request to the first device based on the synchronization trigger information, and send a connection request to the first device when the decision result is yes; The first device is further configured to, in response to the connection request, establish a second Bluetooth communication mode with the second device, and send data to be synchronized to the second device in the second Bluetooth communication mode; The second device is also used to receive the data to be synchronized, and to return synchronization completion confirmation information to the first device after the data to be synchronized has been verified. The first device is further configured to, in response to the synchronization completion confirmation information returned by the second device for the data to be synchronized, disconnect the second Bluetooth communication mode and resend the broadcast signal in the first Bluetooth communication mode.

[0082] The first device provided in this application, employing the data synchronization method described in the above embodiments, can solve the technical problem of how to achieve efficient data synchronization while reducing device power consumption and minimizing manual user operations. Compared with the prior art, the beneficial effects of the first device provided in this application are the same as those of the data synchronization method provided in the above embodiments, and other technical features of the first device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0083] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0084] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0085] In addition, to achieve the above objectives, embodiments of this application also provide a readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the data synchronization method described in the above embodiments.

[0086] The computer-readable storage medium provided in this application embodiment may be, for example, a USB flash drive, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0087] The aforementioned computer-readable storage medium may be included in the first device; or it may exist independently and not assembled into the first device.

[0088] The aforementioned computer-readable storage medium carries one or more programs that, when executed by the first device, cause the first device to perform the process steps of any embodiment of the aforementioned data synchronization method.

[0089] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0091] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules are not, in some cases, limiting the scope of the module itself.

[0092] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described data synchronization method. This solves the technical problem of achieving efficient data synchronization while reducing device power consumption and minimizing manual user operations. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the data synchronization method provided in the above embodiments, and will not be repeated here.

[0093] Furthermore, embodiments of this application also propose a computer program product, including a computer program, which, when executed by a processor, implements the steps of the data synchronization method described above.

[0094] The specific implementation method of the computer program product in this application is basically the same as the embodiments of the above data synchronization method, and will not be described again here.

[0095] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0096] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0097] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software sensor. This computer software sensor is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a first device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0098] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A data synchronization method, characterized in that, Applied to the first device, the data synchronization method includes the following steps: A broadcast signal is sent in a first Bluetooth communication mode, wherein the broadcast signal carries synchronization trigger information, which is used to trigger a second device to decide whether to initiate a connection request; In response to the connection request returned by the second device according to the synchronization trigger information, a data transmission connection in the second Bluetooth communication mode is established with the second device, wherein the transmission rate of the first Bluetooth communication mode is lower than that of the second Bluetooth communication mode, and the power consumption of the second Bluetooth communication mode is higher than that of the first Bluetooth communication mode. In the second Bluetooth communication mode, send the data to be synchronized to the second device; In response to the synchronization completion confirmation information returned by the second device for the data to be synchronized, the second Bluetooth communication mode is disconnected, and the process returns to the step of sending a broadcast signal in the first Bluetooth communication mode.

2. The data synchronization method as described in claim 1, characterized in that, The step of sending a broadcast signal in the first Bluetooth communication mode includes: Obtain the data volume information, data priority information, and data timestamp information of the local data to be synchronized on the first device; The data volume information, the data priority information, and the data timestamp information are encapsulated into a custom data field of the broadcast signal; The encapsulated broadcast signal is transmitted in the first Bluetooth communication mode.

3. The data synchronization method as described in claim 1, characterized in that, The step of establishing a data transmission connection with the second device in the second Bluetooth communication mode in response to the connection request returned by the second device according to the synchronization trigger information includes: Receive the SPP connection request returned by the second device based on the synchronization trigger information; In response to the SPP connection request, the SPP communication module of the first device is woken up, and an SPP connection channel is established with the second device through the SPP communication module to transmit data in the second Bluetooth communication mode.

4. The data synchronization method as described in claim 1, characterized in that, The step of sending the data to be synchronized to the second device in the second Bluetooth communication mode includes: Obtain the starting cursor for this synchronization, wherein the starting cursor is used to represent the data node that has been synchronized in the last time; Based on the starting cursor, incremental data is selected from the locally stored data to be synchronized, wherein the incremental data is data whose data recording time is later than the time node corresponding to the starting cursor; The incremental data is sent to the second device as data to be synchronized using the second Bluetooth communication mode.

5. The data synchronization method as described in claim 4, characterized in that, The step of obtaining the starting cursor for this synchronization includes: If the first device and the second device are paired and synchronized for the first time, the starting cursor is set to empty so that full data synchronization can be performed in the step of sending the data to be synchronized to the second device in the second Bluetooth communication mode. If the first device and the second device are not synchronizing for the first time, the first device receives the historical synchronization cursor sent by the second device and uses the historical synchronization cursor as the starting cursor.

6. The data synchronization method as described in any one of claims 1 to 5, characterized in that, The step of disconnecting the second Bluetooth communication mode in response to the synchronization completion confirmation information returned by the second device for the data to be synchronized includes: Receive synchronization completion confirmation information returned by the second device for the data to be synchronized; In response to the synchronization completion confirmation message, the local synchronization cursor is updated to the latest time node of the currently synchronized data; Send a disconnect command to the second device to disconnect the second Bluetooth communication mode.

7. The data synchronization method as described in any one of claims 1 to 5, characterized in that, The broadcast signal transmission interval is dynamically adjusted according to the motion state of the first device, and / or the broadcast signal transmission interval is dynamically adjusted according to the remaining power of the first device; Specifically, the transmission interval is shortened when the first device is in motion; The transmission interval is extended when the first device is in a stationary state; The transmission interval is extended when the remaining battery power is lower than a preset battery power threshold.

8. The data synchronization method as described in any one of claims 1 to 5, characterized in that, The synchronization trigger information includes data volume information, data priority information, and data timestamp information of the local data to be synchronized on the first device; the decision conditions for the second device to return the connection request based on the synchronization trigger information include at least one of the following: The amount of data to be synchronized has reached a preset data volume threshold. The data priority is a preset priority level; The time difference between the current time and the data timestamp reaches a preset duration.

9. A data synchronization system, characterized in that, The data synchronization system includes a first device and a second device connected by communication; The first device is used to send a broadcast signal, wherein the broadcast signal carries synchronization trigger information, and the synchronization trigger information is used to trigger the second device to decide whether to initiate a connection request to the first device; The second device is configured to receive the broadcast signal, parse the synchronization trigger information, and decide whether to initiate a connection request to the first device based on the synchronization trigger information, and send a connection request to the first device when the decision result is yes; The first device is further configured to, in response to the connection request, establish a second Bluetooth communication mode with the second device, and send data to be synchronized to the second device in the second Bluetooth communication mode; The second device is also used to receive the data to be synchronized, and to return synchronization completion confirmation information to the first device after the data to be synchronized has been verified. The first device is further configured to, in response to the synchronization completion confirmation information returned by the second device for the data to be synchronized, disconnect the second Bluetooth communication mode and resend the broadcast signal in the first Bluetooth communication mode.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data synchronization method as described in any one of claims 1 to 8.