A data synchronization method, terminal and system

By setting up a low-real-time and high-real-time state switching mechanism on the terminal, and adjusting the synchronization strategy according to the application state and user operation requirements, the contradiction between synchronization real-time and resource consumption is resolved, and the resource utilization of the terminal and server is optimized.

CN115695445BActive Publication Date: 2026-01-13HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210081108.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-07-31
Filing Date
2022-01-24
Publication Date
2026-01-13
Estimated Expiration
2042-01-24

AI Technical Summary

Technical Problem

Existing data synchronization methods present a contradiction between real-time synchronization and resource consumption when frequently operating terminals, leading to increased terminal resource consumption and server pressure. Especially when other terminals are not paying attention to updated data, synchronization becomes meaningless.

Method used

By setting up a low-real-time and high-real-time state switching mechanism on the terminal, the interval and real-time strategy of synchronization updates can be adjusted according to the application's state and user operation requirements, thereby reducing the number of synchronization requests and network bandwidth consumption, merging server notifications, and optimizing resource utilization.

Benefits of technology

It achieves the goal of reducing network bandwidth and power consumption, lowering server resources and I/O connection count, and optimizing resource utilization of terminals and servers while ensuring user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695445B_ABST
    Figure CN115695445B_ABST
Patent Text Reader

Abstract

The application discloses a data synchronization method, a terminal and a system. The method comprises the following steps: a first terminal receives a first operation of a user on a first application on the first terminal; the first terminal displays a first interface in response to the first operation, and the content of the first interface is different from the content of a second interface; the first terminal receives a third operation of the user on the first interface; the first terminal uploads data of the first application to a server in response to the third operation, and a second terminal downloads the data of the first application from the server and displays a third interface; the third interface is the same as the first interface. In this way, when the second terminal has a low requirement on synchronization real-time performance, the user operates the application on the first terminal, and the first terminal can lengthen the interval of updating the data for synchronization. When the second terminal has a high requirement on synchronization real-time performance, the user operates the application on the first terminal, and the first terminal can update the data in real time, so that the requirement of the user on synchronization real-time performance is ensured, and resource consumption is reduced to the maximum extent.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to Chinese Patent Application No. 202110877488.6, filed with the State Intellectual Property Office of China on July 31, 2021, entitled "A Data Synchronization Method, Terminal and System", the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present invention relates to the field of communication technology, and in particular to a data synchronization method, terminal and system. Background Technology

[0003] Data synchronization refers to maintaining data consistency across multiple terminals. Data synchronization services utilize servers to ensure data consistency across multiple terminals. For example, when data on a terminal changes (e.g., through adding, deleting, or modifying data in an application), the terminal can update the server with the changed data. When data on the server changes, the server notifies each terminal to retrieve the updated data from the server. This ensures that the data on the terminal remains consistent with the data on the server.

[0004] However, when users frequently interact with application data on a particular terminal, that terminal updates the data frequently, increasing resource consumption on the terminal and putting pressure on the server. If other terminals do not pay attention to the updated data, then the frequent data updates become meaningless. Therefore, existing data synchronization methods suffer from a trade-off between real-time synchronization and resource consumption. Summary of the Invention

[0005] The data synchronization method, terminal, and system provided in this application embodiment can both ensure the real-time synchronization requirements of user data and minimize resource consumption.

