WO2024022119A1 - 数据同步方法、电子设备及*** - Google Patents

数据同步方法、电子设备及*** Download PDF

Info

Publication number
WO2024022119A1
WO2024022119A1 PCT/CN2023/107206 CN2023107206W WO2024022119A1 WO 2024022119 A1 WO2024022119 A1 WO 2024022119A1 CN 2023107206 W CN2023107206 W CN 2023107206W WO 2024022119 A1 WO2024022119 A1 WO 2024022119A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
electronic device
interface
request
information
Prior art date
Application number
PCT/CN2023/107206
Other languages
English (en)
French (fr)
Inventor
王汉才
龚阿世
李有福
刘文慧
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024022119A1 publication Critical patent/WO2024022119A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Definitions

  • the embodiments of the present application relate to the field of terminal technology, and in particular, to a data synchronization method, electronic equipment and system.
  • cross-device data access can be achieved between different electronic devices.
  • the first electronic device such as a tablet, etc.
  • cross-device accesses the application data of the first application indicated by the user operation in the second electronic device.
  • the first electronic device can filter the interface data of the first application corresponding to the user operation instruction from the obtained application data to display the corresponding interface, such as displaying the home page of the application, a certain function page in the application, etc.
  • the user may instruct the first electronic device to display a different interface, so the first electronic device will request to obtain all application data of the first application.
  • the amount of transmitted data is large, resulting in high power consumption.
  • the application data that the first electronic device needs to use in response to user operations may only occupy a smaller proportion, and the proportion of invalid data is relatively high.
  • this application provides a data synchronization method, electronic device and system.
  • the first electronic device can request the second electronic device to obtain the interface data of the first application in the second electronic device to be displayed according to the user's operation. In this way, data synchronization of invalid data is effectively reduced and cross-device data access overhead is reduced.
  • the first aspect is to provide a data synchronization method.
  • the method includes: in response to the user's first operation, the first electronic device sends a first data request to the second electronic device, the first data request is used to request data required by the first interface displayed by the first operation indication, the first The interface corresponds to the first application in the second electronic device.
  • the first electronic device receives the first data sent by the second electronic device, and the first data is data determined by the second electronic device in response to the first data request.
  • the first electronic device displays a first interface.
  • the first electronic device sends a second data request to the second electronic device.
  • the second data request is used to request data required by the second interface displayed by the second operation indication.
  • the second interface corresponds to First application.
  • the first electronic device receives second data sent by the second electronic device.
  • the second data is data determined by the second electronic device in response to the second data request, and the second data is different from the first data.
  • the first electronic device displays a second interface.
  • the first application includes an application program (APP) in the second electronic device, or a service (such as a task manager service, an installation package management service, etc.).
  • APP application program
  • the first electronic device and the second electronic device may synchronize application data or service data required by the interface indicated by the first operation.
  • the first interface includes an interface to be displayed for the first electronic device in response to user operation.
  • the first data includes data of the interface to be displayed indicated by the user operation and data of the interface associated with the interface to be displayed, or the first data includes data of the interface to be displayed indicated by the user operation.
  • the data transmitted between the first electronic device and the second electronic device is data used by the first electronic device to display the interface to be displayed, and is no longer the full data of the application. Effectively reduce the amount of data transmission and reduce the power consumption of electronic equipment.
  • the first electronic device in response to a first operation of the user, sends a first data request to the second electronic device, including: in response to the first operation, the first electronic device determines a data query condition, and the data query condition is used to Query the data required to display the first interface.
  • the first electronic device sends a first data request to the second electronic device, and the first data request carries data query conditions.
  • the data query conditions may include one or more of the application name, row information, column information, water level information, etc. corresponding to the data to be queried.
  • the second electronic device can determine the interface data requested by the first electronic device according to the data query condition.
  • the method further includes: the first electronic device obtains the current The third data in the local data that meets the data query conditions is determined to determine the first information of the third data; the first data request also carries the first information, and the first information includes one or more of the following information of the third data: row Information, column information, water level information.
  • the second electronic device can determine part of the data of the first application according to the data query condition. Afterwards, the second electronic device can determine the first data that is not stored in the first electronic device in this part of the data based on the first information, thereby determining the third data that is not stored in the first electronic device among the data required to display the first interface. A data is sent to the first electronic device.
  • the first electronic device obtains the third data that satisfies the data query condition in the local data, and determines the first information of the third data, including: the first electronic device queries The third data that satisfies the data query condition among the local data stored in the first storage space. After caching the third data into the second storage space, the first electronic device determines the first information of the third data.
  • the first storage space is, for example, a disk
  • the second storage space is, for example, a shared memory.
  • the data reading and writing speed in the shared memory is faster.
  • the application process can directly obtain the data of the first interface in the shared memory, improving data reading and writing. speed, thereby improving interface display efficiency.
  • the first electronic device in response to the received first data, displays the first interface, including: the first electronic device updates the first interface through the received first data. The third data in the second storage space. The first electronic device displays the first interface according to the updated data in the second storage space.
  • the first electronic device after receiving the first data, updates the data corresponding to the first interface that has been stored in the shared memory according to the first data. Afterwards, the first electronic device can display the first interface according to the updated data in the shared memory.
  • the method further includes: the first electronic device updates local data according to the first data.
  • the first electronic device after receiving the first data, updates the stored data of the first application in the disk according to the first data. In this way, the first electronic device can subsequently obtain the updated data of the first application from the disk in response to the user's instruction to display the interface of the first application.
  • the second aspect is to provide a data synchronization method.
  • the method includes: the second electronic device receives a first data request sent by the first electronic device, where the first data request is a first interface determined by the first electronic device in response to the user's first operation for obtaining a first operation indication display.
  • the first interface corresponds to the first application in the second electronic device.
  • the second electronic device determines the first data according to the first data request.
  • the second electronic device sends first data to the first electronic device, and the first data is used by the first electronic device to display the first interface.
  • the second electronic device receives a second data request sent by the first electronic device.
  • the second data request is the data determined by the first electronic device in response to the user's second operation to obtain the second interface displayed by the second operation indication.
  • the second interface corresponds to the first application.
  • the second electronic device determines second data according to the second data request, and the second data is different from the first data.
  • the second electronic device sends second data to the first electronic device, and the second data is used by the first electronic device to display the second interface.
  • the second electronic device determines the first data according to the first data request, including: the second electronic device obtains the data query condition carried in the first data request and determines the first data that satisfies the data query condition.
  • the second electronic device determines the first data according to the first data request, including: the second electronic device obtains the data query condition carried in the first data request and The first information is the information of the third data in the first electronic device that meets the data query conditions determined by the first electronic device.
  • the first information includes one or more of the following information of the third data: row information, column information information, water level information.
  • the second electronic device determines fourth data that satisfies the data query condition.
  • the second electronic device determines the first data in the fourth data that needs to be synchronized based on the first information.
  • the second electronic device determines the first data in the fourth data that needs to be synchronized based on the first information, including: the second electronic device determines based on the first information
  • the fourth data includes the first row of data that is not included in the third data, and the first row of data is determined to be the first data.
  • the second electronic device determines, based on the first information, the second row of data in the fourth data whose water level is higher than the third data, and determines the second row of data as the first data.
  • the second electronic device determines the first column of data based on the first information, and the first column of data is the column data of the third row of data with the same water level in the fourth data and the third data, and the third data does not include the column data, Determine the first column of data as the first data.
  • a third aspect provides an electronic device.
  • the electronic device includes: a processor, a display screen and a memory.
  • the memory and the display screen are coupled to the processor.
  • the memory is used to store computer program codes.
  • the computer program codes include computer instructions.
  • the electronic device Device execution: In response to the user's first operation, the first electronic device sends a first data request to the second electronic device.
  • the first data request is used to request data required by the first interface displayed by the first operation instruction.
  • the first The interface corresponds to the first application in the second electronic device.
  • the first electronic device receives the first data sent by the second electronic device, and the first data is data determined by the second electronic device in response to the first data request.
  • the first electronic device displays a first interface.
  • the first electronic device sends a second data request to the second electronic device.
  • the second data request is used to request data required by the second interface displayed by the second operation indication.
  • the second interface corresponds to First application.
  • the first electronic device receives second data sent by the second electronic device.
  • the second data is data determined by the second electronic device in response to the second data request, and the second data is different from the first data.
  • the first electronic device displays a second interface.
  • the first electronic device in response to the user's first operation, sends a first data request to the second electronic device, including: in response to the first operation, the first electronic device determines a data query condition, and the data query condition is used to Query the data required to display the first interface.
  • the first electronic device sends a first data request to the second electronic device, and the first data request carries data query conditions.
  • the method further includes: the first electronic device obtains the third data that satisfies the data query condition in the local data, and determines the first information of the third data;
  • the request also carries first information, and the first information includes one or more of the following information of the third data: row information, column information, and water level information.
  • the first electronic device obtains the third data that satisfies the data query condition in the local data, and determines the first information of the third data, including: the first electronic device queries The third data that satisfies the data query condition among the local data stored in the first storage space. After caching the third data into the second storage space, the first electronic device determines the first information of the third data.
  • the first electronic device in response to the received first data, displays the first interface, including: the first electronic device updates the first interface through the received first data.
  • the third data in the second storage space.
  • the first electronic device displays the first interface according to the updated data in the second storage space.
  • the processor when the processor reads the computer-readable instructions from the memory, it also causes the electronic device to perform the following operations: the first electronic device updates the local data according to the first data. .
  • a fourth aspect provides an electronic device.
  • the electronic device includes: a processor and a memory.
  • the memory is coupled to the processor.
  • the memory is used to store computer program codes.
  • the computer program codes include computer instructions.
  • the processor reads the computer instructions from the memory
  • the electronic device executes: the second electronic device.
  • the device receives a first data request sent by the first electronic device, where the first data request is a request determined by the first electronic device in response to the user's first operation to obtain data required for the first interface displayed by the first operation instruction,
  • the first interface corresponds to the first application in the second electronic device.
  • the second electronic device determines the first data according to the first data request.
  • the second electronic device sends first data to the first electronic device, and the first data is used by the first electronic device to display the first interface.
  • the second electronic device receives a second data request sent by the first electronic device.
  • the second data request is the data determined by the first electronic device in response to the user's second operation to obtain the second interface displayed by the second operation indication.
  • request the second interface corresponds to the first application.
  • the second electronic device determines second data according to the second data request, and the second data is different from the first data.
  • the second electronic device sends second data to the first electronic device, and the second data is used by the first electronic device to display the second interface.
  • the second electronic device determines the first data according to the first data request, including: the second electronic device obtains the data query condition carried in the first data request and determines the first data that satisfies the data query condition.
  • the second electronic device determines the first data according to the first data request, including: the second electronic device obtains the data query condition carried in the first data request and The first information is the information of the third data in the first electronic device that meets the data query conditions determined by the first electronic device.
  • the first information includes one or more of the following information of the third data: row information, column information information, water level information.
  • the second electronic device determines fourth data that satisfies the data query condition.
  • the second electronic device determines the first data in the fourth data that needs to be synchronized based on the first information.
  • the second electronic device determines based on the first information
  • the first data that needs to be synchronized in the fourth data includes: the second electronic device determines, based on the first information, that the fourth data includes the first row of data that is not included in the third data, and determines that the first row of data is the first data. And/or, the second electronic device determines, based on the first information, the second row of data in the fourth data whose water level is higher than the third data, and determines the second row of data as the first data.
  • the second electronic device determines the first column of data based on the first information, and the first column of data is the column data of the third row of data with the same water level in the fourth data and the third data, and the third data does not include the column data, Determine the first column of data as the first data.
  • a data synchronization system which includes: a first electronic device and a second electronic device.
  • the first electronic device is used to send a first data request to the second electronic device in response to the user's first operation, and the first data request is used to request data required by the first interface displayed by the first operation instruction;
  • An interface corresponds to the first application in the second electronic device.
  • the second electronic device is configured to send the first data to the first electronic device in response to the first data request.
  • the first electronic device is also configured to display the first interface in response to the received first data.
  • the first electronic device is further configured to send a second data request to the second electronic device in response to the user's second operation.
  • the second data request is used to request data required by the second interface displayed by the second operation indication.
  • the interface corresponds to the first application.
  • the second electronic device is configured to send second data to the first electronic device in response to the second data request, where the second data is different from the first data.
  • the first electronic device is also configured to display a second interface in response to the received second data.
  • the first electronic device is configured to determine data query conditions in response to the first operation, the data query conditions are used to query data required to display the first interface, and the data request carries the data query conditions.
  • the first electronic device is also used to obtain the third data that meets the data query condition in the local data, and determine the first information of the third data; the first data
  • the request also carries first information, and the first information includes one or more of the following information of the third data: row information, column information, and water level information.
  • the second electronic device is used to determine fourth data that meets the data query condition.
  • the second electronic device is configured to determine the first data in the fourth data that needs to be synchronized based on the first information.
  • the first data is different from the third data, or part of the first data corresponds to the updated third data.
  • embodiments of the present application provide an electronic device that has the function of implementing the data synchronization method described in the first aspect and any of the possible implementations; or, the electronic device has the function of implementing The functions of the data synchronization method described in the above second aspect and any possible implementation manner thereof.
  • This function can be implemented by hardware, or can be implemented by hardware and corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • a computer-readable storage medium stores a computer program (which may also be referred to as instructions or codes).
  • the computer program When the computer program is executed by an electronic device, it causes the electronic device to perform the method of the first aspect or any one of the embodiments of the first aspect; or , causing the electronic device to perform the second aspect or the method of any one of the implementation modes of the second aspect.
  • embodiments of the present application provide a computer program product.
  • the computer program product When the computer program product is run on an electronic device, it causes the electronic device to execute the method of the first aspect or any one of the embodiments in the first aspect; or, causes the electronic device to execute The device performs the second aspect or the method of any one of the implementation modes of the second aspect.
  • inventions of the present application provide a circuit system.
  • the circuit system includes a processing circuit.
  • the processing circuit is configured to execute the method of the first aspect or any one of the implementation modes of the first aspect; or, the processing circuit is configured to execute The method of the second aspect or any one of the second aspects.
  • embodiments of the present application provide a chip system, including at least one processor and at least one interface circuit.
  • the at least one interface circuit is used to perform transceiver functions and send instructions to at least one processor.
  • at least one processor When at least one processor When executing instructions, at least one processor performs the first aspect or the method of any one implementation of the first aspect; or, at least one processor performs the second aspect or the method of any one implementation of the second aspect.
  • Figure 1 is a schematic diagram 1 of the interface provided by the embodiment of this application.
  • Figure 2 is a schematic diagram of a communication system in which a data synchronization method provided by an embodiment of the present application is applied;
  • Figure 3A is a schematic diagram of the hardware structure of a first electronic device or a second electronic device provided by an embodiment of the present application;
  • Figure 3B is a schematic software structure block diagram of the first electronic device or the second electronic device according to the embodiment of the present application.
  • Figure 4 is a second schematic diagram of the interface provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram three of the interface provided by the embodiment of this application.
  • Figure 6 is a schematic flowchart 1 of the data synchronization method provided by the embodiment of the present application.
  • Figure 7 is a schematic flowchart 2 of the data synchronization method provided by the embodiment of the present application.
  • Figure 8 is a schematic flowchart three of the data synchronization method provided by the embodiment of the present application.
  • Figure 9A is a schematic diagram of a data synchronization scenario provided by an embodiment of the present application.
  • Figure 9B is a schematic diagram 2 of the data synchronization scenario provided by the embodiment of the present application.
  • Figure 10 is a schematic flowchart 4 of the data synchronization method provided by the embodiment of the present application.
  • Figure 11 is a schematic structural diagram of a first electronic device provided by an embodiment of the present application.
  • Figure 12 is a schematic structural diagram of a second electronic device provided by an embodiment of the present application.
  • distributed communication connections can be established between different electronic devices to achieve cross-device data access.
  • cross-device data access data synchronization between different electronic devices is achieved.
  • a screen projection connection is established between the first electronic device and the second electronic device.
  • the first electronic device can receive the screen projection data sent by the second electronic device through the screen projection connection, and the screen projection data is the data of the application in the second electronic device.
  • the first electronic device displays the corresponding application interface according to the screen projection data. In this way, the first electronic device can achieve cross-device access to data of the second electronic device.
  • the application list of the second electronic device can be obtained. Afterwards, the first electronic device can display the corresponding application icon according to the application list. In response to the user's operation on the application icon, first The electronic device may request the second electronic device to obtain the application data corresponding to the application icon, thereby achieving cross-device access to the data in the second electronic device.
  • the mobile phone establishes a communication connection with the tablet, and in response to the user operation, the mobile phone displays the interface of the memo application in the tablet. As shown in Figure 1, the mobile phone displays the home page interface 101 in the memo application. In response to the user's sliding downward operation in the direction indicated by arrow 11, the mobile phone may slide to display the corresponding memo interface. Alternatively, in response to the user's operation of clicking the control 12, the mobile phone may display the memo interface corresponding to the memo content 3.
  • the mobile phone After the mobile phone first detects the user's instruction to display the memo application in the tablet, it will request the tablet to obtain the full data of the memo application, and then synchronize the full data to the local computer. , and then perform local data query.
  • the mobile phone displays the memo icon based on the obtained application list of the tablet.
  • the mobile phone requests the tablet to obtain the full data of the memo application.
  • the mobile phone filters the interface data required for the home page of the memo application that needs to be displayed from the full amount of data of the memo application obtained, and displays the memo home page based on the interface data.
  • the data synchronized in a single time by the electronic device is the entire data of the application or service, while the data used in response to user operation instructions only accounts for a smaller proportion of the total data.
  • the proportion of invalid data is relatively high, causing loss of performance and power consumption of electronic equipment.
  • the electronic device In addition, in the process of cross-device data access by electronic devices, it is necessary to first store all the obtained data of the application or service into the disk through the input/output (I/O) interface, and then filter out the required data from the disk. data, and output the filtered data through the I/O interface.
  • the electronic device requires at least one write I/O interface operation and one read I/O interface operation of the disk.
  • the disk data reading and writing speed is slow, causing a loss in the performance of the electronic device.
  • embodiments of the present application provide a data synchronization method.
  • a first electronic device can respond to a user operation and request the second electronic device to obtain a user operation indication display.
  • the data required for the interface In this way, the first electronic device and the second electronic device only need to transmit part of the data of the application or service required to display the interface. This reduces the transmission of invalid data, reduces the amount of data required for data synchronization, improves data synchronization efficiency, and reduces power consumption.
  • FIG. 2 is a schematic diagram of a communication system in which the data synchronization method provided by the embodiment of the present application is applied. As shown in FIG. 2 , the communication system includes a first electronic device 100 and a second electronic device 200 .
  • the first electronic device 100 is a sink device
  • the second electronic device 200 is a source device.
  • the first electronic device 100 accesses application or service data in the second electronic device 200 across devices and synchronizes the required application data. or service data.
  • the first electronic device 100 accesses the second electronic device 200 across devices and performs data synchronization as needed.
  • the first electronic device 100 displays the interface displayed by the user's operation instruction according to the synchronized data.
  • the first electronic device 100 or the second electronic device 200 may be, for example, a mobile phone, a tablet computer, a notebook computer, a large-screen device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant ( Personal digital assistant (PDA), wearable devices, artificial intelligence (AI) devices and other terminal devices
  • the operating systems installed on the first electronic device 100 or the second electronic device 200 include but are not limited to or other operating systems. This application does not limit the specific type of the first electronic device 100 or the second electronic device 200 or the operating system installed.
  • a wireless communication connection or a wired communication connection (such as a network cable connection, etc.) is established between the first electronic device 100 and the second electronic device 200 .
  • the wireless communication technology for establishing a wireless communication connection includes but is not limited to at least one of the following: Bluetooth (bluetooth, BT) (for example, traditional Bluetooth or low-power (bluetooth low energy, BLE) Bluetooth), wireless local area network (wireless local area network) area networks, WLAN) (such as wireless fidelity (Wi-Fi) network), near field communication (NFC), Zigbee, frequency modulation (FM), infrared , IR), ultra wide band (UWB) technology, etc.
  • the first electronic device 100 and the second electronic device 200 can also establish a communication connection through a third-party device in the local area network, such as a router, gateway, smart device controller, server, wireless access point ( access point, AP) equipment, etc.
  • a third-party device such as a router, gateway, smart device controller, server, wireless access point ( access point, AP) equipment, etc.
  • both the first electronic device 100 and the second electronic device 200 support the proximity discovery function.
  • the first electronic device 100 and the second electronic device 200 can discover each other, and then establish a peer-to-peer (P2P) connection such as Wi-Fi. and/or wireless communication connections such as Bluetooth connections.
  • P2P peer-to-peer
  • wireless communication connections such as Bluetooth connections.
  • the first electronic device 100 may access the data of the second electronic device 200 through the wireless communication connection in response to the user operation.
  • the first electronic device 100 and the second electronic device 200 establish a wireless communication connection through a local area network.
  • the first electronic device 100 and the second electronic device 200 are both connected to the same router.
  • the first electronic device 100 and the second electronic device 200 establish a wireless communication connection through a cellular network, the Internet, etc.
  • the second electronic device 200 accesses the Internet through a router, and the first electronic device 100 accesses the Internet through a cellular network; then, the first electronic device 100 and the second electronic device 200 establish a wireless communication connection.
  • FIG. 3A shows a schematic structural diagram of the first electronic device 100 or the second electronic device 200 .
  • the first electronic device 100 or the second electronic device 200 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, and a power management module 141.
  • Battery 142 antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, sensor module 180, button 190, motor 191, peripheral module 192, camera 193, display screen 194, and user identification module ( subscriber identification module, SIM card interface 195, etc.
  • first electronic device 100 or the second electronic device 200 may include more or less components than shown in the figures, or combine some components, or separate some components, or different components. layout.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • the first electronic device 100 when the first electronic device 100 is a PC, the first electronic device 100 may not include the mobile communication module 150 and the SIM card interface 195 .
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • the USB interface 130 is an interface that complies with the USB standard specification, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
  • the USB interface 130 can be used to connect a charger to charge the first electronic device 100 or the second electronic device 200, and can also be used to transmit data between the first electronic device 100 or the second electronic device 200 and peripheral devices. It can also be used to connect headphones to play audio through them.
  • This interface can also be used to connect other electronic devices, such as AR devices, etc.
  • the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic explanation and does not constitute a structural limitation on the first electronic device 100 or the second electronic device 200 .
  • the first electronic device 100 or the second electronic device 200 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also provide power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, and the like.
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the first electronic device 100 or the second electronic device 200 can be configured through the antenna 1, the antenna 2, and the mobile communication mode.
  • Block 150, wireless communication module 160, modem processor and baseband processor are implemented.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the first electronic device 100 or the second electronic device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
  • the mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G applied on the first electronic device 100 or the second electronic device 200 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be disposed in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the wireless communication module 160 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth ( bluetooth, BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communications solution.
  • WLAN wireless local area networks
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the first electronic device 100 or the second electronic device 200 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the first electronic device 100 or the second electronic device 200 can pass Wireless communications technology communicates with networks and other devices.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • CDMA code division multiple access
  • WCDMA wideband code division multiple access
  • WCDMA wideband code division multiple access
  • TD-SCDMA time division code division multiple access
  • long term evolution long term evolution
  • LTE long term evolution
  • BT
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi) -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the first electronic device 100 or the second electronic device 200 implements the display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is an image processing microprocessor and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the display screen 194 is used to display images, videos, etc.
  • Display 194 includes a display panel.
  • the display panel can use a liquid crystal display (LCD), such as an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix active matrix organic light emitting diode
  • AMOLED organic light emitting diodes
  • FLED flexible light-emitting diodes
  • Mini-led Micro-led
  • Micro-oled quantum dot light emitting diodes
  • QLED quantum dot light emitting diodes
  • the first electronic device 100 or the second electronic device 200 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the first electronic device 100 responds to the user's instruction to display the first application interface and sends the data query condition and the local data snapshot to the second electronic device 200 .
  • the second electronic device 200 determines the data that is not stored in the first electronic device 100 among the data corresponding to the data query condition according to the data query condition and the local data snapshot, and sends the data to the first electronic device 100 .
  • the first electronic device 100 may display the first application interface indicated by the user on the display screen 194 based on the acquired data and the locally stored data.
  • the indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
  • Camera 193 is used to capture still images or video.
  • the object passes through the lens to produce an optical image that is projected onto the photosensitive element.
  • the photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other format image signals.
  • the first electronic device 100 or the second electronic device 200 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the first electronic device 100 or the second electronic device 200 .
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the internal memory 121 may include a program storage area and a data storage area.
  • the stored program area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.).
  • the storage data area may store data created during use of the first electronic device 100 or the second electronic device 200 (such as audio data, phone book, etc.).
  • the internal memory 121 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.
  • the processor 110 executes various functional applications and data processing of the first electronic device 100 or the second electronic device 200 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the internal storage 121 includes a disk and memory. Among them, since the read and write speed of the memory is much higher than the read and write speed of the disk, the system will first cache the data that is read and written frequently into the memory to achieve high speed.
  • the first electronic device 100 after determining the data query conditions for cross-device access data, the first electronic device 100 writes the data filtered out from the disk into the shared memory according to the data query conditions, and determines the first information of the data. Afterwards, the first electronic device 100 sends the data filtering conditions and the first information to the second electronic device 200 through the mobile communication module 150 or the wireless communication module 160 to obtain synchronization data not stored in the disk. The first electronic device 100 writes the obtained synchronization data into the shared memory, so that subsequent application or service processes can directly read the required data from the shared memory, thereby effectively increasing the reading and writing speed and reducing the number of disk data reading and writing times. , improve the efficiency of cross-device data access.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 . The first electronic device 100 or the second electronic device 200 can play music, record, etc. through the audio module 170 .
  • the audio module 170 may include a speaker, a receiver, a microphone, a headphone interface, and an application processor to implement audio functions.
  • the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
  • Touch sensor also known as "touch device”.
  • the touch sensor can be disposed on the display screen 194, and the touch sensor and the display screen 194 form a touch screen, which is also called a "touch screen”. Touch sensors are used to detect touches on or near them.
  • the touch sensor can pass the detected touch operation to the application processor to determine the touch event type.
  • Visual output related to the touch operation may be provided through display screen 194 .
  • the touch sensor may also be disposed on the surface of the first electronic device 100 or the second electronic device 200 at a location different from that of the display screen 194 .
  • the buttons 190 include a power button, a volume button, etc.
  • Key 190 may be a mechanical key. It can also be a touch button.
  • the first electronic device 100 or the second electronic device 200 may receive key input and generate key signal input related to user settings and function control of the first electronic device 100 or the second electronic device 200 .
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be connected to or separated from the first electronic device 100 or the second electronic device 200 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the first electronic device 100 or the second electronic device 200 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the software system of the first electronic device 100 or the second electronic device 200 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of this application takes the Android system with a layered architecture as an example to illustrate the first Software structure of the electronic device 100 or the second electronic device 200 .
  • FIG. 3B is a software structure block diagram of the first electronic device 100 or the second electronic device 200 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
  • the layers communicate through software interfaces.
  • the Android system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime and system libraries, and kernel layer.
  • the application layer can include a series of application packages.
  • the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the first application is installed in the second electronic device 200 .
  • the first electronic device 100 can obtain the application program information of the second electronic device 200 through the communication connection with the second electronic device 200, thereby determining that the second electronic device 200 has the first application installed.
  • the first electronic device 100 may display the application icon of the application in the second electronic device 200 according to the obtained application information.
  • the first electronic device 100 requests the second electronic device 200 to obtain the data of the first application, thereby achieving cross-device access to the data of the first application.
  • the data of the first application requested by the first electronic device 100 includes data of the interface displayed when the user clicks on the application icon of the first application, such as homepage data of the first application.
  • the first application may or may not be installed in the first electronic device 100 .
  • the application framework layer provides an application programming interface (API) and programming framework for applications in the application layer.
  • API application programming interface
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
  • a window manager is used to manage window programs.
  • the window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • Content providers are used to store and retrieve data and make this data accessible to applications.
  • Said data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, etc.
  • a view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • the display interface of a memo application may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide communication functions of the first electronic device 100 or the second electronic device 200 .
  • call status management including connected, hung up, etc.
  • the resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
  • the notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
  • Android runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library contains two parts: one is the functional functions that need to be called by the Java language, and the other is the core library of Android.
  • the application layer and application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application layer and application framework layer into binary files.
  • the virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
  • System libraries can include multiple functional modules. For example: surface manager (surface manager), media libraries (Media Libraries), three-dimensional graphics processing libraries (for example: OpenGL ES), two-dimensional graphics engines (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, composition, and layer processing.
  • 2D Graphics Engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the following takes the first electronic device 100 as the first electronic device, the second electronic device 200 as the second electronic device, and the cross-device access of data of the second electronic device 200 by the first electronic device 100 as an example.
  • the data provided in the embodiment of the present application Synchronization method is explained.
  • a communication connection is established between the first electronic device and the second electronic device.
  • the first electronic device can access data in the second electronic device across devices through the communication connection, thereby realizing the first electronic device 100 and the second electronic device. Data synchronization between two electronic devices 200.
  • the communication connection between the first electronic device and the second electronic device is, for example, a multi-screen collaborative connection to meet the user's need to use the functions of the second electronic device through the first electronic device.
  • a multi-screen collaborative application is installed in the first electronic device and the second electronic device, and then a multi-screen collaborative connection between the first electronic device and the second electronic device can be established through the multi-screen collaborative application.
  • the first electronic device (such as the receiving device) can synchronize the application data in the second electronic device (such as the source device), and display the second electronic device according to the obtained application data.
  • the application interface in the electronic device allows the user to use the application of the second electronic device on the first electronic device.
  • the first electronic device after the first electronic device establishes a communication connection with the second electronic device, it can obtain the application list information of the second electronic device, and display the corresponding application icon according to the application list information. Afterwards, the first electronic device may send an application startup request to the second electronic device in response to the user's operation on the application icon. In response to the received application startup request, the second electronic device starts the corresponding application in the background and sends the corresponding application data to the first electronic device. Then the first electronic device can display the application interface according to the obtained application data. This enables the application in the second electronic device to be launched through screen projection without affecting the operation of the second electronic device. In this way, even if the first electronic device does not install the application of the second electronic device, it can determine that the second electronic device has the application installed according to the application list information, thereby enabling the first electronic device to display the application interface for the user to use.
  • the first electronic device needs to obtain the application data in the second electronic device, so as to realize the display of the interface of the application in the second electronic device.
  • the first electronic device can request the second electronic device to obtain data for displaying the interface to be displayed after detecting the user's instruction to display the application interface, thereby reducing the amount of data transmission. .
  • a mobile phone (such as a first electronic device) establishes a communication connection with a tablet (such as a second electronic device).
  • the user uses the mobile phone to use the memo application (such as the first application) in the tablet.
  • the mobile phone needs to synchronize the memo data in the tablet.
  • interface 401 in (a) of Figure 4 when the mobile phone displays the homepage of the memo application in the tablet, it detects the user's click on the control 41 and determines that the user has instructed to open the memo content 3. Then, the mobile phone can determine that the interface to be displayed is the interface of memo content 3, and can request data for displaying the interface from the tablet.
  • the mobile phone in response to the user operation, the mobile phone generates data query conditions corresponding to the data required to query the interface corresponding to the memo content 3, and sends the data query conditions to the tablet. Then, the tablet can determine the corresponding data based on the received data query conditions and send the data to the mobile phone. As shown in (b) of Figure 4, after receiving the data sent by the tablet, the mobile phone can display the interface 402 corresponding to the memo content 3.
  • the data transmitted between the first electronic device and the second electronic device is data used by the first electronic device to display the interface to be displayed, and is no longer the full data of the application. Effectively reduce the amount of data transmission and reduce the power consumption of electronic equipment.
  • the data corresponding to the interface displayed according to the user operation instruction may include data used to display the interface to be displayed and data used to display the interface associated with the interface to be displayed.
  • the memo content 3 includes a lot of content, and the mobile phone may not be able to display all the contents included in the memo content 3 on one interface.
  • the mobile phone in response to the user's sliding operation (i.e. page turning operation) on the display screen in the direction indicated by arrow 43 , the mobile phone can display the interface as shown in (c) of Figure 4 403.
  • the mobile phone can display the remaining content in the memo content 3 on the interface 403.
  • the mobile phone can obtain data corresponding to all the contents included in the memo content 3. Afterwards, the mobile phone can display the interface 402 based on the obtained data sent by the second electronic device according to information such as the size of the display screen. If the mobile phone later detects the user's page turning operation on the interface 402, it can directly According to the data, the interface 403 is displayed.
  • the mobile phone may request the tablet to obtain data for displaying the interface 402. If the mobile phone subsequently detects the user's page turning operation on the interface 402, the mobile phone can then request data from the tablet for displaying the interface 403.
  • the data required for the interface determined by the first electronic device in response to the user operation includes all data corresponding to the interface indicated by the user operation.
  • data for displaying the interface currently to be displayed may also be included.
  • Data for displaying an interface associated with the interface currently to be displayed may be included.
  • the first electronic device may locally store the data of the application, and the data can be used during this data synchronization process. No need to resync again. Then, the first electronic device can generate a local data snapshot. After that, the first electronic device can send the data query conditions and the local data snapshot to the second electronic device. The second electronic device can filter the data corresponding to the application interface to be displayed by the first electronic device based on the data query conditions and the local data snapshot. The unstored data is synchronized to the first electronic device. This can reduce the number of single data transmissions, improve synchronization efficiency, and reduce power consumption on the basis of data synchronization.
  • the mobile phone in response to the user's operation of clicking the control 41 on the interface 401, acquires the tablet (ie the second electronic device)
  • the data sent only includes data for displaying the interface 402 as shown in (b) of Figure 4 (that is, the content corresponding to the current memo content 3 only includes the display content of the interface 402).
  • the mobile phone sends a data request carrying the local data snapshot corresponding to the interface 402 to the tablet. Then, the tablet can send the newly added memo data in the memo content 3 to the mobile phone based on the obtained local data snapshot, without having to repeatedly send the existing data in the first electronic device.
  • cross-device access to application data in the process of cross-device data access between the first electronic device and the second electronic device, not only cross-device access to application data as described above can be achieved, but also cross-device access to service data, etc. can be achieved, which satisfies Data synchronization requirements between the first electronic device and the second electronic device.
  • application data accessed across devices includes, for example, application display data, audio data and other types of data.
  • the first electronic device accesses the memo application in the second electronic device across devices, and synchronizes the interface display data of the memo application to display the memo application interface in the second electronic device.
  • the first electronic device accesses the music application in the second electronic device across devices, synchronizes the interface display data and audio data of the music application to display the music application interface in the second electronic device, and plays the music.
  • the first electronic device cross-device accesses the task manager service, installation package management service and other services in the second electronic device to synchronize service data between the first electronic device and the second electronic device.
  • the mobile phone is still used as the receiving device, the tablet is used as the source device, and the mobile phone displays the application in the tablet (such as a memo application).
  • the mobile phone determines that the user has instructed to display the multi-tasking interface.
  • the multi-tasking interface cards corresponding to multiple started applications (tasks) are displayed in a cascading, stacked or side-by-side arrangement.
  • the cards displayed on the multi-tasking interface of the mobile phone may include cards corresponding to the applications in the tablet.
  • the task manager service not only needs to determine the applications that have been started in the mobile phone, but also needs to synchronize with the task manager service in the tablet to determine the applications in the tablet used by the mobile phone. .
  • the mobile phone can obtain the display interface content corresponding to this part of the tablet application before the mobile phone detects the user's instruction to display the multi-tasking interface to generate the corresponding card.
  • the mobile phone may display the multi-tasking interface 502 as shown in (b) of Figure 5 . In the multi-tasking interface 502, as indicated by reference numeral 52, a card corresponding to the memo application in the tablet used by the mobile phone is displayed.
  • the data transmitted is the data used by the first electronic device to display the interface to be displayed, which is also not the full amount of the service or application. data. Effectively reduce the amount of data transmission and reduce the power consumption of electronic equipment.
  • cross-device access of the first electronic device to the application in the second electronic device is used to mean that the first electronic device cross-device accesses the application in the second electronic device.
  • the device accesses application data of the application in the second electronic device.
  • the application may be installed in the first electronic device, or the application may not be installed.
  • FIG. 6 is a schematic flowchart of a data synchronization method provided by an embodiment of the present application. As shown in Figure 6, the method includes the following steps.
  • the first electronic device sends a data request to the second electronic device.
  • the user operation is, for example, a user's operation on the first application
  • the first application is an application in the second electronic device.
  • User operations include, for example, an operation of starting the first application (such as an operation on the first application icon, an operation of starting the first application with voice, etc.), an operation of clicking a preset control on the first application interface (such as an operation to instruct the display of the first application) The operation of the function page of the application, etc.), the gesture operation on the display screen of the first electronic device, etc.
  • a communication connection is established between the first electronic device and the second electronic device, and the first electronic device accesses the first application in the second electronic device across devices.
  • the first electronic device determines that the first application is an application in the second electronic device that is accessed across devices. Therefore, the first electronic device sends a data request to the second electronic device for requesting to obtain data in the first application.
  • the first electronic device may request the second electronic device to obtain data in the first application data used to display an interface for displaying user operation instructions.
  • step S601 includes step S601a and step S601b.
  • the first electronic device determines data query conditions.
  • the first electronic device in response to the user's operation on the first application, may determine a data query condition corresponding to the data required to display the interface indicated by the operation, and obtain the corresponding data through the data query condition.
  • the database (such as disk, memory, etc.) of the first electronic device can be a relational database and other types of databases.
  • the data in the database can be stored in various ways such as structured query language (SQL).
  • SQL structured query language
  • a relational database data is stored in correspondence between rows and columns.
  • one data record corresponds to one row of data
  • different fields in one data record correspond to different columns of the row of data.
  • Each update of a data record corresponds to a timestamp, and the order of timestamps between corresponding data records is compared by comparing the water level.
  • the data query conditions may include one or more of the application name, row information, column information, water level information, etc. corresponding to the data to be queried.
  • a data record includes an identification (ID) field, a title field, a modification time field, a classification field, and a content field.
  • Electronic devices can obtain corresponding data records through the ID field.
  • the data query conditions include the ID of the data record.
  • the interface 401 shown in (a) in Figure 4 is the process of the mobile phone (first electronic device) displaying the home page of the memo application in the tablet (second electronic device). , it is detected that the user clicks on the control 41, and it is determined that the user instructs to open the memo content 3. Then, the mobile phone can determine that the interface to be displayed is the interface corresponding to the memo content 3, and then determine the data query conditions corresponding to the data required to display the interface.
  • the window selected by the thick solid line is the data window corresponding to the display data of the memo application homepage.
  • the corresponding display data needs to be queried through the data query conditions corresponding to the data window.
  • 001-006 The corresponding data are data in the database respectively used to display memo content 1 - memo content 6 shown in the interface 401 .
  • the mobile phone can determine that the data query conditions include querying the display data corresponding to the data window selected by the double solid line in Table 1 above.
  • the data query conditions include the rows, columns, water level information of the data window, etc., and are used to query the data of the content fields in the data record with ID 003.
  • the first electronic device sends a data request to the second electronic device, where the data request carries data query conditions.
  • the first electronic device may send a data request carrying the data query condition to the second electronic device.
  • the second electronic device receives the data request sent by the first electronic device.
  • the first electronic device can respond to the user operation and request the second electronic device to obtain the corresponding first application data.
  • the second electronic device determines target data according to the data request, and the target data is used to display an interface for displaying user operation instructions.
  • the second electronic device after receiving the data request, can obtain the data query conditions carried therein. Afterwards, the second electronic device can determine the application corresponding to the data to be queried by the first electronic device according to the data query condition, and determine the data of the application. Afterwards, the second electronic device can determine the target data in the application data that satisfies the data query condition according to the data query condition.
  • the target data determined by the second electronic device is the data corresponding to the memo content 3.
  • the target data is the data included in the data record with ID 003.
  • the second electronic device sends target data to the first electronic device.
  • the second electronic device after determining the target data, sends the target data to the first electronic device.
  • the first electronic device receives the target data sent by the second electronic device.
  • the first electronic device displays an interface displayed by the user's operation instructions according to the target data.
  • the first electronic device may display an interface displayed according to the user operation instruction according to the target data.
  • the first electronic device can cache the target data in the memory.
  • the data reading and writing speed in the memory is faster, which improves the data reading and writing speed, thereby improving the interface display efficiency.
  • the second electronic device may display the interface 402 as shown in (b) of FIG. 4 based on the acquired target data.
  • the first electronic device performs data synchronization on demand during the cross-device data access process according to actual needs, effectively reducing invalid data synchronization during the data synchronization process and improving the energy efficiency ratio during the data synchronization process.
  • the first electronic device synchronizes data on demand. On the basis of ensuring data synchronization, it effectively saves data synchronization power consumption and improves user experience.
  • step S605 may also be included for updating the local storage data.
  • the first electronic device updates locally stored data.
  • the first electronic device may save the received target data.
  • the first electronic device may obtain data of the first application (ie, target data) multiple times. Then, after receiving the target data, the first electronic device can also update the locally stored first application data according to the target data.
  • the locally stored data in the first electronic device includes the display data corresponding to the data window selected by the thick solid line, and the target data sent by the second electronic device received by the first electronic device includes double solid lines. Display data corresponding to the data window selected by the line (i.e. target data). Then, the first electronic device can update the locally stored first application data according to the obtained target data. For example, the first electronic device updates a data record corresponding to the original ID of 003 according to the obtained target data.
  • the first electronic device may save corresponding application data.
  • the first electronic device may also choose not to synchronize part of the saved application data, thereby further reducing the amount of data transmission.
  • FIG. 8 is a schematic flowchart of yet another data synchronization method provided by an embodiment of the present application. As shown in Figure 8, the method includes the following steps.
  • the first electronic device determines data query conditions.
  • step S801 may refer to the relevant content described in the above step S601a, which will not be described again here.
  • the first electronic device determines the first information of the data that satisfies the data query condition in the locally stored data.
  • the first electronic device may have acquired corresponding part of the application data, and then this part of the data will also be stored in the local disk. After determining the data query condition, the first electronic device may first determine the first information of the data in the locally stored data that satisfies the data query condition. In this way, in the process of determining the data that needs to be synchronized, the second electronic device can determine that the repeated data in this part of the data will no longer be synchronized, thereby reducing the amount of data synchronization.
  • the first information includes, for example, row information, column information, water level information, etc. of data that satisfies the data query condition in the local storage data of the first electronic device.
  • the mobile phone ie, the first electronic device
  • the mobile phone has displayed the home page of the memo application, that is, the locally stored data at least includes the memo home page data.
  • the display data corresponding to the data window selected by the thick solid line is stored locally.
  • the mobile phone determines that the interface indicated by the user is the interface corresponding to the memo content 3.
  • the data query condition is the information in the data window selected by the double solid line. Then, it can be determined that the local data snapshot is the first information of the data window at the intersection of the two data windows.
  • the first application data stored locally in the first electronic device is data A
  • the data of the first application in the second electronic device is data B.
  • data B is the latest full amount of data of the first application
  • data B includes data A.
  • part of the data in data A is the first application data before part of the data in data B is updated.
  • the first electronic device determines that the data required to complete the interface displayed by the user operation instruction includes part of the data A stored in the first electronic device, and the data not stored in the first electronic device. Part of the data (this part of data is stored in the second electronic device), that is, the data query conditions are used to query data C and data D.
  • the data A of the first application is already stored in the disk of the first electronic device.
  • the process of the first application starts the data management process of the first electronic device and sends the data query condition to the data management process.
  • the data management process filters out the data C that satisfies the data query conditions from the disk and writes the data C into the shared memory.
  • the data management process in the first electronic device may determine the first information of the data C.
  • the first electronic device sends a data request to the second electronic device, where the data request carries the data query condition and the first information.
  • the first electronic device may send the data query condition and the first information to the second electronic device.
  • Data Request the second electronic device receives the data request sent by the first electronic device.
  • the second electronic device determines differential data that satisfies the data query condition based on the data query condition and the first information.
  • the second electronic device determines the first application corresponding to the data query condition and obtains the data of the first application. Afterwards, the second electronic device queries the data of the first application for data that satisfies the data query condition. Finally, the second electronic device determines the differential data in the queried data based on the first information.
  • the second electronic device determines the display data (differential data) that is not stored by the first electronic device among the display data of the interface to be displayed (data that satisfies the data query condition).
  • the second electronic device packages the determined valid data into differential data by comparing the first information with the information of the queried data.
  • the second electronic device determines that among the data queried by the data query condition, if a certain row of data is not saved by the first electronic device, the second electronic device can determine the row of data as differential data (that is, valid data). .
  • the second electronic device determines that the data queried by the data query condition includes the row of data with ID 003 (that is, including the data record with ID 003), and the first electronic device can be determined based on the first information. This row of data is not saved in . Then, the first electronic device can determine the row of data as differential data.
  • the second electronic device determines based on the first information that among the data retrieved by the data query condition, the first electronic device has saved a certain row of data, but the data level of the row is lower than that of the row of data stored in the second electronic device. water level, the second electronic device can determine the row of data as differential data. As shown in Table 1 above, the second electronic device determines that the data queried by the data query condition includes the row of data with ID 003, and based on the first information, it can be determined that the row of data has been saved in the first electronic device. However, based on the first information, the second electronic device determines that the level of the row of data ID 003 stored in the first electronic device is lower than the level maintained by the second electronic device.
  • the memo data corresponding to memo content 3 stored in the first electronic device includes display data for the display interface 402
  • the memo data corresponding to memo content 3 stored in the second electronic device includes The memo data includes display data for displaying the interface 402 and the interface 403 (that is, including the memo data corresponding to the newly added reference numeral 44).
  • the water level of the memo data corresponding to memo content 3 stored in the second electronic device is higher than the water level of the memo data corresponding to memo content 3 stored in the first electronic device.
  • the memo data of 3 is the updated memo data.
  • the second electronic device determines the data query condition according to the first information. Among the data queried, the first electronic device has saved a certain row of data, and the water level of the row of data is the same, but the columns are different. The second electronic device can query the data. The data of the new column in the row of data is determined to be valid data. As shown in Table 1 above, the second electronic device determines that the data queried by the data query condition includes the row of data with ID 003, and based on the first information, it can be determined that the row of data with the same water level has been saved in the first electronic device.
  • the second electronic device determines that the column data corresponding to the "content” field in the row of data with ID 003 is not stored in the first electronic device. Then, the second electronic device can determine the column data corresponding to the "content” field in the row of data with ID 003 as valid data.
  • the second electronic device may determine data in other scenarios not included in the foregoing example scenarios as invalid data and does not need to be packaged in differential data.
  • the differential data can be empty, that is, there is no need to transmit synchronization data between the first electronic device and the second electronic device this time.
  • the first electronic device can determine the data that satisfies the data query conditions in the locally stored data and display the application interface to be displayed.
  • the first electronic device locally stores display data corresponding to the data window selected by the thick solid line, and the data query condition is the information of the data window selected by the double solid line.
  • the first information is the information of the intersection data window between the data window selected by the thick solid line and the data window selected by the double solid line.
  • the second electronic device can determine that the differential data is the content data corresponding to the "content" data window in the data window selected by the double solid line. That is, the differential data is determined through the sliding window method.
  • the data management process in the first electronic device determines that the data in data A that satisfies the data query condition is data C. Then, the data management process in the first electronic device sends the data query condition and the first information of the data C to the second electronic device.
  • the data management process in the second electronic device may determine according to the data query condition that the data corresponding to the application that the user operation indicates cross-device access is data B in the disk, and determine that the data that satisfies the data query condition includes data C and data in data B. D.
  • the data management process in the second electronic device caches data C and data D into the shared memory. After that, as shown in (b) of Figure 9B, the data management process in the second electronic device can determine the differential data as data D based on the first information of the data C, and the data D is the data to be synchronized by the first electronic device. data.
  • the data C stored in the first electronic device is the latest data
  • the data queried by the second electronic device is divided into data C and data D. , explaining the data synchronization process during cross-device data access.
  • the data queried by the second electronic device according to the data query conditions may include part of the data in the first electronic device, or may also include part of the data corresponding to the first electronic device.
  • updated data for example, data B includes updated data of data C in the first electronic device).
  • the second electronic device sends differential data to the first electronic device.
  • the second electronic device after determining the differential data, sends the differential data to the first electronic device.
  • the first electronic device receives the differential data sent by the second electronic device.
  • the first electronic device displays an interface for displaying user operation instructions based on the differential data and locally stored data.
  • the first electronic device determines the display data of the first application interface to be displayed based on the differential data and the locally stored first application data, and sends the display data to the first application interface.
  • One application After obtaining the display data, the first application can display the corresponding first application interface.
  • the mobile phone after the mobile phone obtains the differential data sent by the tablet, it can synchronize the differential data to the shared memory and record the offset window information corresponding to the differential data. Afterwards, the memo application can determine the required display data in the shared memory according to the offset window information to display the interface 402 of the memo content 3 as shown in (b) of FIG. 4 .
  • the data management process in the first electronic device obtains the data of the second electronic device. After sending the differential data (such as data D), the data management process writes the data D into the shared memory of the first electronic device, and determines the offset window information corresponding to the data D. Afterwards, the data management process sends a data synchronization completion signal to the process of the first application.
  • the data synchronization completion signal may carry shared memory information and offset window information.
  • the process of the first application can read data C and data D from the shared memory according to the offset window information. Furthermore, the process of the first application can display the interface displayed by the user's operation instructions according to the data C and the data D.
  • the first electronic device performs data synchronization on demand during the cross-device data access process according to actual needs, effectively reducing invalid data synchronization during the data synchronization process and improving the energy efficiency ratio during the data synchronization process.
  • the first electronic device synchronizes data on demand. On the basis of ensuring data synchronization, it effectively saves data synchronization power consumption and improves user experience.
  • the first electronic device reduces the number of reading and writing data in the disk through data synchronization in the shared memory, improves efficiency, and reduces performance loss of the first electronic device.
  • the first electronic device updates local data through differential data.
  • the first electronic device may also update the locally stored first application data based on the differential data.
  • the locally stored data in the first electronic device includes the display data corresponding to the data window selected by the thick solid line
  • the differential data sent by the second electronic device received by the first electronic device includes double real Display data corresponding to the "Content” data window selected by the line.
  • the first electronic device can update the locally stored display data of the first application according to the obtained display data corresponding to the "content” data window. For example, the first electronic device adds display data corresponding to the "content" data window.
  • the first electronic device updates local data, including adding locally unstored display data based on the differential data, and may also include updating old display data that has been stored in the first electronic device.
  • the differential data also includes the data corresponding to the "Classification" data window selected by the double solid line. Then, after acquiring the differential data, the first electronic device can update the display data corresponding to the locally stored original "classification" data window according to the display data corresponding to the "classification” data window selected by the double solid line.
  • the embodiment of the present application does not limit the execution order of the above-mentioned step S806 and step S807.
  • the first electronic device may first display an interface based on the differential data, and then update the locally stored data (that is, first perform step S806 and then step S807).
  • the first electronic device may first update the locally stored data according to the differential data, and then display the interface (that is, first perform step S807 and then step S806).
  • the first electronic device updates the locally stored data in the process of displaying the interface according to the differential data (ie, synchronously executes steps S806 and S807).
  • the life cycle of the shared memory in the first electronic device corresponds to the life cycle of the application or service. After the first electronic device ends the running of the service or application process, the life cycle of the shared memory also ends. . Therefore, the first electronic device avoids the loss of synchronized data by synchronizing the data in the disk, so that the corresponding data can be read from the disk when the application or service is started next time.
  • the data management process in the first electronic device first determines from the disk that the data query conditions are met at the beginning of the shared memory life cycle (such as after starting an application or service). data, and then write the data into the shared memory to complete the subsequent data synchronization process.
  • the data management process in the first electronic device can directly determine whether the data in the shared memory meets the data query conditions. If there is data that has met the data query conditions, the data reading can be directly completed to improve the interface. Show execution efficiency. Or, the data management process determines that there is data that meets the data query conditions in both the disk and the shared memory. The data that is in the disk but not in the shared memory can be read from the disk and written to the shared memory. Then the data The management process then completes data synchronization across devices based on the data in the shared memory. This reduces the amount of disk data read and improves efficiency.
  • the first electronic device after querying the data that meets the data query conditions from the disk, can also directly determine the second information of this part of the data and send the second information to the second electronic device. and data query conditions. Afterwards, the first electronic device can also obtain the differential data determined by the second electronic device based on the second information and the data query condition. The first electronic device then updates the data in the disk according to the differential data to complete the task instructed by the user's operation.
  • the first electronic device can also reduce the amount of data transmitted between the first electronic device and the second electronic device during the cross-device data access process, and improve the energy efficiency ratio during the data synchronization process.
  • FIG. 10 is a schematic diagram of the flow of a data synchronization method provided by an embodiment of the present application. As shown in Figure 10, the method includes the following steps.
  • the first electronic device In response to the user's first operation, the first electronic device sends a first data request to the second electronic device.
  • the first data request is used to request data required by the first interface displayed by the first operation instruction.
  • the first interface corresponds to the first application in the second electronic device.
  • the first application includes an application (APP) in the second electronic device, or a service (such as a task manager service, an installation package management service, etc.).
  • APP application
  • a service such as a task manager service, an installation package management service, etc.
  • the first electronic device and the second electronic device may synchronize application data or service data required by the first interface displayed by the first operation instruction.
  • the first interface includes an interface to be displayed for the first electronic device in response to user operation.
  • the first data includes data of the interface to be displayed indicated by the user operation and data of the interface associated with the interface to be displayed, or the first data includes data of the interface to be displayed indicated by the user operation.
  • the first interface is interface 402 as shown in (b) of Figure 4 .
  • the first data includes all data corresponding to the memo application 3, such as data used to display the interface 402, and data used to display the interface 403 shown in (c) of Figure 4.
  • the first data includes data for display interface 402 .
  • the first electronic device determines a data query condition
  • the data query condition is used to query data required to display the first interface.
  • the first data request sent by the first electronic device to the second electronic device carries the data query condition, so that the second electronic device can determine the data required to display the first interface according to the data query condition.
  • the first electronic device acquires the third data in the local data that satisfies the data query condition, and determines the first information of the third data.
  • the first data request also carries first information, and the first information includes one or more of the following information of the third data: row information, column information, and water level information.
  • the second electronic device can determine that the part already stored in the first electronic device is used to display the data required for the first interface. Then, the second electronic device can choose not to synchronize this part of the data, further reducing the amount of data transmission in the subsequent application data synchronization process.
  • the first electronic device queries the third data that satisfies the data query condition among the local data stored in the first storage space. Afterwards, the first electronic device caches the third data into the second storage space, and then determines the first information of the third data.
  • the first storage space is, for example, a disk
  • the second storage space is, for example, a shared memory. Compared with the disk, the data reading and writing speed in the shared memory is faster.
  • the application process can directly obtain the data of the first interface in the shared memory, improving data reading and writing. speed, thereby improving interface display efficiency.
  • the data A of the first application is already stored in the disk (ie, the first storage space) of the first electronic device.
  • the first electronic device filters out the data C that satisfies the data query condition from the disk, and writes the data C into the shared memory (ie, the second storage space).
  • the second electronic device determines the first data according to the first data request.
  • the second electronic device may determine that the data requested by the first data request is data of the first application.
  • the first data request carries a data query condition
  • the second electronic device can determine the data in the first application that satisfies the data query condition according to the data query condition, and then determine that this part of the data is determined as the first data.
  • the first data is part of the data in the first application.
  • the second electronic device can subsequently send the first data to the first electronic device, which can effectively reduce the amount of data transmission.
  • the first data request carries the data query condition and first information
  • the first information is the information of the third data in the first electronic device that satisfies the data query condition determined by the first electronic device.
  • the second electronic device can determine the first data in the fourth data that needs to be synchronized based on the first information. In this way, the second electronic device only needs to send data for displaying the first interface that is not stored in the first electronic device to the first electronic device, further reducing the amount of data transmission.
  • the second electronic device determines, based on the first information, the first data in the fourth data that needs to be synchronized, including: the second electronic device determines, based on the first information, that the fourth data includes the first data that is not included in the third data. Row data, determine the first row of data as the first data. And/or, the second electronic device determines, based on the first information, the second row of data in the fourth data whose water level is higher than the third data, and determines the second row of data as the first data.
  • the second electronic device determines the first column of data based on the first information, and the first column of data is the column data of the third row of data with the same water level in the fourth data and the third data, and the third data does not include the column data, Determine the first column of data as the first data.
  • the second electronic device determines that the data queried by the data query condition includes the row of data with ID 003 (that is, including the data record with ID 003), and the first information can be determined based on the first information. This row of data is not saved in the electronic device. Then, the first electronic device can determine the row of data as the first data.
  • the second electronic device sends the first data to the first electronic device.
  • the second electronic device after determining the first data, sends the first data to the first electronic device.
  • the first electronic device receives the first data sent by the second electronic device.
  • the first electronic device responds to the first data and displays the first interface.
  • the first electronic device after receiving the first data, can display the first interface according to the first data.
  • the first electronic device after the first electronic device receives the first data corresponding to the memo content 3 sent by the user, it can display the interface 402 ( as shown in (b) of Figure 4 according to the first data). That is the first interface).
  • the first electronic device updates the third data in the second storage space through the received first data. Afterwards, the first electronic device can display the first interface according to the updated data in the second storage space.
  • the first electronic device after receiving the first data, updates the data corresponding to the first interface that has been stored in the shared memory according to the first data. Afterwards, the first electronic device can display the first interface according to the updated data in the shared memory.
  • the first electronic device can also update the local data according to the first data.
  • the first electronic device after receiving the first data, updates the stored data of the first application in the disk according to the first data. In this way, the first electronic device can subsequently obtain the updated data of the first application from the disk in response to the user's instruction to display the interface of the first application.
  • the first electronic device sends a second data request to the second electronic device.
  • the second data request is used to request data required by the second interface displayed by the second operation instruction.
  • the second interface also corresponds to the first application. That is to say, after displaying the first interface, the first electronic device responds to the user operation and determines that the user instructs to display other interfaces of the first application, such as the second interface. Then, the first electronic device needs to request the second electronic device to obtain data required for displaying the second interface.
  • the second electronic device determines the second data according to the second data request.
  • the second electronic device may determine that the data requested by the second data request is data of the first application. Wherein, the second data is different from the first data.
  • the second data request carries data query conditions for querying data corresponding to the second interface.
  • the second electronic device may determine, according to the data query conditions, the data in the first application that satisfies the data query conditions, and further determine that this part of the data is determined as the second data.
  • the second data request carries a data query condition for querying data corresponding to the second interface and second information about data in the first electronic device that satisfies the data query condition.
  • the second electronic device can determine part of the data of the first application based on the data query condition, and then determine based on the second information that among the data of the first application, the first electronic device has not stored the second data.
  • the second electronic device sends second data to the first electronic device.
  • the second electronic device after determining the second data, sends the second data to the first electronic device.
  • the first electronic device receives the second data sent by the second electronic device.
  • the first electronic device displays the second interface in response to the second data.
  • the first electronic device after receiving the second data, can display the second interface according to the second data.
  • the first electronic device uses the locally saved data of the first application according to the second data.
  • the first electronic device responds to the user operation and returns to display the homepage of the memo application, as shown in Figure 4 Interface 401 shown in (a).
  • first The electronic device detects the second operation of the user clicking on the control 45 and can send a second data request to the second electronic device.
  • the second data request is used to request to obtain the data required to display the interface corresponding to the memo content 5 .
  • the second electronic device sends the data to the first electronic device in response to the second data request, so that the first electronic device can display an interface corresponding to the memo content 5 .
  • the data transmitted between the first electronic device and the second electronic device is data used by the first electronic device to display the interface to be displayed, and is no longer the full data of the application. Effectively reduce the amount of data transmission and reduce the power consumption of electronic equipment.
  • multiple embodiments of the present application can be combined and the combined solution can be implemented.
  • some operations in the processes of each method embodiment are optionally combined, and/or the order of some operations is optionally changed.
  • the execution order between the steps of each process is only exemplary and does not constitute a limitation on the execution order between the steps. Other execution orders are possible between the steps. It is not intended that the order of execution described is the only order in which these operations may be performed.
  • One of ordinary skill in the art will recognize various ways to reorder the operations described herein.
  • the process details involved in a certain embodiment herein are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.
  • each method embodiment can be implemented individually or in combination.
  • FIG. 11 is a schematic structural diagram of a first electronic device provided by an embodiment of the present application.
  • the first electronic device 1100 may include: a transceiver unit 1101 , a processing unit 1102 and a display unit 1103 .
  • the first electronic device 1100 may be used to implement the functions of the first electronic device involved in the above method embodiments.
  • the transceiver unit 1101 is used to support the first electronic device 1100 to perform S601 and S603 in Figure 6; and/or to support the first electronic device 1100 to perform S601b in Figure 7; and/or to Supporting the first electronic device 1100 to execute S803 and S805 in FIG. 8; and/or supporting the first electronic device 1100 to execute S1001, S1003, S1005 and S1007 in FIG. 10.
  • the processing unit 1102 is used to support the first electronic device 1100 to execute S605 in FIG. 6; and/or to support the first electronic device 1100 to execute S601a in FIG. 7; and/or to support the third An electronic device 1100 executes S801, S802 and S807 in FIG. 8 .
  • the display unit 1103 is used to support the first electronic device 1100 to display interface content; and/or to support the first electronic device 1100 to execute S604 in Figure 6; and/or to support the first electronic device 1100 to execute S806 in Figure 8; and/or, used to support the first electronic device 1100 to perform S1004 and S1008 in Figure 10.
  • the transceiver unit may include a receiving unit and a transmitting unit, may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module.
  • the operation and/or function of each unit in the first electronic device 1100 is to implement the corresponding process of the data synchronization method described in the above method embodiment. All relevant content of each step involved in the above method embodiment can be quoted from the corresponding For the sake of brevity, the functional description of the functional unit will not be repeated here.
  • the first electronic device 1100 shown in FIG. 11 may also include a storage unit (not shown in FIG. 11), in which programs or instructions are stored.
  • a storage unit not shown in FIG. 11
  • the transceiver unit 1101, the processing unit 1102, and the display unit 1103 execute the program or instruction
  • the first electronic device 1100 shown in FIG. 11 can perform the data synchronization method described in the above method embodiment.
  • the technical solution provided by this application can also be a functional unit or chip in the first electronic device, or a device used in conjunction with the first electronic device.
  • FIG. 12 is a schematic structural diagram of a second electronic device provided by an embodiment of the present application.
  • the second electronic device 1200 may include: a transceiver unit 1201 and a processing unit 1202.
  • the second electronic device 1200 may be used to implement the functions of the second electronic device involved in the above method embodiments.
  • the transceiver unit 1201 is used to support the second electronic device 1200 to perform S601 and S603 in Figure 6; and/or, for supporting the second electronic device 1200 to execute S601b in FIG. 7; and/or for supporting the second electronic device 1200 to execute S803 and S805 in FIG. 8; and/or for supporting the second electronic device 1200 to execute S801b in FIG. S1001, S1003, S1005 and S1007 in 10.
  • the processing unit 1202 is used to support the second electronic device 1200 to execute S602 in FIG. 6; and/or to support the second electronic device 1200 to execute S804 in FIG. 8; and/or to support the second electronic device 1200 to execute S804 in FIG.
  • the second electronic device 1200 executes S1002 and S1006 in FIG. 10 .
  • the transceiver unit may include a receiving unit and a transmitting unit, may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module.
  • the operation and/or function of each unit in the second electronic device 1200 is to implement the corresponding process of the data synchronization method described in the above method embodiment. All relevant content of each step involved in the above method embodiment can be quoted from the corresponding For the sake of brevity, the function description of the functional unit will not be repeated here.
  • the second electronic device 1200 shown in FIG. 12 may also include a storage unit (not shown in FIG. 12), in which programs or instructions are stored.
  • a storage unit not shown in FIG. 12
  • the transceiver unit 1201 and the processing unit 1202 execute the program or instruction
  • the second electronic device 1200 shown in FIG. 12 can perform the data synchronization method described in the above method embodiment.
  • the technical solution provided by this application can also be a functional unit or chip in the second electronic device, or a device used in conjunction with the second electronic device.
  • An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, and the memory is used to store programs or instructions. When the program or instructions are executed by the processor, the The chip system implements the method in any of the above method embodiments.
  • processors in the chip system there may be one or more processors in the chip system.
  • the processor can be implemented in hardware or software.
  • the processor may be a logic circuit, an integrated circuit, or the like.
  • the processor may be a general-purpose processor implemented by reading software code stored in memory.
  • the memory may be integrated with the processor or may be provided separately from the processor, which is not limited by the embodiments of the present application.
  • the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip, or may be separately provided on different chips.
  • the embodiments of this application vary on the type of memory, and The arrangement of the memory and processor is not specifically limited.
  • the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or a system on chip (SoC). ), it can also be a central processor (central processor unit, CPU), a network processor (network processor, NP), a digital signal processing circuit (digital signal processor, DSP), or a microcontroller (micro controller unit, MCU), it can also be a programmable logic device (PLD) or other integrated chip.
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • SoC system on chip
  • CPU central processor unit, CPU
  • NP network processor
  • DSP digital signal processing circuit
  • microcontroller micro controller unit, MCU
  • PLD programmable logic device
  • each step in the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software.
  • the method steps disclosed in conjunction with the embodiments of this application can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • a computer program is stored in the computer-readable storage medium. When the computer program is run on a computer, it causes the computer to perform the above related steps to implement the above embodiments. data synchronization method.
  • An embodiment of the present application also provides a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to perform the above related steps to implement the data synchronization method in the above embodiment.
  • the embodiment of the present application also provides a device.
  • the device may specifically be a component or module, and the device may include one or more connected processors and memories. Among them, memory is used to store computer programs. When the computer program is executed by one or more processors, the device is caused to execute the data synchronization method in each of the above method embodiments.
  • the devices, computer-readable storage media, computer program products or chips provided by the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects it can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be described again here.
  • the steps of the methods or algorithms described in connection with the disclosure of the embodiments of this application can be implemented in hardware or by a processor executing software instructions.
  • Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (RAM), flash memory, read only memory (read only memory, ROM), erasable programmable read-only memory (ROM), erasable programmable ROM (EPROM), electrically erasable programmable read-only memory (EPROM, EEPROM), register, hard disk, removable hard disk, compact disc (CD-ROM) or any other form of storage media well known in the art.
  • An exemplary storage medium is coupled to the processor such that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and storage medium may be located in an application specific integrated circuit (ASIC).
  • ASIC application specific integrated circuit
  • the disclosed method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of modules or units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored. or not executed.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, indirect coupling or communication connection of modules or units, and may be in electrical, mechanical or other forms.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.
  • Computer-readable storage media includes but is not limited to any of the following: U disk, mobile hard disk, read-only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk, etc.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk or optical disk etc.
  • Various media that can store program code include but is not limited to any of the following: U disk, mobile hard disk, read-only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Human Computer Interaction (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请提供数据同步方法、电子设备及***,涉及终端技术领域。本申请中第一电子设备可根据用户操作,向第二电子设备请求获取待显示的第二电子设备中第一应用的界面数据,以减少无效数据的数据同步,降低跨设备数据访问开销。该方法包括:第一电子设备响应于第一操作向第二电子设备发送第一数据请求,以请求第一操作指示显示的第一界面所需数据。第一电子设备接收第二电子设备发送的第一数据并显示第一界面。第一电子设备响应于第二操作向第二电子设备发送第二数据请求,以请求第二操作指示显示的第二界面所需数据。第一电子设备接收第二电子设备发送的第二数据并显示第一界面,第二数据不同于第一数据。

Description

数据同步方法、电子设备及***
本申请要求于2022年07月26日提交国家知识产权局、申请号为202210883769.7、发明名称为“数据同步方法、电子设备及***”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及终端技术领域,尤其涉及一种数据同步方法、电子设备及***。
背景技术
在分布式场景中,不同电子设备之间可实现跨设备数据访问。比如,第一电子设备(如平板等)响应于用户操作,跨设备访问第二电子设备中用户操作指示的第一应用的应用数据。之后,第一电子设备可在获取到的应用数据中筛选用户操作指示对应的第一应用的界面数据,以显示相应的界面,如显示应用的首页、应用中某一功能页面等。
但是,电子设备之间跨设备数据访问,用户可能会指示第一电子设备显示不同的界面,因此第一电子设备会请求获取第一应用的全部应用数据。而同步应用的全部应用数据,传输数据量较大,导致功耗较多。并且,同步的全部应用数据中,第一电子设备响应于用户操作需要使用的应用数据可能只占用其中较少的比例,无效数据占比较高。
发明内容
为了解决上述的技术问题,本申请提供了一种数据同步方法、电子设备及***。本申请提供的技术方案,第一电子设备可根据用户操作,向第二电子设备请求获取待显示的第二电子设备中第一应用的界面数据。这样,有效减少无效数据的数据同步,降低跨设备数据访问开销。
为了实现上述的技术目的,本申请实施例提供了如下技术方案:
第一方面,提供一种数据同步方法。该方法包括:响应于用户的第一操作,第一电子设备向第二电子设备发送第一数据请求,第一数据请求用于请求第一操作指示显示的第一界面所需的数据,第一界面对应于第二电子设备中的第一应用。第一电子设备接收第二电子设备发送的第一数据,第一数据为第二电子设备响应于第一数据请求确定的数据。响应于接收到的第一数据,第一电子设备显示第一界面。响应于用户的第二操作,第一电子设备向第二电子设备发送第二数据请求,数第二据请求用于请求第二操作指示显示的第二界面所需的数据,第二界面对应于第一应用。第一电子设备接收第二电子设备发送的第二数据,第二数据为第二电子设备响应于第二数据请求确定的数据,第二数据不同于第一数据。响应于接收到的第二数据,第一电子设备显示第二界面。
可选的,第一应用包括第二电子设备中的应用程序(APP),或服务(如任务管理器服务、安装包管理服务等)。响应于第一操作,第一电子设备和第二电子设备可同步该第一操作指示显示的界面所需的应用数据或服务数据。
可选的,第一界面包括为第一电子设备响应于用户操作待显示的界面。第一数据包括用户操作指示的待显示的界面的数据以及与待显示的界面关联界面的数据,或者第一数据包括用户操作指示的待显示的界面的数据。
如此,在跨设备数据访问过程中,第一电子设备和第二电子设备之间传输的数据为用于第一电子设备显示待显示界面的数据,而不再是应用的全量数据。有效减少数据传输量,降低电子设备功耗。
根据第一方面,响应于用户的第一操作,第一电子设备向第二电子设备发送第一数据请求,包括:响应于第一操作,第一电子设备确定数据查询条件,数据查询条件用于查询显示第一界面所需的数据。第一电子设备向第二电子设备发送第一数据请求,第一数据请求携带有数据查询条件。
可选的,数据查询条件中可包括待查询数据对应的应用名称、行信息、列信息、水位信息等中的一项或几项。
如此,第二电子设备根据数据查询条件,能够确定第一电子设备请求的界面数据。
根据第一方面,或者以上第一方面的任意一种实现方式,方法还包括:第一电子设备获取本 地数据中满足数据查询条件的第三数据,确定第三数据的第一信息;第一数据请求中还携带有第一信息,第一信息包括第三数据的如下一项或几项信息:行信息、列信息、水位信息。
示例性的,第二电子设备在接收到第一数据请求后,能够根据数据查询条件确定第一应用的部分数据。之后,第二电子设备能够根据第一信息,在这部分数据中确定第一电子设备中未存储的第一数据,从而确定将显示第一界面所需的数据中第一电子设备未存储的第一数据发送到第一电子设备。
如此,进一步减少跨设备数据访问过程中,电子设备之间数据的传输量,降低电子设备功耗。
根据第一方面,或者以上第一方面的任意一种实现方式,第一电子设备获取本地数据中满足数据查询条件的第三数据,确定第三数据的第一信息,包括:第一电子设备查询第一存储空间中存储的本地数据中满足数据查询条件的第三数据。第一电子设备将第三数据缓存至第二存储空间后,确定第三数据的第一信息。
可选的,第一存储空间例如为磁盘,第二存储空间例如为共享内存。相比于磁盘,共享内存中数据读写速度较快,将用于显示第一界面的数据缓存至共享内存中后,应用进程可直接在共享内存中获取第一界面的数据,提高数据读写速度,从而提高界面显示效率。
根据第一方面,或者以上第一方面的任意一种实现方式,响应于接收到的第一数据,第一电子设备显示第一界面,包括:第一电子设备通过接收到的第一数据更新第二存储空间中的第三数据。第一电子设备根据第二存储空间中的更新后的数据,显示第一界面。
示例性的,第一电子设备在接收到第一数据后,根据第一数据更新共享内存中已经存储的第一界面对应的数据。之后,第一电子设备可根据共享内存中更新后的数据,显示第一界面。
根据第一方面,或者以上第一方面的任意一种实现方式,方法还包括:第一电子设备根据第一数据,更新本地数据。
示例性的,第一电子设备在接收到第一数据后,根据第一数据更新磁盘中的已经存储的第一应用的数据。这样后续第一电子设备响应于用户指示显示第一应用的界面的操作,可从磁盘中获取到已经更新的第一应用的数据。
第二方面,提供一种数据同步方法。该方法包括:第二电子设备接收第一电子设备发送的第一数据请求,第一数据请求为第一电子设备响应于用户的第一操作确定的用于获取第一操作指示显示的第一界面所需的数据的请求,第一界面对应于第二电子设备中的第一应用。第二电子设备根据第一数据请求,确定第一数据。第二电子设备向第一电子设备发送第一数据,第一数据用于第一电子设备显示第一界面。第二电子设备接收第一电子设备发送的第二数据请求,第二数据请求为第一电子设备响应于用户的第二操作确定的用于获取第二操作指示显示的第二界面所需的数据的请求,第二界面对应于第一应用。第二电子设备根据第二数据请求,确定第二数据,第二数据不同于第一数据。第二电子设备向第一电子设备发送第二数据,第二数据用于第一电子设备显示第二界面。
根据第二方面,第二电子设备根据第一数据请求,确定第一数据,包括:第二电子设备获取第一数据请求中携带的数据查询条件,确定满足数据查询条件的第一数据。
根据第二方面,或者以上第二方面的任意一种实现方式,第二电子设备根据第一数据请求,确定第一数据,包括:第二电子设备获取第一数据请求中携带的数据查询条件和第一信息,第一信息为第一电子设备确定的第一电子设备中满足数据查询条件的第三数据的信息,第一信息包括第三数据的如下一项或几项信息:行信息、列信息、水位信息。第二电子设备确定满足数据查询条件的第四数据。第二电子设备根据第一信息,确定第四数据中需要同步的第一数据。
根据第二方面,或者以上第二方面的任意一种实现方式,第二电子设备根据第一信息,确定第四数据中需要同步的第一数据,包括:第二电子设备根据第一信息,确定第四数据中包括第三数据中没有的第一行数据,确定第一行数据为第一数据。和/或,第二电子设备根据第一信息,确定第四数据中水位高于第三数据的第二行数据,确定第二行数据为第一数据。和/或,第二电子设备根据第一信息,确定第一列数据,第一列数据为第四数据和第三数据中水位相同的第三行数据中,第三数据不包括的列数据,确定第一列数据为第一数据。
第二方面以及第二方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一 方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第三方面,提供一种电子设备。该电子设备包括:处理器、显示屏和存储器,存储器和显示屏与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当处理器从存储器中读取计算机指令,使得电子设备执行:响应于用户的第一操作,第一电子设备向第二电子设备发送第一数据请求,数第一据请求用于请求第一操作指示显示的第一界面所需的数据,第一界面对应于第二电子设备中的第一应用。第一电子设备接收第二电子设备发送的第一数据,第一数据为第二电子设备响应于第一数据请求确定的数据。响应于接收到的第一数据,第一电子设备显示第一界面。响应于用户的第二操作,第一电子设备向第二电子设备发送第二数据请求,数第二据请求用于请求第二操作指示显示的第二界面所需的数据,第二界面对应于第一应用。第一电子设备接收第二电子设备发送的第二数据,第二数据为第二电子设备响应于第二数据请求确定的数据,第二数据不同于第一数据。响应于接收到的第二数据,第一电子设备显示第二界面。
根据第三方面,响应于用户的第一操作,第一电子设备向第二电子设备发送第一数据请求,包括:响应于第一操作,第一电子设备确定数据查询条件,数据查询条件用于查询显示第一界面所需的数据。第一电子设备向第二电子设备发送第一数据请求,第一数据请求携带有数据查询条件。
根据第三方面,或者以上第三方面的任意一种实现方式,方法还包括:第一电子设备获取本地数据中满足数据查询条件的第三数据,确定第三数据的第一信息;第一数据请求中还携带有第一信息,第一信息包括第三数据的如下一项或几项信息:行信息、列信息、水位信息。
根据第三方面,或者以上第三方面的任意一种实现方式,第一电子设备获取本地数据中满足数据查询条件的第三数据,确定第三数据的第一信息,包括:第一电子设备查询第一存储空间中存储的本地数据中满足数据查询条件的第三数据。第一电子设备将第三数据缓存至第二存储空间后,确定第三数据的第一信息。
根据第三方面,或者以上第三方面的任意一种实现方式,响应于接收到的第一数据,第一电子设备显示第一界面,包括:第一电子设备通过接收到的第一数据更新第二存储空间中的第三数据。第一电子设备根据第二存储空间中的更新后的数据,显示第一界面。
根据第三方面,或者以上第三方面的任意一种实现方式,当处理器从存储器中读取计算机可读指令,还使得电子设备执行如下操作:第一电子设备根据第一数据,更新本地数据。
第三方面以及第三方面中任意一种实现方式所对应的技术效果,可参见上述第三方面及第三方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第四方面,提供一种电子设备。该电子设备包括:处理器和存储器,存储器和处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当处理器从存储器中读取计算机指令,使得电子设备执行:第二电子设备接收第一电子设备发送的第一数据请求,第一数据请求为第一电子设备响应于用户的第一操作确定的用于获取第一操作指示显示的第一界面所需的数据的请求,第一界面对应于第二电子设备中的第一应用。第二电子设备根据第一数据请求,确定第一数据。第二电子设备向第一电子设备发送第一数据,第一数据用于第一电子设备显示第一界面。第二电子设备接收第一电子设备发送的第二数据请求,第二数据请求为第一电子设备响应于用户的第二操作确定的用于获取第二操作指示显示的第二界面所需的数据的请求,第二界面对应于第一应用。第二电子设备根据第二数据请求,确定第二数据,第二数据不同于第一数据。第二电子设备向第一电子设备发送第二数据,第二数据用于第一电子设备显示第二界面。
根据第四方面,第二电子设备根据第一数据请求,确定第一数据,包括:第二电子设备获取第一数据请求中携带的数据查询条件,确定满足数据查询条件的第一数据。
根据第四方面,或者以上第四方面的任意一种实现方式,第二电子设备根据第一数据请求,确定第一数据,包括:第二电子设备获取第一数据请求中携带的数据查询条件和第一信息,第一信息为第一电子设备确定的第一电子设备中满足数据查询条件的第三数据的信息,第一信息包括第三数据的如下一项或几项信息:行信息、列信息、水位信息。第二电子设备确定满足数据查询条件的第四数据。第二电子设备根据第一信息,确定第四数据中需要同步的第一数据。
根据第四方面,或者以上第四方面的任意一种实现方式,第二电子设备根据第一信息,确定 第四数据中需要同步的第一数据,包括:第二电子设备根据第一信息,确定第四数据中包括第三数据中没有的第一行数据,确定第一行数据为第一数据。和/或,第二电子设备根据第一信息,确定第四数据中水位高于第三数据的第二行数据,确定第二行数据为第一数据。和/或,第二电子设备根据第一信息,确定第一列数据,第一列数据为第四数据和第三数据中水位相同的第三行数据中,第三数据不包括的列数据,确定第一列数据为第一数据。
第四方面以及第四方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第五方面,提供一种数据同步***,该***包括:第一电子设备和第二电子设备。其中,第一电子设备,用于响应于用户的第一操作,向第二电子设备发送第一数据请求,第一数据请求用于请求第一操作指示显示的第一界面所需的数据,第一界面对应于第二电子设备中的第一应用。第二电子设备,用于响应于第一数据请求,向第一电子设备发送第一数据。第一电子设备,还用于响应于接收到的第一数据,显示第一界面。第一电子设备,还用于响应于用户的第二操作,向第二电子设备发送第二数据请求,第二数据请求用于请求第二操作指示显示的第二界面所需的数据,第二界面对应于第一应用。第二电子设备,用于响应于第二数据请求,向第一电子设备发送第二数据,第二数据不同于第一数据。第一电子设备,还用于响应于接收到的第二数据,显示第二界面。
根据第五方面,第一电子设备,用于响应于第一操作,确定数据查询条件,数据查询条件用于查询显示第一界面所需的数据,数据请求携带有数据查询条件。
根据第五方面,或者以上第五方面的任意一种实现方式,第一电子设备,还用于获取本地数据中满足数据查询条件的第三数据,确定第三数据的第一信息;第一数据请求中还携带有第一信息,第一信息包括第三数据的如下一项或几项信息:行信息、列信息、水位信息。
根据第五方面,或者以上第五方面的任意一种实现方式,第二电子设备,用于确定满足数据查询条件的第四数据。第二电子设备,用于根据第一信息,确定第四数据中需要同步的第一数据,第一数据不同于第三数据,或第一数据中的部分数据对应于更新后的第三数据。
第五方面以及第五方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第六方面,本申请实施例提供一种电子设备,该电子设备具有实现如上述第一方面及其中任一种可能的实现方式中所述的数据同步方法的功能;或者,该电子设备具有实现如上述第二方面及其中任一种可能的实现方式中所述的数据同步方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应地软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第六方面以及第六方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第七方面,提供一种计算机可读存储介质。计算机可读存储介质存储有计算机程序(也可称为指令或代码),当该计算机程序被电子设备执行时,使得电子设备执行第一方面或第一方面中任意一种实施方式的方法;或者,使得电子设备执行第二方面或第二方面中任意一种实施方式的方法。
第七方面以及第七方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第八方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行第一方面或第一方面中任意一种实施方式的方法;或者,使得电子设备执行第二方面或第二方面中任意一种实施方式的方法。
第八方面以及第八方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第九方面,本申请实施例提供一种电路***,电路***包括处理电路,处理电路被配置为执行第一方面或第一方面中任意一种实施方式的方法;或者,处理电路被配置为执行第二方面或第二方面中任意一种实施方式的方法。
第九方面以及第九方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一 方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第十方面,本申请实施例提供一种芯片***,包括至少一个处理器和至少一个接口电路,至少一个接口电路用于执行收发功能,并将指令发送给至少一个处理器,当至少一个处理器执行指令时,至少一个处理器执行第一方面或第一方面中任意一种实施方式的方法;或者,至少一个处理器执行第二方面或第二方面中任意一种实施方式的方法。
第十方面以及第十方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。
附图说明
图1为本申请实施例提供的界面示意图一;
图2为本申请实施例提供的一种数据同步方法应用的通信***的示意图;
图3A为本申请实施例提供的第一电子设备或第二电子设备的硬件结构示意图;
图3B为本申请实施例的第一电子设备或第二电子设备的软件结构框图示意图;
图4为本申请实施例提供的界面示意图二;
图5为本申请实施例提供的界面示意图三;
图6为本申请实施例提供的数据同步方法流程示意图一;
图7为本申请实施例提供的数据同步方法流程示意图二;
图8为本申请实施例提供的数据同步方法流程示意图三;
图9A为本申请实施例提供的数据同步场景示意图一;
图9B为本申请实施例提供的数据同步场景示意图二;
图10为本申请实施例提供的数据同步方法流程示意图四;
图11为本申请实施例提供的第一电子设备的结构示意图;
图12为本申请实施例提供的第二电子设备的结构示意图。
具体实施方式
下面结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个或两个以上(包含两个)。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。术语“连接”包括直接连接和间接连接,除非另外说明。“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。
在一些场景中,不同电子设备之间可建立分布式通信连接,实现跨设备数据访问,在跨设备数据访问的过程中,实现不同电子设备之间的数据同步。
比如,第一电子设备和第二电子设备之间建立投屏连接。第一电子设备可通过投屏连接,接收第二电子设备发送的投屏数据,该投屏数据为第二电子设备中的应用的数据。第一电子设备根据投屏数据,显示相应的应用界面。这样,第一电子设备可实现跨设备访问第二电子设备的数据。
又比如,第一电子设备与第二电子设备建立连接后,可获取到第二电子设备的应用列表。之后,第一电子设备可根据应用列表,显示相应的应用图标。响应于用户对应用图标的操作,第一 电子设备可向第二电子设备请求获取该应用图标对应的应用数据,实现跨设备访问第二电子设备中的数据。
示例性的,手机与平板建立通信连接,响应于用户操作,手机显示平板中的备忘录应用的界面。如图1所示,手机显示备忘录应用中的首页界面101。响应于用户沿箭头11所示方向向下滑动的操作,手机可滑动显示相应的备忘录界面。或者,响应于用户点击控件12的操作,手机可显示备忘录内容3对应的备忘录界面。
由于在使用应用的过程中,用户行为不可控。因此,在跨设备访问其他电子设备应用数据的过程中,手机在首次检测到用户指示显示平板中的备忘录应用的操作后,会向平板请求获取备忘录应用的全量数据,将全量数据同步至本地后,再进行本地数据查询。
比如,手机根据获取到的平板的应用列表,显示备忘录图标,响应于用户对备忘录图标的操作,手机向平板请求获取备忘录应用的全量数据。之后,手机再从获取到的备忘录应用的全量数据中,筛选需要显示的备忘录应用的首页需要的界面数据,根据界面数据显示备忘录首页。
可以看出,目前电子设备跨设备数据访问的过程中,电子设备单次同步的数据为应用或服务的全量数据,而响应于用户操作指示所使用的数据只占全量数据中的较小比例,无效数据占比较高,造成电子设备的性能和功耗的损失。
并且,电子设备跨设备访问数据的过程中,会同步应用或服务的全量数据。下一次该电子设备跨设备访问同样的应用或服务的过程中,还是会同步该应用或服务的全量数据,而不会使用本地已经缓存的该应用或服务的数据,导致跨设备访问数据的过程能效比较低。
此外,电子设备跨设备访问数据的过程中,需要先将获取到的应用或服务的全量数据通过输入/输出(input/output,I/O)接口存储到磁盘中,之后再从磁盘中筛选需要的数据,通过I/O接口输出筛选出的数据。在该过程中,电子设备至少需要一次磁盘的写I/O接口操作和一次读I/O接口操作,而磁盘数据读写速度较慢,造成电子设备性能的损耗。
由此,本申请实施例提供一种数据同步方法,第一电子设备在访问第二电子设备中的应用或服务的过程中,可响应于用户操作,向第二电子设备请求获取用户操作指示显示的界面所需的数据。这样,第一电子设备和第二电子设备只需要传输应用或服务的数据中显示界面所需的部分数据。从而降低无效数据的传输,减少数据同步的数据量,提高数据同步效率,降低功耗。
图2为本申请实施例提供的数据同步方法应用的通信***的示意图。如图2中所示,该通信***包括第一电子设备100和第二电子设备200。
可选的,第一电子设备100为接收端设备,第二电子设备200为源端设备,第一电子设备100跨设备访问第二电子设备200中的应用或服务的数据,同步所需应用数据或服务数据。比如,第一电子设备100响应于用户操作,跨设备访问第二电子设备200,按需进行数据同步。之后,第一电子设备100根据同步到的数据,显示用户操作指示显示的界面。
可选的,第一电子设备100或第二电子设备200例如可以为手机、平板电脑、笔记本电脑、大屏设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、可穿戴设备、人工智能(artificial intelligence,AI)设备等终端设备,第一电子设备100或第二电子设备200安装的操作***包括但不限于 或者其它操作***。本申请对第一电子设备100或第二电子设备200的具体类型、所安装的操作***均不作限制。
在一种实施方式中,第一电子设备100和第二电子设备200之间建立有无线通信连接或有线通信连接(如通过网线连接等)。其中,建立无线通信连接的无线通信技术包括但不限于以下的至少一种:蓝牙(bluetooth,BT)(例如,传统蓝牙或者低功耗(bluetooth low energy,BLE)蓝牙),无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),近距离无线通信(near field communication,NFC),紫蜂(Zigbee),调频(frequency modulation,FM),红外(infrared,IR),超宽带(ultra wide band,UWB)技术等。
可选的,第一电子设备100和第二电子设备200也可以通过局域网中的第三方设备建立通信连接,第三方设备例如是路由器、网关、智能设备控制器、服务器、无线访问接入点(access point,AP)设备等。
比如,第一电子设备100和第二电子设备200都支持靠近发现功能。示例性地,第一电子设备100靠近第二电子设备200后,第一电子设备100和第二电子设备200能够互相发现对方,之后建立诸如Wi-Fi端到端(peer to peer,P2P)连接和/或蓝牙连接等无线通信连接。之后,第一电子设备100可响应于用户操作,通过无线通信连接访问第二电子设备200的数据。
又比如,第一电子设备100和第二电子设备200通过局域网,建立无线通信连接。比如,第一电子设备100和第二电子设备200都连接至同一路由器。
再比如,第一电子设备100和第二电子设备200通过蜂窝网络、因特网等,建立无线通信连接。如第二电子设备200通过路由器接入因特网,第一电子设备100通过蜂窝网络接入因特网;进而,第一电子设备100和第二电子设备200建立无线通信连接。
示例性的,图3A示出了第一电子设备100或第二电子设备200的一种结构示意图。
第一电子设备100或第二电子设备200可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,传感器模块180,按键190,马达191,外设模块192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。
可以理解的是,本申请实施例示意的结构并不构成对第一电子设备100或第二电子设备200的具体限定。在本申请另一些实施例中,第一电子设备100或第二电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
比如,在第一电子设备100为PC的情况下,第一电子设备100可以不包括移动通信模块150和SIM卡接口195。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了***的效率。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为第一电子设备100或第二电子设备200充电,也可以用于第一电子设备100或第二电子设备200与***设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对第一电子设备100或第二电子设备200的结构限定。在本申请另一些实施例中,第一电子设备100或第二电子设备200也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193和无线通信模块160等供电。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
第一电子设备100或第二电子设备200的无线通信功能可以通过天线1,天线2,移动通信模 块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。第一电子设备100或第二电子设备200中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在第一电子设备100或第二电子设备200上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
无线通信模块160可以提供应用在第一电子设备100或第二电子设备200上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星***(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,第一电子设备100或第二电子设备200的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得第一电子设备100或第二电子设备200可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯***(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,和/或IR技术等。所述GNSS可以包括全球卫星定位***(global positioning system,GPS),全球导航卫星***(global navigation satellite system,GLONASS),北斗卫星导航***(beidou navigation satellite system,BDS),准天顶卫星***(quasi-zenith satellite system,QZSS)和/或星基增强***(satellite based augmentation systems,SBAS)。
第一电子设备100或第二电子设备200通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),例如采用有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Mini-led,Micro-led,Micro-oled,量子点发光二极管(quantum dot light emitting diodes,QLED)等生产制造。在一些实施例中,第一电子设备100或第二电子设备200可以包括1个或N个显示屏194,N为大于1的正整数。
在一种实施方式中,第一电子设备100响应于用户指示显示第一应用界面的操作,向第二电子设备200发送数据查询条件和本地数据快照。这样,第二电子设备200根据数据查询条件和本地数据快照,确定数据查询条件对应的数据中第一电子设备100中未存储的数据,将该数据发送到第一电子设备100。之后,第一电子设备100可根据获取到的数据和本地存储数据,在显示屏194上显示用户指示显示的第一应用界面。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,第一电子设备100或第二电子设备200可以包括1个或N个摄像头193,N为大于1的正整数。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展第一电子设备100或第二电子设备200的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作***,至少一个功能所需的应用(比如声音播放功能,图像播放功能等)等。存储数据区可存储第一电子设备100或第二电子设备200使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行第一电子设备100或第二电子设备200的各种功能应用以及数据处理。
可选的,内部存储器121中包括磁盘和内存。其中,由于内存的读写速度远远高于磁盘的读写速度,因此***会将读写较为频繁的数据先缓存至内存中,实现高速缓存。
一些示例中,第一电子设备100在确定跨设备访问数据的数据查询条件后,根据数据查询条件将从磁盘中筛选出的数据写入共享内存中,并确定该数据的第一信息。之后,第一电子设备100通过移动通信模块150或无线通信模块160,向第二电子设备200发送数据筛选条件和第一信息,以获取磁盘中未存储的同步数据。第一电子设备100将获取到的同步数据写入共享内存中,那么后续应用或服务的进程可直接从共享内存中读取所需数据,从而有效提高读写速度,减少磁盘数据的读写次数,提高跨设备数据访问效率。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。第一电子设备100或第二电子设备200可以通过音频模块170,例如音乐播放,录音等。音频模块170可以包括扬声器,受话器,麦克风,耳机接口,以及应用处理器等实现音频功能。
传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。
触摸传感器,也称“触控器件”。触摸传感器可以设置于显示屏194,由触摸传感器与显示屏194组成触摸屏,也称“触控屏”。触摸传感器用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器也可以设置于第一电子设备100或第二电子设备200的表面,与显示屏194所处的位置不同。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。第一电子设备100或第二电子设备200可以接收按键输入,产生与第一电子设备100或第二电子设备200的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。
SIM卡接口195用于连接SIM卡。SIM卡可以通过***SIM卡接口195,或从SIM卡接口195拔出,实现和第一电子设备100或第二电子设备200的接触和分离。第一电子设备100或第二电子设备200可以支持1个或N个SIM卡接口,N为大于1的正整数。
第一电子设备100或第二电子设备200的软件***可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android***为例,示例性说明第一 电子设备100或第二电子设备200的软件结构。
图3B是本申请实施例的第一电子设备100或第二电子设备200的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android***分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和***库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图3B所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
一些示例中,如图3B所示,第二电子设备200中安装有第一应用。第一电子设备100可通过与第二电子设备200之间的通信连接,获取第二电子设备200的应用程序信息,从而确定第二电子设备200安装有第一应用。可选的,第一电子设备100可根据获取到的应用程序信息,显示第二电子设备200中应用的应用图标。响应于用户点击第一应用的应用图标的操作,第一电子设备100向第二电子设备200请求获取第一应用的数据,从而实现跨设备访问第一应用的数据。
可选的,第一电子设备100请求获取的第一应用的数据包括用户点击第一应用的应用图标所指示显示的界面的数据,如第一应用的首页数据。
可选的,第一电子设备100中可安装有第一应用或未安装第一应用。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图3B所示,应用程序框架层可以包括窗口管理器,内容提供器,视图***,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图***包括可视控件,例如显示文字的控件,显示图片的控件等。视图***可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,备忘录应用的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供第一电子设备100或第二电子设备200的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在***顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android runtime包括核心库和虚拟机。Android runtime负责安卓***的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
***库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。
表面管理器用于对显示子***进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
二维图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
以下以第一电子设备100为第一电子设备,第二电子设备200为第二电子设备,以第一电子设备100跨设备访问第二电子设备200的数据为例,对本申请实施例提供的数据同步方法进行说明。
在一种实施方式中,第一电子设备和第二电子设备之间建立有通信连接,第一电子设备可通过通信连接跨设备访问第二电子设备中的数据,实现第一电子设备100和第二电子设备200之间的数据同步。
可选的,第一电子设备和第二电子设备之间的通信连接例如为多屏协同连接,以满足用户通过第一电子设备使用第二电子设备的功能的需求。比如,第一电子设备和第二电子设备中安装多屏协同应用,之后可通过多屏协同应用建立第一电子设备和第二电子设备之间的多屏协同连接。其中,建立多屏协同连接的各个电子设备中,第一电子设备(如接收端设备)可同步第二电子设备(如源端设备)中的应用数据,根据获取到的应用数据,显示第二电子设备中的应用界面,用户可在第一电子设备上使用第二电子设备的应用。
可选的,第一电子设备与第二电子设备建立通信连接后,可获取到第二电子设备的应用列表信息,并根据应用列表信息显示相应的应用图标。之后,第一电子设备可响应于用户对应用图标的操作,向第二电子设备发送应用启动请求。第二电子设备响应于接收到的应用启动请求,后台启动相应的应用,并将相应的应用数据发送到第一电子设备。那么第一电子设备可根据获取到的应用数据显示应用界面。从而实现通过投屏的方式启动第二电子设备中的应用,并且不影响第二电子设备的运行。这样,第一电子设备在不安装第二电子设备应用的情况下,也可根据应用列表信息,确定第二电子设备安装有该应用,从而实现第一电子设备显示该应用界面供用户使用。
在上述示例的跨设备数据访问场景中,第一电子设备需要获取到第二电子设备中的应用数据,从而实现显示第二电子设备中的应用的界面。为避免单次数据同步的数据量过大,第一电子设备可在检测到用户指示显示应用界面的操作后,向第二电子设备请求获取用于显示待显示界面的数据,从而减少数据传输量。
示例性的,手机(如第一电子设备)与平板(如第二电子设备)建立通信连接,用户通过手机使用平板中的备忘录应用(如第一应用),手机需要同步平板中的备忘录数据。如图4中的(a)所示界面401,手机显示平板中的备忘录应用的首页的过程中,检测到用户点击控件41的操作,确定用户指示打开备忘录内容3。那么,手机可确定待显示的界面为备忘录内容3的界面,可向平板请求获取用于显示该界面的数据。
可选的,手机响应于用户操作,生成用于查询显示备忘录内容3对应的界面所需的数据对应的数据查询条件,并将该数据查询条件发送到平板。那么,平板根据接收到的数据查询条件,可确定相应的数据,并将该数据发送到手机。如图4中的(b)所示,手机接收到平板发送的数据后,可显示备忘录内容3对应的界面402。
如此,在跨设备数据访问过程中,第一电子设备和第二电子设备之间传输的数据为用于第一电子设备显示待显示界面的数据,而不再是应用的全量数据。有效减少数据传输量,降低电子设备功耗。
可选的,用户操作指示显示的界面对应的数据,可能包括用于显示待显示界面的数据以及用于显示与该待显示界面相关联的界面的数据。
示例性的,如图4所示场景,备忘录内容3包括的内容较多,手机可能无法在一个界面上显示全部的备忘录内容3包括的内容。如图4中的(b)所示界面402,响应于用户在显示屏上沿箭头43所示方向的滑动操作(即翻页操作),手机可显示如图4中的(c)所示界面403。如附图标记44所示,手机可在界面403上,显示备忘录内容3中剩余的内容。
那么,响应于用户在界面401上用户点击控件41的操作,手机可获取到备忘录内容3包括的全部内容对应的数据。之后,手机可根据显示屏大小等信息,基于获取到的第二电子设备发送的数据,显示界面402。如后续手机检测到用户在界面402上的翻页操作,可直接根据已获取的数 据,显示界面403。
或者,应用中已完成数据的切分。响应于用户在界面401上用户点击控件41的操作,手机可向平板请求获取用于显示界面402的数据。如后续手机检测到用户在界面402上的翻页操作,手机可再向平板请求获取用于显示界面403的数据。
需要说明的是,为了便于描述,下文中第一电子设备响应于用户操作,确定的界面所需的数据,包括用户操作指示的界面对应的全部数据。如包括显示当前待显示的界面的数据,还可包括显示与当前待显示的界面相关联的界面的数据。
可选的,第一电子设备如之前已经访问过用户操作指示显示的第二电子设备中的应用,那么第一电子设备本地可能保存有该应用的数据,该数据在本次数据同步过程中可不必再重新同步。那么,第一电子设备可生成本地数据快照。之后,第一电子设备可将数据查询条件和本地数据快照发送到第二电子设备,第二电子设备可根据数据查询条件和本地数据快照,筛选待显示的应用界面对应的数据中第一电子设备未存储的数据,将这一部分数据同步到第一电子设备。从而能够在实现数据同步的基础上,减少单次数据传输数量,提高同步效率,降低功耗。
示例性的,如图4所示中的(a)所示,响应于用户在界面401上用户点击控件41的操作,手机(即第一电子设备)获取到的平板(即第二电子设备)发送的数据仅包括用于显示如图4中的(b)所示的界面402的数据(即当前备忘录内容3对应的内容只包括界面402的显示内容)。
之后,响应于用户在平板上,对备忘录应用中备忘录内容3的编辑操作,新增部分备忘录数据。之后,响应于用户在界面401上用户点击控件41的操作,手机向平板发送携带有界面402对应的本地数据快照的数据请求。那么,平板可根据获取到的本地数据快照,向手机发送备忘录内容3中新增的备忘录数据,而不必再重复发送第一电子设备中已有的数据。
如此,进一步减少跨设备数据访问过程中,电子设备之间数据的传输量,降低电子设备功耗。
在一种实施方式中,第一电子设备和第二电子设备之间跨设备数据访问的过程中,不仅可以实现如上所述的跨设备访问应用数据,也可实现跨设备访问服务数据等,满足第一电子设备和第二电子设备之间的数据同步需求。可选的,跨设备访问的应用数据例如包括应用显示数据、音频数据等多种类型的数据。
比如,第一电子设备跨设备访问第二电子设备中的备忘录应用,同步备忘录应用的界面显示数据,以显示第二电子设备中的备忘录应用界面。或者,第一电子设备跨设备访问第二电子设备中的音乐应用,同步音乐应用的界面显示数据和音频数据,以显示第二电子设备中的音乐应用界面,以及播放音乐。
又比如,第一电子设备跨设备访问第二电子设备中的任务管理器服务、安装包管理服务等服务,以实现同步第一电子设备和第二电子设备之间的服务数据。
示例性的,仍以手机为接收端设备,平板为源端设备,手机显示平板中的应用(如备忘录应用)为例。如图5中的(a)所示界面501,响应于用户在显示屏底部沿箭头51所示方向的上划操作,手机确定用户指示显示多任务界面。多任务界面中通过层叠、堆叠或并排等排列方式来显示已启动的多个应用(任务)对应的卡片。其中,手机跨设备访问平板中的应用,那么在手机的多任务界面上显示的卡片可能包括平板中的应用对应的卡片。因此,手机响应于用户操作启动任务管理器服务后,任务管理器服务不仅需要确定手机中已经启动的应用,还需要与平板中的任务管理器服务进行同步,以确定手机使用的平板中的应用。并且,手机可获得手机在检测到用户指示显示多任务界面的操作前,这部分平板应用对应的显示界面内容,以生成相应的卡片。之后,手机可显示如图5中的(b)所示的多任务界面502。在多任务界面502中,如附图标记52所示,显示有手机使用的平板中的备忘录应用对应的卡片。
如此,在跨设备数据访问过程中,第一电子设备和第二电子设备同步服务数据的过程中,传输的数据为用于第一电子设备显示待显示界面的数据,同样不是服务或应用的全量数据。有效减少数据传输量,降低电子设备功耗。
如下以第一电子设备跨设备访问第二电子设备中的应用为例,对上述数据同步过程进行详细介绍。
需要说明的是,第一电子设备跨设备访问第二电子设备中的应用用于表示第一电子设备跨设 备访问第二电子设备中的应用的应用数据。可选的,第一电子设备中可安装有该应用,或未安装该应用。
示例性的,图6为本申请实施例提供的一种数据同步方法的流程示意图。如图6所示,该方法包括如下步骤。
S601、响应于用户操作,第一电子设备向第二电子设备发送数据请求。
其中,用户操作例如为用户对第一应用的操作,第一应用为第二电子设备中的应用。用户操作例如包括启动第一应用的操作(如对第一应用图标的操作、语音启动第一应用的操作等)、在第一应用界面上点击预设控件的操作(如用于指示显示第一应用的功能页面的操作等)、在第一电子设备显示屏上的手势操作等。
在一种实施方式中,第一电子设备和第二电子设备之间建立有通信连接,第一电子设备跨设备访问第二电子设备中的第一应用。第一电子设备在检测到用户对第一应用的操作后,确定第一应用为跨设备访问的第二电子设备中的应用。因此,第一电子设备向第二电子设备发送数据请求,用于请求获取第一应用中的数据。其中,为减少单次数据传输数量,第一电子设备可向第二电子设备请求获取第一应用数据中用于显示用户操作指示显示的界面的数据。
可选的,如图7所示,步骤S601包括步骤S601a和步骤S601b。
S601a、响应于用户操作,第一电子设备确定数据查询条件。
在一种实施方式中,第一电子设备响应于用户对第一应用的操作,可确定显示该操作指示的界面所需的数据对应的数据查询条件,通过数据查询条件获取相应的数据。
可选的,第一电子设备的数据库(如磁盘、内存等)可为关系型数据库等多种类型的数据库。其中,数据库中的数据可通过结构化查询语言(structured query language,SQL)等多种方式进行存储。以关系型数据库为例,在关系型数据库中,数据以行、列对应关系进行存储。其中,一条数据记录对应于一行数据,一条数据记录中不同的字段对应于该行数据不同的列。数据记录每更新一次对应于一个时间戳,通过水位高低比较相应数据记录间时间戳的先后顺序。如水位高,用于表示该条数据记录的时间戳更近,为距离当前时间点更加近的时间点更新的数据;水位低,用于表示该条数据记录的时间戳较远,为距离当前时间点较远的时间点更新的历史数据。那么相应的,数据查询条件中可包括待查询数据对应的应用名称、行信息、列信息、水位信息等中的一项或几项。
示例性的,数据库中存储的数据如以下表1所示的格式进行存储。其中,一条数据记录包括标识(identity,ID)字段、标题字段、修改时间字段、分类字段、内容字段。电子设备通过ID字段,可获取到相应的数据记录。可选的,数据查询条件包括数据记录的ID。
表1
示例性的,以上述图4所示场景为例,如图4中的(a)所示界面401,手机(第一电子设备)显示平板(第二电子设备)中的备忘录应用的首页的过程中,检测到用户点击控件41的操作,确定用户指示打开备忘录内容3。那么,手机可确定待显示的界面为备忘录内容3对应的界面,进而确定显示该界面所需的数据对应的数据查询条件。
比如,如上表1所示,粗实线选中的窗口为显示备忘录应用首页的显示数据对应的数据窗口,如显示备忘录首页需要通过该数据窗口对应的数据查询条件查询相应的显示数据。其中,001-006 对应的数据为数据库中分别用于显示界面401所示的备忘录内容1-备忘录内容6的数据。那么,如上所述响应于用户点击界面401上控件41的操作,手机可确定数据查询条件包括查询上表1中双实线选中的数据窗口对应的显示数据。如数据查询条件包括该数据窗口的行、列、水位信息等,用于查询ID为003的数据记录中内容字段的数据。
S601b、第一电子设备向第二电子设备发送数据请求,该数据请求携带有数据查询条件。
在一种实施方式中,第一电子设备在确定数据查询条件后,可向第二电子设备发送携带有数据查询条件的数据请求。相应的,第二电子设备接收第一电子设备发送的数据请求。
通过上述步骤S601a和步骤S601b,第一电子设备可响应于用户操作,向第二电子设备请求获取相应的第一应用数据。
S602、第二电子设备根据数据请求,确定目标数据,该目标数据用于显示用户操作指示显示的界面。
在一种实施方式中,第二电子设备在接收到数据请求后,可获取其中携带的数据查询条件。之后,第二电子设备可根据数据查询条件,确定第一电子设备待查询的数据所对应的应用,确定该应用的数据。之后,第二电子设备可根据数据查询条件,确定应用数据中满足数据查询条件的目标数据。
示例性的,如上述图4所示场景,第二电子设备确定的目标数据为备忘录内容3对应的数据。如上表1所示,目标数据为ID为003的数据记录包括的数据。
S603、第二电子设备向第一电子设备发送目标数据。
在一种实施方式中,第二电子设备在确定目标数据后,将该目标数据发送到第一电子设备。相应的,第一电子设备接收第二电子设备发送的目标数据。
S604、第一电子设备根据目标数据,显示用户操作指示显示的界面。
在一种实施方式中,第一电子设备在接收到目标数据后,可根据目标数据显示用户操作指示显示的界面。
可选的,第一电子设备在接收到目标数据后,可将目标数据缓存至内存中。相比于磁盘,内存中数据读写速度较快,提高数据读写速度,从而提高界面显示效率。
示例性的,如上述图4所示场景,第二电子设备根据获取到的目标数据,可显示如图4中(b)所示界面402。
如此,第一电子设备根据实际需要,在跨设备数据访问过程中,按需进行数据同步,有效减少数据同步过程中的无效数据同步,提升数据同步过程中的能效比。
此外,第一电子设备按需同步数据,在保证数据同步的基础上,有效节省数据同步功耗,提升用户使用体验。
可选的,如图6所示,在步骤S604之后,还可以包括步骤S605,用于更新本地存储数据。
S605、第一电子设备更新本地存储数据。
在一种实施方式中,第一电子设备在接收到目标数据后,可保存接收到的目标数据。第一电子设备在跨设备访问第二电子设备的应用的过程中,可能会多次获取到第一应用的数据(即目标数据)。那么,第一电子设备在接收到目标数据后,也可根据目标数据,更新本地存储的第一应用数据。
示例性的,如上表1所示,第一电子设备中本地存储数据中包括粗实线选中的数据窗口对应的显示数据,第一电子设备接收到的第二电子设备发送的目标数据包括双实线选中的数据窗口对应的显示数据(即目标数据)。那么,第一电子设备可根据获取到目标数据更新本地存储的第一应用数据,如第一电子设备根据获取到的目标数据,更新原ID为003对应的一条数据记录。
在跨设备访问第二电子设备的应用的过程中,第一电子设备可保存相应的应用数据。那么可选的,第一电子设备在数据同步过程中,也可选择不再同步已经保存的部分应用数据,从而进一步减少数据传输量。
示例性的,图8为本申请实施例提供的又一种数据同步方法的流程示意图。如图8所示,该方法包括如下步骤。
S801、响应于用户操作,第一电子设备确定数据查询条件。
可选的,步骤S801的内容可参考上述步骤S601a所述的相关内容,在此不再赘述。
S802、第一电子设备确定本地存储数据中,满足数据查询条件的数据的第一信息。
在一种实施方式中,第一电子设备在此次检测到用户操作之前,可能已经获取过相应的部分应用数据,那么本地磁盘中也会存储有这部分数据。第一电子设备在确定数据查询条件后,可先确定本地存储数据中满足数据查询条件的数据的第一信息。这样后续,第二电子设备在确定需要同步的数据的过程中,可确定不再同步这部分数据中重复的数据,降低数据同步量。可选的,第一信息例如包括第一电子设备本地存储数据中满足数据查询条件的数据的行信息、列信息、水位信息等。
示例性的,如图4中的(a)所示界面401,手机(即第一电子设备)已经显示备忘录应用的首页,即本地存储数据至少包括备忘录首页数据。如上述步骤S601a中关于上表1所述示例的内容,本地存储有粗实线选中的数据窗口对应的显示数据。手机响应于用户点击界面401上所示控件41的操作,确定用户指示显示的界面为备忘录内容3对应的界面,如上表1所示,数据查询条件为双实线选中的数据窗口的信息。那么,可确定本地数据快照为两个数据窗***集的数据窗口的第一信息。
示例性的,如图9A所示,第一电子设备中本地存储的第一应用数据为数据A,第二电子设备中第一应用的数据为数据B。可以理解的是,数据B为第一应用的最新的全量数据,数据B包括数据A。可选的,在一些示例中,数据A中的部分数据为数据B中部分数据更新前的第一应用数据。如图9A所示,第一电子设备响应于用户操作,确定完成用户操作指示显示的界面所需的数据包括第一电子设备中存储的数据A中部分数据,以及第一电子设备中未存储的部分数据(这部分数据在第二电子设备中存储),即数据查询条件用于查询数据C和数据D。
可选的,如图9B中的(a)所示,第一电子设备的磁盘中已经存储有第一应用的数据A。并且,响应于用户操作,第一应用的进程启动第一电子设备的数据管理进程,并向数据管理进程发送数据查询条件。之后,数据管理进程从磁盘中筛选出满足数据查询条件数据C,并将数据C写入共享内存中。在该过程中,第一电子设备中的数据管理进程可确定数据C的第一信息。
S803、第一电子设备向第二电子设备发送数据请求,该数据请求中携带有数据查询条件和第一信息。
在一种实施方式中,第一电子设备在确定数据查询条件和本地存储数据中满足数据查询条件的数据的第一信息后,可向第二电子设备发送携带有数据查询条件和第一信息的数据请求。相应的,第二电子设备接收第一电子设备发送的数据请求。
S804、第二电子设备根据数据查询条件和第一信息,确定满足数据查询条件的差分数据。
在一种实施方式中,第二电子设备获取到数据查询条件和第一信息后,确定数据查询条件对应的第一应用,并获取第一应用的数据。之后,第二电子设备在第一应用的数据中查询满足数据查询条件的数据。最后,第二电子设备根据第一信息,在查询到的数据中确定差分数据。
比如,第二电子设备确定待显示的界面的显示数据(满足数据查询条件的数据)中,第一电子设备未存储的显示数据(差分数据)。
可选的,第二电子设备通过比较第一信息和查询到的数据的信息,将确定的有效数据打包为差分数据。
比如,第二电子设备根据第一信息,确定数据查询条件查询到的数据中,第一电子设备未保存的某行数据,第二电子设备可将该行数据确定为差分数据(即有效数据)。如上表1所示,第二电子设备确定数据查询条件查询到的数据包括ID为003的这一行数据(即包括ID为003的这一条数据记录),而根据第一信息可确定第一电子设备中未保存该行数据。那么,第一电子设备可将该行数据确定为差分数据。
又比如,第二电子设备根据第一信息,确定数据查询条件查询到的数据中,第一电子设备已保存某行数据,但该行数据水位低于第二电子设备中存储的该行数据的水位,第二电子设备可将该行数据确定为差分数据。如上表1所示,第二电子设备确定数据查询条件查询到的数据包括ID为003的这一行数据,且根据第一信息可确定第一电子设备中已保存该行数据。但是,第二电子设备根据第一信息,确定第一电子设备中保存的ID 003这一行数据的水位低于第二电子设备中保 存的ID 003这一行数据的水位。即第二电子设备中保存的ID为003这一行数据,相较于第一电子设备中ID为003这一行数据为更加新的数据,因此此次需要重新同步。那么,第二电子设备可将ID为003这一行数据确定为差分数据。示例性的,如图4所示场景,如第一电子设备中保存的对应于备忘录内容3的备忘录数据包括用于显示界面402的显示数据,第二电子设备中保存的对应于备忘录内容3的备忘录数据包括用于显示界面402和界面403的显示数据(即包括新增的附图标记44对应的备忘录数据)。那么,第二电子设备中保存的对应于备忘录内容3的备忘录数据的水位高于第一电子设备中保存的对应于备忘录内容3的备忘录数据的水位,第二电子设备中保存的对应于备忘录内容3的备忘录数据为更新后的备忘录数据。
再比如,第二电子设备根据第一信息,确定数据查询条件查询到的数据中,第一电子设备已保存某行数据,且该行数据的水位相同,但列不同,第二电子设备可将该行数据中的新增列的数据确定为有效数据。如上表1所示,第二电子设备确定数据查询条件查询到的数据包括ID为003的这一行数据,且根据第一信息可确定第一电子设备中已保存水位相同的该行数据。但是,第二电子设备根据第一信息,确定第一电子设备中未保存ID为003这一行数据中,“内容”字段对应的列数据。那么,第二电子设备可将ID为003这一行数据中“内容”字段对应的列数据确定为有效数据。
可选的,第二电子设备可将前述示例场景中,未包括的其他场景中的数据确定为无效数据,不必打包在差分数据中。可选的,差分数据可为空,即此次第一电子设备和第二电子设备之间不必再传输同步数据。后续第一电子设备根据获取到的差分数据,可确定根据本地存储数据中,满足数据查询条件的数据,显示待显示的应用界面。
示例性的,如上述步骤S601a中关于上表1所示例的内容,第一电子设备本地存储有粗实线选中的数据窗口对应的显示数据,数据查询条件为双实线选中的数据窗口的信息。如上述步骤S802所述,第一信息为粗实线选中的数据窗口和双实线选中的数据窗口之间交集的数据窗口的信息。那么,第二电子设备可确定差分数据为双实线选中的数据窗口中的“内容”数据窗口对应的内容数据。即通过滑窗的方式,确定差分数据。
示例性的,如图9B中的(a)所示,第一电子设备中的数据管理进程确定数据A中满足数据查询条件的数据为数据C。那么,第一电子设备中的数据管理进程将数据查询条件和数据C的第一信息发送到第二电子设备。第二电子设备中的数据管理进程可根据数据查询条件确定用户操作指示跨设备访问的应用对应的数据为磁盘中的数据B,并且确定满足数据查询条件的数据包括数据B中的数据C和数据D。可选的,第二电子设备中的数据管理进程将数据C和数据D缓存至共享内存中。之后,如图9B中的(b)所示,第二电子设备中的数据管理进程可根据数据C的第一信息,确定差分数据为数据D,该数据D即为待第一电子设备同步的数据。
其中,为了方便描述,在图9B所示的场景中,以第一电子设备中存储的数据C为最新的数据,且将第二电子设备查询到的数据切分为数据C和数据D为例,对跨设备数据访问过程中的数据同步过程进行说明。可以理解的是,在实际跨设备数据访问过程中,第二电子设备根据数据查询条件查询到的数据可以包括第一电子设备中的部分数据,或者也可以包括第一电子设备中的部分数据对应的更新后的数据(如数据B包括第一电子设备中的数据C更新后的数据)。
S805、第二电子设备向第一电子设备发送差分数据。
在一种实施方式中,第二电子设备在确定差分数据后,将该差分数据发送到第一电子设备。相应的,第一电子设备接收第二电子设备发送的差分数据。
S806、第一电子设备根据差分数据和本地存储数据,显示用户操作指示显示的界面。
在一种实施方式中,第一电子设备在接收到差分数据后,根据差分数据和本地存储的第一应用数据,确定待显示的第一应用界面的显示数据,并将该显示数据发送到第一应用。第一应用获取到显示数据后,可显示相应的第一应用界面。
示例性的,如图4所示场景,手机获取到平板发送的差分数据后,可将差分数据同步到共享内存中,并记录差分数据对应的偏移窗口信息。之后,备忘录应用根据偏移窗口信息,可在共享内存中确定所需的显示数据,以显示如图4中的(b)所示的备忘录内容3的界面402。
又示例性的,如图9B中的(c)所示,第一电子设备中的数据管理进程获取到第二电子设备 发送的差分数据(如数据D)后,数据管理进程将数据D写入到第一电子设备的共享内存中,并确定数据D对应的偏移窗口信息。之后,数据管理进程向第一应用的进程发送数据同步完成信号,该数据同步完成信号中可携带共享内存信息和偏移窗口信息。第一应用的进程根据偏移窗口信息可从共享内存中读取出数据C和数据D。进而第一应用的进程可根据数据C和数据D显示用户操作指示显示的界面。
如此,第一电子设备根据实际需要,在跨设备数据访问过程中,按需进行数据同步,有效减少数据同步过程中的无效数据同步,提升数据同步过程中的能效比。
并且,第一电子设备按需同步数据,在保证数据同步的基础上,有效节省数据同步功耗,提升用户使用体验。
此外,第一电子设备通过共享内存中的数据同步,减少磁盘中数据的读写次数,提高效率,降低第一电子设备的性能损耗。
S807、第一电子设备通过差分数据更新本地数据。
在一种实施方式中,第一电子设备在接收到差分数据后,也可根据差分数据,更新本地存储的第一应用数据。
示例性的,如上表1所示,第一电子设备中本地存储数据中包括粗实线选中的数据窗口对应的显示数据,第一电子设备接收到的第二电子设备发送的差分数据包括双实线选中的“内容”数据窗口对应的显示数据。那么,第一电子设备可根据获取到的“内容”数据窗口对应的显示数据更新本地存储的第一应用的显示数据。比如,第一电子设备新增“内容”数据窗口对应的显示数据。
可选的,第一电子设备更新本地数据,包括根据差分数据新增本地未存储的显示数据,还可包括更新的第一电子设备中已经存储的旧的显示数据。如上表1所示,差分数据还包括双实线选中的“分类”数据窗口对应的数据。那么,第一电子设备在获取到差分数据后,可根据双实线选中的“分类”数据窗口对应的显示数据更新本地存储的原“分类”数据窗口对应的显示数据。
又示例性的,如图9B中的(c)所示,第一电子设备中的数据管理进程在将获取到第二电子设备发送的差分数据D写入共享内存后,还可根据差分数据D更新本地磁盘中存储的数据A,如将数据A更新为数据A’。
其中,本申请实施例不限制上述步骤S806和步骤S807的执行顺序。第一电子设备在获取到差分数据后,可先根据差分数据显示界面,之后再更新本地存储数据(即先执行步骤S806,再步骤S807)。或者,第一电子设备在获取到差分数据后,可先根据差分数据更新本地存储数据,之后再显示界面(即先执行步骤S807,再步骤S806)。或者,第一电子设备获取到差分数据后,在根据差分数据显示界面的过程中,更新本地存储数据(即同步执行步骤S806和步骤S807)。
可选的,第一电子设备中的共享内存的生命周期对应于应用或服务的生命周期,在第一电子设备结束此次服务或应用的进程的运行后,共享内存的生命周期也随之结束。因此,第一电子设备通过同步磁盘中的数据,避免同步数据丢失,以便于下次启动应用或服务时,可从磁盘中读取到相应的数据。
可选的,如图9B中的(a)所示,第一电子设备中的数据管理进程在共享内存生命周期的开始阶段(如启动应用或服务后),先从磁盘中确定满足数据查询条件的数据,再将该数据写入到共享内存中,以完成后续的数据同步过程。
后续,响应于用户操作,第一电子设备中的数据管理进程可直接先确定共享内存中的数据是否满足数据查询条件,如存在已经满足数据查询条件的数据,可直接完成数据读取,提高界面显示执行效率。或者,数据管理进程确定磁盘中和共享内存中均存在满足数据查询条件的数据,可将磁盘中有但共享内存中没有的数据,从磁盘中读取出来,写入到共享内存中,之后数据管理进程再基于共享内存中的数据完成跨设备的数据同步。从而减少磁盘数据的读取量,提高效率。
在一些场景中,在上述步骤S802中,第一电子设备在从磁盘中查询到满足数据查询条件的数据后,也可直接确定这部分数据的第二信息,向第二电子设备发送第二信息和数据查询条件。之后,第一电子设备也可获取到第二电子设备根据第二信息和数据查询条件确定的差分数据。第一电子设备再根据差分数据更新磁盘中的数据,以完成用户操作指示的任务。
如此,第一电子设备同样能够减少跨设备数据访问过程中,第一电子设备和第二电子设备之间传输的数据量,提升数据同步过程中的能效比。
可选的,第一电子设备和第二电子设备跨设备数据访问过程中,其他应用或服务的数据同步的过程,可参考上述各个实施例中示例的应用数据同步过程,本申请实施例对此不再赘述。
可选的,图10为本申请实施例提供的一种数据同步方法流程的示意图。如图10所示,该方法包括如下步骤。
S1001、响应于用户的第一操作,第一电子设备向第二电子设备发送第一数据请求,该第一数据请求用于请求第一操作指示显示的第一界面所需的数据。
其中,第一界面对应于第二电子设备中的第一应用。可选的,第一应用包括第二电子设备中的应用程序(application,APP),或服务(如任务管理器服务、安装包管理服务等)。响应于第一操作,第一电子设备和第二电子设备可同步该第一操作指示显示的第一界面所需的应用数据或服务数据。
其中,第一界面包括为第一电子设备响应于用户操作待显示的界面。第一数据包括用户操作指示的待显示的界面的数据以及与待显示的界面关联界面的数据,或者第一数据包括用户操作指示的待显示的界面的数据。
示例性的,如上述图4所示场景,第一界面为如图4中的(b)所示界面402。第一数据包括备忘录应用3对应的全部数据,如包括用于显示界面402的数据,以及用于显示如图4中的(c)所示界面403的数据。或者,第一数据包括用于显示界面402的数据。
在一种实施方式中,响应于第一操作,第一电子设备确定数据查询条件,该数据查询条件用于查询显示第一界面所需的数据。之后,第一电子设备向第二电子设备发送的第一数据请求中携带有数据查询条件,从而第二电子设备能够根据数据查询条件,确定显示第一界面所需的数据。
可选的,第一电子设备确定数据查询条件后,获取本地数据中满足数据查询条件的第三数据,确定第三数据的第一信息。其中,第一数据请求中还携带有第一信息,第一信息包括第三数据的如下一项或几项信息:行信息、列信息、水位信息。
这样,第二电子设备在获取第一数据请求后,可确定第一电子设备中已经存储的部分用于显示第一界面所需的数据。那么,第二电子设备可选择不再同步这部分数据,进一步减少后续应用数据同步过程中的数据传输量。
可选的,第一电子设备查询第一存储空间中存储的本地数据中满足数据查询条件的第三数据。之后,第一电子设备将第三数据缓存至第二存储空间后,确定第三数据的第一信息。其中,第一存储空间例如为磁盘,第二存储空间例如为共享内存。相比于磁盘,共享内存中数据读写速度较快,将用于显示第一界面的数据缓存至共享内存中后,应用进程可直接在共享内存中获取第一界面的数据,提高数据读写速度,从而提高界面显示效率。
示例性的,如图9B中的(a)所示,第一电子设备的磁盘(即第一存储空间)中已经存储有第一应用的数据A。第一电子设备从磁盘中筛选出满足数据查询条件数据C,并将数据C写入共享内存(即第二存储空间)中。
S1002、第二电子设备根据第一数据请求,确定第一数据。
在一种实施方式中,第二电子设备接收到第一数据请求后,可确定第一数据请求用于请求的数据为第一应用的数据。
可选的,第一数据请求中携带有数据查询条件,第二电子设备在根据数据查询条件可确定第一应用的数据中满足数据查询条件的数据,进而可确定这部分数据确定为第一数据。其中,第一数据为第一应用中的部分数据。这样,后续第二电子设备可向第一电子设备发送第一数据,能够有效减少数据传输量。
可选的,第一数据请求中携带有数据查询条件和第一信息,该第一信息为第一电子设备确定的第一电子设备中满足数据查询条件的第三数据的信息。那么,第二电子设备在确定本地满足数据查询条件的第四数据后,可根据第一信息,确定第四数据中需要同步的第一数据。这样,第二电子设备只需向第一电子设备发送第一电子设备中没有存储的用于显示第一界面的数据,进一步减少数据的传输量。
示例性的,第二电子设备根据第一信息,确定第四数据中需要同步的第一数据,包括:第二电子设备根据第一信息,确定第四数据中包括第三数据中没有的第一行数据,确定第一行数据为第一数据。和/或,第二电子设备根据第一信息,确定第四数据中水位高于第三数据的第二行数据,确定第二行数据为第一数据。和/或,第二电子设备根据第一信息,确定第一列数据,第一列数据为第四数据和第三数据中水位相同的第三行数据中,第三数据不包括的列数据,确定第一列数据为第一数据。
比如,如上表1所示,第二电子设备确定数据查询条件查询到的数据包括ID为003的这一行数据(即包括ID为003的这一条数据记录),而根据第一信息可确定第一电子设备中未保存该行数据。那么,第一电子设备可将该行数据确定为第一数据。
S1003、第二电子设备向第一电子设备发送第一数据。
可选的,第二电子设备在确定第一数据后,向第一电子设备发送第一数据。相应的,第一电子设备接收第二电子设备发送的第一数据。
S1004、第一电子设备响应于第一数据,显示第一界面。
在一种实施方式中,第一电子设备在接收到第一数据后,可根据第一数据显示第一界面。
示例性的,如上述图4所示场景,第一电子设备接收到用户发送的备忘录内容3对应的第一数据后,可根据第一数据显示如图4中的(b)所示界面402(即第一界面)。
可选的,第一电子设备通过接收到的第一数据更新第二存储空间中的第三数据。之后,第一电子设备可根据第二存储空间中的更新后的数据,显示第一界面。
示例性的,第一电子设备在接收到第一数据后,根据第一数据更新共享内存中已经存储的第一界面对应的数据。之后,第一电子设备可根据共享内存中更新后的数据,显示第一界面。
可选的,第一电子设备在接收到第一数据后,还可根据第一数据,更新本地数据。
示例性的,第一电子设备在接收到第一数据后,根据第一数据更新磁盘中的已经存储的第一应用的数据。这样后续第一电子设备响应于用户指示显示第一应用的界面的操作,可从磁盘中获取到已经更新的第一应用的数据。
S1005、响应于用户的第二操作,第一电子设备向第二电子设备发送第二数据请求,该第二数据请求用于请求第二操作指示显示的第二界面所需的数据。
其中,第二界面同样对应于第一应用。也就是说,第一电子设备在显示第一界面后,又响应于用户操作,确定用户指示显示第一应用的其他界面,如第二界面。那么,第一电子设备就需要向第二电子设备再请求获取用于显示第二界面所需的数据。
S1006、第二电子设备根据第二数据请求,确定第二数据。
在一种实施方式中,第二电子设备接收到第二数据请求后,可确定第二数据请求用于请求的数据为第一应用的数据。其中,第二数据不同于第一数据。
可选的,第二数据请求中携带有用于查询第二界面对应的数据的数据查询条件。第二电子设备在接收到第二数据请求后,可根据数据查询条件可确定第一应用的数据中满足数据查询条件的数据,进而可确定这部分数据确定为第二数据。
可选的,第二数据请求中携带有用于查询第二界面对应的数据的数据查询条件以及第一电子设备中满足该数据查询条件的数据的第二信息。第二电子设备在接收到第二数据请求后,可根据该数据查询条件确定部分第一应用的数据,之后再根据第二信息,确定这部分第一应用的数据中,第一电子设备未存储的第二数据。
S1007、第二电子设备向第一电子设备发送第二数据。
可选的,第二电子设备在确定第二数据后,向第一电子设备发送第二数据。相应的,第一电子设备接收第二电子设备发送的第二数据。
S1008、第一电子设备响应于第二数据,显示第二界面。
在一种实施方式中,第一电子设备在接收到第二数据后,可根据第二数据显示第二界面。
可选的,第一电子设备根据第二数据根据本地保存的第一应用的数据。
示例性的,如上述图4所示场景,第一电子设备显示如图4中的(b)所示界面402的过程中,响应于用户操作,返回显示备忘录应用首页,如显示如图4中的(a)所示界面401。之后,第一 电子设备检测到用户点击控件45的第二操作,可向第二电子设备发送第二数据请求,该第二数据请求用于请求获取显示备忘录内容5对应的界面所需的数据。第二电子设备响应于第二数据请求向第一电子设备发送该数据,从而第一电子设备可显示备忘录内容5对应的界面。
如此,在跨设备数据访问过程中,第一电子设备和第二电子设备之间传输的数据为用于第一电子设备显示待显示界面的数据,而不再是应用的全量数据。有效减少数据传输量,降低电子设备功耗。
在一些方案中,可以对本申请的多个实施例进行组合,并实施组合后的方案。可选的,各方法实施例的流程中的一些操作任选地被组合,并且/或者一些操作的顺序任选地被改变。并且,各流程的步骤之间的执行顺序仅是示例性的,并不构成对步骤之间执行顺序的限制,各步骤之间还可以是其他执行顺序。并非旨在表明所述执行次序是可以执行这些操作的唯一次序。本领域的普通技术人员会想到多种方式来对本文所述的操作进行重新排序。另外,应当指出的是,本文某个实施例涉及的过程细节同样以类似的方式适用于其他实施例,或者,不同实施例之间可以组合使用。
此外,方法实施例中的某些步骤可等效替换成其他可能的步骤。或者,方法实施例中的某些步骤可以是可选的,在某些使用场景中可以删除。或者,可以在方法实施例中增加其他可能的步骤。
并且,各方法实施例之间可以单独实施,或结合起来实施。
以上结合图4-图10详细说明了本申请实施例提供的数据同步方法。以下结合图11和图12详细说明本申请实施例提供的电子设备。
在一种可能的设计中,图11为本申请实施例提供的第一电子设备的结构示意图。如图11所示,第一电子设备1100可以包括:收发单元1101、处理单元1102以及显示单元1103。第一电子设备1100可用于实现上述方法实施例中涉及的第一电子设备的功能。
可选地,收发单元1101,用于支持第一电子设备1100执行图6中的S601和S603;和/或,用于支持第一电子设备1100执行图7中的S601b;和/或,用于支持第一电子设备1100执行图8中的S803和S805;和/或,用于支持第一电子设备1100执行图10中的S1001、S1003、S1005以及S1007。
可选地,处理单元1102,用于支持第一电子设备1100执行图6中的S605;和/或,用于支持第一电子设备1100执行图7中的S601a;和/或,用于支持第一电子设备1100执行图8中的S801、S802以及S807。
可选地,显示单元1103,用于支持第一电子设备1100显示界面内容;和/或,支持第一电子设备1100执行图6中的S604;和/或,用于支持第一电子设备1100执行图8中的S806;和/或,用于支持第一电子设备1100执行图10中的S1004和S1008。
其中,收发单元可以包括接收单元和发送单元,可以由收发器或收发器相关电路组件实现,可以为收发器或收发模块。第一电子设备1100中的各个单元的操作和/或功能分别为了实现上述方法实施例中所述的数据同步方法的相应流程,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能单元的功能描述,为了简洁,在此不再赘述。
可选地,图11所示的第一电子设备1100还可以包括存储单元(图11中未示出),该存储单元中存储有程序或指令。当收发单元1101、处理单元1102以及显示单元1103执行该程序或指令时,使得图11所示的第一电子设备1100可以执行上述方法实施例中所述的数据同步方法。
图11所示的第一电子设备1100的技术效果可以参考上述方法实施例中所述的数据同步方法的技术效果,此处不再赘述。
除了以第一电子设备1100的形式以外,本申请提供的技术方案也可以为第一电子设备中的功能单元或者芯片,或者与第一电子设备匹配使用的装置。
在一种可能的设计中,图12为本申请实施例提供的第二电子设备的结构示意图。如图12所示,第二电子设备1200可以包括:收发单元1201和处理单元1202。第二电子设备1200可用于实现上述方法实施例中涉及的第二电子设备的功能。
可选地,收发单元1201,用于支持第二电子设备1200执行图6中的S601和S603;和/或, 用于支持第二电子设备1200执行图7中的S601b;和/或,用于支持第二电子设备1200执行图8中的S803和S805;和/或,用于支持第二电子设备1200执行图10中的S1001、S1003、S1005以及S1007。
可选地,处理单元1202,用于支持第二电子设备1200执行图6中的S602;和/或,用于支持第二电子设备1200执行图8中的S804;和/或,用于支持第二电子设备1200执行图10中的S1002和S1006。
其中,收发单元可以包括接收单元和发送单元,可以由收发器或收发器相关电路组件实现,可以为收发器或收发模块。第二电子设备1200中的各个单元的操作和/或功能分别为了实现上述方法实施例中所述的数据同步方法的相应流程,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能单元的功能描述,为了简洁,在此不再赘述。
可选地,图12所示的第二电子设备1200还可以包括存储单元(图12中未示出),该存储单元中存储有程序或指令。当收发单元1201和处理单元1202执行该程序或指令时,使得图12所示的第二电子设备1200可以执行上述方法实施例中所述的数据同步方法。
图12所示的第二电子设备1200的技术效果可以参考上述方法实施例中所述的数据同步方法的技术效果,此处不再赘述。
除了以第二电子设备1200的形式以外,本申请提供的技术方案也可以为第二电子设备中的功能单元或者芯片,或者与第二电子设备匹配使用的装置。
本申请实施例还提供一种芯片***,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片***实现上述任一方法实施例中的方法。
可选地,该芯片***中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。
可选地,该芯片***中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请实施例并不限定。示例性地,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型,以及存储器与处理器的设置方式不作具体限定。
示例性地,该芯片***可以是现场可编程门阵列(field programmable gate array,FPGA),可以是专用集成芯片(AP设备plication specific integrated circuit,ASIC),还可以是***芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。
应理解,上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当该计算机程序在计算机上上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的数据同步方法。
本申请实施例还提供一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的数据同步方法。
另外,本申请实施例还提供一种装置。该装置具体可以是组件或模块,该装置可包括相连的一个或多个处理器和存储器。其中,存储器用于存储计算机程序。当该计算机程序被一个或多个处理器执行时,使得装置执行上述各方法实施例中的数据同步方法。
其中,本申请实施例提供的装置、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法。因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
结合本申请实施例公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应地软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read only memory,ROM)、可擦除可编程只读存储器(erasable programmable ROM,EPROM)、电可擦可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于专用集成电路(AP设备plication specific integrated circuit,ASIC)中。
通过以上的实施方式的描述,本领域技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明。实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成;即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的***,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的。例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式;例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,模块或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
计算机可读存储介质包括但不限于以下的任意一种:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (18)

  1. 一种数据同步***,其特征在于,所述***包括:第一电子设备和第二电子设备;
    所述第一电子设备,用于响应于用户的第一操作,向所述第二电子设备发送第一数据请求,所述第一数据请求用于请求所述第一操作指示显示的第一界面所需的数据,所述第一界面对应于所述第二电子设备中的第一应用;
    所述第二电子设备,用于响应于所述第一数据请求,向所述第一电子设备发送第一数据;
    所述第一电子设备,还用于响应于接收到的所述第一数据,显示所述第一界面;
    所述第一电子设备,还用于响应于用户的第二操作,向所述第二电子设备发送第二数据请求,所述第二数据请求用于请求所述第二操作指示显示的第二界面所需的数据,所述第二界面对应于所述第一应用;
    所述第二电子设备,用于响应于所述第二数据请求,向所述第一电子设备发送第二数据,所述第二数据不同于所述第一数据;
    所述第一电子设备,还用于响应于接收到的所述第二数据,显示所述第二界面。
  2. 根据权利要求1所述的***,其特征在于,
    所述第一电子设备,用于响应于所述第一操作,确定数据查询条件,所述数据查询条件用于查询显示所述第一界面所需的数据,所述数据请求携带有所述数据查询条件。
  3. 根据权利要求2所述的***,其特征在于,
    所述第一电子设备,还用于获取本地数据中满足所述数据查询条件的第三数据,确定所述第三数据的第一信息;所述第一数据请求中还携带有所述第一信息,所述第一信息包括所述第三数据的如下一项或几项信息:行信息、列信息、水位信息。
  4. 根据权利要求3所述的***,其特征在于,
    所述第二电子设备,用于确定满足所述数据查询条件的第四数据;
    所述第二电子设备,用于根据所述第一信息,确定所述第四数据中需要同步的所述第一数据,所述第一数据不同于所述第三数据,或所述第一数据中的部分数据对应于更新后的所述第三数据。
  5. 一种数据同步方法,其特征在于,所述方法包括:
    响应于用户的第一操作,第一电子设备向第二电子设备发送第一数据请求,所述第一数据请求用于请求所述第一操作指示显示的第一界面所需的数据,所述第一界面对应于所述第二电子设备中的第一应用;
    所述第一电子设备接收所述第二电子设备发送的第一数据,所述第一数据为所述第二电子设备响应于所述第一数据请求确定的数据;
    响应于接收到的所述第一数据,所述第一电子设备显示所述第一界面;
    响应于用户的第二操作,所述第一电子设备向所述第二电子设备发送第二数据请求,所述数第二据请求用于请求所述第二操作指示显示的第二界面所需的数据,所述第二界面对应于所述第一应用;
    所述第一电子设备接收所述第二电子设备发送的第二数据,所述第二数据为所述第二电子设备响应于所述第二数据请求确定的数据,所述第二数据不同于所述第一数据;
    响应于接收到的所述第二数据,所述第一电子设备显示所述第二界面。
  6. 根据权利要求5所述的方法,其特征在于,所述响应于用户的第一操作,第一电子设备向第二电子设备发送第一数据请求,包括:
    响应于所述第一操作,所述第一电子设备确定数据查询条件,所述数据查询条件用于查询显示所述第一界面所需的数据;
    所述第一电子设备向所述第二电子设备发送第一数据请求,所述第一数据请求携带有所述数据查询条件。
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:
    所述第一电子设备获取本地数据中满足所述数据查询条件的第三数据,确定所述第三数据的第一信息;所述第一数据请求中还携带有所述第一信息,所述第一信息包括所述第三数据的如下一项或几项信息:行信息、列信息、水位信息。
  8. 根据权利要求7所述的方法,其特征在于,所述第一电子设备获取本地数据中满足所述数据查询条件的第三数据,确定所述第三数据的第一信息,包括:
    所述第一电子设备查询第一存储空间中存储的所述本地数据中满足所述数据查询条件的所述第三数据;
    所述第一电子设备将所述第三数据缓存至第二存储空间后,确定所述第三数据的所述第一信息。
  9. 根据权利要求8所述的方法,其特征在于,所述响应于接收到的所述第一数据,所述第一电子设备显示所述第一界面,包括:
    所述第一电子设备通过接收到的所述第一数据更新所述第二存储空间中的所述第三数据;
    所述第一电子设备根据所述第二存储空间中的更新后的数据,显示所述第一界面。
  10. 根据权利要求5-9任一项所述的方法,其特征在于,所述方法还包括:
    所述第一电子设备根据所述第一数据,更新本地数据。
  11. 一种数据同步方法,其特征在于,所述方法包括:
    第二电子设备接收第一电子设备发送的第一数据请求,所述第一数据请求为所述第一电子设备响应于用户的第一操作确定的用于获取所述第一操作指示显示的第一界面所需的数据的请求,所述第一界面对应于所述第二电子设备中的第一应用;
    所述第二电子设备根据所述第一数据请求,确定第一数据;
    所述第二电子设备向所述第一电子设备发送所述第一数据,所述第一数据用于所述第一电子设备显示所述第一界面;
    所述第二电子设备接收所述第一电子设备发送的第二数据请求,所述第二数据请求为所述第一电子设备响应于用户的第二操作确定的用于获取所述第二操作指示显示的第二界面所需的数据的请求,所述第二界面对应于所述第一应用;
    所述第二电子设备根据所述第二数据请求,确定第二数据,所述第二数据不同于所述第一数据;
    所述第二电子设备向所述第一电子设备发送所述第二数据,所述第二数据用于所述第一电子设备显示所述第二界面。
  12. 根据权利要求11所述的方法,其特征在于,所述第二电子设备根据所述第一数据请求,确定第一数据,包括:
    所述第二电子设备获取所述第一数据请求中携带的数据查询条件,确定满足所述数据查询条件的第一数据。
  13. 根据权利要求11或12所述的方法,其特征在于,所述第二电子设备根据所述第一数据请求,确定第一数据,包括:
    所述第二电子设备获取所述第一数据请求中携带的数据查询条件和第一信息,所述第一信息为所述第一电子设备确定的所述第一电子设备中满足所述数据查询条件的第三数据的信息,所述第一信息包括所述第三数据的如下一项或几项信息:行信息、列信息、水位信息;
    所述第二电子设备确定满足所述数据查询条件的第四数据;
    所述第二电子设备根据第一信息,确定所述第四数据中需要同步的所述第一数据。
  14. 根据权利要求13所述的方法,其特征在于,所述第二电子设备根据第一信息,确定所述第四数据中需要同步的所述第一数据,包括:
    所述第二电子设备根据所述第一信息,确定所述第四数据中包括所述第三数据中没有的第一行数据,确定所述第一行数据为所述第一数据;
    和/或,
    所述第二电子设备根据所述第一信息,确定所述第四数据中水位高于所述第三数据的第二行数据,确定所述第二行数据为所述第一数据;
    和/或,
    所述第二电子设备根据所述第一信息,确定第一列数据,所述第一列数据为所述第四数据和所述第三数据中水位相同的第三行数据中,所述第三数据不包括的列数据,确定所述第一列数据 为所述第一数据。
  15. 一种电子设备,其特征在于,包括:处理器、显示屏和存储器,所述存储器和所述显示屏与所述处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述处理器从所述存储器中读取所述计算机指令,使得所述电子设备执行如权利要求5-10中任意一项所述的方法。
  16. 一种电子设备,其特征在于,包括:处理器和存储器,所述存储器与所述处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述处理器从所述存储器中读取所述计算机指令,使得所述电子设备执行如权利要求11-14中任意一项所述的方法。
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行如权利要求5-10中任意一项所述的方法;或者,使得所述电子设备执行如权利要求11-14中任意一项所述的方法。
  18. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求5-10中任意一项所述的方法;或者,使得所述计算机执行如权利要求11-14中任意一项所述的方法。
