Data synchronization method and device
Patent Information
- Application Number
- CN202610833167.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-10-16
AI Technical Summary
这导致终端设备设备中安装的健康应用关闭从而无法再从蓝牙穿戴设备中获取蓝牙穿戴设备新采集到的健康数据
[0015]This disclosure provides a data synchronization method applied to a terminal device, comprising: a communication component in the terminal device receiving a synchronization instruction forwarded by a manufacturer's server via a target connection, storing the synchronization instruction in a first memory of the terminal device; the target connection being a system-level connection between the terminal device and the manufacturer's server; the synchronization instruction being sent from an application server to the manufacturer's server; an application processor in the terminal device reading the synchronization instruction from the first memory, controlling the terminal device to maintain a communication connection with a data acquisition device, controlling the startup of the application's background process, and instructing the application to perform data synchronization according to the synchronization instruction; and the application running in the application processor obtaining synchronization data through the communication connection. The synchronization instruction includes a location identifier for locating the terminal device and the application, a device identifier for the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device. This method can complete data synchronization between the terminal device and the data acquisition device regardless of whether the application processor is in sleep mode or whether the application's process has been cleared, without requiring additional hardware. This solves the problem that when the terminal device enters sleep mode, the Android system restricts the CPU, blocks the network, and freezes background processes, causing health applications installed on the terminal device to be unable to obtain newly collected health data from Bluetooth wearable devices.
Smart Images