[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions.

[0007] In a first aspect, embodiments of this application provide a data synchronization method. The execution subject of this method can be a terminal or a component located in the terminal (e.g., a chip, chip system, or processor). The following description uses a terminal as the execution subject. The method includes: a first terminal receiving a first operation from a user on a first application on the first terminal; the first terminal responding to the first operation displaying a first interface, the content of which differs from the content of a second interface displayed by a second terminal; the first terminal receiving a third operation from the user on the first interface; and in response to the third operation, the first terminal uploading data of the first application to a server, and the second terminal retrieving the data of the first application from the server and displaying a third interface, wherein the data of the first application includes the data of the first interface; and the third interface is identical to the first interface. Thus, when a user operates an application on the first terminal, it can trigger the second terminal to retrieve application data from the server.

[0008] Taking the memo application as an example, when the second terminal does not have high requirements for real-time synchronization, the user's operation of the memo on the first terminal allows the first terminal to extend the interval between synchronized data updates, reducing the number and frequency of synchronization requests, thereby saving network bandwidth and power consumption, and reducing the number of server I / O connections. The server can also merge notifications, reducing the number of notifications sent and lowering server resources and network bandwidth. When the second terminal has high requirements for real-time synchronization, the user's operation of the memo on the first terminal allows the first terminal to update data in real time, maintaining high real-time synchronization and ensuring a good user experience with the memo.

[0009] In some possible implementations, the method further includes: a first terminal receiving a fourth operation from a user on a first interface; in response to the fourth operation, the first terminal uploading data of a first application to a server and displaying the fourth interface; and a second terminal obtaining data of the first application from the server and displaying a fifth interface, wherein the data of the first application includes the data of the fourth interface; and the fifth interface is the same as the fourth interface.

[0010] In some possible implementations, the first terminal responding to the first operation by displaying the first interface includes: sending a first request to the server, the first request being used to request the establishment of a first session, and determining a first state of the first session based on the first operation, the first state being a low real-time state; the server being used to determine a second state of a second session of the second terminal, the second state of the second session being determined based on the first request, the second state of the second session being a low real-time state.

[0011] Taking the memo application as an example, when the second terminal does not have high requirements for real-time synchronization, the user operates the memo on the first terminal. The first terminal can lengthen the interval between synchronized data updates, reducing the number and quantity of synchronization requests, thereby saving network bandwidth and power consumption, and reducing the number of server I / O connections. The server can merge notifications, reducing the number of notifications sent, and reducing server resources and network bandwidth.

[0012] In some implementations, the first terminal responds to the third operation by sending a third request to the server, the third request being used to request a switch from a low real-time state to a high real-time state; the second terminal is used to obtain the second state of the second session from the server and update the second state of the second session to the high real-time state.

[0013] Taking the memo application as an example, when the second terminal has high requirements for real-time synchronization, the first terminal can update the data in real time when the user operates the memo on the first terminal, maintaining high real-time synchronization and ensuring the user's experience using the memo.

[0014] In some possible implementations, the first terminal uploads data of the first application to the server, including: in a first state of low real-time performance, the terminal uploads data of the first application to the server after a third preset time interval, and the second terminal retrieves data of the first application from the server after the third preset time interval; in a first state of high real-time performance, the terminal uploads data of the first application to the server in real time, and the second terminal retrieves data of the first application from the server in real time.

[0015] In some implementations, the first request carries the state of a first application on a first terminal, and the first state of the first session and the second state of the second session are determined based on the state of the first application. In this way, the application on the first terminal can set a synchronization real-time strategy according to its own state.

[0016] In some implementations, the first request carries a real-time policy parameter, and the first state of the first session and the second state of the second session are determined based on the real-time policy parameter, which is determined based on the state of the first application on the first terminal.

[0017] In some possible implementations, the method further includes: the first terminal receiving a sixth operation from a user on a first application on the first terminal; and the first terminal responding to the sixth operation by sending a seventh request to the server, the seventh request being used to request the deletion of the session.

[0018] In some implementations, the first or second state is a low real-time state, and the real-time strategy is to update data asynchronously; the first or second state is a high real-time state, and the real-time strategy is to update data synchronously.

[0019] In some implementations, the first application includes a method application and a third-party application, the method application including at least one of contacts, memos, calendar, bookmarks, documents, text messages, emails, and photos.

[0020] Secondly, embodiments of this application provide a data synchronization method. The execution subject of this method can be a terminal or a component located in the terminal (e.g., a chip, chip system, or processor). The following description uses a terminal as the execution subject. The method includes: a second terminal receiving a second operation from a user on a first application on the second terminal; the second terminal responding to the second operation displaying a second interface, the content of which differs from the content of the first interface on the first terminal; when the first terminal receives a third operation from the user on the first interface and responds to the third operation by uploading data of the first application to a server, the second terminal retrieves the data of the first application from the server and displays a third interface, wherein the data of the first application includes the data of the first interface; the third interface is identical to the first interface.

[0021] In some possible implementations, the method further includes: when the first terminal receives a fourth operation from the user on the first interface and, in response to the fourth operation, uploads data of the first application to the server and displays the fourth interface, the second terminal obtains data of the first application from the server and displays the fifth interface, wherein the data of the first application includes the data of the fourth interface; and the fifth interface is the same as the fourth interface.

[0022] In some implementations, after the second terminal responds to the second operation and displays a second interface, the content of which differs from the first interface, the second terminal further includes displaying a sixth interface after a first preset time interval. This sixth interface is identical to the first interface. Taking a memo application as an example, when the user operates the memo and the second terminal does not have high requirements for real-time synchronization, the first terminal can lengthen the interval between synchronized data updates, reducing the number and frequency of synchronization requests, thereby saving network bandwidth and power consumption, and reducing the number of server I / O connections. The server can also merge notifications, reducing the number of notifications sent and lowering server resources and network bandwidth.

[0023] In some possible implementations, the second terminal responding to the second operation and displaying the second interface includes: sending a second request to the server, the second request being used to request the establishment of a second session, the server determining a second state of the second session, the second state of the second session being determined based on the first request sent by the first terminal, and the second state of the second session being a low real-time state.

[0024] In some implementations, when the first terminal responds to the third operation by sending a third request to the server, the third request is used to request a switch from a low real-time state to a high real-time state; the second terminal obtains the second state of the second session from the server and updates the second state of the second session to a high real-time state.

[0025] In some possible implementations, the second terminal obtains the second state of the second session from the server, including: the second terminal sending a fourth request to the server at a second preset time interval, the fourth request being used to obtain the latest state; the second terminal receiving the latest state sent by the server and updating the second state of the second session to a high real-time state.

[0026] In some possible implementations, the second terminal obtains data from the first application from the server, including: the second terminal obtaining a data change notification from the server according to a real-time policy corresponding to the second state; the second terminal sending a fifth request to the server based on the data change notification, the fifth request being used to request updated data; the second terminal obtaining the updated data from the server according to the real-time policy corresponding to the second state, the server receiving the fifth request and sending the updated data to the second terminal based on the fifth request.

[0027] In some possible implementations, the second terminal obtains data from the first application from the server, including: the second terminal queries the server for data changes at a second preset time interval; when the data on the server changes, the second terminal sends a sixth request to the server, the sixth request being used to request updated data; the second terminal obtains updated data from the server according to a real-time strategy corresponding to a second state, the server receiving the sixth request and sending updated data to the second terminal according to the sixth request.

[0028] In some implementations, the first request carries the state of a first application on a first terminal, and the first state of a first session and the second state of a second session are determined based on the state of the first application.

[0029] In some implementations, the first request carries a real-time policy parameter, and the first state of the first session and the second state of the second session are determined based on the real-time policy parameter, which is determined based on the state of the first application on the first terminal.

[0030] In some implementations, the first terminal receives a sixth operation from the user on a first application on the first terminal; in response to the sixth operation, the first terminal sends a seventh request to the server, the seventh request being used to request the deletion of the session; the second terminal receives a seventh operation from the user on a first application on the second terminal; in response to the seventh operation, the second terminal sends an eighth request to the server, the eighth request being used to request the deletion of the session.

[0031] In some implementations, the first or second state is a low real-time state, and the real-time strategy is to update data asynchronously; the first or second state is a high real-time state, and the real-time strategy is to update data synchronously.

[0032] In some implementations, the first application includes a method application and a third-party application, the method application including at least one of contacts, memos, calendar, bookmarks, documents, text messages, emails, and photos.

[0033] Thirdly, embodiments of this application provide a data synchronization system, the system comprising: a first terminal receiving a first operation by a user on a first application on the first terminal; the first terminal responding to the first operation by displaying a first interface; a second terminal receiving a second operation by a user on a first application on the second terminal; the second terminal responding to the second operation by displaying a second interface, the content of the second interface being different from the content of the first interface; the first terminal receiving a third operation by a user on the first interface; responding to the third operation, the first terminal uploading data of the first application to a server, and the second terminal obtaining data of the first application from the server and displaying a third interface, wherein the data of the first application includes the data of the first interface; the third interface is identical to the first interface.

[0034] Taking the memo application as an example, when the second terminal does not have high requirements for real-time synchronization, the user's operation of the memo on the first terminal allows the first terminal to extend the interval between synchronized data updates, reducing the number and frequency of synchronization requests, thereby saving network bandwidth and power consumption, and reducing the number of server I / O connections. The server can also merge notifications, reducing the number of notifications sent and lowering server resources and network bandwidth. When the second terminal has high requirements for real-time synchronization, the user's operation of the memo on the first terminal allows the first terminal to update data in real time, maintaining high real-time synchronization and ensuring a good user experience with the memo.

[0035] In some implementations, the first terminal receives a fourth operation from the user on the first interface; in response to the fourth operation, the first terminal uploads data of the first application to the server and displays the fourth interface, and the second terminal retrieves data of the first application from the server and displays the fifth interface, wherein the data of the first application includes the data of the fourth interface; the fifth interface is the same as the fourth interface.

[0036] In some implementations, after the second terminal responds to the second operation and displays a second interface, the content of which differs from the first interface, the second terminal further includes displaying a sixth interface after a first preset time interval. This sixth interface is identical to the first interface. Taking a memo application as an example, when the user operates the memo and the second terminal does not have high requirements for real-time synchronization, the first terminal can lengthen the interval between synchronized data updates, reducing the number and frequency of synchronization requests, thereby saving network bandwidth and power consumption, and reducing the number of server I / O connections. The server can also merge notifications, reducing the number of notifications sent and lowering server resources and network bandwidth.

[0037] In some possible implementations, the first terminal responding to the first operation and displaying the first interface includes: sending a first request to the server, the first request being used to request the establishment of a first session, and determining a first state of the first session based on the first operation, the first state being a low real-time state; the second terminal responding to the second operation and displaying the second interface includes: sending a second request to the server, the second request being used to request the establishment of a second session, the server determining a second state of the second session, the second state of the second session being determined based on the first request, and the second state of the second session being a low real-time state.

[0038] In some implementations, the first terminal responds to the third operation by sending a third request to the server, the third request being used to request a switch from a low real-time state to a high real-time state; the second terminal obtains the second state of the second session from the server and updates the second state of the second session to the high real-time state.

[0039] In some possible implementations, the second terminal obtains the second state of the second session from the server, including: the second terminal sending a fourth request to the server at a second preset time interval, the fourth request being used to obtain the latest state; the second terminal receiving the latest state sent by the server and updating the second state of the second session to a high real-time state.

[0040] In some possible implementations, the first terminal uploads data of the first application to the server, including: in a first state of low real-time performance, the terminal uploads data of the first application to the server after a third preset time interval, and the second terminal retrieves data of the first application from the server after the third preset time interval; in a first state of high real-time performance, the terminal uploads data of the first application to the server in real time, and the second terminal retrieves data of the first application from the server in real time.

[0041] In some possible implementations, the second terminal obtains data from the first application from the server, including: the second terminal obtaining a data change notification from the server according to a real-time policy corresponding to the second state; the second terminal sending a fifth request to the server based on the data change notification, the fifth request being used to request updated data; the second terminal obtaining the updated data from the server according to the real-time policy corresponding to the second state, the server receiving the fifth request and sending the updated data to the second terminal based on the fifth request.

[0042] In some possible implementations, the second terminal obtains data from the first application from the server, including: the second terminal queries the server for data changes at a second preset time interval; when the data on the server changes, the second terminal sends a sixth request to the server, the sixth request being used to request updated data; the second terminal obtains updated data from the server according to a real-time strategy corresponding to a second state, the server receiving the sixth request and sending updated data to the second terminal according to the sixth request.

[0043] In some implementations, the first request carries the state of a first application on a first terminal, and the first state of a first session and the second state of a second session are determined based on the state of the first application.

[0044] In some implementations, the first request carries a real-time policy parameter, and the first state of the first session and the second state of the second session are determined based on the real-time policy parameter, which is determined based on the state of the first application on the first terminal.

[0045] In some implementations, the first terminal receives a sixth operation from the user on a first application on the first terminal; in response to the sixth operation, the first terminal sends a seventh request to the server, the seventh request being used to request the deletion of the session; the second terminal receives a seventh operation from the user on a first application on the second terminal; in response to the seventh operation, the second terminal sends an eighth request to the server, the eighth request being used to request the deletion of the session.

[0046] In some implementations, the first or second state is a low real-time state, and the real-time strategy is to update data asynchronously; the first or second state is a high real-time state, and the real-time strategy is to update data synchronously.

[0047] In some implementations, the first application includes system applications and third-party applications, with system applications including at least one of contacts, memos, calendars, bookmarks, documents, text messages, emails, and photos.

[0048] Fourthly, embodiments of this application provide a terminal applied to the service access method of the first aspect.

[0049] Fifthly, embodiments of this application provide a computer-readable storage medium including computer instructions that, when executed on a terminal, cause the terminal to perform the service access method of the first aspect or the second aspect.

[0050] In a sixth aspect, embodiments of this application provide a computer program in which, when the program is invoked by a processor, the service access method of the first or second aspect is executed.

[0051] In a seventh aspect, embodiments of this application provide a chip system including one or more processors, wherein when the one or more processors execute instructions, the one or more processors execute the service access method of the first aspect or the second aspect.

[0052] The specific implementation methods and corresponding technical effects of each embodiment in the third to the other aspects can be found in the specific implementation methods and technical effects of the first or second aspects. Attached Figure Description

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

[0054] Figure 1 A schematic diagram of the structure of a system provided in this application embodiment;

[0055] Figure 2 (1) is a schematic diagram of the structure of a terminal provided in an embodiment of this application;

[0056] Figure 2 (2) is a system framework diagram of a terminal provided in an embodiment of this application;

[0057] Figure 3 This is a flowchart illustrating a data synchronization method.

[0058] Figure 4 (1) is a flowchart of the session creation stage of a data synchronization method provided in an embodiment of this application;

[0059] Figure 4 (2) is a flowchart of the session creation stage of a data synchronization method provided in an embodiment of this application;

[0060] Figure 4 (3) is a flowchart of the session creation stage of a data synchronization method provided in an embodiment of this application;

[0061] Figure 4 (4) is a flowchart of the session creation stage of a data synchronization method provided in an embodiment of this application;

[0062] Figure 5 A schematic diagram illustrating server-side session management for the same user, provided as an embodiment of this application;

[0063] Figure 6(1a) is a flowchart illustrating the data synchronization stage of a data synchronization method provided in an embodiment of this application;

[0064] Figure 6(1b) is a flowchart illustrating the data synchronization stage of a data synchronization method provided in an embodiment of this application;

[0065] Figure 6 (2a) is a flowchart illustrating the data synchronization stage of a data synchronization method provided in an embodiment of this application;

[0066] Figure 6 (2b) is a flowchart illustrating the data synchronization stage of a data synchronization method provided in an embodiment of this application;

[0067] Figure 6 (3) is a flowchart illustrating the data synchronization stage of another data synchronization method provided in the embodiments of this application;

[0068] Figure 6 (4) is a flowchart of the deletion session stage of another data synchronization method provided in the embodiments of this application;

[0069] Figure 7 A schematic diagram of a display page of a first mobile phone provided in an embodiment of this application;

[0070] Figure 8 A schematic diagram of yet another display page of the first mobile phone provided in an embodiment of this application;

[0071] Figure 9 (1) is a schematic diagram of another display page of the first mobile phone provided in the embodiments of this application;

[0072] Figure 9 (2) is a schematic diagram of a display page of a second mobile phone provided in an embodiment of this application;

[0073] Figure 9 (3) is a schematic diagram of a display page of a second mobile phone provided in an embodiment of this application;

[0074] Figure 10 A schematic diagram of yet another display page of the first mobile phone provided in an embodiment of this application;

[0075] Figure 11 (1) is a schematic diagram of another display page of the first mobile phone provided in the embodiments of this application;

[0076] Figure 11 (2) is a schematic diagram of another display page of the second mobile phone provided in the embodiments of this application;

[0077] Figure 12 A schematic diagram of yet another display page of the first mobile phone provided in an embodiment of this application;

[0078] Figure 13 A schematic diagram of yet another display page of the first mobile phone provided in an embodiment of this application;

[0079] Figure 14 (1) is a schematic diagram of another display page of the first mobile phone provided in the embodiments of this application;

[0080] Figure 14 (2) is a schematic diagram of another display page of the second mobile phone provided in the embodiments of this application;

[0081] Figure 15 (1) is a schematic diagram of another display page of the first mobile phone provided in the embodiments of this application;

[0082] Figure 15 (2) is a schematic diagram of another display page of the second mobile phone provided in the embodiments of this application;

[0083] Figure 15 (3) is a schematic diagram of another display page of the second mobile phone provided in the embodiments of this application;

[0084] Figure 16 (1) is a schematic diagram of another display page of the second mobile phone provided in the embodiments of this application;

[0085] Figure 16 (2) is a schematic diagram of another display page of the first mobile phone provided in the embodiments of this application;

[0086] Figure 17 (1) is a schematic diagram of another display page of the second mobile phone provided in the embodiments of this application;

[0087] Figure 17 (2) is a schematic diagram of another display page of the first mobile phone provided in the embodiment of this application. Detailed Implementation

[0088] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.

[0089] The data synchronization method provided in this application embodiment can be applied to... Figure 1The system shown consists of multiple terminals and servers. For example... Figure 1 As shown, the system 100 may include a server 110 and multiple terminals (such as a first terminal 120, a second terminal 130, a third terminal 140, a fourth terminal 150, and a fifth terminal 160).

[0090] The aforementioned terminal can be a mobile phone, tablet computer, desktop computer, laptop computer, notebook computer, ultra-mobile personal computer (UMPC), handheld computer, netbook, personal digital assistant (PDA), wearable terminal, television, virtual reality device, or other device with display function. The specific form of the terminal is not specifically limited in the embodiments of this application.

[0091] For example, such as Figure 1 As shown, the first terminal 120 and the fifth terminal 160 can both be mobile phones, the second terminal 130 can be a tablet computer, the third terminal 140 can be a television, and the fourth terminal 150 can be a laptop computer.

[0092] Figure 2 (1) is a structural block diagram of the above terminal.

[0093] As shown in Figure 2 (1), the terminal (such as the first terminal 120, the second terminal 130, the third terminal 140 and the fourth terminal 150) may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. The sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, a barometric pressure sensor 280C, a magnetic sensor 280D, an accelerometer sensor 280E, a distance sensor 280F, a proximity sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, etc.

[0094] It is understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the terminal 120. In other embodiments of this application, the terminal 120 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0095] Processor 210 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0096] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0097] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

[0098] In some embodiments, the processor 210 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0099] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 210 may include multiple I2C buses. The processor 210 can couple to the touch sensor 280K, charger, flash, camera 293, etc., through different I2C bus interfaces. For example, the processor 210 can couple to the touch sensor 280K through the I2C interface, enabling the processor 210 and the touch sensor 280K to communicate through the I2C bus interface, thereby realizing the touch function of the terminal 120.

[0100] The I2S interface can be used for audio communication. In some embodiments, the processor 210 may include multiple I2S buses. The processor 210 can be coupled to the audio module 270 via the I2S bus to enable communication between the processor 210 and the audio module 270. In some embodiments, the audio module 270 can transmit audio signals to the wireless communication module 260 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0101] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 270 and the wireless communication module 260 can be coupled via the PCM bus interface. In some embodiments, the audio module 270 can also transmit audio signals to the wireless communication module 260 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0102] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 210 and the wireless communication module 260. For example, the processor 210 communicates with the Bluetooth module in the wireless communication module 260 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 270 can transmit audio signals to the wireless communication module 260 via the UART interface to enable music playback through Bluetooth headphones.

[0103] The MIPI interface can be used to connect the processor 210 to peripheral devices such as the display screen 294 and the camera 293. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 210 and the camera 293 communicate via the CSI interface to enable the shooting function of the terminal 120. The processor 210 and the display screen 294 communicate via the DSI interface to enable the display function of the terminal 120.

[0104] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 210 to a camera 293, a display screen 294, a wireless communication module 260, an audio module 270, a sensor module 280, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0105] USB port 230 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, or USB Type-C port. USB port 230 can be used to connect a charger to charge terminal 120, and can also be used for data transfer between terminal 120 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0106] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the terminal 120. In other embodiments of this application, the terminal 120 may also adopt different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.

[0107] The charging management module 240 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 receives charging input from the wired charger via the USB interface 230. In some wireless charging embodiments, the charging management module 240 receives wireless charging input via the wireless charging coil of the terminal 120. While charging the battery 242, the charging management module 240 can also supply power to the electronic device via the power management module 241.

[0108] The power management module 241 connects the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240, providing power to the processor 210, internal memory 221, display screen 294, camera 293, and wireless communication module 260, etc. The power management module 241 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 241 may also be located within the processor 210. In other embodiments, the power management module 241 and the charging management module 240 may be located in the same device.