PCT/CN2023/107206 2022-07-26 2023-07-13 数据同步方法、电子设备及*** WO2024022119A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210883769.7A CN117527822A (zh) 2022-07-26 2022-07-26 数据同步方法、电子设备及***
CN202210883769.7 2022-07-26

Publications (1)

Publication Number Publication Date
WO2024022119A1 true WO2024022119A1 (zh) 2024-02-01

Family

ID=89705345

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/107206 WO2024022119A1 (zh) 2022-07-26 2023-07-13 数据同步方法、电子设备及***

Country Status (2)

Country Link
CN (1) CN117527822A (zh)
WO (1) WO2024022119A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200183525A1 (en) * 2017-08-23 2020-06-11 Huawei Technologies Co., Ltd. Display method and apparatus
CN112291764A (zh) * 2019-08-06 2021-01-29 华为技术有限公司 一种内容接续方法、***及电子设备
CN112486363A (zh) * 2020-10-30 2021-03-12 华为技术有限公司 一种跨设备的内容分享方法、电子设备及***
US20210173838A1 (en) * 2019-12-06 2021-06-10 Sap Se Intelligent sharing pagination mechanism adaptive to huge data
CN114296948A (zh) * 2020-09-21 2022-04-08 荣耀终端有限公司 一种跨设备调用应用的方法及电子设备
CN114490719A (zh) * 2022-02-16 2022-05-13 平安科技(深圳)有限公司 一种数据查询方法、装置、电子设备以及存储介质
US20230208790A1 (en) * 2020-05-29 2023-06-29 Huawei Technologies Co., Ltd. Content sharing method, apparatus, and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200183525A1 (en) * 2017-08-23 2020-06-11 Huawei Technologies Co., Ltd. Display method and apparatus
CN112291764A (zh) * 2019-08-06 2021-01-29 华为技术有限公司 一种内容接续方法、***及电子设备
US20210173838A1 (en) * 2019-12-06 2021-06-10 Sap Se Intelligent sharing pagination mechanism adaptive to huge data
US20230208790A1 (en) * 2020-05-29 2023-06-29 Huawei Technologies Co., Ltd. Content sharing method, apparatus, and system
CN114296948A (zh) * 2020-09-21 2022-04-08 荣耀终端有限公司 一种跨设备调用应用的方法及电子设备
CN112486363A (zh) * 2020-10-30 2021-03-12 华为技术有限公司 一种跨设备的内容分享方法、电子设备及***
CN114490719A (zh) * 2022-02-16 2022-05-13 平安科技(深圳)有限公司 一种数据查询方法、装置、电子设备以及存储介质