Figure CN122933651A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data transmission technology, and more specifically, to a data synchronization method and apparatus. Background Technology
[0002] Currently, Android devices enter sleep mode after the screen is turned off. In sleep mode, Android limits CPU usage, blocks network access, and freezes background processes. This causes health apps installed on the device to close, preventing them from acquiring newly collected health data from Bluetooth wearable devices. Summary of the Invention
[0003] One object of this disclosure is to provide a new technical solution for data synchronization.
[0004] According to a first aspect of this disclosure, a data synchronization method is provided, applied to a terminal device, comprising: When the communication component in the terminal device receives a synchronization instruction forwarded by the manufacturer's server through a target connection, it stores the synchronization instruction in the first memory of the terminal device. The target connection is a system-level connection between the terminal device and the manufacturer's server. The synchronization instruction is sent from the application server to the manufacturer's server. The application processor in the terminal device reads the synchronization instruction from the first memory, and controls the terminal device to maintain a communication connection with the data acquisition device, controls the background process of the application to start, and instructs the application to perform data synchronization according to the synchronization instruction; The application running in the application processor obtains synchronization data through the communication connection. The synchronization instruction includes a location identifier for locating the terminal device and the application, a device identifier for the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device.
[0005] Optionally, when the communication component in the terminal device receives a synchronization instruction forwarded by the manufacturer's server through a target connection, it stores the synchronization instruction in a first memory in the terminal device, including: When the communication component in the terminal device receives a synchronization instruction forwarded by the manufacturer's server through a target connection and the application processor in the terminal device is in a sleep state, it wakes up the application processor in the terminal device and stores the synchronization instruction in the first memory of the terminal device.
[0006] Optionally, the target connection is a vendor-grade push channel between the terminal device and the vendor's server, and the location identifier is a token.
[0007] Optionally, the step of controlling the terminal device to maintain a communication connection with the data acquisition device and controlling the start of the application's background process according to the synchronization command includes: According to the synchronization instruction, the terminal device is controlled to maintain a communication connection with the data acquisition device and the background process of the application is started within a first preset time period; The method further includes: After the first preset time period, the terminal device is controlled to disconnect from the data acquisition device, causing the awakened application processor to return to sleep mode.
[0008] Optionally, after the application running in the application processor obtains synchronization data through the communication connection, the method further includes: The application uses lightweight database transactions to write the synchronized data to the local database.
[0009] Optionally, after the application processor reads the synchronization instruction from the first memory, the method further includes: The application processor sends a first reception response to the vendor server, and the vendor server forwards the first reception response to the application server.
[0010] According to a second aspect of this disclosure, a data synchronization method is provided, applied to an application server, the method comprising: Under the set triggering conditions, a synchronization command is sent to the manufacturer's server of the terminal device, so that the manufacturer's server forwards the synchronization command to the terminal device through the target connection; The target connection is a system-level connection between the terminal device and the manufacturer's server. The synchronization instruction includes a location identifier for locating the application in the terminal device, a device identifier for the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device.
[0011] Optionally, the set triggering condition is that a preset time interval is reached or the application server does not receive the synchronization data obtained by the application reported by the terminal device within a third preset time period.
[0012] Optionally, the method further includes: If the first response information sent by the manufacturer's server is not received within the second preset time period or the second response information sent by the manufacturer's server is not received within the third preset time period, the step of sending the synchronization instruction to the manufacturer's server of the terminal device is re-executed. The second response information is the response information sent by the manufacturer's server to the application server after receiving the synchronization instruction sent by the application server. The third preset time period is shorter than the second preset time period.
[0013] According to a third aspect of this disclosure, an electronic device is provided, wherein, when the electronic device is a terminal device, the electronic device includes: A communication component is used to store a synchronization instruction forwarded by a vendor server into a first memory in the terminal device when the synchronization instruction is received through a target connection. The target connection is a system-level connection between the terminal device and the vendor server. The synchronization instruction is sent from the application server to the vendor server. The synchronization instruction includes a location identifier for locating the terminal device and the application, a device identifier for the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device. A first memory is used to store the synchronization instructions and the first computer instructions; An application processor is configured to read the synchronization instructions from the first memory and invoke first computer instructions to perform the method as described in any one of the first aspects; When the electronic device is an application server, the electronic device includes: The second memory is used to store the second computer instructions. A processor for recalling the second computer instructions from the second memory to perform the method as described in any one of the second aspects.
[0014] According to a third aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of the first or second aspects.
[0015] This disclosure provides a data synchronization method applied to a terminal device, comprising: a communication component in the terminal device receiving a synchronization instruction forwarded by a manufacturer's server via a target connection, storing the synchronization instruction in a first memory of the terminal device; the target connection being a system-level connection between the terminal device and the manufacturer's server; the synchronization instruction being sent from an application server to the manufacturer's server; an application processor in the terminal device reading the synchronization instruction from the first memory, controlling the terminal device to maintain a communication connection with a data acquisition device, controlling the startup of the application's background process, and instructing the application to perform data synchronization according to the synchronization instruction; and the application running in the application processor obtaining synchronization data through the communication connection. The synchronization instruction includes a location identifier for locating the terminal device and the application, a device identifier for the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device. This method can complete data synchronization between the terminal device and the data acquisition device regardless of whether the application processor is in sleep mode or whether the application's process has been cleared, without requiring additional hardware. This solves the problem that when the terminal device enters sleep mode, the Android system restricts the CPU, blocks the network, and freezes background processes, causing health applications installed on the terminal device to be unable to obtain newly collected health data from Bluetooth wearable devices.
[0016] Other features and advantages of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments of the present disclosure and, together with their description, serve to explain the principles of the present disclosure.
[0018] Figure 1 This is a flowchart illustrating a data synchronization method provided in this disclosure. Figure 1 ; Figure 2 This is a flowchart illustrating a data synchronization method provided in this disclosure. Figure 2 ; Figure 3 This is a schematic diagram of the structure of an electronic device provided in this disclosure. Figure 1 ; Figure 4 This is a schematic diagram of the structure of an electronic device provided in this disclosure. Figure 2 . Detailed Implementation
[0019] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.
[0020] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use.
[0021] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0022] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0023] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0024] It should be noted that all actions related to the collection, storage, use, processing, transmission, provision, disclosure, and deletion of data in this disclosure are carried out in accordance with local data protection regulations and with the full authorization of the relevant data owners.
[0025] This disclosure provides a data synchronization method to address the problem of how an application on a terminal device can synchronize data from a data acquisition device when the application processor is in hibernation mode or the manufacturer has killed background processes.
[0026] When the data synchronization method provided in this disclosure is applied to an application server, such as Figure 1 As shown, the data synchronization method provided in this disclosure includes the following steps S110.
[0027] Step S110: Under the set triggering conditions, a synchronization command is sent to the manufacturer's server of the terminal device, so that the manufacturer's server forwards the synchronization command to the terminal device through the target connection.
[0028] The target connection is a system-level connection between the terminal device and the manufacturer's server. The synchronization instruction includes a location identifier for locating the application in the terminal device, a device identifier for the data acquisition device, and a synchronization instruction that instructs the application to obtain synchronization data from the data acquisition device.
[0029] In this embodiment, the application server is the backend server of the application. The set trigger condition is the condition that triggers the application server to send a synchronization command to the manufacturer's server of the terminal device. In one embodiment of this disclosure, the set trigger condition is the arrival of a preset time interval. The preset time interval is 30 minutes. It should be noted that the preset time interval can be determined according to the type of synchronization data collected by the data acquisition device, and this disclosure does not limit the value of the preset time interval. In another embodiment of this disclosure, the set trigger condition is that the application server does not receive synchronization data reported by the terminal device as obtained by the application within a fifth preset time period. The third preset time period is exemplarily 1 hour. If the application server does not receive synchronization data reported by the terminal device as obtained by the application within the fifth preset time period, it indicates that the application is likely in a closed state.
[0030] A synchronization instruction is used to instruct an application on a terminal device to synchronize data. This synchronization instruction includes a location identifier for the target terminal device among a plurality of candidate terminal devices that have established a target connection with the manufacturer's server, and a location identifier for the target application among a plurality of candidate applications installed on the target terminal device. The synchronization instruction also includes a device identifier for a data acquisition device, wherein the data acquisition device is exemplarily a wearable device (such as a smartwatch) that has established a communication connection with the terminal device. Furthermore, the synchronization instruction also includes a synchronization instruction instructing the aforementioned target application to obtain synchronization data from the data acquisition device. In this embodiment of the disclosure, the data volume of the synchronization instruction is small, which minimizes the transmission power consumption of the synchronization instruction and avoids redundant data consuming network resources.
[0031] In step S110 above, the application server monitors the set trigger conditions. When the set trigger conditions are met, it generates a synchronization instruction containing the location identifier of the application in the positioning terminal device, the device identifier of the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device. Further, the synchronization instruction is sent to the vendor server corresponding to the terminal device. After receiving the synchronization instruction, the vendor server parses it to locate the aforementioned target terminal device. Further, the vendor server forwards the synchronization instruction to the target terminal device via a target connection. In one embodiment of this disclosure, after receiving the synchronization instruction sent by the cloud server, the vendor server sends a second reception response to the cloud server.
[0032] The target connection is a system-level connection between the terminal device and the vendor's service. Specifically, it refers to the system-level connection established between the terminal device and the vendor's server. This target connection is maintained at the underlying level by the operating system (such as Android) deployed on the terminal device. It is a high-priority channel natively allowed by the operating system and is unaffected by application processor hibernation or application process cleanup, ensuring stable message delivery. Therefore, regardless of whether the application processor is in hibernation mode, the vendor's server can send synchronization commands to the terminal device through the target connection.
[0033] In one embodiment of this disclosure, the target connection is a long-lived connection serving as a vendor-grade push channel between the terminal device and the vendor server. Based on this, the location identifier is a token requested by the target application from the vendor server upon its first launch, used to bind the installed terminal device and the application. Furthermore, after obtaining the token, the application uploads it to the application server.
[0034] As can be seen from step S110 above, this embodiment of the present disclosure sends a synchronization command to the manufacturer's server under set trigger conditions through the application server, which can flexibly control the triggering time of the synchronization data and adapt to diverse data synchronization needs.
[0035] Corresponding to step S110 above, this disclosure also provides another data synchronization method, which is applied to a terminal device. Figure 2 As shown, the method includes the following steps S210 to S230.
[0036] In step S210, when the communication component in the terminal device receives the synchronization instruction forwarded by the manufacturer's server through the target connection, it stores the synchronization instruction in the first memory of the terminal device. The target connection is a system-level connection between the terminal device and the manufacturer's server, and the synchronization instruction is sent from the application server to the manufacturer's server.
[0037] In this embodiment, the memory in the terminal device is referred to as the first memory. The communication component is a system-level resident service pre-installed by the operating system in the terminal device, running independently of the application. It is used to receive system-level messages issued by the vendor server, has low-power network monitoring capabilities, and can still work normally when the application processor is in sleep mode. Furthermore, the communication component establishes a target connection with the vendor server through the operating system's underlying interface. Based on the application server generating a synchronization command and sending it to the vendor server, the vendor server forwards the synchronization command to the terminal device through the target connection, and the communication component receives the synchronization command. After receiving the synchronization command, the communication component writes the synchronization command into the first memory to complete the storage.
[0038] It should be noted that this embodiment does not limit whether the application processor is in a sleep state. If the application processor is in an active state (not in sleep mode), the communication component immediately triggers a hardware interrupt after receiving a synchronization command from the vendor server through the target connection. This hardware interrupt is responded to by the application processor, which then executes step S220 below. Conversely, if the application processor is in a sleep state, it is forcibly woken up. After being woken up, the application processor executes step S220 below. Based on this, step S110 is specifically implemented through step S111 below.
[0039] In step S111, when the communication component in the terminal device receives the synchronization instruction forwarded by the manufacturer's server through the target connection and the application processor in the terminal device is in a sleep state, it wakes up the application processor in the terminal device and stores the synchronization instruction in the first memory of the terminal device.
[0040] In step S220, the application processor in the terminal device reads the synchronization instruction from the first memory, controls the terminal device to maintain a communication connection with the data acquisition device, controls the background process of the application to start, and instructs the application to perform data synchronization according to the synchronization instruction.
[0041] In this embodiment, the application processor is the core processing unit of the terminal device, that is, the central processing unit of the terminal device. It is responsible for scheduling system resources, executing program instructions, and controlling the operation of hardware modules, and has capabilities such as process scheduling and communication control. The data acquisition device is a device that has established a communication connection with the terminal device and is used to collect, for example, health data, such as wearable health monitoring devices used to collect data such as heart rate and blood oxygen.
[0042] When the terminal device is in a dormant state or the application process is cleaned up, the terminal device disconnects from the data acquisition device. When the terminal device is in an active state and the application process is started, the terminal device maintains a communication connection with the data acquisition device, and the application performs data synchronization. Based on this, the specific implementation of step S220 is as follows: If the application processor itself is in an active state, and is not woken up by a hardware interrupt triggered by the communication component, the application server maintains a communication connection between the terminal device and the data acquisition device, keeps the application's background process running, and instructs the application to obtain synchronization data from the data acquisition device. If the application processor itself is in a dormant state, and is woken up by a hardware interrupt triggered by the communication component, the application processor reads the connection information of the data acquisition device according to the device identifier of the data acquisition device in the synchronization instruction. Further, based on this connection information, it controls the terminal device to establish a communication connection with the data acquisition device corresponding to the aforementioned device identifier, starts the background process of the application corresponding to the application identifier in the location identifier, and instructs the application to perform data synchronization according to the synchronization instruction in the synchronization instruction. The first memory pre-stores the connection information of the data acquisition device. In one embodiment of this disclosure, the control terminal device and the data acquisition device maintain a communication connection by maintaining a low-power communication connection. Based on this, when establishing a communication connection between the control terminal device and the data acquisition device, redundant authentication procedures are skipped, thus shortening the communication connection time.
[0043] In step S230, the application running in the application processor obtains synchronization data through the communication connection.
[0044] Through step S220 above, a communication connection has been established between the terminal device and the data acquisition device, and the background process of the application has been started. Therefore, without displaying a user interface, the application can obtain newly acquired synchronization data from the data acquisition device through the established communication connection between the terminal device and the data acquisition device, thus avoiding the loss of data to be synchronized collected by the data acquisition device. Based on this, data synchronization between the terminal device and the data acquisition device is completed.
[0045] In this embodiment of the disclosure, since only the background process of the application is kept running, the application consumes less system resources, which meets the low power consumption requirements when the application processor is in a sleep state.
[0046] As described in steps S210 to S230 above, this disclosure provides a data synchronization method applied to a terminal device, comprising: When a communication component in the terminal device receives a synchronization instruction forwarded by a vendor server through a target connection, it stores the synchronization instruction in a first memory of the terminal device. The target connection is a system-level connection between the terminal device and the vendor server. The synchronization instruction is sent from the application server to the vendor server. The application processor reads the synchronization instruction from the first memory and, according to the synchronization instruction, controls the terminal device to maintain a communication connection with a data acquisition device, controls the start of the application's background process, and instructs the application to perform data synchronization. The application running in the application processor obtains synchronization data through the communication connection. The synchronization instruction includes a location identifier for locating the terminal device and the application, a device identifier for the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device. This method can complete data synchronization between the terminal device and the data acquisition device regardless of whether the application processor is in sleep mode or the application's process has been cleaned up, without requiring additional hardware. This resolves the issue where, after a terminal device enters sleep mode, the Android system restricts the CPU, blocks the network, and freezes background processes, causing health applications installed on the terminal device to be unable to obtain newly collected health data from the Bluetooth wearable device.
[0047] In one embodiment of this disclosure, the steps S220 above, which involve controlling the terminal device to maintain a communication connection with the data acquisition device according to the synchronization command and controlling the start of the background process of the application, are specifically implemented through the following steps S221.
[0048] Step S221: According to the synchronization instruction, the control terminal device maintains a communication connection with the data acquisition device and controls the background process of the application to start within a first preset time period.
[0049] The first preset duration is typically the duration during which the application can obtain the synchronized data collected by the data acquisition device.
[0050] The data synchronization method provided in this disclosure further includes: after a first preset time period, the control terminal device disconnects the communication connection with the data acquisition device, so that the awakened application processor returns to a dormant state.
[0051] In one embodiment of this disclosure, step S221 can be implemented by requesting a temporary wake-up lock of a first preset duration from the application. Corresponding to step S221, after the first preset duration, the temporary wake-up lock is released, and the control terminal device returns to the state before step S221. For example, the communication connection with the data acquisition device is disconnected, causing the woken application processor to return to a sleep state.
[0052] Through the above step S221, the application processor can return to sleep mode while ensuring that the application obtains the synchronous data collected by the data acquisition device.
[0053] In one embodiment of this disclosure, the data synchronization method provided by this disclosure further includes the following step S240 after the above step S230.
[0054] In step S240, the application uses a lightweight database transaction to write the synchronized data to the local database.
[0055] Lightweight database transactions, exemplified by SQLite transactions, allow applications to write synchronized data to the local database in a lightweight manner by disabling redundant checks and using batch writes. This facilitates fast and low-power writing of synchronized data to the local database.
[0056] In one embodiment of this disclosure, after the application processor reads the synchronization instruction from the first memory in step S220 above, the data synchronization method provided by this disclosure further includes the following step S222.
[0057] In step S222, the application processor sends a first reception response to the vendor server, and the vendor server forwards the first reception response to the application server.
[0058] Through the above step S222, the application server can determine that the synchronization command has been sent to the terminal device.
[0059] Corresponding to step S222, there may be situations where the terminal device fails to receive the synchronization command due to network fluctuations or loss of synchronization commands. In this regard, when the data synchronization method provided in this disclosure is applied to an application server, the data synchronization method provided in this disclosure further includes the following step S120.
[0060] Step S120: If no first reception response information is received from the manufacturer's server within the second preset time period or no second reception response information is received from the manufacturer's server within the third preset time period, the synchronization command to be sent to the manufacturer's server of the terminal device is re-executed.
[0061] The second received response information is the response information sent by the manufacturer's server to the application server after receiving the synchronization instruction sent by the application server, and the third preset duration is less than the second preset duration.
[0062] The second preset duration is the time elapsed from the moment the application server sends the synchronization command to the moment the application server receives the first response information. The third preset duration is the time elapsed from the moment the application server sends the synchronization command to the moment the application server receives the second response information. The specific values of the second and third preset durations can be set based on experience or experimentation.
[0063] If no first response message is received from the vendor server within the second preset time period, or no second response message is received from the vendor server within the third preset time period, it is determined that the network component of the terminal device has not received the synchronization command. In this case, step S110 is repeated. This timeout retry mechanism effectively solves the problem of synchronization task failure caused by network fluctuations and lost synchronization commands, ensuring the stability and reliability of the data synchronization process.
[0064] In one embodiment of this disclosure, the specific implementation of step S120 can be as follows: step S121.
[0065] Step S121: If the first receiving response information sent by the manufacturer's server is not received within the second preset time period or the second receiving response information sent by the manufacturer's server is not received within the third preset time period, the synchronization command to be sent to the manufacturer's server of the terminal device is re-executed after the fourth preset time period.
[0066] The fourth preset duration is 10 seconds, and the above step S121 can reduce the probability of failure when sending synchronization instructions to the terminal device frequently in the event of network fluctuations.
[0067] This disclosure also provides an electronic device, in the case that the electronic device is a terminal device, such as... Figure 3 As shown, the electronic device 300 includes: Communication component 310 is used to store a synchronization instruction forwarded by a vendor server into a first memory in the terminal device when the synchronization instruction is received through a target connection. The target connection is a system-level connection between the terminal device and the vendor server. The synchronization instruction is sent from the application server to the vendor server. The synchronization instruction includes a location identifier for locating the terminal device and the application, a device identifier for the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device. The first memory 320 is used to store the synchronization instructions and the first computer instructions; Application processor 330 is configured to read the synchronization instructions from the first memory and invoke the first computer instructions to execute the data synchronization method applied to the terminal device as described above. In the case where the electronic device 300 is an application server, such as Figure 4 As shown, the electronic device 300 includes: The second memory 340 is used to store second computer instructions. Processor 350 is configured to retrieve the second computer instructions from the second memory to execute a data synchronization method, such as that applied to an application server.
[0068] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the data synchronization methods described in the above method embodiments.
[0069] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0070] This disclosure may be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement any of the methods in the foregoing embodiments of this disclosure.
[0071] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media may include, for example, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), compact disc-read-only memory (CD-ROM), digital versatile disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any combination thereof. The computer-readable storage medium used herein is not to be interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0072] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include one or more of copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to computer-readable storage media in the respective computing / processing device.
[0073] The computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source or object programs written in any combination of one or more programming languages, including object-oriented programming languages (such as Smalltalk, C++, etc.) and conventional procedural programming languages (such as the "C" language or similar programming languages). The computer-readable program instructions may 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 a remote computer, the remote computer may be connected to the user's computer via any type of network (e.g., a local area network or a wide area network), or it may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays, or programmable logic arrays, can execute computer-readable program instructions to implement various aspects of the embodiments of this disclosure by utilizing state information from the computer-readable program instructions.
[0074] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0075] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0076] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0077] 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 the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive 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 action, or using a combination of dedicated hardware and computer instructions. It should be noted that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are all equivalent.
[0078] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of this disclosure is defined by the appended claims.
Claims
1. A data synchronization method, characterized in that, Applied to terminal devices, including: When the communication component in the terminal device receives a synchronization instruction forwarded by the manufacturer's server through a target connection, it stores the synchronization instruction in the first memory of the terminal device. The target connection is a system-level connection between the terminal device and the manufacturer's server. The synchronization instruction is sent from the application server to the manufacturer's server. The application processor in the terminal device reads the synchronization instruction from the first memory, and controls the terminal device to maintain a communication connection with the data acquisition device, controls the background process of the application to start, and instructs the application to perform data synchronization according to the synchronization instruction; The application running in the application processor obtains synchronization data through the communication connection. The synchronization instruction includes a location identifier for locating the terminal device and the application, a device identifier for the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device.
2. The method according to claim 1, characterized in that, When the communication component in the terminal device receives a synchronization instruction forwarded by the manufacturer's server through a target connection, it stores the synchronization instruction in the first memory of the terminal device, including: When the communication component in the terminal device receives a synchronization instruction forwarded by the manufacturer's server through a target connection and the application processor in the terminal device is in a sleep state, it wakes up the application processor in the terminal device and stores the synchronization instruction in the first memory of the terminal device.
3. The method according to claim 1, characterized in that, The target connection is a vendor-grade push channel between the terminal device and the vendor's server, and the location identifier is a token.
4. The method according to claim 2, characterized in that, The step of controlling the terminal device to maintain a communication connection with the data acquisition device and controlling the start of the application's background process according to the synchronization command includes: According to the synchronization instruction, the terminal device is controlled to maintain a communication connection with the data acquisition device and the background process of the application is started within a first preset time period; The method further includes: After the first preset time period, the terminal device is controlled to disconnect from the data acquisition device, causing the awakened application processor to return to sleep mode.
5. The method according to claim 1, characterized in that, After the application running in the application processor obtains synchronization data through the communication connection, the method further includes: The application uses lightweight database transactions to write the synchronized data to the local database.
6. The method according to claim 1, characterized in that, After the application processor in the terminal device reads the synchronization instruction from the first memory, the method further includes: The application processor in the terminal device sends a first reception response to the vendor server, and the vendor server forwards the first reception response to the application server.
7. A data synchronization method, characterized in that, Applied to an application server, the method includes: Under the set triggering conditions, a synchronization command is sent to the manufacturer's server of the terminal device, so that the manufacturer's server forwards the synchronization command to the terminal device through the target connection; The target connection is a system-level connection between the terminal device and the manufacturer's server. The synchronization instruction includes a location identifier for locating the application in the terminal device, a device identifier for the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device.
8. The method according to claim 7, characterized in that, The set triggering condition is that a preset time interval is reached or the application server does not receive the synchronization data obtained by the application reported by the terminal device within a third preset time period.
9. The method according to claim 7, characterized in that, The method further includes: If the first response information sent by the manufacturer's server is not received within the second preset time period or the second response information sent by the manufacturer's server is not received within the third preset time period, the step of sending the synchronization instruction to the manufacturer's server of the terminal device is re-executed. The second response information is the response information sent by the manufacturer's server to the application server after receiving the synchronization instruction sent by the application server. The third preset time period is shorter than the second preset time period.
10. An electronic device, characterized in that, When the electronic device is a terminal device, the electronic device includes: A communication component is used to store a synchronization instruction forwarded by a vendor server into a first memory in the terminal device when the synchronization instruction is received through a target connection. The target connection is a system-level connection between the terminal device and the vendor server. The synchronization instruction is sent from the application server to the vendor server. The synchronization instruction includes a location identifier for locating the terminal device and the application, a device identifier for the data acquisition device, and a synchronization instruction instructing the application to obtain synchronization data from the data acquisition device. A first memory is used to store the synchronization instructions and the first computer instructions; An application processor is configured to read the synchronization instructions from the first memory and invoke first computer instructions to perform the method as described in any one of claims 1-6; When the electronic device is an application server, the electronic device includes: The second memory is used to store the second computer instructions. A processor for recalling the second computer instructions from the second memory to perform the method as described in any one of claims 7-9.