[0109] The wireless communication function of terminal 120 can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor and baseband processor.

[0110] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 120 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0111] The mobile communication module 250 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G on the terminal 120. The mobile communication module 250 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves via the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the modem processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 250 may be housed in the processor 210. In some embodiments, at least some functional modules of the mobile communication module 250 and at least some modules of the processor 210 may be housed in the same device.

[0112] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 270A, receiver 270B, etc.) or displays images or videos through the display screen 294. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 210 and may be housed in the same device as the mobile communication module 250 or other functional modules.

[0113] The wireless communication module 260 can provide solutions for wireless communication applications on the terminal 120, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 210. The wireless communication module 260 can also receive signals to be transmitted from processor 210, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0114] In some embodiments, antenna 1 of terminal 120 is coupled to mobile communication module 250, and antenna 2 is coupled to wireless communication module 260, enabling terminal 120 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0115] Terminal 120 implements display functions through a GPU, display screen 294, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0116] Display screen 294 is used to display images, videos, etc. Display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, terminal 120 may include one or N displays 294, where N is a positive integer greater than 1.

[0117] Terminal 120 can perform shooting functions through ISP, camera 293, video codec, GPU, display 294 and application processor.

[0118] The ISP (Image Signal Processor) is used to process data fed back from the camera 293. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 293.

[0119] Camera 293 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, terminal 120 may include one or N cameras 293, where N is a positive integer greater than 1.

[0120] A digital signal processor (DSP) is used to process digital signals. Besides digital image signals, it can also process other digital signals. For example, when terminal 120 selects a frequency point, the DSP can perform Fourier transforms on the frequency energy.

[0121] Video codecs are used to compress or decompress digital video. Terminal 120 may support one or more video codecs. Thus, terminal 120 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0122] NPU stands for Neural Network (NN) Computing Processor. By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs can enable intelligent cognitive applications in terminals, such as image recognition, facial recognition, speech recognition, and text understanding.

[0123] The external storage interface 220 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the terminal 120. The external storage card communicates with the processor 210 through the external storage interface 220 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card.

[0124] Internal memory 221 can be used to store computer executable program code, which includes instructions. Internal memory 221 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of terminal 120 (such as audio data, phonebook, etc.). Furthermore, internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 210 executes various functional applications and data processing of terminal 120 by running instructions stored in internal memory 221 and / or instructions stored in memory located in the processor.

[0125] Terminal 120 can implement audio functions, such as music playback and recording, through audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, and application processor.

[0126] The audio module 270 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 270 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 270 may be located in the processor 210, or some functional modules of the audio module 270 may be located in the processor 210.

[0127] The speaker 270A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Terminal 120 can listen to music or make hands-free calls through the speaker 270A.

[0128] The receiver 270B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the terminal 120 receives a phone call or voice message, the receiver 270B can be brought close to the listener's ear to hear the voice.

[0129] Microphone 270C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 270C, inputting the sound signal into microphone 270C. Terminal 120 may have at least one microphone 270C. In some embodiments, terminal 120 may have two microphones 270C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, terminal 120 may have three, four, or more microphones 270C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0130] The headphone jack 270D is used to connect wired headphones. The headphone jack 270D can be a USB 230 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0131] Pressure sensor 280A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 280A can be disposed on display screen 294. There are many types of pressure sensors 280A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 280A, the capacitance between the electrodes changes. Terminal 120 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 294, terminal 120 detects the intensity of the touch operation based on pressure sensor 280A. Terminal 120 can also calculate the touch position based on the detection signal from pressure sensor 280A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0132] The gyroscope sensor 280B can be used to determine the motion attitude of the terminal 120. In some embodiments, the gyroscope sensor 280B can determine the angular velocity of the terminal 120 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 280B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 280B detects the angle of the terminal 120's shake, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the terminal 120 through reverse movement, thus achieving image stabilization. The gyroscope sensor 280B can also be used in navigation and motion-sensing game scenarios.

[0133] The barometric pressure sensor 280C is used to measure air pressure. In some embodiments, the terminal 120 calculates altitude using the air pressure value measured by the barometric pressure sensor 280C to assist in positioning and navigation.

[0134] The magnetic sensor 280D includes a Hall sensor. The terminal 120 can use the magnetic sensor 280D to detect the opening and closing of the flip cover. In some embodiments, when the terminal 120 is a flip phone, the terminal 120 can detect the opening and closing of the flip cover using the magnetic sensor 280D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0135] The 280E accelerometer can detect the magnitude of acceleration in various directions (typically three axes) of the terminal 120. When the terminal 120 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices, and is applied to applications such as screen orientation switching and pedometers.

[0136] A distance sensor 280F is used to measure distance. Terminal 120 can measure distance via infrared or laser. In some embodiments, during a shooting scene, terminal 120 can utilize the distance sensor 280F for distance measurement to achieve fast focusing.

[0137] The proximity sensor 280G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The terminal 120 emits infrared light outward through the LED. The terminal 120 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal 120. When insufficient reflected light is detected, the terminal 120 can determine that there is no object near the terminal 120. The terminal 120 may use the proximity sensor 280G to detect when the user holds the terminal 120 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 280G can also be used in holster mode and pocket mode for automatic unlocking and screen locking.

[0138] The ambient light sensor 280L is used to sense the ambient light intensity. The terminal 120 can adaptively adjust the brightness of the display screen 294 based on the sensed ambient light intensity. The ambient light sensor 280L can also be used to automatically adjust the white balance when taking photos. The ambient light sensor 280L can also work in conjunction with the proximity sensor 280G to detect whether the terminal 120 is in a pocket, preventing accidental touches.

[0139] The fingerprint sensor 280H is used to collect fingerprints. The terminal 120 can use the collected fingerprint characteristics to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0140] Temperature sensor 280J is used to detect temperature. In some embodiments, terminal 120 uses the temperature detected by temperature sensor 280J to execute a temperature processing strategy. For example, when the temperature reported by temperature sensor 280J exceeds a threshold, terminal 120 reduces the performance of the processor located near temperature sensor 280J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is below another threshold, terminal 120 heats battery 242 to prevent abnormal shutdown of terminal 120 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, terminal 120 boosts the output voltage of battery 242 to prevent abnormal shutdown due to low temperature.

[0141] Touch sensor 280K, also known as a "touch device," can be located on display screen 294. The touch sensor 280K and display screen 294 together form a touchscreen, also known as a "touchscreen." Touch sensor 280K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 294. In other embodiments, touch sensor 280K may also be located on the surface of terminal 120, in a different position than display screen 294.

[0142] The bone conduction sensor 280M can acquire vibration signals. In some embodiments, the bone conduction sensor 280M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 280M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 280M can also be incorporated into headphones to form bone conduction headphones. The audio module 270 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 280M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 280M to realize heart rate detection functionality.

[0143] Buttons 290 include a power button, volume buttons, etc. Buttons 290 can be mechanical buttons or touch-sensitive buttons. Terminal 120 can receive button input and generate key signal inputs related to user settings and function control of terminal 120.

[0144] Motor 291 can generate vibration alerts. Motor 291 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can be corresponding to touch operations applied to different applications (such as taking photos, playing audio, etc.). Motor 291 can also correspond to different vibration feedback effects for touch operations applied to different areas of the display screen 294. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0145] Indicator 292 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0146] Of course, the terminal 120 may also include other functional units, and this application embodiment does not limit this.

[0147] The data synchronization method provided in this application embodiment is described below using the architecture shown in Figure 2(1) as an example. Each unit in the following embodiments may have the components shown in Figure 2(1), which will not be described in detail. The creation in this application embodiment can also be understood as generating or determining, and the "carrying" in this application embodiment can also be understood as "including". This is a unified explanation, and this application embodiment does not make specific limitations on this.

[0148] Furthermore, the actions, terms, etc., involved in the various embodiments of this application can be referenced interchangeably without limitation. The message names or parameter names in the messages between the various devices in the embodiments of this application are merely examples, and other names may be used in specific implementations without limitation.

[0149] See Figure 2 (2), which is a software structure block diagram of the first electronic device provided in the embodiment of this application.

[0150] As shown in Figure 2(2), the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some feasible implementations, the Android system can be divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0151] The application layer can include a series of application packages.

[0152] As shown in Figure 2 (2), the application package may include Bluetooth, device management application (application with device management function), navigation, memo, WLAN, SMS, gallery, calendar, call and other applications (APP).

[0153] The application framework layer provides application programming interfaces and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0154] As shown in Figure 2(2), the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.

[0155] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0156] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, etc.

[0157] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0158] The phone manager is used to provide communication functions for terminal 120. For example, it manages call status (including connection and disconnection).

[0159] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0160] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog-style notifications on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0161] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0162] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0163] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0164] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0165] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0166] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0167] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0168] A 2D graphics engine is a graphics engine for 2D drawing.

[0169] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0170] It should be noted that the synchronization module shown in Figure 2(2) can be integrated into the application framework layer or into a specific application, such as a memo. This application embodiment does not impose specific limitations.

[0171] To facilitate understanding of the technical solutions of this application, the relevant technologies involved in the embodiments of this application will be explained first.

[0172] 1. Data synchronization

[0173] Data synchronization refers to using a server to synchronize data between multiple terminals.

[0174] For example, when data on a terminal is updated, the terminal updates the data on the server. When data on the server is updated, the server notifies multiple terminals to retrieve the updated data from the server. In this way, the data on multiple terminals and the server remains consistent.

[0175] 2. Data Update

[0176] Data updates refer to changes in data, such as data addition, data deletion, and data modification.

[0177] Data updates can be divided into uplink data updates and downlink data updates.

[0178] Uplink data update refers to the process where, when data on the terminal is updated, the terminal updates the data to the server.

[0179] Downlink data update refers to the process where, when the data on the server is updated, the terminal retrieves the updated data from the server.

[0180] Before describing the technical solution of this application in detail, we will first introduce the existing data synchronization methods.

[0181] like Figure 3 The image shows a flowchart of a data synchronization method. The flowchart is as follows:

[0182] S301, Receive user operations on the first application APP (hereinafter referred to as the first APP) data.

[0183] The operations can include adding, deleting, and modifying operations.

[0184] S302. In response to the user's operation on the data of the first APP, the first APP configures an update identifier for the updated data.

[0185] S303, The first application sends a data change request to the server, which carries the updated data. Accordingly, the server receives the updated data.

[0186] S304, Server updates data.

[0187] S305, the server sends the update result to the first application. This update result may include "update successful" or "update failed." Correspondingly, the first application receives the update result sent by the server.

[0188] S306, First APP updates data and deletes update identifier.

[0189] S307. The server sends a data change notification to the second APP, and the second APP receives the data change notification accordingly.

[0190] S308, the second APP sends a data retrieval request to the server. Correspondingly, the server receives the data retrieval request.

[0191] S309. The server sends the updated data to the second application. Correspondingly, the second application receives the updated data sent by the server.

[0192] S310, second APP update data.

[0193] In practical implementation, taking a memo application as an example where both the first and second apps are memo applications, when a user edits a memo on the first terminal, even though the second terminal is online and synchronizing data, the memo is not open on the second terminal. This demonstrates that the first and second terminals have different real-time requirements for memo synchronization data. Examples of scenarios with different real-time requirements are provided below:

[0194] 1) High real-time scenarios

[0195] Example 1: When a user edits a memo on a first terminal, and the user also opens the memo on a second terminal, the user will want the memo edited on the first terminal to be displayed synchronously on the second terminal as soon as possible.

[0196] 2) Low real-time scenarios

[0197] Example 2: When a user edits a memo on the first terminal, but does not open the memo on the second terminal, it means that the user is not concerned about whether the memo data on the second terminal is updated in real time. They only need to ensure that the memo data on the second terminal is up-to-date the next time the user opens the memo on the second terminal.

[0198] Therefore, when a user frequently edits a memo on the first terminal, the terminal updates the data frequently, increasing its resource consumption and the server's load. If other terminals, such as the second terminal, do not pay attention to the memo updates, then the frequent data updates by the first terminal become meaningless. Therefore, balancing the real-time nature of synchronized data with resource consumption becomes crucial.

[0199] To address the aforementioned technical problems, embodiments of this application provide a data synchronization method. The method includes a first terminal receiving a first operation from a user on a first application on the first terminal. In response to the first operation, the first terminal displays a first interface. A second terminal receives a second operation from the user on a first application on the second terminal. In response to the second operation, the second terminal displays a second interface, the content of which differs from the content of the first interface. The first terminal receives a third operation from the user on the first interface. In response to the third operation, the first terminal uploads data from the first application to a server, and the second terminal downloads the data from the first application from the server and displays a third interface, wherein the data from the first application includes the data from the first interface; the third interface is identical to the first interface.