Also Published As

Publication number Publication date
CN117527822A (zh) 2024-02-06

Similar Documents

Publication Publication Date Title
CN113553014B (zh) 多窗口投屏场景下的应用界面显示方法及电子设备
WO2021121052A1 (zh) 一种多屏协同方法、***及电子设备
WO2022089207A1 (zh) 一种跨设备应用交互方法、电子设备与服务器
WO2020211705A1 (zh) 一种联系人的推荐方法及电子设备
US12010257B2 (en) Image classification method and electronic device
WO2023207761A1 (zh) 外设控制方法、电子设备及***
WO2021104117A1 (zh) 一种构建应用程序资源包的方法、构建装置及终端设备
WO2021185352A1 (zh) 一种版本升级方法及相关装置
WO2023005900A1 (zh) 一种投屏方法、电子设备及***
WO2024022119A1 (zh) 数据同步方法、电子设备及***
CN115221255A (zh) 地图数据更新方法、装置及***
WO2023071590A1 (zh) 输入控制方法及电子设备
WO2022252805A1 (zh) 显示方法及电子设备
WO2023066036A1 (zh) 一种跨设备文件显示方法、设备及***
WO2022206600A1 (zh) 一种投屏方法、***及相关装置
WO2023045774A1 (zh) 显示方法及电子设备
WO2023061298A1 (zh) 一种图片备份***、方法与设备
WO2024037346A1 (zh) 页面管理方法及电子设备
CN117009023B (zh) 显示通知信息的方法及相关装置
WO2023142696A1 (zh) 缩略图存储方法及电子设备
WO2024125287A1 (zh) 数据同步方法及电子设备
CN111434154A (zh) 一种终端内***器件的管理方法及终端
WO2024140279A1 (zh) 传输文件的方法及电子设备
WO2024061129A1 (zh) 数据访问方法、电子设备和计算机可读存储介质
WO2023246290A1 (zh) 一种功耗控制方法及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23845331

Country of ref document: EP

Kind code of ref document: A1