[0200] The first operation can be used to launch the first application or to browse the application's interface.

[0201] When the second terminal has low real-time synchronization requirements, user interaction with applications on the first terminal allows the first terminal to extend the intervals between synchronized data updates, reducing the number and frequency of synchronization requests, thereby saving network bandwidth and power consumption, and lowering the number of server I / O connections. The server can also consolidate notifications, reducing the number of notifications sent and minimizing server resource and network bandwidth usage. Conversely, when the second terminal has high real-time synchronization requirements, user interaction with applications on the first terminal allows the first terminal to update data in real time, maintaining high real-time synchronization and ensuring a smooth user experience.

[0202] In one specific implementation, a first terminal receives a first operation from a user on a first application on the first terminal, and in response to the first operation, displays a first interface and sends a first request to a server, the first request being used to request the establishment of a first session. A second terminal receives a second operation from a user on a first application on the second terminal, and in response to the second operation, sends a second request to a server, the second request being used to request the establishment of a second session. The server establishes the first session according to the first request and establishes the second session according to the second request, and determines the first state of the first session and the second state of the second session according to the first request. The first terminal receives a third operation from a user on the first interface, and in response to the third operation, displays a second interface, and transmits data of the first application to the server according to the real-time strategy corresponding to the first state of the first session. The second terminal transmits data of the first application to the server according to the real-time strategy corresponding to the second state of the second session, and displays a third interface, the interface information of the third interface being consistent with or inconsistent with the interface information of the second interface.

[0203] The real-time strategy can include high real-time strategy and low real-time strategy. The real-time strategy executed by the first application is determined by the state of applications on other terminals of the user. For example, in a low real-time scenario, the first terminal can use a low real-time strategy to send updated data. In a high real-time scenario, the first terminal can use a high real-time strategy to send updated data. In this way, the first terminal sends updated data according to the real-time strategy, which can both ensure the real-time synchronization requirements of user data and minimize resource consumption.

[0204] This application's embodiments are applied to various multi-terminal data synchronization services, such as those involving contacts, memos, calendars, bookmarks, documents, SMS messages, emails, photos, and third-party applications. Of course, this application's embodiments are not limited to the above-mentioned services. In specific implementation, this application's embodiments will be described using the memo service as an example.

[0205] The following describes in detail a data synchronization method provided in this application embodiment, taking a scenario where the first terminal is a first mobile phone 120, the second terminal is a second mobile phone 160, and the memos in the first mobile phone 120 and the second mobile phone 160 are synchronized.

[0206] Figure 4(1) is a flowchart illustrating the session establishment stage of a data synchronization method provided in an embodiment of this application; Figure 4(2) is a flowchart illustrating the session establishment stage of a data synchronization method provided in an embodiment of this application; Figure 4(3) is a flowchart illustrating the session establishment stage of a data synchronization method provided in an embodiment of this application. Referring to Figures 4(1), 4(2), and 4(3), the method may include:

[0207] S4001, The first mobile phone 120 receives the first operation of the user on the first memo on the first mobile phone 120.

[0208] The first operation can refer to a gesture operation, which may include click, press, swipe, etc. The click operation may also include click and double-click operations.

[0209] The first action is used to instruct the first memo to initiate the session establishment function. The first action can be an action on the icon of the first memo or an action on a control on the memo.

[0210] First, the first action is to operate the icon of the first memo.

[0211] For example, a specific implementation of S4001 could be: Figure 7 The image shows a schematic diagram of the desktop of the first mobile phone 120. When a user clicks on the first memo 102 on the desktop 101 of the first mobile phone 120, the first mobile phone 120 receives the user's click on the memo 102. In other words, when a user clicks on the first memo 102 on the first mobile phone 120, the function of establishing a conversation can be initiated.

[0212] Second, the first operation is to operate the controls on the first memo.

[0213] The operation of controls on the first memo can include two scenarios: first, operating controls on the interface of the first memo; second, operating options in the application settings of the first memo.

[0214] The first type is the controls on the interface of the memo app.

[0215] For example, a specific implementation of S4001 could also be: after the user clicks on the memo app on the first mobile phone 120, the first mobile phone 120 launches the memo app. At this time, the first mobile phone 120 displays a first interface, which can be the memo app's launch interface, and this interface also displays a first control for requesting to establish a session. For example, after the user clicks... Figure 7 Following the shown memo 102, the display interface of the first mobile phone 120 changes from... Figure 7 The desktop 101 shown jumps to Figure 8 The first interface 201 shown also displays a first control (such as an enable synchronization control) 202. The user clicks... Figure 8 The first control 202 shown is used by the first mobile phone 120 to receive user clicks on the first control 202. In other words, when the user clicks on the control on the interface of the first memo 102, the session establishment function can be initiated.

[0216] The second method involves selecting an option in the application settings for the first memo.

[0217] For example, on the application settings interface of First Memo, users can select the "Enable Session Function" option. That is, when the user selects the enable option, the session creation function will be activated. When the user clicks the First Memo icon, First Memo needs to check whether the "Enable Session Function" is enabled. If it is enabled, then S4011 is executed.

[0218] In one specific implementation, as shown in Figure 4 (3), S4001 is as follows: the first memo of the first mobile phone receives the first operation of the user on the first memo, the first memo sends the status of the first memo to the session module, or the session module obtains the status of the first memo.

[0219] S4011. In response to the first operation, the first mobile phone 120 sends a first request to the server 110 to establish a first session, and the server 110 receives the first request sent by the first mobile phone 120.

[0220] The first session can be understood as the process of communication between the first mobile phone 120 and the server 110. Specifically, in this embodiment of the application, the first session can be understood as the process of the first mobile phone 120 and the server 110 negotiating a synchronization state, which may include or cover all data synchronization processes.

[0221] The first request carries the state of the first memo. This memo's state can include an inactive state, a browsing state, and an editing state. Predefined: the inactive and browsing states are low real-time states, represented as STATE_LOW; the editing state is a high real-time state, represented as STATE_HIGH.

[0222] It should be noted here that:

[0223] 1. For services such as contacts, calendar, bookmarks, documents, SMS, and email, the browsing state is a low real-time state, which can be represented as STATE_LOW. Browsing can refer to browsing a directory, viewing the specific content of an article, etc. The editing state of these services is a high real-time state, which can be represented as STATE_HIGH.

[0224] 2. For services such as photo viewing, the browsing state is a low real-time state, which can be represented as STATE_LOW. Browsing can include viewing images, videos, etc. The editing / copying state of this service is a high real-time state, which can be represented as STATE_HIGH.

[0225] 3. For third-party applications and other services, such as sports applications, the browsing state is low real-time, which can be represented as STATE_LOW. Browsing can refer to viewing videos or parameters within the application. The information processing state is high real-time, which can be represented as STATE_HIGH. For example, information processing can refer to detecting the user's movement data during exercise.

[0226] Of course, the first request can also include real-time policy parameters. For example:

[0227] In one specific implementation, in response to the first operation, the first mobile phone 120 can obtain the state of the first memo. The state of the first memo may include an inactive state, a browsing state, and an editing state. The first mobile phone 120 configures real-time policy parameters based on the state of the first memo. For example, as shown in Figure 4(3), when the session module of the first mobile phone 120 obtains the state of the first memo as a browsing state, the session module of the first mobile phone 120 determines that the real-time requirement for data synchronization of the first memo is low. At this time, the session module of the first mobile phone 120 configures the real-time policy parameter as a low real-time parameter, that is, the program code corresponding to the first request carries the REQ_NORMAL field. When the session module of the first mobile phone 120 obtains the state of the first memo as an editing state, the session module of the first mobile phone 120 determines that the real-time requirement for data synchronization of the memo is high. At this time, the session module of the first mobile phone 120 configures the real-time policy parameter as a high real-time parameter, that is, the program code corresponding to the first request carries the REQ_HIGH field.

[0228] In another specific implementation, as shown in Figure 4(3), in response to the first operation, the first memo configures a real-time policy parameter according to its state and sends the real-time policy parameter to the session module of the first mobile phone in the first request. For example, when the state of the first memo is browsing, the first memo configures the real-time policy parameter to a low real-time parameter and carries the real-time policy parameter in the first request, that is, carries the REQ_NORMAL field in the program code corresponding to the first request. When the state of the first memo is editing, the first memo configures the real-time policy parameter to a high real-time parameter and carries the real-time policy parameter in the first request, that is, carries the REQ_HIGH field in the program code corresponding to the first request.

[0229] Of course, the first request is not limited to carrying real-time policy parameters or the status of the memo; it can also carry other information, such as user identifiers, first mobile phone identifiers, etc. This application embodiment does not impose specific limitations.

[0230] S4021, Server 110 establishes the first session based on the first request.

[0231] S4031, Server 110 sends a notification to the first mobile phone 120 that the session creation is complete.

[0232] Similarly, the process of the second mobile phone 160 requesting to establish a session is the same as that of the first mobile phone 120. The details are as follows:

[0233] S4002, the second mobile phone 160 receives a second operation from the user on the second memo on the second mobile phone.

[0234] The second operation can be the same as the first operation, as can be found in the relevant description of the first operation above, and will not be repeated here.

[0235] S4002 and S4001 are implemented in the same way, and will not be described again in the embodiments of this application.

[0236] S4012. In response to the second operation, the second mobile phone 160 sends a second request to the server 110 to establish a second session, and the server 110 receives the second request sent by the second mobile phone 160.

[0237] The second session can be understood as the process of communication between the second mobile phone 160 and the server 110. Specifically, in this embodiment, the second session can be understood as the process of synchronization state negotiation between the second mobile phone 160 and the server 110, which may include or cover all data synchronization processes.

[0238] The second request may carry the state of the second memorandum or real-time policy parameters. Specifically, S4012 and S4011 are implemented in the same way, and will not be described again in this embodiment.

[0239] S4022, Server 110 establishes a second session based on the second request.

[0240] S4032, Server 110 sends a notification to the second mobile phone 160 that the session creation is complete.

[0241] After server 110 establishes a first session with first mobile phone 120 and a second session with second mobile phone 160, server 110 determines the status of the first and second sessions as follows:

[0242] S4041, Server 110 determines the first state of the first session based on the first request.

[0243] The first state can be used to characterize the real-time data requirements of the first mobile phone 120 for other terminals of the same user.

[0244] The first request mentioned above may carry the status of the first memo on the first mobile phone 120, or it may carry real-time policy parameters. The following is a detailed description of the different types of information carried in the first request:

[0245] First, the first request carries the status of the first memo on the first mobile phone 120.

[0246] If the first request sent by the first mobile phone 120 carries the STATE_HIGH field, then the server 110 can determine that the first state of the first conference is a high real-time state, which can be represented as CLIENT_STATE_HIGH. If the first request sent by the first mobile phone 120 carries the STATE_LOW field, then the server 110 can determine that the first state of the first conference is a low real-time state, which can be represented as CLIENT_STATE_LOW.

[0247] Second, the first request carries real-time policy parameters.

[0248] If the first request carries a real-time policy parameter, the server 110 can determine the first state of the first session based on the real-time policy parameter. For example, if the first request sent by the first mobile phone 120 carries the REQ_HIGH field, the server 110 determines that the first state of the first session is a high real-time state, which can be represented as CLIENT_STATE_HIGH. If the first request sent by the first mobile phone 120 carries the REQ_LOW field, the server 110 determines that the first state of the first session is a low real-time state, which can be represented as CLIENT_STATE_LOW.

[0249] Of course, the first mobile phone 120 can also determine the first state of the first session based on the first request. For example, in S4040, the first request carries the state of the first memo, and the first mobile phone 120 can also determine the first state of the first session based on the state of the first memo. For example, if the state of the first memo is a high real-time state, the first mobile phone 120 determines that the first state of the first conference is a high real-time state; if the state of the first memo is a low real-time state, the first mobile phone 120 determines that the first state of the first conference is a low real-time state.

[0250] S4051, Server 110 determines the second state of the first session based on the second request.

[0251] The second state can be used to characterize the real-time data synchronization requirements of other terminals of the same user to the first mobile phone 120.

[0252] The second request, like the first request, can carry the status of the second memo on the second mobile phone 160, or it can carry real-time policy parameters. The following is a detailed description of the different types of information carried in the second request:

[0253] The first and second requests carry the status of the second memo on the second mobile phone 160.

[0254] If the second request sent by the second mobile phone 160 carries the STATE_HIGH field, then the server 110 determines that the second state of the first session is a high real-time state, which can be represented as CLOUD_STATE_HIGH. If the second request sent by the second mobile phone 160 carries the STATE_LOW field, then the server 110 determines that the second state of the first session is a low real-time state, which can be represented as CLOUD_STATE_LOW.

[0255] After server 110 determines the second state of the first session, server 110 configures a real-time policy based on the second state of the first session. For example, if the second state of the first session is a high real-time state, server 110 configures a high real-time policy. If the second state of the first session is a low real-time state, server 110 configures a low real-time policy.

[0256] Second, the second request carries real-time policy parameters.

[0257] If the second request carries a real-time policy parameter, server 110 can determine the second state of the first session. For example, if the request sent by the second mobile phone 160 carries the REQ_HIGH field, server 110 determines that the second state of the first session is a high real-time state, which can be represented as CLOUD_STATE_HIGH. If the request sent by the second mobile phone 160 carries the REQ_LOW field, server 110 determines that the second state of the first session is a low real-time state, which can be represented as CLOUD_STATE_LOW.

[0258] S4061, Server 110 sends the second state of the first session to the first mobile phone 120, and correspondingly, the first mobile phone 120 receives the second state of the first session.

[0259] It should be noted that server 110 can include the second state of the first session in the notification that the session has been created and send it to the first mobile phone 120.

[0260] Similarly, server 110 determines the state of the second session in the same way it determines the state of the first session.

[0261] S4042, Server 110 determines the first state of the second session based on the second request.

[0262] The specific implementation method is the same as S4041 above, as follows:

[0263] In Method 1, if the second request sent by the second mobile phone 160 carries the STATE_HIGH field, then the server 110 determines that the first state of the second session is a high real-time state, which can be represented as CLIENT_STATE_HIGH. If all second requests sent by the second mobile phone 160 carry the STATE_LOW field, then the server 110 determines that the first state of the second session is a low real-time state, which can be represented as CLIENT_STATE_LOW.

[0264] Method 2: If the second request carries a real-time policy parameter, server 110 can determine the first state of the second session. For example, if the second request sent by the second mobile phone 160 carries the REQ_HIGH field, server 110 determines that the first state of the second session is a high real-time state, which can be represented as CLIENT_STATE_HIGH. If the request sent by the second mobile phone 160 carries the REQ_LOW field, server 110 determines that the first state of the second session is a low real-time state, which can be represented as CLIENT_STATE_LOW.

[0265] In other words, the second mobile phone 160 can also determine the first state of the second session based on the second request. For example, in S4040', the second request carries the state of the second memo, and the second mobile phone 160 can also determine the first state of the second session based on the state of the second memo. The specific implementation method is similar to the implementation method of S4040 above, and will not be described again here.

[0266] S4052, Server 110 determines the second state of the second session based on the first request.

[0267] The specific implementation method is the same as S4051 above, as follows:

[0268] In Method 1, if the first request sent by the first mobile phone 120 carries the STATE_HIGH field, then the server 110 can determine that the second state of the second conference is a high real-time state, which can be represented as CLOUD_STATE_HIGH. If the first requests sent by the first mobile phone 120 all carry the STATE_LOW field, then the server 110 can determine that the second state of the first conference is a low real-time state, which can be represented as CLOUD_STATE_LOW.

[0269] Method 2: If the first request carries a real-time policy parameter, the server 110 can determine the second state of the second session based on the real-time policy parameter. For example, if the first request sent by the first mobile phone 120 carries the REQ_HIGH field, the server 110 determines that the second state of the second session is a high real-time state, which can be represented as CLOUD_STATE_HIGH. If the first request sent by the first mobile phone 120 carries the REQ_LOW field, the server 110 determines that the second state of the second session is a low real-time state, which can be represented as CLOUD_STATE_LOW.

[0270] S4062, Server 110 sends the second state of the second session to the second mobile phone 160, and correspondingly, the second mobile phone 160 receives the second state of the second session.

[0271] In summary, the session status returned by server 110 to the terminal is determined based on the session status on other terminals. The session status on each terminal is based on the session status returned by server 110.

[0272] Server 110 can create a session (or collaborative session) for each terminal, and multiple sessions may exist simultaneously (such as the first session and the second session). Sessions from multiple terminals of the same user (such as the first mobile phone 120 and the second mobile phone 160) form a session group. Figure 5 The diagram illustrates how server 110 manages a session group of the same user. Figure 5 In this context, each collaborative session can include:

[0273] User ID: Used to identify a user. This can be understood as: users in the same session group share the same user ID.

[0274] Session ID: Used to identify a session. That is, each collaborative session has a different ID. The session ID is generated when the session is created and can be used to specify the session to be updated when the session is updated.

[0275] Terminal ID: Used to identify a terminal. In other words, the terminal ID is used to associate a terminal. In specific applications, when it is necessary to send push notifications to a terminal, the terminal ID can be used to specify the terminal to receive push notifications.

[0276] First state: determined based on the behavior of the terminal itself, the first state of the terminal itself is synchronized with the second state of at least one peer.

[0277] In some embodiments, the real-time data synchronization requirements between terminals and other terminals are retained on server 110, and server 110 is used to control the terminals to execute real-time strategies.

[0278] Second state: Determined based on the behavior of the peer, the second state of the terminal is synchronized with the first state of at least one peer.

[0279] In some embodiments, this is a real-time data synchronization requirement from other terminals to this terminal. It is returned to the terminal for use by the synchronization agent to control the terminal to execute real-time policies.

[0280] The synchronization proxy is used to proxy applications (such as memos) to send or receive data. In this embodiment, the synchronization proxy can refer to a proxy unit composed of a data module, a session module, and a push module.

[0281] In a session group, when the state of a session in the group changes, it will affect the state changes of other sessions. As shown in Figures 4(2), 4(3), and 4(4), the specific details are as follows:

[0282] The change in the first state of the first session of the first mobile phone 120 will affect the second state of the second session of the second mobile phone 160.

[0283] For example, suppose the first state of the first session is a low real-time state.

[0284] S4101, the first mobile phone 120 receives the user's third operation on the first memo on the first mobile phone 120, and changes the first state of the first session to a high real-time state.

[0285] For example, after the first mobile phone 120 receives the session state of the first session sent by the server 110, or while the first mobile phone 120 is maintaining the session state of the first session, the first mobile phone 120 displays as follows: Figure 10 The second interface 301 shown also displays a second control 302, which is used to initiate editing. The first mobile phone 120 receives a third operation from the user on the second control. At this time, the first mobile phone 120 determines that the first state of the first session has changed from a low real-time state to a high real-time state.

[0286] S4111 In response to the third operation, the first mobile phone 120 sends a third request (or fifth request) to the server 110 to change the low real-time state to a high real-time state. Accordingly, the server 110 receives the third request.

[0287] The third request can carry information about changes in session state. For example, the session state may switch from a low real-time state to a high real-time state.

[0288] In one implementation, after the user performs a third operation on the second control, in response to the third operation, the first mobile phone 120 changes the state of the memo from a low real-time state to a high real-time state. At this time, the first mobile phone 120 configures the real-time strategy parameter to a high real-time strategy parameter and sends the high real-time strategy parameter to the server 110 in the third request.

[0289] In another implementation, after the user performs a third operation on the second control, in response to the third operation, the first mobile phone 120 changes the state of the memo from a low real-time state to a high real-time state. At this time, the first mobile phone 120 sends the switch from the low real-time state to the high real-time state in the third request to the server 110.

[0290] S4121, Server 110 changes the first state of the first session to a high real-time state based on the third request.

[0291] Continuing with the above example, when server 110 receives a fifth request carrying high real-time policy parameters, server 110 determines the first state of the first session to be a high real-time state based on the third request. At this time, server 110 changes the first state of the first session from a low real-time state to a high real-time state.

[0292] S4131, Server 110 determines that the second state of the second session is a high real-time state.

[0293] Continuing with the above example, when server 110 receives a third request carrying high real-time policy parameters, server 110 determines the second state of the second session to be a high real-time state based on the third request. At this time, server 110 changes the second state of the second session to a high real-time state.

[0294] Once server 110 determines that the second state of the second session is a high real-time state, the second mobile phone 160 obtains the updated second state of the second session. The specific implementation method is as follows:

[0295] Method 1: The second mobile phone 160 periodically polls the second state of the second session.

[0296] As shown in Figure 4(2), 1. Assume that the first state of the second session is a low real-time state.

[0297] S4072, the second mobile phone 160 sends a fourth request to the server 110 at a second preset time interval. This fourth request is used to request the latest status. Accordingly, the server 110 receives the fourth request.

[0298] S4082, Server 110 determines the second state of the second session as a high real-time state based on the fourth request.

[0299] S4092, Server 110 sends the latest session status to Second Mobile Phone 160. Correspondingly, Second Mobile Phone 160 receives the latest status.

[0300] S4102, the second mobile phone 160 updates the second state of the second session to a high real-time state.

[0301] 2. Assume that the first state of the second session is a high real-time state.

[0302] S4072', the second mobile phone 160 sends a fourth request to the server 110, which is used to request the latest status. Accordingly, the server 110 receives the fourth request.

[0303] S4082', Server 110 determines, based on the fourth request, that the second state of the second session remains in a high real-time state.

[0304] S4092', Server 110 sends the latest session status to Second Mobile Phone 160. Accordingly, Second Mobile Phone 160 receives the latest status.

[0305] S4102', the second mobile phone 160 maintains the second state update of the second session to a high real-time state.

[0306] Method 2: Server 110 pushes the second state of the second session to the second mobile phone 160.

[0307] As shown in Figure 4 (3), S4141, server 110 sends the second state of the second session to the second mobile phone 160.

[0308] Server 110 sends the second state of the second session, which is in a high real-time state, to second mobile phone 160.

[0309] The above example illustrates the change from a low real-time state to a high real-time state in the first session. Similarly, the implementation of the change from a high real-time state to a low real-time state in the first session is similar and will not be repeated here.

[0310] Furthermore, the above explanation, which describes how changes in the first state of the first session of the first mobile phone 120 affect the second state of the second session of the second mobile phone 160, also explains how changes in the first state of the first session of the second mobile phone 160 affect the second state of the first session of the first mobile phone 120.

[0311] For example, suppose the first state of the second session is a high real-time state.

[0312] The second mobile phone 160 receives a fourth operation from the user on a second memo on the second mobile phone 160. In response to the fourth operation, the second mobile phone 160 sends a sixth request to the server 110 to change the session state. Accordingly, the server 110 receives the sixth request. When the server 110 receives the sixth request carrying the message to switch from a high real-time state to a low real-time state, it determines, based on the request, that the second state of the first session is a high real-time state, and the first state of the second session is a high real-time state.

[0313] As can be seen, in the scenario of data synchronization between two terminals, the first state of the first session and the second state of the second session are the same, both determined by the state of the first memo on the first mobile phone. The second state of the first session is the same as the first state of the first session, both determined by the state of the second memo on the second mobile phone.

[0314] It should be noted that in scenarios where data synchronization occurs between at least three terminals, the first state of the first session of the first terminal and the first state of the second session of the second terminal affect the second state of the third session of the third terminal. For example, when the first state of the session of at least one of the first and second terminals is a high real-time state, the second state of the third session of the third terminal is also a high real-time state; when the first states of the sessions of both the first and second terminals are low real-time states, the second state of the third session of the third terminal is also a low real-time state.

[0315] S4151 and the second mobile phone 160 update the second state of the second session to a high real-time state.

[0316] After a session is established, data can be synchronized between the terminals. When the data on one terminal changes, the changed data can be synchronized to other terminals.

[0317] The following details the specific process of data synchronization between various terminals:

[0318] In one specific implementation, the first state is used to characterize the real-time requirements when uploading data, and the second state is used to characterize the real-time requirements when downloading data.

[0319] Figure 6(1a) shows a flowchart of the data update stage of a data synchronization method provided in an embodiment of this application; the method may further include:

[0320] S6013, The first mobile phone 120 receives the user's fifth operation on the first memo on the first mobile phone 120.

[0321] For example, the user's Figure 9 (1) or Figure 10 The operation of the second control 302 shown.

[0322] S6014, In response to the fifth operation, the first mobile phone 120 sends the memo update data to the server 110 according to the first state of the first session. Accordingly, the server 110 receives the memo update data.

[0323] When the user Figure 9 (1) or Figure 10 Following the fifth operation of the second control 302 shown, in response to the fifth operation, the interface of the first mobile phone 120 changes from... Figure 10 The interface shown in step 301 redirects to... Figure 11 The interface 401 shown in (1) is also displayed on the interface 401. An edit box 402 and a third control 403 are also displayed on the interface 401. The user can enter edit content in the edit box 402, such as memo content 6, etc.

[0324] S6015, Server 110 update memo data.

[0325] When the user is Figure 11 When “memo content 6” is entered in the edit box 402 of interface 401 shown in Figure (1), the first state of the first session of the first mobile phone 120 is a high real-time state, and correspondingly, the second state of the second session of the second mobile phone 160 is a high real-time state. The first mobile phone 120 receives the edit content entered by the user in the edit box. The memo of the first mobile phone 120 sends the user's edit content to the data module shown in Figure 6 (3). The data module receives the user's edit content and updates the data of the memo. At the same time, the first mobile phone 120 uploads the updated data to the server 110 in real time. The server 110 updates the data of the memo.

[0326] When the second mobile phone needs to download updated data from server 110, the following methods can be used:

[0327] S6016, The second mobile phone confirms that the data on the server has changed.

[0328] Specifically, this can be achieved in the following ways:

[0329] Method 1: S60161, The second mobile phone establishes a TCP / HTTP long connection with the server. S60162, Based on the second state of the second session, the server sends a notification to the second mobile phone via the TCP / HTTP long connection.

[0330] The second state of the second session can be either a low real-time state or a high real-time state. Details are as described in Method 2 and will not be repeated here.

[0331] Method 2: S60163, the second mobile phone requests to subscribe to notifications from the server. S60164, the server pushes a data change notification to the second mobile phone according to the second state of the second session.

[0332] The data change notification is used to notify the second mobile phone 160 server of changes in data transmission.

[0333] Method 3, S60165, the second mobile phone starts timed monitoring. S60166, the second mobile phone queries the data on the server based on the first state of the second session and sends the changes.

[0334] S6017, the second mobile phone sends a data retrieval request to the server according to the first state of the second session. Correspondingly, the server receives the data retrieval request.

[0335] This data retrieval request is used to request the server to send changed data.

[0336] S6018, The server sends updated data to the second mobile phone.

[0337] S6019, second phone update memo data.

[0338] S6020, the second mobile phone displays the data in the memo.

[0339] The first state of the first session is consistent with the second state of the second session, and vice versa. For example, if the first state of the first session is a low real-time performance state, then the second state of the second session is also a low real-time performance state. The data synchronization implementation process is described below:

[0340] Figure 6(1b) shows a flowchart of the data update stage of a data synchronization method provided in an embodiment of this application. The method further includes:

[0341] S6013, The first mobile phone 120 receives the user's fifth operation on the first memo on the first mobile phone 120.

[0342] The specific details of this step are described above and will not be repeated here.

[0343] S6014, In response to the fifth operation, the first mobile phone 120 sends the memo update data to the server 110 according to the first state of the first session. Accordingly, the server 110 receives the memo update data.

[0344] Depending on the first state of the first session, the first mobile phone 120 can upload updated data to the server in the following ways:

[0345] The data module of the first mobile phone obtains the first state of the first session on the first mobile phone's session module and sends the updated data to the server's data module according to the real-time policy corresponding to the first state. For example, when the first state of the first session is STATE_LOW, the synchronization agent does not need to synchronize data to the server in a timely manner. The server's data module updates the data in the memo.

[0346] For example, as shown in Figure 6(1b), S6014 can be specifically implemented as follows: S60141. If the first state of the first session is a low real-time state, the first mobile phone 120 determines whether the second preset time interval for sending data is met. If not, the first mobile phone 120 delays sending the update data of the memo to the server 110; if it is met, the first mobile phone 120 sends the update data of the memo to the server 110.

[0347] S6015, Server 110 update memo data.

[0348] The specific details of this step are described above and will not be repeated here.

[0349] S6016, The second mobile phone confirms that the data on the server has changed.

[0350] Specifically, as shown in Figure 6(3), the server's data module sends the data change notification to the server's session module. The server's session module sends the data change notification to the push module according to the real-time policy corresponding to the second state of the second session. The server's push module sends the data change notification to the push module of the second mobile phone. The push module of the second mobile phone sends the data change notification to the session module of the second mobile phone. The session module of the second mobile phone sends the data change notification to the data module according to the real-time policy corresponding to the second state of the second session. As shown in Figure 6(1b), specifically:

[0351] If the second state of the second session is a low real-time state, then in S61163, the server determines whether the third preset time interval for sending the notification is met. If not, then S62163 is executed; if so, then S63163 is executed. In S62163, the server delays sending the data change notification. In S63163, the server sends the data change notification to the second mobile phone.

[0352] S6017, the second mobile phone sends a data retrieval request to the server according to the second state of the second session. Accordingly, the server receives the data retrieval request.

[0353] This data retrieval request is used to request the server to send changed data.

[0354] S6018, The server sends updated data to the second mobile phone.

[0355] S6019, second phone update memo data.

[0356] S6020, the second mobile phone displays the data in the memo.

[0357] The specific descriptions of S6017-S6020 are as described above and will not be repeated here.

[0358] The first state of the first session is consistent with the second state of the second session, and vice versa. For example, if the first state of the first session is a high real-time state, then the second state of the second session is also a high real-time state. The data synchronization implementation process is described below:

[0359] Figure 6(1b) shows a flowchart of the data update stage of a data synchronization method provided in an embodiment of this application. The method further includes:

[0360] S6013, The first mobile phone 120 receives the user's fifth operation on the first memo on the first mobile phone 120.

[0361] The specific details of this step are described above and will not be repeated here.

[0362] S6014, In response to the fifth operation, the first mobile phone 120 sends the memo update data to the server 110 according to the first state of the first session. Accordingly, the server 110 receives the memo update data.

[0363] Depending on the first state of the first session, the first mobile phone 120 can upload updated data to the server in the following ways:

[0364] The data module of the first mobile phone obtains the first state of the first session on the first mobile phone's session module and sends the updated data to the server's data module according to the real-time policy corresponding to the first state. For example, when the first state of the first session is STATE_HIGH, the synchronization agent needs to synchronize data to the server in a timely manner. The server's data module updates the data in the memo.

[0365] For example, S6014 can be implemented as follows: S60142. If the first state of the first session is a high real-time state, then the first mobile phone 120 sends the update data of the memo to the server 110 in real time.

[0366] S6015', Server 110 updates the memo data.

[0367] S6015' is the same as S6015. For details on its implementation, please refer to the relevant content above. It will not be repeated here.

[0368] S6016, The second mobile phone confirms that the data on the server has changed.

[0369] Specifically, as shown in Figure 6(3), the server's data module sends the data change notification to the server's session module. The server's session module sends the data change notification to the push module according to the real-time policy corresponding to the second state of the second session. The server's push module sends the data change notification to the push module of the second mobile phone. The push module of the second mobile phone sends the data change notification to the session module of the second mobile phone. The session module of the second mobile phone sends the data change notification to the data module according to the real-time policy corresponding to the second state of the second session. As shown in Figure 6(1b), specifically:

[0370] If the second state of the second session is a high real-time state, then S64163, the server sends the updated data of the memo to the second mobile phone in real time.

[0371] S6017', The second mobile phone determines the first state of the second session.

[0372] S6017. The second mobile phone sends a data retrieval request (such as the seventh request) to the server according to the first state of the second session. Accordingly, the server receives the data retrieval request.

[0373] This data retrieval request is used to request the server to send changed data.

[0374] S6018, The server sends updated data to the second mobile phone.

[0375] S6019, second phone update memo data.

[0376] S6020, the second mobile phone displays the data in the memo.

[0377] The specific descriptions of S6017-S6020 are as described above and will not be repeated here.

[0378] In another specific implementation, the first state is used to characterize the real-time requirements when downloading data, and the second state is used to characterize the real-time requirements when uploading data.

[0379] Figure 6 (2a) is a flowchart illustrating the data update stage of a data synchronization method provided in an embodiment of this application; the method may further include:

[0380] S6013', Server 110 updates the second state of the first session and sends the second state of the first session to the first mobile phone 120.

[0381] In one possible implementation, when the second mobile phone 160 receives an operation from the user on the second memo on the second mobile phone 160, the second mobile phone 160 determines the first state of the second session. As mentioned above, the first state of the second session is consistent with the second state of the first session, therefore the server 110 updates the second state of the first session according to the state of the second memo carried in the second request.

[0382] S6014, the first mobile phone 120 sends the update data of the memo to the server 110 according to the second state of the first session. Correspondingly, the server 110 receives the update data of the memo.

[0383] The specific details of this step are described above and will not be repeated here.

[0384] S6015, Server 110 update memo data.

[0385] The specific details of this step are described above and will not be repeated here.

[0386] When the second mobile phone needs to download updated data from server 110, the following methods can be used:

[0387] S6016, The second mobile phone confirms that the data on the server has changed.

[0388] Specifically, this can be achieved in the following ways:

[0389] Method 1: S60161, The second mobile phone establishes a TCP / HTTP long connection with the server. S60162, Based on the first state of the second session, the server sends a notification to the second mobile phone via the TCP / HTTP long connection.

[0390] The first state of the second session can be either a low real-time state or a high real-time state. Specific details are described below and will not be repeated here.

[0391] Method 2: S60163, the second mobile phone requests to subscribe to notifications from the server. S60164, the server pushes a data change notification to the second mobile phone based on the first state of the second session.

[0392] The data change notification is used to notify the second mobile phone 160 server of changes in data transmission.

[0393] Method 3, S60165, the second mobile phone starts timed monitoring. S60166, the second mobile phone queries the data on the server based on the first state of the second session and sends the changes.

[0394] S6017, the second mobile phone sends a data retrieval request to the server according to the second state of the second session. Accordingly, the server receives the data retrieval request.

[0395] This data retrieval request is used to request the server to send changed data.

[0396] S6018, The server sends updated data to the second mobile phone.

[0397] S6019, second phone update memo data.

[0398] S6020, the second mobile phone displays the data in the memo.

[0399] The specific descriptions of S6017-S6020 are as described above and will not be repeated here.

[0400] The first state of the first session is consistent with the second state of the second session, and vice versa. For example, if the second state of the first session is a low real-time performance state, then correspondingly, the first state of the second session is also a low real-time performance state. The data synchronization implementation process is described below:

[0401] Figure 6(2b) shows a flowchart of the data update stage of a data synchronization method provided in an embodiment of this application. The method further includes:

[0402] S6013', Server 110 updates the second state of the first session and sends the second state of the first session to the first mobile phone 120.

[0403] The specific details of this step are described above and will not be repeated here.

[0404] S6014, the first mobile phone 120 sends the update data of the memo to the server 110 according to the first state of the first session. Correspondingly, the server 110 receives the update data of the memo.

[0405] Depending on the second state of the first session, the first mobile phone 120 can upload updated data to the server in the following ways:

[0406] The data module of the first mobile phone obtains the second state of the first session from the session module of the first mobile phone, and sends the updated data to the server's data module according to the real-time policy corresponding to the second state. For example, when the second state of the first session is CLOUD_STATE_LOW, the synchronization agent does not need to synchronize data to the server in a timely manner. The server's data module updates the data in the memo.

[0407] For example, as shown in Figure 6(2b), S6014 can be specifically implemented as follows: S60141' If the second state of the first session is a low real-time state, then the first mobile phone 120 determines whether the second preset time interval for sending data is met. If not, the first mobile phone 120 delays sending the update data of the memo to the server 110; if it is met, the first mobile phone 120 sends the update data of the memo to the server 110.

[0408] S6015, Server 110 update memo data.

[0409] The specific details of this step are described above and will not be repeated here.

[0410] When the second mobile phone needs to download updated data from server 110, the following methods can be used:

[0411] S6016, The second mobile phone confirms that the data on the server has changed.

[0412] Specifically, this can be achieved in the following ways:

[0413] Specifically, as shown in Figure 6(3), the server's data module sends the data change notification to the server's session module. The server's session module sends the data change notification to the push module according to the real-time policy corresponding to the first state of the second session. The server's push module sends the data change notification to the push module of the second mobile phone. The second mobile phone's push module sends the data change notification to the session module of the second mobile phone. The second mobile phone's session module sends the data change notification to the data module according to the real-time policy corresponding to the first state of the second session. As shown in Figure 6(2b), specifically:

[0414] If the first state of the second session is a low real-time state, then in S61163', the server determines whether the third preset time interval for sending the notification is met. If not, then S62163' is executed; if so, then S63163' is executed. In S62163', the server delays sending the data change notification. In S63163', the server sends the data change notification to the second mobile phone.

[0415] S6017', The second mobile phone determines the first state of the second session.

[0416] S6017. The second mobile phone sends a data retrieval request (such as the seventh request) to the server according to the first state of the second session. Accordingly, the server receives the data retrieval request.

[0417] This data retrieval request is used to request the server to send changed data.

[0418] S6018, The server sends updated data to the second mobile phone.

[0419] S6019, second phone update memo data.

[0420] S6020, the second mobile phone displays the data in the memo.

[0421] The specific descriptions of S6017-S6020 are as described above and will not be repeated here.

[0422] The first state of the first session is consistent with the second state of the second session, and vice versa. For example, if the second state of the first session is a high real-time state, then correspondingly, the first state of the second session is also a high real-time state. The data synchronization implementation process is described below:

[0423] Figure 6(2b) shows a flowchart of the data update stage of a data synchronization method provided in an embodiment of this application. The method further includes:

[0424] S6013, The first mobile phone 120 receives the user's fifth operation on the first memo on the first mobile phone 120.

[0425] The specific details of this step are described above and will not be repeated here.

[0426] S6014, In response to the fifth operation, the first mobile phone 120 sends the memo update data to the server 110 according to the first state of the first session. Accordingly, the server 110 receives the memo update data.

[0427] Depending on the second state of the first session, the first mobile phone 120 can upload updated data to the server in the following ways:

[0428] The data module of the first mobile phone obtains the second state of the first session from the session module of the first mobile phone, and sends the updated data to the server's data module according to the real-time policy corresponding to the second state. For example, when the second state of the first session is CLOUD_STATE_HIGH, the synchronization agent needs to synchronize data to the server in a timely manner. The server's data module updates the data in the memo.

[0429] For example, as shown in Figure 6 (2b), S6014 can be specifically implemented as follows: S60142' If the second state of the first session is a high real-time state, then the first mobile phone 120 sends the update data of the memo to the server 110 in real time.

[0430] S6015', Server 110 updates the memo data.

[0431] S6015' is the same as S6015. For details on its implementation, please refer to the relevant content above. It will not be repeated here.

[0432] S6016, The second mobile phone confirms that the data on the server has changed.

[0433] Specifically, as shown in Figure 6(3), the server's data module sends the data change notification to the server's session module. The server's session module sends the data change notification to the push module according to the real-time policy corresponding to the first state of the second session. The server's push module sends the data change notification to the push module of the second mobile phone. The second mobile phone's push module sends the data change notification to the session module of the second mobile phone. The second mobile phone's session module sends the data change notification to the data module according to the real-time policy corresponding to the first state of the second session. As shown in Figure 6(2b), specifically:

[0434] If the first state of the second session is a high real-time state, then S64163', the server sends the updated data of the memo to the second mobile phone in real time.

[0435] S6017', The second mobile phone determines the first state of the second session.

[0436] S6017. The second mobile phone sends a data retrieval request (such as the seventh request) to the server according to the first state of the second session. Accordingly, the server receives the data retrieval request.

[0437] This data retrieval request is used to request the server to send changed data.

[0438] S6018, The server sends updated data to the second mobile phone.

[0439] S6019, second phone update memo data.

[0440] S6020, the second mobile phone displays the data in the memo.

[0441] The specific descriptions of S6017-S6020 are as described above and will not be repeated here.

[0442] In some embodiments, when a user does not need to obtain synchronization data, the user can operate the first mobile phone 120 and / or the second mobile phone 160 to delete the session. Figure 6 (4) is a flowchart illustrating the session deletion stage of a data synchronization method provided in this application embodiment; as shown in Figure 6 (4), the method may further include:

[0443] S6023, The first mobile phone 120 receives the sixth operation of the user on the first memo on the first mobile phone 120.

[0444] This sixth action is used to instruct the first memo to delete the session. This sixth action can be a control on the action memo.

[0445] The manipulation of controls on the first memo can include two scenarios:

[0446] The first type involves manipulating the controls on the interface of the first memo.

[0447] For example, the first memo interface also displays a control for deleting a session. When the user clicks this control, the first mobile phone sends a session deletion request to the server, and the server deletes the session based on the session deletion request.

[0448] The second method involves selecting an option in the application settings for the first memo.

[0449] For example, the First Messenger settings interface has an option for "Delete Session". When the user selects this option, the First Messenger deletes the session. Alternatively, the First Messenger settings interface has an option for "Create Session". When the user does not select this option, the First Messenger deletes the session.

[0450] S6024. In response to the sixth operation, an eighth request is sent, which is used to request the deletion of the session.

[0451] S6027. The server deletes the first session based on the eighth request.

[0452] Similarly, the operation of deleting a session on the second mobile phone 160 is the same as that on the first mobile phone 120.

[0453] S6025, the second mobile phone 160 receives the user's seventh operation on the second memo on the second mobile phone 160.

[0454] S6026. In response to the seventh operation, a ninth request is sent, which is used to request the deletion of the session.

[0455] S6028. The server deletes the second session based on the ninth request.

[0456] The following explanation is based on specific scenarios:

[0457] In the first scenario, the user's actions on the first phone trigger data synchronization between the first and second phones.

[0458] Scenario 1: Both the first and second mobile phones are in a low real-time state; data between the first and second phones will not be synchronized. For example, when the user operates... Figure 8 When control 202 is displayed on the interface shown, the interface of the first mobile phone 120 changes from... Figure 8 The interface shown will redirect to Figure 9The interface 301 shown in (1) is shown in the figure. At this time, the user can browse the content of the interface 301 and also edit the content of the interface 301. When the user browses the content of the interface 301, the first mobile phone 120 has a low real-time requirement for the second mobile phone 160. That is to say, the first state of the first session of the first mobile phone 120 is a low real-time state, and the second state of the second session of the second mobile phone 160 is a low real-time state. At this time, the second mobile phone 160 does not need to synchronize data in real time, that is, the second mobile phone 160 does not obtain synchronized data, and the second mobile phone 160 is as follows Figure 9 The interface shown in (2) is blank.

[0459] Scenario 2: Both the first and second mobile phones are in a high real-time state, and the data of the first and second mobile phones are synchronized.

[0460] In one embodiment, when the user edits the content of interface 301, the first mobile phone 120 has high real-time requirements for the second mobile phone 160. That is, the first state of the first session of the first mobile phone 120 is a high real-time state, and the second state of the second session of the second mobile phone 160 is also a high real-time state. At this time, the second mobile phone 160 needs to synchronize data in real time; that is, once the second mobile phone 160 has acquired the synchronized data, the interface of the second mobile phone 160 changes from... Figure 9 The interface shown in (2) jumps to Figure 9 The interface shown in (3) is shown in the middle.

[0461] In other embodiments, when the user is Figure 10 When "Memo Content 5" is clicked on the interface 301 shown, the interface of the first mobile phone 120 changes. Figure 10 The interface shown will redirect to Figure 11 The interface shown in (1) is shown in the image. When the user is in Figure 11 When information is entered into the edit box in the interface shown in (1), the first state of the first session of the first mobile phone 120 is a high real-time state, and correspondingly, the second state of the second session of the second mobile phone 160 is a high real-time state. At this time, the second mobile phone 160 downloads updated data from the server 110 in real time, that is, the second mobile phone 160 sends a data acquisition request to the server 110 in real time. In other words, the interface of the second mobile phone 160 is changed from... Figure 9 (2) updated to Figure 11 (2) and the first mobile phone 120 display Figure 10 The interface and the second mobile phone 160 display Figure 11 The interface of (2) updates data synchronously.

[0462] In other embodiments, when the user is Figure 12 When control 302 is clicked on the interface shown, the interface of the first mobile phone 120 changes. Figure 12 The interface shown will redirect to Figure 13The interface shown. When the user is in Figure 13 When "memo content 6" is entered in the edit box 602 of the interface 601 shown, and the control 603 is clicked, the interface of the first mobile phone 120 changes. Figure 13 The interface shown will redirect to Figure 14 Interface 701 is shown in (1). At this time, the first state of the first session of the first mobile phone 120 is a high real-time state, and correspondingly, the second state of the second session of the second mobile phone 160 is a high real-time state. At this time, the second mobile phone 160 downloads updated data from the server 110 in real time, that is, the second mobile phone 160 sends a data acquisition request to the server 110 in real time. In other words, the interface of the second mobile phone 160 is changed from... Figure 11 (2) updated to Figure 14 (2) and the first mobile phone 120 display Figure 14 The interface of the middle (1) and the display of the second mobile phone 160 Figure 14 The interface of (2) updates data synchronously.

[0463] In the second scenario, the user's actions on the second phone trigger data synchronization between the first and second phones.

[0464] Scenario 3: Both the first and second mobile phones are in a low real-time state, and the data between the first and second mobile phones will not be synchronized.

[0465] Continuing with the example above, when the user operates the first mobile phone 120 Figure 12 , Figure 13 , Figure 14 (1) or Figure 15 When (2) is in the middle, the second mobile phone 160 displays as follows Figure 9 (2) or Figure 15 The interface shown in (2) is shown. For example, when a user browses the first mobile phone 120... Figure 15 When the content of interface 801 shown in (1) is displayed, both the first mobile phone and the second mobile phone are in a low real-time state. At this time, the second mobile phone 160 does not need to synchronize data in real time, that is, the second mobile phone 160 does not obtain synchronized data. On the second mobile phone 160, as shown in (1) the content of interface 801, both the first mobile phone and the second mobile phone are in a low real-time state. At this time, the second mobile phone 160 does not need to synchronize data in real time. Figure 15 The interface shown in (2) is blank.

[0466] Scenario 4: Both the first and second mobile phones are in a high real-time state, and the data of the first and second mobile phones are synchronized.

[0467] In one embodiment, when the user operates the second mobile phone Figure 15Control 903 on the interface shown in (2) is used because, due to the user's operation on the second mobile phone, the second mobile phone 160 has a high real-time requirement for the first mobile phone 120. That is, the first state of the second session of the second mobile phone 160 is a high real-time state. In other words, the second mobile phone 160 needs the first mobile phone 120 to upload data in real time in order to download the data uploaded by the first mobile phone 120 in real time. Thus, the display interface of the second mobile phone 160 is changed from... Figure 15 The interface shown in (2) jumps to Figure 15 The interface shown in (3) is the same as that of the first mobile phone 120. Figure 15 The interface shown in (1) is synchronized.

[0468] In another embodiment, when the user edits the second mobile phone 160 Figure 15 When the interface shown in (3) displays "Memo Content 5", the first state of the first session of the second mobile phone 160 is a high real-time state, and the second mobile phone 160 has high real-time requirements for the first mobile phone 120. That is to say, the second mobile phone 160 needs the first mobile phone 120 to upload data in real time in order to download the data uploaded by the first mobile phone 120 in real time. At this time, the interface of the second mobile phone 160 changes from Figure 15 The interface shown in (3) jumps to Figure 16 The interface shown in (1) is shown in the image. When the user is on the second mobile phone 160... Figure 16 When you continue to enter information in the edit box of the interface shown in (1) (such as taking a photo is tentatively scheduled for June 6, 2021), the interface of the first mobile phone 120 will change from... Figure 15 The interface of (1) will redirect to Figure 16 The interface 111 shown in (2) is the same as that of the second mobile phone 160. Figure 16 The interface shown in (1) is synchronized.

[0469] In some embodiments, both the first and second mobile phones are in a high real-time state, and data from the second mobile phone is synchronized to the first mobile phone. When the user is on the second mobile phone 160... Figure 16 When information is entered into the edit box in the interface shown in (1) (e.g., taking a photo is tentatively scheduled for June 6, 2021), and control 405 is clicked to complete the editing, at this time, both the first mobile phone and the second mobile phone are in a high real-time state. At this time, the interface of the first mobile phone 120 changes from Figure 15 The interface of (1) will redirect to Figure 16 The interface 111 shown in (2) is the same as that of the second mobile phone 160. Figure 16 The interface shown in (1) is synchronized.

[0470] In some embodiments, both the first and second mobile phones are in a high real-time state, and data from the first mobile phone is synchronized to the second mobile phone. When the user is on the first mobile phone 120... Figure 16Continue entering information (such as "Please attend on time") in the edit box of the interface shown in (2), that is, Figure 17 As shown in (2), click control 406 to complete the editing. At this time, both the first and second mobile phones are in a high real-time state, and the interface of the second mobile phone 160 is changed from Figure 16 The interface shown in (1) jumps to Figure 17 The interface shown in (1) is the same as that of the first mobile phone 120. Figure 17 The interface shown in (2) is synchronized.

[0471] For details on the specific implementation of the embodiments of this application, please refer to the above-mentioned relevant content. The embodiments of this application will not be repeated here.

[0472] The various solutions in the above embodiments of this application can be combined without contradiction.

[0473] This application provides another type of terminal. This terminal executes any of the methods described above.

[0474] This application provides a system that performs any of the methods described above.

[0475] This application also provides a computer-readable storage medium including instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0476] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0477] This application also provides a chip including a processor and an interface circuit. The interface circuit is coupled to the processor. The processor is used to run computer programs or instructions to implement the above-described method. The interface circuit is used to communicate with other modules outside the chip.

[0478] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.

[0479] In the description of this application, the words "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0480] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0481] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0482] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0483] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0484] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0485] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope 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.

Claims

1. A data synchronization method, comprising: receiving, by a first terminal, a first operation of a user on a first application on the first terminal; displaying, by the first terminal, a first interface in response to the first operation, wherein content of the first interface is different from content of a second interface displayed by a second terminal; receiving, by the first terminal, a third operation of the user on the first interface; uploading, by the first terminal, data of the first application to a server in response to the third operation, and obtaining, by the second terminal, the data of the first application from the server and displaying a third interface, wherein the data of the first application comprises data of the first interface, and the third interface is the same as the first interface; displaying, by the first terminal, the first interface in response to the first operation comprises: sending a first request to the server, wherein the first request is used to request to establish a first session, and determining a first state of the first session according to the first operation, wherein the first state is a low real-time state; determining, by the server, a second state of a second session of the second terminal, wherein the second state of the second session is determined according to the first request, and the second state of the second session is the low real-time state; the response to the third operation comprises: sending, by the first terminal, a third request to the server in response to the third operation, wherein the third request is used to request to switch from the low real-time state to a high real-time state; obtaining, by the second terminal, the second state of the second session from the server, and updating the second state of the second session to the high real-time state.

2. The method of claim 1, wherein, further comprising: receiving, by the first terminal, a fourth operation of the user on the first interface; uploading, by the first terminal, the data of the first application to the server and displaying a fourth interface in response to the fourth operation, and obtaining, by the second terminal, the data of the first application from the server and displaying a fifth interface, wherein the data of the first application comprises data of the fourth interface, and the fifth interface is the same as the fourth interface.

3. The method of claim 2, wherein, uploading, by the first terminal, the data of the first application to the server comprises: when the first state is the low real-time state, uploading, by the first terminal, the data of the first application to the server after a third preset time interval, and obtaining, by the second terminal, the data of the first application from the server after the third preset time interval; when the first state is the high real-time state, uploading, by the first terminal, the data of the first application to the server in real time, and obtaining, by the second terminal, the data of the first application from the server in real time.

4. The method of claim 1, wherein, the first request carries a state of the first application on the first terminal, and the first state of the first session and the second state of the second session are determined according to the state of the first application.

5. The method of claim 1, wherein, The first request carries a real-time policy parameter, and the first state of the first session and the second state of the second session are determined according to the real-time policy parameter, and the real-time policy parameter is determined according to the state of the first application program on the first terminal.

6. The method of claim 1, wherein, Further comprising: The first terminal receives a sixth operation of a user on the first application program on the first terminal; The first terminal sends a seventh request to the server in response to the sixth operation, and the seventh request is used to request deleting a session.

7. The method of any one of claims 1-6, wherein, The first state or the second state is a low real-time state, and the real-time policy is asynchronous data updating. The first state or the second state is a high real-time state, and the real-time policy is synchronous data updating.

8. The method of claim 1, wherein, The first application program comprises a method application program and a third-party application program, and the method application program comprises at least one of a contact list, a memo, a calendar, a bookmark, a document, a short message, an email, and a photo.

9. A data synchronization method, comprising: The second terminal receives a second operation of a user on a first application program on the second terminal; The second terminal displays a second interface in response to the second operation, and the content of the second interface is different from the content of a first interface of a first terminal; When the first terminal receives a third operation of a user on the first interface and uploads data of the first application program to a server in response to the third operation, the second terminal obtains the data of the first application program from the server and displays a third interface, wherein the data of the first application program comprises data of the first interface, and the third interface is the same as the first interface; The second terminal displays a second interface in response to the second operation, and the content of the second interface is different from the content of a first interface of a first terminal; When the first terminal sends a third request to the server in response to the third operation, the third request is used to request switching a low real-time state to a high real-time state; The second terminal obtains the second state of the second session from the server and updates the second state of the second session to a high real-time state. Further comprising:

10. The method of claim 9, wherein, When the first terminal receives a fourth operation of a user on the first interface and uploads data of the first application program to the server and displays a fourth interface in response to the fourth operation, the second terminal obtains the data of the first application program from the server and displays a fifth interface, wherein the data of the first application program comprises data of the fourth interface, and the fifth interface is the same as the fourth interface. ​ 11. The method of claim 10, wherein, After the second terminal responds to the second operation and displays a second interface, the content of the second interface being different from the content of the first interface, it also includes... After a first preset time interval, the second terminal displays a sixth interface, which is the same as the first interface.

12. The method of claim 11, wherein, The second terminal obtains the second state of the second session from the server, including: The second terminal sends a fourth request to the server at a second preset time interval, the fourth request being used to obtain the latest status; The second terminal receives the latest status sent by the server and updates the second status of the second session to a high real-time status.

13. The method of claim 9, wherein, The second terminal obtains data from the first application from the server, including: The second terminal obtains the data change notification from the server according to the real-time policy corresponding to the second state; The second terminal sends a fifth request to the server based on the data change notification, the fifth request being used to request updated data; The second terminal obtains the updated data from the server according to the real-time policy corresponding to the second state. The server is used to receive the fifth request and send the updated data to the second terminal according to the fifth request.

14. The method of claim 9, wherein, The second terminal obtains data from the first application from the server, including: The second terminal queries the data changes on the server at a second preset time interval; When the data on the server changes, the second terminal sends a sixth request to the server, the sixth request being used to request updated data; The second terminal obtains the updated data from the server according to the real-time policy corresponding to the second state. The server is used to receive the sixth request and send the updated data to the second terminal according to the sixth request.

15. The method of claim 9, wherein, The first request carries the state of the first application on the first terminal. The first request is used to request the establishment of a first session. The first state of the first session and the second state of the second session are determined based on the state of the first application.

16. The method of claim 9, wherein, The first request carries a real-time policy parameter. The first state of the first session and the second state of the second session are determined based on the real-time policy parameter, which is determined based on the state of the first application on the first terminal.

17. The method according to claim 9, characterized in that, The first terminal receives a sixth operation from the user on the first application on the first terminal; In response to the sixth operation, the first terminal sends a seventh request to the server, the seventh request being used to request the deletion of the session; The second terminal receives a seventh operation from the user on the first application on the second terminal; In response to the seventh operation, the second terminal sends an eighth request to the server, the eighth request being used to request the deletion of the session.

18. The method of claim 9, wherein, The first request is used to request the establishment of a first session. The first state of the first session or the second state of the second session is a low real-time state, and the real-time strategy is to update data asynchronously. The first state or the second state is a high real-time state, and the real-time strategy is to synchronously update data.

19. The method according to claim 18, characterized in that, The first application includes a method application and a third-party application, wherein the method application includes at least one of the following: address book, memo, calendar, bookmarks, documents, text messages, emails, and photos.

20. A data synchronization system, characterized in that, The first terminal receives a first operation from the user on the first application on the first terminal; The first terminal responds to the first operation and displays the first interface; The second terminal receives a second operation from the user on the first application on the second terminal; The second terminal responds to the second operation by displaying a second interface, the content of which is different from the content of the first interface; The first terminal receives a third operation from the user on the first interface; In response to the third operation, the first terminal uploads the data of the first application to the server, and the second terminal obtains the data of the first application from the server and displays a third interface, wherein the data of the first application includes the data of the first interface; the third interface is the same as the first interface. The first terminal, in response to the first operation, displays a first interface including: Send a first request to the server, the first request being used to request the establishment of a first session, and determine the first state of the first session based on the first operation, the first state being a low real-time state; In response to the second operation, the second terminal displays a second interface including: A second request is sent to the server to request the establishment of a second session. The server determines a second state of the second session based on the first request. The second state of the second session is a low real-time state. The response to the third operation further includes: In response to the third operation, the first terminal sends a third request to the server, the third request being used to request a switch from a low real-time state to a high real-time state; The second terminal obtains the second state of the second session from the server and updates the second state of the second session to a high real-time state.

21. The system of claim 20, wherein, Also includes: The first terminal receives the user's fourth operation on the first interface; In response to the fourth operation, the first terminal uploads the data of the first application to the server and displays a fourth interface, and the second terminal retrieves the data of the first application from the server and displays a fifth interface, wherein the data of the first application includes the data of the fourth interface; the fifth interface is the same as the fourth interface.

22. The system of claim 21, wherein, After the second terminal responds to the second operation and displays a second interface, the content of the second interface being different from the content of the first interface, it also includes... After a first preset time interval, the second terminal displays a sixth interface, which is the same as the first interface.

23. The system of claim 22, wherein, The second terminal obtains the second state of the second session from the server, including: The second terminal sends a fourth request to the server at a second preset time interval, the fourth request being used to obtain the latest status; The second terminal receives the latest status sent by the server and updates the second status of the second session to a high real-time status.

24. The system of claim 20, wherein, The first terminal uploads data from the first application to the server, including: The first state is a low real-time state, in which the first terminal uploads the data of the first application to the server after a third preset time interval, and the second terminal obtains the data of the first application from the server after the third preset time interval. The first state is a high real-time state, in which the first terminal uploads the data of the first application to the server in real time, and the second terminal obtains the data of the first application from the server in real time.

25. The system of claim 20, wherein, The second terminal obtains data from the first application from the server, including: The second terminal obtains the data change notification from the server according to the real-time policy corresponding to the second state; The second terminal sends a fifth request to the server based on the data change notification, the fifth request being used to request updated data; The second terminal obtains the updated data from the server according to the real-time policy corresponding to the second state. The server is used to receive the fifth request and send the updated data to the second terminal according to the fifth request.

26. The system of claim 20, wherein, The second terminal obtains data from the first application from the server, including: The second terminal queries the data changes on the server at a second preset time interval; When the data on the server changes, the second terminal sends a sixth request to the server, the sixth request being used to request updated data; The second terminal obtains the updated data from the server according to the real-time policy corresponding to the second state. The server is used to receive the sixth request and send the updated data to the second terminal according to the sixth request.

27. The system of claim 20, wherein, The first request carries the state of the first application on the first terminal, and the first state of the first session and the second state of the second session are determined based on the state of the first application.

28. The system of claim 20, wherein, The first request carries a real-time policy parameter. The first state of the first session and the second state of the second session are determined based on the real-time policy parameter, which is determined based on the state of the first application on the first terminal.

29. The system according to claim 20, characterized in that, The first terminal receives a sixth operation from the user on the first application on the first terminal; In response to the sixth operation, the first terminal sends a seventh request to the server, the seventh request being used to request the deletion of the session; The second terminal receives a seventh operation from the user on the first application on the second terminal; In response to the seventh operation, the second terminal sends an eighth request to the server, the eighth request being used to request the deletion of the session.

30. The system according to any one of claims 20-29, characterized in that, The first state or the second state is a low real-time state, and the real-time strategy is to update data asynchronously; The first state or the second state is a high real-time state, and the real-time strategy is to synchronously update data.

31. The system according to claim 20, characterized in that, The first application includes system applications and third-party applications. The system applications include at least one of the following: contacts, memos, calendar, bookmarks, documents, text messages, emails, and photos.

32. A communication terminal, characterized by Perform the data synchronization method as described in any one of claims 1-8; or, perform the data synchronization method as described in any one of claims 9-19.

33. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on a terminal, cause the terminal to perform the data synchronization method as described in any one of claims 1-8; or, to perform the data synchronization method as described in any one of claims 9-19.

34. A computer program product, characterised in that, When the program in the computer program product is invoked by the processor, the data synchronization method of any one of claims 1-8 is executed, or the data synchronization method of any one of claims 9-19 is executed.

35. A chip system, characterized by The system includes one or more processors, which, when executing instructions, perform the data synchronization method as described in any one of claims 1-8; or, perform the data synchronization method as described in any one of claims 9-19.

Citation Information

Patent Citations

  • Interface operation implementing method and device

    CN104965637A

  • Cross-screen intelligent algorithm and personal television based on cross-screen intelligent algorithm

    CN110430463A