CN117271655A - Data synchronization method, system, medium, program product and electronic device - Google Patents
Data synchronization method, system, medium, program product and electronic device Download PDFInfo
- Publication number
- CN117271655A CN117271655A CN202210671444.2A CN202210671444A CN117271655A CN 117271655 A CN117271655 A CN 117271655A CN 202210671444 A CN202210671444 A CN 202210671444A CN 117271655 A CN117271655 A CN 117271655A
- Authority
- CN
- China
- Prior art keywords
- data
- electronic device
- packet
- check code
- data packet
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 84
- 230000001360 synchronised effect Effects 0.000 claims abstract description 48
- 230000015654 memory Effects 0.000 claims description 40
- 238000012217 deletion Methods 0.000 claims description 8
- 230000037430 deletion Effects 0.000 claims description 8
- 230000005540 biological transmission Effects 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 15
- 238000004891 communication Methods 0.000 description 54
- 230000006854 communication Effects 0.000 description 54
- 238000012423 maintenance Methods 0.000 description 33
- 230000004048 modification Effects 0.000 description 31
- 238000012986 modification Methods 0.000 description 31
- 238000010586 diagram Methods 0.000 description 24
- 230000008569 process Effects 0.000 description 17
- 238000004422 calculation algorithm Methods 0.000 description 16
- 238000007726 management method Methods 0.000 description 15
- 230000006870 function Effects 0.000 description 11
- 238000010295 mobile communication Methods 0.000 description 10
- 230000005236 sound signal Effects 0.000 description 8
- 230000000977 initiatory effect Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 6
- 230000002093 peripheral effect Effects 0.000 description 6
- 238000007792 addition Methods 0.000 description 5
- 210000000988 bone and bone Anatomy 0.000 description 5
- 230000008859 change Effects 0.000 description 5
- 230000004044 response Effects 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000002452 interceptive effect Effects 0.000 description 4
- 238000005192 partition Methods 0.000 description 4
- 229920001621 AMOLED Polymers 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013523 data management Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 239000002096 quantum dot Substances 0.000 description 2
- 239000004984 smart glass Substances 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 241000854350 Enicospilus group Species 0.000 description 1
- 241000234435 Lilium Species 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000007175 bidirectional communication Effects 0.000 description 1
- 230000036772 blood pressure Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 239000004020 conductor Substances 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000001939 inductive effect Effects 0.000 description 1
- 230000000873 masking effect Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 229910044991 metal oxide Inorganic materials 0.000 description 1
- 150000004706 metal oxides Chemical class 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 230000010349 pulsation Effects 0.000 description 1
- 230000005855 radiation Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 230000001755 vocal effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3236—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
- H04L9/3239—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application relates to the field of data processing, and discloses a data synchronization method, a system, a medium, a program product and electronic equipment. The source electronic equipment stores the data in groups and sets a check code for each group, and the check code is used for identifying the content of the data stored in the groups, so that when other target electronic equipment synchronizes the data from the source electronic equipment, the check code of each group is obtained and compared with the check codes of all groups in the target electronic equipment to determine different groups of the check codes, and then the different groups of the check codes and the source electronic equipment synchronize the data in the different groups, so that when the target electronic equipment is not synchronized with the source electronic equipment for the first time, all the data do not need to be synchronized, the synchronous data quantity is reduced, and the data synchronization efficiency is improved.
Description
Technical Field
The present invention relates to the field of data processing, and in particular, to a data synchronization method, system, medium, program product, and electronic device.
Background
With the increase in the number and variety of electronic devices held by users, data synchronization is often required between electronic devices, such as synchronization of data of contacts, short messages, mails, memos, instant messages (Instant Messaging, IM), and the like, between electronic devices.
At present, after a certain electronic device and another electronic device perform data synchronization, if a user modifies data in one of the electronic devices, when the two electronic devices perform synchronization again, all data needs to be transmitted to the other electronic device to perform synchronization, which is long in time consumption and low in efficiency, and affects user experience.
Disclosure of Invention
In view of this, the embodiments of the present application provide a data synchronization method, system, medium, program product, and electronic device, which can reduce the amount of data synchronized during non-first data synchronization between electronic devices, and are beneficial to improving synchronization efficiency and user experience.
In a first aspect, the present application provides a data synchronization method, applied to a first electronic device, where the method includes: receiving a data synchronization message from a second electronic device, wherein the data synchronization message comprises M check codes, the check codes are used for identifying the data content of the corresponding data packet, and M is more than or equal to 1; comparing the M check codes with N check codes of N data packets stored on the first electronic device to determine different check codes, wherein N is more than or equal to 1; based on the determined different check codes, the N data packets stored on the first electronic device are updated to M data packets identified by the M check codes.
In this embodiment of the present application, when the first electronic device (the target electronic device) and the second electronic device (the source electronic device) perform data synchronization for the non-first time, the first electronic device may determine, according to the check code received from the second electronic device, data packets with different data contents (i.e., packets corresponding to different check codes, for example, the following differential data packets) included in the first electronic device and the second electronic device, so that only data in the data packets with different data contents need to be synchronized, thereby reducing the data amount of the data synchronization of the first electronic device from the second electronic device, which is beneficial to improving the synchronization efficiency and improving the user experience.
In one possible implementation of the first aspect, M is equal to N, and there is a one-to-one correspondence between the M check codes and the N check codes; and updating the N data packets stored on the first electronic device to M data packets identified by the M check codes based on the determined different check codes, including: and updating the first data packet corresponding to the first check code stored on the first electronic device into a second data packet corresponding to the second check code when the first check code exists in the N check codes and the second check code corresponding to the first check code in the M check codes is different from the first check code.
That is, the first electronic device compares the check code of the first data packet in the first electronic device with the check code of the second data packet corresponding to the data packet in the second electronic device, and if the check codes are different, the first electronic device updates the content in the first data packet to the content in the second data packet, which indicates that the first data packet is different from the content in the second data packet.
In one possible implementation of the first aspect, updating the N data packets stored on the first electronic device to M data packets identified by the M check codes based on the determined different check codes includes: deleting a third data packet corresponding to the third check code stored on the first electronic device when the third check code exists in the N check codes and the third check code does not exist in the M check codes; or in the case that the fourth check code exists in the M check codes and the fourth check code does not exist in the N check codes, storing a fourth data packet corresponding to the fourth check code on the first electronic device.
In the embodiment of the application, only the data packets are stored in the first electronic device and the second electronic device, so that the data amount stored in the first electronic device and the second electronic device can be reduced, and the storage space of the first electronic device and the second electronic device can be saved.
In a possible implementation of the first aspect, the check code of the data packet is determined by a message digest of each data in the data packet.
In a possible implementation of the first aspect, the check code of the data packet is determined by a message digest of each data in the data packet, including: the check code of the data packet is obtained by exclusive OR operation of message digests of all data in the data packet one by one.
In one possible implementation of the first aspect, the data packet to which each data belongs is determined according to a character of a preset field in the data.
That is, the packet in which each data is located is determined according to the character of the preset field of each data.
In a possible implementation of the first aspect, the preset field includes at least one of the following fields: in the case that the data includes contact information, the preset field includes a phone number of the contact; when the data comprises a short message, the preset field comprises the number of the receiver or the sender of the short message; in the case where the data includes a memo, the preset field includes a creation time of the memo; in the case where the data comprises mail, the preset field comprises sender or recipient information, wherein the sender or recipient information comprises an email address and/or name; in the case of a data instant message, the preset field includes a transmission or reception time of the instant message.
The data packets are determined through the preset fields, and the data packets are determined quickly due to the fact that the fields comprise simpler contents and are high in calculation speed.
In a possible implementation of the first aspect, the data content in the data packet includes at least one of the following data: contact information, text messages, memos, mails, instant messages.
In one possible implementation of the first aspect, a first application or a first service is installed in both the first electronic device and the second electronic device; and receiving, by the first application or first service installed in the first electronic device, a data synchronization message from the first application or first service installed in the first electronic device; comparing the M check codes with N check codes of N data packets stored on the first electronic device by a first application or a first service in the first electronic device to determine different check codes; the N data packets stored on the first electronic device are updated to M data packets identified by the M check codes by a different check code determined by a first application or a first service in the first electronic device.
That is, the first electronic device and the second electronic device may implement the data synchronization method of each embodiment of the present application based on the same first application, and may also implement the data synchronization method of each embodiment of the present application based on the first service.
In a possible implementation of the first aspect, the first application includes one of the following applications: contact applications, memo applications, short message applications, mail applications, instant messaging applications.
In a second aspect, the present application provides a data synchronization method applied to a second electronic device, which is characterized in that the method includes: p check codes are obtained and are used for identifying the data content of the corresponding data packet, wherein P is more than or equal to 1; and sending a data synchronization message to the first electronic device, wherein the data synchronization message comprises P check codes, and the P check codes are used for determining the data packets to be synchronized to the first electronic device in the P data packets corresponding to the P check codes.
In this embodiment of the present application, when the second electronic device synchronizes data with the first electronic device, only data packets (for example, the following difference data packets) with different data contents in the first electronic device and the second electronic device may be synchronized, so that the amount of synchronized data is reduced, the synchronization efficiency is improved, and the user experience is improved.
In a possible implementation of the second aspect, the method further includes: a check code of the data packet is determined based on the message digest of each data stored in the data packet.
That is, the P check codes are determined from the message digests of the respective data in the respective data packets.
In a possible implementation of the second aspect, determining the check code of the data packet based on the message digest of each data stored in the data packet includes: and performing exclusive OR operation on the message summaries of all the data in the data packet one by one to obtain the check code of the data packet.
That is, the P check codes are obtained by performing exclusive-or operation on the message digests of the respective data in the respective data packets one by one.
In a possible implementation of the second aspect, determining the check code of the data packet based on the message digest of each data stored in the data packet further includes: under the condition that the first data in the fifth data packet is detected to be deleted, updating the check code of the fifth data packet into an exclusive OR operation result of the information abstract of the first data and the current check code of the fifth data packet, wherein the fifth data packet is one of data packets corresponding to P check codes; or under the condition that the new second data in the sixth data packet is detected, updating the check code of the sixth data packet into an exclusive OR operation result of the information abstract of the second data and the current check code of the sixth data packet, wherein the sixth data packet is one of the data packets corresponding to the P check codes; or under the condition that the third data in the seventh data packet is detected to be modified into the fourth data, updating the check code of the seventh data packet into an exclusive OR operation result of the information abstract of the third data, the information abstract of the fourth data and the current check code of the seventh data packet one by one, wherein the seventh data packet is one of the data packets corresponding to the P check codes.
In the embodiment of the application, when the second electronic device updates the check code of each data packet, the update of the check code can be performed only by performing exclusive or operation between the message digest of the changed data and the current check code of each data packet, and recalculation based on the message digest of each data is not needed, thereby being beneficial to improving the update speed of the check code.
In a possible implementation of the second aspect, the data packet to which each data belongs is determined according to a character of a preset field in the data.
In a possible implementation of the second aspect, the preset field includes at least one of the following fields: in the case that the data includes contact information, the preset field includes a phone number of the contact; when the data comprises a short message, the preset field comprises the number of the receiver or the sender of the short message; in the case where the data includes a memo, the preset field includes a creation time of the memo; in the case where the data comprises mail, the preset field comprises sender or recipient information, wherein the sender or recipient information comprises an email address and/or name; in the case of data instant messages, the preset field includes the time of transmission or reception of the instant message.
In a third aspect, the present application provides a data synchronization system, including a first electronic device and a second electronic device; the second electronic device is used for sending a data synchronization message to the first electronic device, wherein the data synchronization message comprises R check codes, the check codes are used for identifying the data content of the corresponding data packet, and R is more than or equal to 1; the first electronic device is used for receiving the data synchronization message, comparing the R check codes with S check codes of S data packets stored on the first electronic device, determining different check codes, and updating the S data packets stored on the first electronic device into R data packets identified by the R check codes based on the determined different check codes, wherein S is more than or equal to 1.
In this embodiment of the present application, when the first electronic device (the target electronic device) and the second electronic device (the source electronic device) perform data synchronization for the non-first time, the first electronic device may determine, according to the check code received from the second electronic device, data packets with different data contents (i.e., packets corresponding to different check codes, for example, the following differential data packets) included in the first electronic device and the second electronic device, so that only data in the data packets with different data contents need to be synchronized, thereby reducing the data amount of the data synchronization of the first electronic device from the second electronic device, which is beneficial to improving the synchronization efficiency and improving the user experience.
In a possible implementation of the third aspect, the check code of the data packet is obtained by performing an exclusive-or operation on message digests of respective data in the data packet one by one.
In a possible implementation of the third aspect, the second electronic device is further configured to: updating the check code of the eighth data packet to be an exclusive or operation result of the information abstract of the fifth data and the current check code of the eighth data packet under the condition that the deletion of the fifth data in the eighth data packet is detected, wherein the eighth data packet is one of the data packets corresponding to the R check codes; or under the condition that the new sixth data in the ninth data packet is detected, updating the check code of the ninth data packet into an exclusive OR operation result of the information abstract of the sixth data and the current check code of the ninth data packet, wherein the ninth data packet is one of the data packets corresponding to the R check codes; or under the condition that the seventh data in the tenth data packet is detected to be modified into the eighth data, updating the check code of the tenth data packet into the information abstract of the seventh data, the information abstract of the eighth data and the current check code of the tenth data packet to be subjected to exclusive OR operation one by one, wherein the tenth data packet is one of the data packets corresponding to the R check codes.
In one possible implementation manner of the third aspect, the first electronic device and the second electronic device are terminal devices, or the first electronic device is a terminal device and the second electronic device is a server.
In a possible implementation of the third aspect, the data synchronization system further includes a third electronic device, where the third electronic device is configured to receive the data synchronization message from the second electronic device and send the data synchronization message to the first electronic device.
In the embodiment of the application, the second electronic device may send the data packet and the check code of the data packet to the third electronic device, and the third electronic device synchronizes data to the first electronic device. So that the third electronic device can perform data synchronization to the plurality of first electronic devices.
In one possible implementation manner of the third aspect, the first electronic device and the second electronic device are terminal devices, and the third electronic device is a server.
In one possible implementation of the third aspect, the terminal device includes any one of a mobile phone, a car phone, a wearable device, and a tablet computer.
In a fourth aspect, the present application provides a readable storage medium having stored thereon instructions that, when executed on an electronic device, cause the electronic device to implement any one of the data synchronization methods provided in the first aspect and the second aspect.
In a fifth aspect, the present application provides an electronic device, including: a memory for storing instructions for execution by one or more processors of the electronic device; and a processor, one of the processors of the electronic device, for executing instructions stored in the memory to implement any one of the data synchronization methods provided in the first aspect and the second aspect.
In a sixth aspect, the present application provides a computer program product comprising instructions which, when executed on an electronic device, cause the electronic device to implement any one of the data synchronization methods provided in the first aspect and the second aspect.
Drawings
FIG. 1A illustrates a schematic diagram of a handset 10 for group storage of contact information, according to some embodiments of the application;
FIG. 1B illustrates a schematic view of a scenario in which a smart watch 20 first synchronizes contact information from a cell phone 10, according to some embodiments of the present application;
FIG. 2A illustrates a schematic view of a scenario in which smart watch 20 does not synchronize contact information for the first time from handset 10, according to some embodiments of the present application;
FIG. 2B illustrates a schematic diagram of a process by which smart watch 20 does not synchronize contact information for the first time from handset 10, in accordance with some embodiments of the present application;
FIG. 3A illustrates a group storage schematic of contact information, according to some embodiments of the present application;
FIG. 3B illustrates a schematic diagram of partitioned storage of contacts, according to some embodiments of the present application;
FIG. 4A illustrates a schematic diagram of packet storage of a memo, according to some embodiments of the present application;
FIG. 4B illustrates a packet storage schematic of mail, according to some embodiments of the present application;
fig. 4C illustrates a packet storage schematic of a sms message, according to some embodiments of the present application;
FIG. 5 illustrates a flow diagram for packet storage of data, according to some embodiments of the present application;
FIG. 6 is a flow chart illustrating a method of updating a packet check code according to some embodiments of the present application;
FIG. 7A illustrates an open link displayed in a handset 10, according to some embodiments of the application TM A contact interface schematic of the application;
FIG. 7B illustrates a display in a cell phone 10 in an open connection, according to some embodiments of the present application TM Applying the added contact interface schematic;
FIG. 7C illustrates a clear connection displayed in the handset 10, according to some embodiments of the application TM Application contact interface detail schematics;
FIG. 7D illustrates an open link displayed in the handset 10, according to some embodiments of the application TM Applying a modified contact interface schematic;
FIG. 8 illustrates an interactive flow diagram of a data synchronization method, according to some embodiments of the present application;
FIG. 9A illustrates an interface diagram of a drop down menu bar in the handset 10, according to some embodiments of the application;
FIG. 9B illustrates a Bluetooth pairing interface diagram in a drop down menu bar in the handset 10, according to some embodiments of the application;
FIG. 10 illustrates a schematic view of a scenario of data synchronization, according to some embodiments of the present application;
FIG. 11 illustrates an interactive flow diagram of yet another data synchronization method, according to some embodiments of the present application;
FIG. 12A illustrates a schematic diagram of a vehicle 41 first synchronizing contacts with a server 30, according to some embodiments of the present application;
FIG. 12B illustrates a schematic diagram of a vehicle 41 again in contact synchronization with the server 30, in accordance with some embodiments of the present application;
FIG. 13 illustrates a schematic diagram of a scenario in which memos are synchronized in a distributed system, according to some embodiments of the present application;
FIG. 14 illustrates a software architecture diagram of the handset 10, according to some embodiments of the application;
FIG. 15 illustrates a schematic diagram of coupling the handset 10 to other electronic devices via a distributed soft bus 041, according to some embodiments of the present application;
fig. 16 illustrates a schematic diagram of the structure of a handset 10, according to some embodiments of the application.
Detailed Description
Illustrative embodiments of the present application include, but are not limited to, data synchronization methods, systems, media, program products, and electronic devices.
The following describes in detail the specific implementation procedure of the technical solution provided in the embodiments of the present application with reference to the accompanying drawings.
As described above, after data synchronization is performed between one electronic device and another electronic device, if a user modifies data in one of the electronic devices, when data synchronization is performed between the two electronic devices again, all data still needs to be sent to the other electronic device to complete the synchronization. For example, 10000 pieces of contact information are stored in the mobile phone 10, and the 10000 pieces of contact information are already synchronized to the smart watch 20, when the user modifies one piece of contact information in the mobile phone 10, the mobile phone 10 still needs to resend 10000 pieces of contact information containing the modified contact information to the smart watch 20 when synchronizing the contact information to the smart watch 20 again, which has the problems of long time consumption and low efficiency.
In order to improve the data synchronization efficiency between electronic devices, in some embodiments, the mobile phone 10 may record a log of data synchronization with other electronic devices, and record changed data content caused by modification, deletion, addition, and other operations of the user after the mobile phone 10 synchronizes data with other electronic devices last time, so that only the changed data can be synchronized when the mobile phone synchronizes data with other electronic devices next time, thereby reducing the amount of synchronized data and further improving the data synchronization efficiency. However, this way of synchronizing data needs to occupy the storage space of the mobile phone 10 to store the log synchronized with each electronic device and the changed data, and the data storage structure is complex, and after the recorded log or the changed data is cleaned, all the data stored in the mobile phone 10 still needs to be synchronized to the smart watch 20, which is time-consuming and inefficient, and affects the user experience.
For convenience of description, in the embodiments of the present application, the electronic device that sends data to the outside when synchronizing data, for example, the above-mentioned mobile phone 10, may be referred to as a source electronic device hereinafter, and the electronic device that receives the synchronization data sent by the source electronic device when synchronizing data may be referred to as a target electronic device.
In order to solve the problems of long time consumption and low efficiency in the data synchronization process, the embodiment of the application provides a data synchronization method. Specifically, in the method, the source electronic device groups each piece of stored data, and determines a check code for each group, wherein the check code can be determined based on each piece of data in the group, and the check codes of the groups are different when the content of the data in the group is different. Based on the above, when the target electronic device resynchronizes the data from the source electronic device, the target electronic device only needs to acquire the check code of each group in the source electronic device, and compares the acquired check code of each group in the source electronic device with the check code of the synchronized corresponding group in the target electronic device, so as to determine the different groups of the check codes, namely the groups with different differences of the included data. Further, the target electronic device may acquire the data of the difference packet from the source electronic device, completing data synchronization.
Therefore, the target electronic device only needs to synchronize the data of the difference packet from the source electronic device, so that the amount of the synchronous data is reduced, the synchronous efficiency is improved, and meanwhile, the additional expense of the source electronic device is not increased, for example, the source electronic device does not need to record the synchronous logs of the electronic device and each target electronic device, and also does not need to record the changed data in the source electronic device after the electronic device is synchronized with each target electronic device last time.
It will be appreciated that in some embodiments, the source electronic device may group the stored pieces of data, for example, by adding a group identifier to each piece of data, where the group identifier indicates the group of each piece of data, and for example, setting a plurality of storage areas in the memory of the source electronic device, where the data in each storage area is a group, etc. In other embodiments, the source electronic device may set a grouping rule for each piece of stored data instead of storing each piece of data in a grouping manner, and when determining the check code of a certain group, the source electronic device may first screen out the data of the group from each piece of data according to the grouping rule, and determine the check code of the group based on the screened data. For convenience of description, the description will be presented below with "the source electronic device performs packet storage of stored pieces of data".
It will be appreciated that the check code for each packet may be determined based on the specific content of each piece of data in each packet, for uniquely identifying the data stored in one packet, the contents of the data stored in the packets differing, and the check codes of the packets differing. For example, in some embodiments, the check code for each packet may be determined by logical and/or arithmetic operations performed on the message digests of each piece of data in the packet, such as by exclusive-or operations performed on the message digests of each piece of data one by one. It is assumed that three pieces of data are included in a certain packet, the message digests of the three pieces of data are X1, X2, X3, the check code of the group can be obtained by performing exclusive-or operation on the result of exclusive-or operation on X1 and X2 and then performing exclusive-or operation on X3. The exclusive or operation is that two data to be operated have the same binary number, and according to the bit number of the binary number, the bit of the input data is 0 when a certain bit is the same, and the bit of the output data is 1 when a certain bit is different, for example, the result of the exclusive or operation of x1=0101 and x2=1001 is 1100. The operation result of the exclusive-or operation of the plurality of data is independent of the order in which the respective data are operated, so that the check code of the group may be obtained by exclusive-or operation of X1 and X3 with X2, or by exclusive-or operation of X2 and X3 with X1.
It will be appreciated that, after detecting a change in data in a certain packet, for example, when the source electronic device adds, deletes or modifies a piece of data in the packet in response to a maintenance operation (such as adding, deleting, modifying, etc.) of the user, the source electronic device may update the check code of the packet based on the changed data, so that the check code of the packet may correspond to the content of the changed data stored in the packet. When the target electronic device synchronizes data from the source electronic device, the updated check code can be acquired, and the packet is determined to be a difference packet, so that the data of the packet can be synchronized.
For example, assuming that the check code of the packet is determined by performing an exclusive-or operation on the message digests of the respective pieces of data in the packet, after detecting a new addition or deletion operation on a certain piece of data, the source electronic device may update the check code of the packet to an exclusive-or operation result of the message digest of the piece of data and the current check code of the packet. For another example, the source electronic device, upon detecting a modification operation to a piece of data in the packet, may update the check code of the packet to: the result of exclusive OR operation is carried out on the message digest before the data modification, the message digest after the data modification and the current check code of the group one by one. For another example, when the source electronic device detects that the user modifies one piece of data in a certain packet, the packet of the piece of data is changed to another packet, the check code of the packet may be updated to an exclusive-or operation result of the message digest before the modification of the piece of data and the current check code of the packet, and the check code of the other packet may be updated to an exclusive-or operation result of the message digest after the modification of the piece of data and the current check code of the other packet. The details will be described in detail below, and are not described in detail herein.
It will be appreciated that Message Digest (MD) of each piece of data is available based on the specific content of each piece of data for uniquely identifying one piece of data, that is, data including different specific contents, the Message digests of the data also being different. For example, in some embodiments, the message digest of each piece of data may be calculated using a message digest algorithm, such as the MD4 algorithm (message digest algorithm designed by Ronald L. Rivest in 1990, for one piece of data, the resulting message digest comprises 128 bits of binary numbers), the MD5 algorithm (modified version of MD4 by Rivest in 1991, for one piece of data, the resulting message digest comprises 128 bits of binary numbers), the secure hash algorithm (Secure Hash Algorithm, SHA) algorithm 1 (MD algorithm designed by NIST NSA, for one piece of data, the resulting message digest comprises 160 bits of binary numbers), SHA224, SHA256, SHA384, SHA512, and the like. For convenience of description, the following embodiments will be described by taking a message digest of each piece of data obtained by the MD5 algorithm as an example.
It is understood that the source and target electronic devices may be any electronic device including, but not limited to, a laptop computer, a smart television, a smart speaker, a tablet computer, a server, a wearable device (e.g., smart watch, smart bracelet, smart glasses, etc.), a head mounted display, a mobile email device, a portable gaming device, a portable music player, a reader device, etc., and embodiments of the present application are not limited. The following description will take a source electronic device as a mobile phone 10 and a target electronic device as a smart watch 20 as an example.
Specifically, fig. 1A illustrates a schematic diagram of a handset 10 for group storage of contact information, according to some embodiments of the application; FIG. 1B illustrates a schematic view of a scenario in which a smart watch 20 first synchronizes contact information from a cell phone 10, according to some embodiments of the present application; FIG. 2A illustrates a schematic view of a scenario in which smart watch 20 does not synchronize contact information for the first time from handset 10, according to some embodiments of the present application; fig. 2B illustrates a schematic diagram of a process by which smart watch 20 may not synchronize contact information from handset 10 for the first time, in accordance with some embodiments of the present application.
Referring to fig. 1A, 10000 pieces of contact information are stored in the mobile phone 10, the mobile phone 10 may divide the 10000 pieces of contact information into 100 groups, i.e. groups 00 to 99 according to the last two digits of the phone number in the contact information, and determine a check code for each group according to the specific content of each group, for example, determine the check codes of each group, i.e. check codes 00 to 99 by performing exclusive-or operation on the information digests of the contact information in each group. Thus, referring to fig. 1B, when the smart watch 20 synchronizes the contact information from the mobile phone 10 for the first time, 10000 pieces of contact information can be obtained from the mobile phone 1, and the 10000 pieces of contact information are stored in groups in the same manner as the mobile phone 10, and the check codes of the groups are stored at the same time.
Fig. 2A illustrates a schematic view of a scenario in which smart watch 20 again synchronizes contact information from handset 10, according to some embodiments of the present application.
Referring to fig. 2A, when the smart watch 20 synchronizes the contact information from the mobile phone 10 again, it mainly includes the following steps: s21, the intelligent watch 20 can firstly acquire the check codes of all groups from the mobile phone 10, and compare the check codes of all groups with the check codes of the corresponding groups in the intelligent watch 20 to determine different groups with different check codes; s22: the smart watch 20 transmits the packet identification of the difference packet to the mobile phone 10; s23: the mobile phone 10 responds to the received grouping identification of the difference grouping, the contact information of the difference grouping is sent to the intelligent watch 20, the intelligent watch 20 stores the acquired contact in the intelligent watch 20, and the contact information synchronization is completed. For example, referring to fig. 2B, it is assumed that the check code of the group 01 of the mobile phone 10 changes due to the contact information in the group 01, for example, the user operates the mobile phone 10 to modify, delete or add the contact information, and the check code 01 is changed to the check code 01', so that when the smart watch 20 synchronizes the contact information from the mobile phone 10, the acquired check code of the group 01 is the check code 01', the check code of the group 01 in the smart watch 20 is the check code 01, and the two are different, so as to determine that the group 01 is a differential group. The intelligent watch 20 can complete the synchronization of the contacts only by acquiring the data in the group 01 from the mobile phone 10, and the synchronization of the other 99 grouped contacts is not needed, so that the synchronization efficiency is improved.
It will be appreciated that the data that the source electronic device synchronizes with the target electronic device may be, for example, any data that can facilitate grouping, such as entry-type data. The item data may be any data stored in a bar, and the item data may include at least one field, where at least one field in each piece of data includes specific content, and the item data includes, but is not limited to, contacts, sms, mails, memos, instant messages, and the like. Specifically, for example, assuming that the contact information includes a name, a phone number, and a work unit, the contact information includes three fields, that is, a name, a phone number, and a work unit, and for one piece of contact information, the three fields may have specific contents, or may have only specific contents in some of them. For convenience of description, the following description will take synchronous data as entry type data as an example.
For ease of understanding, the technical scheme of grouping the item data will be described first.
As described above, a single piece of data in the item data includes at least one field, and thus, the mobile phone 10 can use any one of the fields as a packet field of the item data, and determine the packet of each piece of data based on at least part of the contents of the packet field of the data. In general, a field having specific contents for each piece of data may be employed as a packet field or a field which is not normally modified may be employed as a packet field. For example, in the case where the item data is a contact, the grouping field may be a telephone number, a name, or the like; in the case that the item type data is a short message, the grouping field may be the number of the addressee or the sender; in the case where the item data is mail, the grouping field may be a mailbox, a name, or the like of the sender or the recipient; in the case where the item data is a memo, the packet field may be a creation time of the memo; in the case where the item data is an instant message, the packet field may be a transmission or reception time of each message, or the like. The electronic device may determine the grouping of the pieces of data based on at least a portion of the content in the grouping field using a preset grouping rule.
In particular, fig. 3A illustrates a block storage schematic of contact information, according to some embodiments of the present application. As shown in fig. 3A, the fields of the contact information include at least a phone number and a name, and the mobile phone 10 may determine the group of the pieces of contact information according to the phone number, for example, the last two digits of the phone number are taken as the group of the pieces of contact information, and the contact information stored in the mobile phone 10 is divided into 100 groups (group 00 to group 99). In some embodiments, the mobile phone 10 may add a grouping identifier to each piece of contact information, which is used to indicate the grouping of each piece of contact information, so that each piece of contact information in the mobile phone 10 may be stored in the memory according to any sequence, the mobile phone 10 may determine the grouping of each piece of contact information according to the grouping identifier of each piece of contact information, and the mobile phone 10 does not need to change the data structure of the stored contact information. In other embodiments, the handset 10 may also store contact information in a partitioned manner, i.e., store data in one group in adjacent areas of memory to increase the access speed of data in the same group. For example, referring to fig. 3B, when the mobile phone 10 stores the contact information shown in fig. 3A, 100 storage partitions may be set in the memory, and the contact information of the same group is stored in the same storage partition, so that when the mobile phone 10 can read the data of the same group from the memory more quickly, the efficiency of data synchronization is improved.
It will be appreciated that in some embodiments, the mobile phone 10 may not store the contact information in groups, but only determine the check codes from the group 00 to the group 99 by using the group field of the contact information, so that the mobile phone 10 may not adjust the data structure of the contact information stored in the mobile phone 10, for example, add a group identifier for each piece of contact information or store the contact information of the same group in the adjacent area in the memory, and only maintain the check codes of different groups, so that the data synchronization method and other electronic devices provided in embodiments of the present application can perform data synchronization according to the groups.
It will be appreciated that in other embodiments, other bits of the phone number field may be used to determine the grouping of contact information, and other fields of contact information may be used to determine the grouping of contact information, without limitation.
For another example, FIG. 4A shows a grouping storage schematic of a memo. Referring to fig. 4A, the memo includes at least two fields of a creation time and a memo content, and the mobile phone 10 may determine a group of each memo with the creation time of the memo as a group field, for example, determine a group of each memo according to a second corresponding to the creation time of each memo, and divide the memo into 60 groups. Alternatively, the number of milliseconds corresponding to each memo creation time is divided into 100 groups by taking the remainder for 10.
It will be appreciated that in other embodiments, other bits of the creation time may be used to determine the grouping of the memos, and other fields of the memo may be used to determine the grouping of the memos, without limitation.
For another example, FIG. 4B shows a packet storage schematic of mail. Referring to fig. 4B, the mail includes at least two fields of a sender/receiver and content, and the electronic device uses the sender/receiver as a grouping field to determine the grouping of each mail, for example, the mail is divided into 100 groups according to the last two digits of the american standard code for information interchange (American Standard Code for Information Interchange, ASCII) corresponding to the initial of the email address of the sender or receiver.
It will be appreciated that in other embodiments, other bits of the sender/recipient field may be used to determine the grouping of mail, and other fields of mail may be used to determine the grouping of mail, without limitation.
For another example, fig. 4C shows a packet storage schematic of a sms. Referring to fig. 4C, the short message includes at least two fields of a sender/receiver number and content, and the mobile phone 10 may determine the grouping of each short message by using the sender/receiver number field of the short message as a grouping field, for example, the last two digits in the sender/receiver number field are used as the grouping, and the short message is 100 groups.
It will be appreciated that in other embodiments, other bits of the sender/receiver field may be used to determine the grouping of the short messages, and other fields of the short messages may be used to determine the grouping of the short messages, which is not limited herein.
It will be appreciated that the above grouping fields of the various types of item data and the manner in which the items are grouped according to the grouping fields are merely examples, and in other embodiments, other grouping fields may be used to group the various types of item data in other manners, without limitation.
For easy understanding, the following describes the technical scheme of the mobile phone 10 for storing the entry data in groups, generating and updating the check code of each group.
In particular, fig. 5 illustrates a flow diagram for packet storage of data, according to some embodiments of the present application. The execution subject of the process is the mobile phone 10, for example, at least one application program or service in the mobile phone 10, as shown in fig. 5, and the process includes the following steps.
S501: item data is acquired.
Illustratively, applications in the handset 10, such as contact applications, short message service applications, mail applications, memo applications, instant messaging applications (e.g., open links) TM WeChat TM 、QQ TM Etc.) may be obtained from the memory of the handset 10 or from a server to which the application corresponds, such as contacts, messages, mails, memos, messages for instant messaging applications, etc. For convenience of description, the following steps are described by taking item data as contact information.
S502: a grouping of individual pieces of data in the item data is determined.
Illustratively, the handset 10 determines a packet field of the item data from the acquired item data, and obtains a packet of each piece of data based on the determined packet field.
For example, referring to fig. 3A, for contact information, the handset 10 may group the contact information into 100 groups with the phone number field as a grouping field and the last 2 digits of the phone number as groupings of pieces of data; for another example, referring to fig. 4A, for the memo, the creation time of the memo may be taken as a grouping field, the seconds of the creation time of the memo may be taken as a grouping field of each memo, and the memo may be divided into 60 groups; for another example, referring to fig. 4B, for mail, the last 2 bits of ASCII code of the first letter of the email address of the sender/receiver of the mail may be taken as a grouping field, dividing the mail into 100 groups; for another example, referring to fig. 4C, for a short message, the sender/receiver number may be used as a grouping field, and the last two digits of the sender/receiver number may be used as a grouping, so that the short message may be divided into 100 groups.
It will be appreciated that in other embodiments, other fields may be used to group various types of item data, without limitation.
It can be appreciated that after determining the grouping of each piece of data, the mobile phone 10 may store each piece of data in a grouping manner, for example, referring to fig. 3A, the mobile phone 10 may add a grouping identifier to each piece of contact information for indicating the grouping of each piece of contact data, so that the storage position and structure of each piece of stored contact information do not need to be adjusted; for another example, referring to fig. 3B, the mobile phone 10 may set a plurality of storage partitions in the memory, and store the contact information belonging to the same group in the same storage partition, so that the speed of reading the data of the same group from the memory by the mobile phone 10 can be increased, and the speed of sending the data of the same group to other electronic devices by the mobile phone 10 can be increased.
S503: a message digest of each piece of data in each packet is determined.
Illustratively, the handset 10 may determine the message digest of each piece of data by the aforementioned message digest algorithm of MD4, MD5, SHA-1, etc., which may be used to determine the check code of each packet.
For example, for the contact information shown in fig. 3A, the message digest of the 1 st piece of contact information "123456798 list" obtained by using the MD5 algorithm is a 32-bit 16-ary number "0FA340B963445F53D9EFC042E39AB3AA" (the 32-bit 16-ary number corresponds to a 128-bit binary number), and the message digest of the 1001 st piece of contact information "123457698RALPH" is a 32-bit 16-ary number "EF93E986151D6912858BF5BE101E4029" obtained by using the MD5 algorithm.
S504: and determining the check code of each packet according to the message digest of each piece of data in each packet.
Illustratively, the mobile phone 10 may perform a logical operation (e.g. and, or, not, exclusive or, etc.) or an arithmetic operation (e.g. add, subtract, multiply, divide, etc.) on the message digest of each piece of data according to the message digest of each piece of data determined in step S503, to obtain the check code of each packet.
In some embodiments, the handset 10 may exclusive-or the message digests of the data in a packet one by one to obtain the check code of each packet. For example, assuming that a certain packet includes n pieces of data, the message digest of the ith piece of data is Hash i The check code of the packet may be identified as Hash 1 ⊕Hash 2 ⊕……⊕Hash n (exclusive or operator), wherein the order of the message digests of the pieces of data can be arbitrarily adjusted. Specifically, for example, in fig. 3A, the group 98 includes the 1 st contact information and the 1001 st contact information, and the check code of the group 98 is the exclusive or operation result of the message digests of the two contact information, that is, 0FA340B963445F53D9EFC042E39AB3AA @ EF93E986151D6912858BF5BE101E 4029=d11 EEB639BC9B20AE321AF1CF384F383.
It will be appreciated that in other embodiments, the check code for each packet may be determined in other ways, and is not limited in this regard.
It will be appreciated that in some embodiments, the handset 10 may maintain a data for storing the check code of each packet, for example a vector of k elements may be used to store the check code of each packet, where k is the number of packets so that one element of the vector may correspond to the check code of a packet.
It can be understood that, when the mobile phone 10 stores the item data in groups for the first time, the step S501 to the step S504 can obtain the groups of each item of data and the check codes of each group, and when the item data stored in the groups are synchronized to other electronic devices, for example, the smart watch 20 for the first time, the data in each group and the check codes of each group are sent to the smart watch 20.
It should be understood that the foregoing execution sequence of steps S501 to S504 is merely an example, and in other embodiments, the execution sequence of the partial steps may be adjusted, or the partial steps may be split or combined, which is not limited herein. For example, the order of the aforementioned step S502 and step S503 may be exchanged, the aforementioned step S503 and step 504 may be combined, and the like.
The following describes a technical scheme of updating the check code of each packet when the mobile phone 10 maintains the entry data.
Specifically, fig. 6 is a flow chart illustrating a method for updating a packet check code according to some embodiments of the present application. The execution subject of the process is the mobile phone 10, for example, at least one application program or service in the mobile phone 10, as shown in fig. 6, and the process includes the following steps.
S601: a maintenance operation on the item data is detected.
Illustratively, the handset 10 may update the check code of each packet by performing the following steps S602 to S606 in the case where the maintenance operation of the item data by the user is detected.
It is to be appreciated that maintenance operations on the item data include, but are not limited to, additions, deletions, modifications.
For example, FIG. 7A illustrates a clear connection displayed in the handset 10 TM The contact interface schematic of the application, the user can enter the options interface shown in FIG. 7B, including the options menu 71, by clicking on the "Add" control 70; the user may add a contact (i.e., a new operation) by clicking the "add contact" control 711, and the mobile phone 10 may detect a maintenance operation on the item data after detecting the clicking operation of the "add contact" control 711 by the user.
For another example, the user may view detailed information of one contact in the contact interface shown in fig. 7A, for example, by clicking on a JIM header, enter the JIM contact detail interface shown in fig. 7C, and the user may enter the options interface shown in fig. 7D, including the options menu 73, by clicking on the "options" control 72; the user may edit the contact information of JIM by operating the "edit contact" control 731, and delete the contact information of JIM by operating the "delete contact" control 732. So that the handset 10 can detect maintenance operations on the item data after detecting operations of the user's edit contact' control 731 or 'delete contact' control 732.
It will be appreciated that the case where the handset 10 detects a maintenance operation on the item data is merely an example, and in other embodiments, the handset 10 may detect a maintenance operation on the item data for different application programs or services for different item data, which is not limited herein.
S602: the type of maintenance operation is determined.
Illustratively, after the handset 10 detects a maintenance operation of the item data by a user, the type of maintenance operation may be determined. If it is determined that the maintenance operation is new or deleted, the process goes to step S603; in the case where it is determined that the maintenance operation is modified, the flow goes to step S605.
It will be appreciated that the types of maintenance operations may include addition, deletion and modification, and that for different types of maintenance operations, the handset 10 may update the check code of the target packet corresponding to the maintenance operation in different manners.
S603: and determining a target packet corresponding to the newly added or deleted target data.
For example, the mobile phone 10 may determine a target packet corresponding to the newly added target data according to a packet field in the newly added target data of the user, or determine a target packet corresponding to the target data of the deletion operation according to a packet identifier of the target data deleted by the user.
For example, when one piece of contact information is newly added, the mobile phone 10 may determine the target group according to the last two digits of the phone number of the newly added contact information input by the user, for example, assume that the phone number of the newly added contact is "123684798", the target group corresponding to the newly added contact information is the group 98, and for example, assume that the contact information deleted by the user is the contact information of lis, and refer to fig. 3A to know that the target group corresponding to the contact information of lis is the group 98.
S604: a message digest of the target data is determined and a check code of the target packet is updated based on the message digest of the target data.
The mobile phone 10 determines a message digest of the target data according to the specific content of the data added or deleted by the user, and updates the check code of the target packet based on the message digest.
For example, assuming that the information of the newly added contact of the user is "123684798KATE" (i.e. the name of the newly added contact is KATE and the phone number is 123684798), the message digest of the target data obtained by using the MD5 algorithm is: 2566590C52CB05017DB7A3E3A102C392; for another example, assuming that the contact information deleted by the user is contact information of list, the message digest of the target data obtained by using the MD5 algorithm is: 0FA340B963445F53D9EFC042E39AB3AA.
It will be appreciated that the method of determining the message digest of the target data by the handset 10 during the updating of the check code of the packet should be the same as the method of calculating the message digest of each piece of data employed by the handset 10 to first generate the check code of each packet of the item data stored in the packet.
After determining the message digest of the target data, the mobile phone 10 may perform an exclusive-or operation on the message digest of the target data and the check code of the target packet, and use the operation result as a new check code of the target packet. For example, in the case that the maintenance operation is to delete contact information of lie, the mobile phone 10 may perform an exclusive or operation on the message digest 0FA340B963445F53D9EFC042E39AB3AA of the target data and the check code D11EEB639BC9B20AE321AF1CF384F383 of the packet 98 obtained in the step S504 to obtain a new check code EF93E986151D6912858BF5BE101E4029; for another example, in the case of maintaining the contact information of the KATE, the mobile phone 10 may perform an exclusive or operation on the message digest 2566590C52CB05017DB7A3E3a102C392 of the target data and the check code D11EEB639BC9B20AE321AF1CF384F383 of the packet 98 obtained in the step S504 to obtain a new check code D3488EF35EE50808184EE10752863011. Thus, for the addition or deletion of one piece of data, the mobile phone 10 can update the check code of the target group through one exclusive-or operation, so that the operation amount is less and the updating speed is high.
It should be appreciated that, in other embodiments, the mobile phone 10 may update the check code in other manners, for example, exclusive or the message digest of each piece of data in the target packet to recalculate the check code of the target packet, and the foregoing step S504 may be referred to, which is not described herein.
S605: and determining a target packet corresponding to the target data subjected to the modification operation.
Illustratively, the mobile phone 10 determines the target packet corresponding to the target data for modification according to the packet identifier of the target data for modification by the user.
For example, in the case where it is determined that the field corresponding to the modification operation is not a packet field, the mobile phone 10 may determine the target packet according to the packet identification of the contact information corresponding to the modification operation. For example, the contact information modified by the user is contact information of lis, then referring to fig. 3A, it can be known that the target group corresponding to the contact information of lis is group 98.
For another example, in the case where the field corresponding to the modification operation is determined to be a packet field, the mobile phone 10 may include two packets: one is a packet (hereinafter referred to as a first target packet) to which the packet identification of the contact information corresponding to the modification operation corresponds, and the other is a packet (hereinafter referred to as a second target packet) determined from the modified packet field. Specifically, referring to fig. 3A, assuming that the modification operation modifies the phone number in the contact information of lie from 123456798 to 123654720, the first target packet may be the packet identification corresponding packet 98 in the contact information of lie and the second target packet may be the packet 20 corresponding to the modified phone number 123654720.
S606: and determining the message digests of the target data before and after modification, and updating the check codes of the target packets based on the message digests of the target data before and after modification.
Illustratively, handset 10 determines the message digests of the target data before and after modification and updates the target packet check code based on the message digests of the target data before and after modification.
For example, when the field corresponding to the modification operation is not a packet field, the mobile phone 10 may perform an exclusive-or operation on the message digest of the target data before modification and the check code of the target packet, and then perform an exclusive-or operation on the operation result and the modified message digest of the target data to obtain a new check code of the target packet. Thus, for the modification of one piece of data, the mobile phone 10 can update the check code of the target group through two exclusive or operations, so that the operation amount is less and the updating speed is high.
Specifically, assuming that the target data is contact information of lis, the target packet is the aforementioned packet 98, and the contact information of lis is modified to be "123456798135654525 lis" (i.e. a new phone number 135654525 is added), the message digest after modification of the target data is 7E327F6E3E117847411E52B2D9B0B3CE can be obtained by using the MD5 algorithm. Therefore, the mobile phone 10 may perform exclusive-or operation on the message digest 0FA340B963445F53D9EFC042E39AB3AA before the modification of the target data and the check code D11EEB639BC9B20AE321AF1CF384F383 of the packet 98 to obtain an operation result EF93E986151D6912858BF5BE101E4029, and then perform exclusive-or operation on the operation result and the modified message digest 7E327F6E3E117847411E52B2D9B0B3CE to obtain a new check code F01F765D9a99AE06AB98C210C9AEF3E7 of the target packet.
For another example, in the case where the field corresponding to the modification operation is a packet field, the modification operation may be actually decomposed into a delete operation in the first target packet and a new operation in the second target packet, so that the mobile phone 10 may update the check code of the first target packet to an exclusive-or operation result of the message digest before modification of the target data and the current check code of the first target packet, and update the check code of the second target packet to an exclusive-or operation result of the message digest after modification of the target data and the current check code of the second target packet.
Specifically, assuming that the target data is contact information of lis, the modification operation is to modify the phone number of lis from 123456798 to 123654720, the modified message digest of the target data is: message digest corresponding to "123654720LILY" obtained by MD5 algorithm: 613AC4F4E14a19583B05EACD3EF51357. The mobile phone 10 may perform an exclusive-or operation on the message digest 0FA340B963445F53D9EFC042E39AB3AA before the modification of the target data and the current check code D11EEB639BC9B20AE321AF1CF384F383 of the packet 98 to obtain a new check code EF93E986151D6912858BF5BE101E4029 of the packet 98. The mobile phone 10 may further exclusive-or the modified message digest 613AC4F4E14a19583B05EACD3EF51357 of the target data with the current check code 9123674BA490B1E6CB5F45536BC8DEE2 of the packet 20 to obtain a new check code F019A3BF45DAA8BEF05AAF9E553DCDB5 of the packet 20. It will be appreciated that, in other embodiments, the mobile phone 10 may update the check code of the target packet by other manners, for example, performing an exclusive-or operation on the message digests of the respective pieces of data in the target data after performing the maintenance operation, which is not limited herein.
The technical scheme of the application is described below in connection with a specific application scenario.
In the scenario shown in fig. 2A, when the smart watch 20 synchronizes the contact information from the mobile phone 10 for the first time, the check code of each group may be obtained from the mobile phone 10, then the obtained group check code is compared with the check code of the corresponding group in the smart watch 20, the difference group having a difference with the contact information of the smart watch 20 in the mobile phone 10 is determined, the contact information of the difference group is obtained from the mobile phone 10, the contact information of the difference group is stored in the corresponding group in the smart watch 20, and the check code of the corresponding group is updated to the check code of the difference group in the mobile phone 10. Thus, the intelligent watch 20 only needs to synchronize the contact information of the difference group with the mobile phone 10, and the synchronization efficiency is improved.
Specifically, fig. 8 illustrates an interactive flow diagram of a data synchronization method, according to some embodiments of the present application. The process includes the following steps.
S801: the handset 10 detects an operation of bluetooth pairing with the smart watch 20.
Illustratively, after detecting that the user performs bluetooth pairing with the smart watch 20 on the mobile phone 10, the mobile phone 10 triggers the data synchronization method in the embodiment of the present application.
For example, referring to fig. 9A, a user may trigger the bluetooth pairing interface 902 shown in fig. 9B by clicking on the bluetooth control 901 in the drop-down menu bar of the mobile phone 10, and after detecting the clicking operation of the selection control 903 of the smart watch 20 by the user, the mobile phone 10 may detect the operation of bluetooth pairing with the smart watch 20.
It will be appreciated that in other embodiments, the user may trigger the instruction to perform bluetooth pairing with the smart watch 20 by means provided by the operating system of the other mobile phone 10, which is not limited herein.
S802: the handset 10 and the smart watch 20 establish a bluetooth communication connection.
Illustratively, the handset 10 and the smart watch 20 establish a bluetooth communication connection for synchronizing contacts.
It will be appreciated that in other embodiments, the connection established between the mobile phone 10 and the smart watch for contact synchronization may be other connections, such as near field communication, wireless lan, etc., and the communication connection between the mobile phone 10 and the smart watch 20 is not limited in this application.
S803: the smart watch 20 sends a contact synchronization request to the handset 10.
Illustratively, the smart watch 20 sends a contact synchronization request to the handset 10 after establishing a bluetooth communication connection with the handset 10.
In some embodiments, in the case where the smart watch 20 does not store the contact information, that is, in the case where the smart watch 20 performs the contact synchronization with the mobile phone 10 for the first time, the contact synchronization request sent by the smart watch 20 may further include an identifier of the first time synchronization, so that the mobile phone 10 adopts a synchronization method of the first time synchronization according to the identifier.
It will be appreciated that in some embodiments, the system services used for data synchronization in smart watch 20 may initiate a data synchronization request to other electronic devices after a communication connection is established with the other electronic devices. In other embodiments, the data synchronization request may also be initiated by an application in the smart watch 20, such as by a contact application initiating a synchronization request to the handset 10 for contacts in the address bookIs connected by the open TM Application initiated to smooth connection TM The method comprises the steps of initiating a synchronous request of contacts in an application, initiating the synchronous request of mails by a mail application, initiating the synchronous request of short messages by a short message application, initiating the synchronous request of memos by a memo application, initiating the synchronous request of messages in an instant messaging application by an instant messaging application and the like. The embodiments of the present application do not limit the application or service that initiates the data synchronization request.
It will be appreciated that in some embodiments, the handset 10 is provided with different call interfaces for the first synchronization and the non-first synchronization, so that other electronic devices may synchronize the first or non-first contact information with the handset 10 through the different call interfaces. For example, the handset 10 may set a full synchronization interface for the first synchronization so that the smart watch 20 may synchronize all contact information from the handset 10 through the full synchronization interface. For another example, the handset 10 may set a packet synchronization interface for non-first time synchronization such that the smartwatch 20 may synchronize at least one packet of contact information from the handset 10 through the packet synchronization interface.
S804: handset 10 sends the group stored contact information to smart watch 20 in response to the contact synchronization request.
Illustratively, when it is determined that the smart watch 20 is first in contact synchronization with the mobile phone 10, the mobile phone 10 sends group-stored contact information to the smart watch 20, where the group-stored contact information includes a check code of each group.
For example, handset 10 may send the group stored contact information to smart watch 20 as previously shown in fig. 3A or 3B.
S805: the smart watch 20 stores contact information in groups.
Illustratively, smart watch 20 stores the received group-stored contact information in groups as well, and stores the check code for each group at the same time.
The foregoing steps S801 to S805 introduce the technical scheme of the smart watch 20 synchronizing the contact data from the mobile phone 10 for the first time, and introduce the technical scheme of the smart watch 20 synchronizing the contact with the mobile phone 10 again after the user maintains the contact information in the mobile phone 10.
S806: and updating the grouping data and the check code according to the contact information maintenance operation.
For example, after detecting the maintenance operation of the user on the contact data in the mobile phone 10, the mobile phone 10 may update the data and the check code of each group according to the contact information maintenance operation, and the specific update manner may refer to the related description of the embodiment shown in fig. 6 and will not be described herein.
S807: the handset 10 and the smart watch 20 establish a bluetooth communication connection.
For example, the mobile phone 10 and the smart phone 20 establish a bluetooth communication connection for synchronizing contact information, and the description of steps S801 to S802 may be referred to, which is not described herein.
S808: the smart watch 20 sends a contact synchronization request to the handset 10.
Illustratively, the smart watch 20 sends a contact synchronization request to the handset 10 in the event that it is determined that a communication connection has been established with the handset 10.
S809: in response to the contact synchronization request, a check code for each packet is sent to smart watch 20.
Illustratively, the handset 10 sends the check code for each packet to the smart watch 20 if it is determined that the smart watch 20 is not in contact synchronization with the handset 10 for the first time. For example, the mobile phone 10 may determine that the smart watch 20 is not performing contact synchronization with the mobile phone 10 for the first time, and send the check code of each group in the mobile phone 10 to the smart watch 20, if the received contact synchronization request does not include the identifier of the first synchronization.
S810: smartwatch 20 determines the differential packet based on the check code for each packet in handset 10 and the verification identity of each packet in smartwatch 20.
Illustratively, in some embodiments, the number of packets in smartwatch 20 is the same as the number of packets in handset 10, and there is a one-to-one correspondence of packets in smartwatch 20 to packets in handset 10. After receiving the check code of each packet in the mobile phone 10, the smart watch 20 compares the acquired check code of each packet with the check code of the corresponding packet in the smart watch 20, and determines the packet with inconsistent check codes as the difference packet. For example, referring to fig. 2B, the smart watch 20 may obtain check codes corresponding to the packets 00 to 99 in the mobile phone 10, and compare the packet check codes corresponding to the packets 00 to 99 in the smart watch 20 with the obtained check codes to determine that the check code 01 is different from the check code 01', that is, the packet 01 in the mobile phone 10 is a difference packet.
It will be appreciated that in some embodiments, packets of the handset 10 and the smart watch 20 that do not include contact information may not be stored in separate memories, thereby saving storage space in the handset 10 and the smart watch 20. In the case where the packets not including the contact information in the mobile phone 10 and the smart watch 20 may not be stored in the respective memories, the number of data packets stored in the smart watch 20 and the mobile phone 10 may be different, that is, the number of check codes transmitted by the mobile phone 10 and the number of check codes in the smart watch 20 received by the smart watch 20 may be different, and there is no one-to-one correspondence. The differential packet thus determined by smart watch 20 includes:
the first type of difference packet, that is, a packet existing in the mobile phone 10, but not existing in the smart watch 20, the smart watch 20 may determine that the packet corresponding to the check code X is the first type of difference packet when the packet identifier of the packet corresponding to each check code X received does not exist in the packet identifiers of the packets corresponding to each check code in the smart watch 20. For example, assuming that the packet of check code X received by smartwatch 20 is identified as 98, and no packet in smartwatch 20 is identified as 98, packet 98 is a first type of differential packet.
The second type of differential packet, i.e. a packet that does not exist in the mobile phone 10 but exists in the smart watch 20, the smart watch 20 may determine that the packet corresponding to the check code X is the second type of differential packet when the packet identifier of the packet corresponding to the check code X in the smart watch 20 does not exist in the received packet identifiers corresponding to the check codes. For example, assuming that smartwatch 20 has a packet with a packet identification of 98, but the packet identification of the packet corresponding to each check code transmitted by handset 10 is not 98, packet 98 is illustrated as a second type of differential packet.
The third type of difference packet, that is, the packet having the check code different is present in both the mobile phone 10 and the smart watch 20, and the smart watch 20 may determine that the packet having the check code X is the third type of difference packet when the packet identifier of the packet having the check code Y is the same as the packet identifier of the packet corresponding to the received check code X but the check code X is different from the check code Y in the smart watch 20. For example, assuming that the packet identifier of the packet corresponding to the check code F019A3BF45DAA8BEF05AAF9E553DCDB5 received by the smartwatch 20 is 98 and the check code of the packet identified as 98 in the smartwatch 20 is D11EEB639BC9B20AE321AF1CF384F383, the packet 98 is a third type of differential packet.
It will be appreciated that the differential packet determined by smart watch 20 may be one or more, and is not limited in this regard.
S811: the smart watch 20 obtains and stores contact information and check codes for each differential group in the handset 10.
Illustratively, after determining the difference packets, the smart watch 20 acquires the contact information and the check code of each difference packet from the mobile phone 10, and stores the acquired contact information and check code of the difference packet in the packet corresponding to the smart watch 20. For example, when it is determined that the packet 01 in the mobile phone 10 is a difference packet, the smart watch 20 may send a request for obtaining the contact information and the check code of the packet 01 to the mobile phone 10, after receiving the request, the mobile phone 10 sends the contact information and the check code 01' in the packet 01 to the smart watch 20, after receiving the contact information and the check code 01' in the packet 01, the smart watch 20 stores the received contact information in the packet 01, and updates the check code of the packet 01 to the check code 01'.
It will be appreciated that in some embodiments, smart watch 20 may, after determining the differential packet, use the packet synchronization interface described above to obtain contact information in the differential packet from handset 10.
It may be appreciated that, in some embodiments, in the case where the difference packet includes the first type difference packet, the second type difference packet, and the third type difference packet in the foregoing step S810, for the first type difference packet, the smart watch 20 may newly add a packet, acquire the contact information in the first type difference packet from the mobile phone 10, and store the acquired contact information in the newly added packet; for the second type of differential group, smart watch 20 may delete the contact information in the second type of differential group from the smart watch; for the third type of differential group, smart watch 20 may obtain contact information for the third type of differential group from cell phone 10 and replace the contact information for the third type of differential group in smart watch 20 with the obtained contact information.
It can be appreciated that in other embodiments, in the process of synchronizing the contact information of the difference group, the contact information with the difference may be determined by comparing the contact information of the difference group in the smart watch 20 and the mobile phone 10, so that only the contact information with the difference is synchronized, the amount of synchronized data is further reduced, and the synchronization efficiency is improved.
According to the method provided by the embodiment of the application, in the process of carrying out contact person synchronization for the non-first time, the mobile phone 10 and the intelligent watch 20 do not need to carry out synchronization on all contact person information, only the contact person information grouped by difference is needed to be synchronized, the synchronous data volume is reduced, the synchronous efficiency is improved, meanwhile, the mobile phone 10 does not need to record logs synchronous with other electronic equipment and changed contact person information after last synchronization with other electronic equipment, and the user experience is improved.
In the above embodiments, a scenario in which two electronic devices directly perform data synchronization is described, and a scenario in which two electronic devices perform data synchronization by using a third electronic device as an intermediate device is described below.
Fig. 10 illustrates a schematic view of a scenario of data synchronization, according to some embodiments of the present application.
As shown in fig. 10, the same application program (e.g., a free link) is installed in the cellular phone 10 and the car machine 41 of the car 40 TM Applications) or services (e.g. Hua as cloudsService), the electronic device installing the application or service may utilize the server 30 for data exchange. In this data synchronization scenario, the mobile phone 10 stores contact information stored in groups, and the car machine 41 synchronizes the contact information in the mobile phone 10 from the server 30, which may include the following steps: s11: the mobile phone 10 may upload the contact information stored in the group and the check code of each group to the server 30; s12: after the vehicle machine 41 is connected to the server 30, the server 30 transmits the check code of each packet to the vehicle machine 41; s13: the vehicle machine 41 compares the acquired check code of each packet with the check code of the corresponding packet in the vehicle machine 41, determines a difference packet, and sends the packet identifier of the difference packet to the server 30; s14: after receiving the packet identifier of the difference packet, the server 30 may send the contact information of the difference packet to the vehicle machine 41, so that the vehicle machine 41 stores the contact information into the corresponding packet after receiving the contact information. In this way, when the car machine 41 synchronizes the contact information in the mobile phone 10 through the server 30, only the contact information grouped differently is needed to be synchronized, and all the contact information is not needed to be synchronized, so that the amount of synchronized data is reduced, and the synchronization efficiency is improved.
Specifically, fig. 11 illustrates an interactive flow diagram of yet another data synchronization method, according to some embodiments of the present application. As shown in fig. 11, the flow includes the following steps.
S1101: the handset 10 establishes a communication connection with the server 30.
The handset 10 establishes a communication connection with a server, illustratively through an application or service.
For example, the handset 10 may access the Internet through a mobile network or wireless network, etc., such that applications or services in the handset 10, such as a clear connection TM Application, hua is cloud TM A service, etc., that is connectable to the corresponding server 30 so that the mobile phone 10 can exchange data with the server 30.
S1102: the handset 10 uploads the contact information stored in the group and the check code for each group to the server 30.
Illustratively, after the mobile phone 10 and the server 30 establish a communication connection, the contact information stored in the mobile phone in groups and the check codes of the groups may be uploaded to the server 30, so that other electronic devices connected to the server 30 using the same user account as the mobile phone 10 may synchronize the contact information in the mobile phone 10 from the server 30.
S1103: the vehicle machine 41 and the server 30 establish a communication connection.
Illustratively, the vehicle 41 may access the Internet through a mobile network, a wireless network, a wired network, etc., such that applications or services in the vehicle 41, such as a free-wheeling connection TM Application, hua is cloud TM A service, etc., which is connectable to the corresponding server 30 so that the vehicle machine 41 can exchange data with the server 30.
S1104: the vehicle 41 transmits a data synchronization request to the server 30.
Illustratively, the vehicle 41 sends a data synchronization request to the server 30 after establishing a communication connection with the server 30.
It will be appreciated that the vehicle 41 may include an identification of the first data synchronization when the data synchronization request is first sent to the server 30, so that the server 30 may respond to the data synchronization request in a corresponding manner according to the identification.
It will be appreciated that the description of the synchronization of contact information in this embodiment is merely an example, and the data synchronization request sent may be different for different applications or services, and the data to be synchronized may also be different.
It will be appreciated that in some embodiments, the server 30 is provided with different call interfaces for the first synchronization and the non-first synchronization so that other electronic devices may synchronize first or non-first contact information with the server 30 through the different call interfaces. For example, the server 30 may set a full synchronization interface for the first synchronization so that the vehicle 41 may synchronize all contact information from the server 30 through the full synchronization interface. For another example, the server 30 may set a packet synchronization interface for non-primary synchronization so that the vehicle 41 may synchronize at least one packet of contact information from the server 30 through the packet synchronization interface.
S1105: the server 30 transmits the contact information stored in the group and the check code of each group to the car machine 41 in response to the data synchronization request.
Illustratively, the server 30 sends the contact information stored in the group and the check code of each group to the car machine 41 in case that the car machine 41 is determined to synchronize the contact information with the server 30 for the first time. For example, if the data synchronization request includes the identifier of the first synchronization, the server 30 may determine that the vehicle device 41 performs the contact information synchronization with the server 30 for the first time, and send the contact information stored in the packets and the check code of each packet to the vehicle device 41.
S1106: the car machine 41 stores the received contact information in groups and the check code of each group.
Illustratively, the car machine 41 receives the contact information and the check codes of each group stored in the group transmitted by the server 30, and stores the contact information and the check codes of each group in the car machine 41.
For example, referring to fig. 12A, after the vehicle 41 performs contact synchronization with the server 30 for the first time, the contact information in each group stored in the vehicle 41 is the same as the check code of each group. Illustratively, for the packet 98, which includes 2 pieces of contact information, namely contact information of LILY and contact information of RALPH, the corresponding check code 98 of the packet 98 is D11EEB639BC9B20AE321AF1CF384F38.
The foregoing steps S1101 to S1106 introduce the technical solution of the car machine 41 to synchronize the contact information in the mobile phone 10 for the first time, and introduce the technical solution of the mobile phone 10 to maintain the contact information as follows.
S1107: the handset 10 updates the contact information and the check code of the corresponding group according to the data maintenance operation.
For example, after detecting the data maintenance operation of the user on the contact information, the mobile phone 10 may update the contact information and the check code corresponding to the group according to the data maintenance operation, and the detailed description of the foregoing steps S601 to S606 may be referred to, which is not described herein.
S1108: the handset 10 uploads the data in the packet corresponding to the data maintenance operation and the check code to the server 30.
For example, after updating the contact information and the check code of the corresponding group according to the data maintenance operation, the mobile phone 10 may upload the data and the check code in the group corresponding to the data maintenance operation to the server 30, so that other electronic devices connected to the server 30 by using the same user account number as the mobile phone 10 may be synchronized in time.
It will be appreciated that in some embodiments, if the mobile phone 10 is connected to the server 30 when updating the contact information and the check code of the corresponding packet according to the data maintenance operation, the mobile phone 10 may send the data and the check code in the packet corresponding to the data maintenance operation to the server 30. In other embodiments, if the mobile phone 10 is not connected to the server 30 when updating the contact information and the check code of the corresponding group according to the data maintenance operation, the mobile phone 10 may record the contact information and the check code of the corresponding group updated by the data maintenance operation, and upload the recorded contact information and check code of the corresponding group updated by the data maintenance operation to the server 30 after the mobile phone 10 is connected to the server 30.
S1109: the server 30 updates the data stored in the packet.
Illustratively, after receiving the data and the check code in the packet corresponding to the data maintenance operation uploaded by the mobile phone 10, the server 30 updates the data and the check code of the packet into the corresponding packet.
The above steps S1107 to S1109 describe the technical scheme of synchronizing the data of the mobile phone 10 after the user maintains the contact information to the server 30, and the following describes the technical scheme of synchronizing the contact information of the car machine 41 from the server 30 for the non-first time.
S1110: the vehicle 41 transmits a data synchronization request to the server 30.
Illustratively, the vehicle 41 may send a data synchronization request to the server 30 after establishing a communication connection with the server 30.
It will be appreciated that, in the case where the vehicle 41 does not perform data synchronization with the server 30 for the first time, the first synchronization identifier is not included in the data synchronization request sent by the vehicle 41.
The manner in which the vehicle 41 and the server 30 establish the communication connection may be described with reference to the manner in which the vehicle 41 and the server 30 establish the communication connection in the foregoing step S1103, which is not described herein.
S1111: the server 30 transmits a check code of each packet to the vehicle body 41 in response to the data synchronization request.
For example, when the server 30 receives the data synchronization request sent by the vehicle 41 and determines that the vehicle 41 is not performing data synchronization with the server 30 for the first time, the check code of each packet stored in the server 30 is sent to the vehicle 41.
S1112: the vehicle 41 determines the difference packet based on the check code of each packet in the vehicle 41 and the verification identifier of each packet in the server 30.
Illustratively, after the vehicle machine 41 receives the check code of each packet in the server 30, the check code of each packet is compared with the check code of the corresponding packet in the vehicle machine 41 to determine the difference packet with different check codes.
For example, referring to fig. 12B, assume that the contact information acquired by the vehicle 41 in step S1106 is the contact information shown in fig. 3A, where the packet 98 in the vehicle 41 includes two pieces of contact information, i.e., contact information of lie and RALPH, and the corresponding check code 98 is D11EEB639BC9B20AE321AF1CF384F38. In the foregoing steps S1107 to S1109, the user adds KATE contact information through the mobile phone 11, so that the group 98 includes three pieces of contact information, i.e., contact information of lie, RALPH and KATE, among the contact information stored in the mobile phone 10 and the server 30, and the corresponding check code 98 is D3488EF35EE50808184EE10752863011. After the vehicle 41 receives the check code corresponding to the packet 98 sent by the server 30 (i.e. 98D3488EF35EE50808184EE 10752863011), the check code 98' is determined to be different from the check code 98 by comparing with the check code 98 corresponding to the vehicle 41 (i.e. D11EEB639BC9B20AE321AF1CF384F 38), so as to determine that the packet 98 in the server 30 is a differential packet.
S1113: the car body 41 acquires and stores the contact information and the check code of each differential group in the server 30.
Illustratively, the vehicle 41 obtains and stores the contact information of the difference packet and the check code of the difference packet from the server 30 according to the packet identification of the difference packet.
For example, referring to fig. 12B, the vehicle 41 may acquire contact information of lie, RALPH, and KATE from the server 30, store the acquired contact information in the packet 98 of the vehicle 41, and update the check code of the packet 98 to D3488EF35EE50808184EE10752863011.
It will be appreciated that in some embodiments, the vehicle 41 may obtain the contact information in the differential packet from the server 30 through the packet synchronization interface described above after determining the differential packet.
According to the method provided by the embodiment of the application, the vehicle-mounted device 41 does not need to synchronize all the contact information every time in the process of synchronizing the contact information in the mobile phone 10 from the server 30, only the contact information in the difference group is required to be synchronized, the synchronous data volume is reduced, the synchronous efficiency is improved, and the vehicle-mounted device 41 or the server 30 only needs to maintain the check codes of all the groups without additional expenditure, so that the user experience is improved.
It can be understood that the technical solution of the present application described in the above embodiments using the item data as the contact information is only an example, and the technical solution of the above embodiments is also applicable to other scenarios of synchronizing item data of any type, such as short messages, memos, mails, messages of instant messaging applications, etc., which are not limited herein.
Furthermore, the technical scheme of the embodiment of the application is also applied to a scene of data synchronization between the slave device and the master device in the distributed system.
For example, FIG. 13 illustrates a schematic diagram of a scenario in which memos are synchronized in a distributed system, according to some embodiments of the present application.
In the scenario shown in fig. 13, the distributed system includes a master device handset 10, a slave device smart watch 20, a tablet computer 50 and a smart television 60, the handset 10 establishes communication connection with other slave devices through a distributed soft bus, and a memo application or service is installed in each of the handset 10, the smart watch 20, the tablet computer 50 and the smart television 60. Here, the mobile phone 10 stores memo information in packets, and packet fields of each piece of memo information may refer to the foregoing description related to fig. 4A.
Referring to fig. 13, the synchronization memo information of the smart watch 20, the tablet 50, the smart tv 60 from the mobile phone 10 may include the steps of: s131: after detecting that communication connection is established between the memo application or service installed in the intelligent watch 20/the tablet personal computer 50/the intelligent television 60 and the mobile phone 10, acquiring the check codes of all groups in the mobile phone 10 through a distributed soft bus; s132: the memo application or service installed in the smart watch 20/the tablet computer 50/the smart television 60 compares the acquired grouping identification with the check codes in the respective corresponding grouping to determine the difference grouping corresponding to each device, for example, the smart watch 20 can determine the difference grouping 1, the tablet computer 50 can determine the difference grouping 2, the smart television 60 can determine the difference grouping 3, and then the difference grouping and the device identification of each device are sent to the mobile phone 10, for example, the grouping identification of the smart watch 20 can send the difference grouping 1, the grouping identification of the tablet computer 50 can send the difference grouping 2, and the grouping identification of the smart television 3 can send the difference grouping 3; s133: the mobile phone 10 sends the memo information and the check code of the difference packet (for example, the aforementioned difference packet 1/2/3) corresponding to each device through the distributed soft bus according to the packet identifier and the device identifier of the difference packet sent by each device, so that the memo application or service installed in each device can update the memo information in each device according to the memo information and the check code of the received difference packet, and synchronization of the memo information in the distributed system is realized.
It is understood that the distributed soft bus is a technology provided by an operating system of the electronic device and used for coupling a plurality of electronic devices through the same or different communication modes, and will be specifically described below when describing a software architecture of the electronic device, which is not described herein.
It can be appreciated that the manner in which the smart watch 20, the tablet pc 50 and the smart television 60 determine the difference group may refer to the method in which the smart watch 20 and the car machine 41 are different in the foregoing embodiments, which is not described herein.
By the method provided by the embodiment of the application, no matter how many slave devices are in communication connection with the mobile phone 10, the mobile phone 10 can be rapidly synchronized with other electronic devices in the distributed system, and the data in the difference packet is only required to be synchronized, so that the synchronous data quantity is reduced, and the synchronization efficiency is improved.
It should be understood that the above-mentioned distributed system coupled between electronic devices through a distributed soft bus shown in fig. 13 is merely an example, and the distributed soft bus is merely used as a carrier for communication between the electronic devices.
It can be appreciated that the operating system used by the electronic device such as the mobile phone 10 may be android TM 、iOS TM (Input Output System) and one of the operating systems such as hong (Harmony OS), are not limited herein. The software architecture of the handset 10 will now be described using the hong-and-Monte operating system as an example.
Fig. 14 illustrates a software architecture diagram of the handset 10, according to some embodiments of the application. As shown in fig. 14, the software architecture of the mobile phone 10 mainly includes:
the application layer 02 may include system applications 021 and extension applications 022 (or third party applications). The system applications 021 may include desktop memo 0211, settings, cameras, short messages, mails, and the like; the extended application 022 may include a free link TM 0221. Other instant messaging applications (e.g., weChat TM 、QQ TM Etc.), etc. In some embodiments, the data synchronization method provided in the embodiments of the present application may be applied to each application program in the application layer 02, for example, the instructions of the data synchronization method are embedded in the memo 0211 or the free link TM 0221, so that the memo 0211 can be synchronized and linked with other electronic devices through the data synchronization method provided by the application TM 0221 may synchronize contact information or messages with other electronic devices through the data synchronization method provided in the embodiments of the present application.
The framework layer 03 provides a multi-language framework for the application layer, including an Interface (UI) framework 031, a User program framework 032, and a capability framework 033, among others. The UI framework 031 includes a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like, which are not described herein. The user program framework 032 and capability framework 033 may provide the application with capabilities of the various capability components required by the application, such as computing capabilities (which may include CPU computing power, graphics processor (Graphics Processing Unit, GPU) computing power, image signal processor (Image Signal Processor, ISP) computing power, etc.), pickup capabilities (which may include microphone pickup capabilities, voice recognition capabilities, etc.), security capabilities in terms of device security (which may include trusted operating environment security levels, etc.), display capabilities (which may include screen resolution, screen size, etc.), playback capabilities (which may include sound amplifying capabilities, stereo performance capabilities, etc., as well as storage capabilities (which may include memory capabilities of the device, random access memory (random access memory, RAM) capabilities, etc.), etc., without limitation.
The system service layer 04 is the core of the software system of the mobile phone 10, and can provide services for application programs of the application layer 02 through the framework layer 03. The system services layer 04 includes a distributed soft bus 041, a distributed data management module 042, a data synchronization service 043, and the like. Wherein:
The distributed soft bus 041 is used to couple the mobile phone 10 with other electronic devices to form a distributed system. For example, fig. 15 illustrates a schematic diagram of coupling the handset 10 to other electronic devices via a distributed soft bus 041, according to some embodiments of the application. As shown in fig. 15, handset 10, smart watch 20, tablet 50, smart television 60 are coupled by a distributed soft bus 041, the distributed soft bus 041 including a bus backbone 0411, a task and data bus 0412, device information 0413, base communications 0414, and the like. Wherein:
the bus hub 0411 is used for resolving commands issued by the application layer 02 of the mobile phone 10, discovering and connecting devices, and the like, and comprises a data and computing center, a decision center, an interconnection management center, and the like. For example, in the scenario illustrated in FIG. 13, the bus hub 0411 may be used to discover an electronic device that has the same application or service (e.g., memo) installed with the handset 10;
the task and data bus 0412 is used for the transfer of tasks and data between the handset 10 and other electronic devices. For example, in some embodiments, task and data bus 0412 may be used to transmit the check code of each packet, the identity of the difference packet, the memo information of the difference packet, the check code of the difference packet, etc.;
The device information 0413 is used to obtain and manage information of the handset 10 and other electronic devices, for example, in some implementations, the device information module 0413 may be used to obtain a device identification of the electronic device that sent the differential packet to the handset 10;
the base communication 0414 is used to establish a communication connection between the mobile phone 10 and other electronic devices in a wired and/or wireless manner, such as wireless, bluetooth, near field communication, local area network, etc., and to cooperatively mask differences in protocols between the electronic devices through a protocol stack and a soft and hard collaboration.
Distributed data management 042 is based on a distributed soft bus to implement distributed management of application data and user data. For example, in some embodiments, the handset 10 may send the difference grouped memo information to the corresponding electronic device via distributed data management 042.
The data synchronization service 043 is used for performing data synchronization according to the data synchronization method provided in the embodiment of the present application. For example, an application program corresponding to an instruction not embedded with the data synchronization method provided in the embodiment of the present application may store the item data in the application program in a packet through the data synchronization service 043, and perform data synchronization based on the data synchronization service 043 and other electronic devices.
The kernel layer 05 includes a kernel subsystem 051 and a drive subsystem 052. The kernel subsystem 051 provides basic kernel capabilities for upper layers, including process/thread management, memory management, file system, network management, peripheral management, etc., by masking multi-kernel differences. The drive subsystem 052 includes a hardware drive framework that can provide unified peripheral access capabilities and management framework for the handset 10.
It will be appreciated that the software architecture of the mobile phone 10 shown in fig. 14 and the connection manner between the mobile phone 10 and other electronic devices shown in fig. 15 are merely examples, and in other embodiments, the mobile phone 10 may also use other software architectures different from those shown in fig. 14, or form a distributed system by connecting between other electronic devices and other connection manners different from those shown in fig. 15, which is not limited in this application.
It will be appreciated that the electronic devices in the embodiments of the present application may use the same or similar software architecture as the mobile phone 10, or may use a different software architecture, which is not limited herein.
It should be understood that the technical solutions of the present application described above in the mobile phone 10, the smart watch 20, the server 30, the car machine 41 of the car 40, the tablet pc 50, the smart tv 60, etc. are only examples, and the technical solutions of the embodiments of the present application may be applied to any electronic device capable of performing data exchange with other electronic devices, including, but not limited to, a laptop computer, a smart tv, a smart speaker, a tablet pc, a server, a wearable device (e.g., a smart watch, a smart bracelet, a smart glasses, etc.), a head-mounted display, a mobile email device, a portable game console, a portable music player, a reader device, etc., which are not limited in the embodiments of the present application.
The configuration of the electronic device to which the embodiment of the present application is applied will be described below by taking the hardware configuration of the mobile phone 10 as an example.
Specifically, fig. 16 illustrates a schematic structural diagram of a mobile phone 10, according to some embodiments of the present application. As shown in fig. 16, the mobile phone 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, a subscriber identity module (subscriber identification module, SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
The processor 110 may include one or more processing units, for example, processing modules or processing circuits that may include a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a digital signal processor (Digital Signal Processor, DSP), a microprocessor (Micro-programmed Control Unit, MCU), an artificial intelligence (Artificial Intelligence, AI) processor, or a programmable logic device (Field Programmable Gate Array, FPGA), or the like. Wherein the different processing units may be separate devices or may be integrated in one or more processors. For example, the processor 110 may be configured to provide instructions for a data synchronization method provided by embodiments of the present application.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a serial peripheral interface (Serial Peripheral Interface, SPI), a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. In some embodiments, the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement bluetooth functionality, for example, to establish a communication connection with other electronic devices through bluetooth to send check codes of each packet, data of each packet to other electronic devices through bluetooth, to obtain a data synchronization request through bluetooth, to receive abnormal packets, etc.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate via a CSI interface to implement the camera functionality of handset 10. The processor 110 and the display 194 communicate via a DSI interface to implement the display functions of the handset 10.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The external memory interface 120 may be used to interface with an external memory card, such as a Micro SD card, to extend the memory capabilities of the handset 10. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, item data stored in a classified manner such as contacts, messages, memos, mails, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The internal memory 121 may include a program memory area and a data memory area. Wherein the program storage area is capable of storing an operating system, at least one application program required for a function (such as the aforementioned open connection TM An application, a memo application, a contact application, a short message application, a mail application), and the like. The data storage area may store data created during use of the handset 10, such as various types of item data stored in packets (e.g., contacts, messages, memos, mails, etc.), check codes for each packet, and so forth. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 executes various functional applications of the handset 10 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor 110.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect to a charger to charge the mobile phone 10, or may be used to transfer data between the mobile phone 10 and peripheral devices. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
The charge management module 140 is configured to receive a charge input from a charger. The charging management module 140 can also supply power to the mobile phone 10 through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The wireless communication function of the mobile phone 10 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc. applied to the handset 10. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), NFC, infrared (IR), etc. applied to the handset 10. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, the handset 10 may establish a communication connection with other electronic devices using the mobile communication module 150 or a wireless communication solution provided by the mobile communication module, and perform data synchronization with other electronic devices through the data synchronization method provided in embodiments of the present application based on the established communication connection.
The handset 10 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals.
The earphone interface 170D is used to connect a wired earphone.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The handset 10 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display 194, the mobile phone 10 detects the intensity of the touch operation based on the pressure sensor 180A. The handset 10 may also calculate the location of the touch based on the detection signal from the pressure sensor 180A.
The acceleration sensor 180E can detect the magnitude of acceleration of the mobile phone 10 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the handset 10 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
The ambient light sensor 180L is used to sense ambient light level. The handset 10 may adaptively adjust the brightness of the display 194 based on perceived ambient light levels. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect if the handset 10 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The mobile phone 10 can utilize the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photographing, fingerprint incoming call answering and the like.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may be disposed on the surface of the mobile phone 10 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The handset 10 may receive key inputs, generating key signal inputs related to user settings and function control of the handset 10.
The motor 191 may generate a vibration cue.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the handset 10 may include 1 or N cameras 193, N being a positive integer greater than 1.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a Mini-LED, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the handset 10 may include 1 or N display screens 194, N being a positive integer greater than 1.
The handset 10 may implement display functions through a GPU, a display 194, an application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is 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 change display information.
The SIM card interface 195 is used to connect a SIM card.
It should be understood that the structure of the mobile phone 10 shown in the embodiments of the present application does not constitute a specific limitation on the mobile phone 10. In other embodiments of the present application, the handset 10 may include more or fewer components than shown, or certain components may be combined, certain components may be split, or different arrangements of components may be provided. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
It will be appreciated that the electronic device to which the data synchronization method provided in the embodiments of the present application is applicable may have the same or similar structure as the mobile phone 10, and may also include more or fewer modules than the mobile phone 10, which is not limited herein.
Embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of these implementations. Embodiments of the present application may be implemented as a computer program or program code that is executed on a programmable system including at least one processor, a storage system (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device.
Program code may be applied to input instructions to perform the functions described herein and generate output information. The output information may be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a Digital Signal Processor (DSP), microcontroller, application Specific Integrated Circuit (ASIC), or microprocessor.
The program code may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. Program code may also be implemented in assembly or machine language, if desired. Indeed, the mechanisms described in the present application are not limited in scope to any particular programming language. In either case, the language may be a compiled or interpreted language.
In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer readable media. Thus, a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to floppy diskettes, optical disks, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random Access Memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signal digital signals, etc.) in an electrical, optical, acoustical or other form of propagated signal using the internet. Thus, a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).
In the drawings, some structural or methodological features may be shown in a particular arrangement and/or order. However, it should be understood that such a particular arrangement and/or ordering may not be required. Rather, in some embodiments, these features may be arranged in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of structural or methodological features in a particular figure is not meant to imply that such features are required in all embodiments, and in some embodiments, may not be included or may be combined with other features.
It should be noted that, in the embodiments of the present application, each unit/module is a logic unit/module, and in physical aspect, one logic unit/module may be one physical unit/module, or may be a part of one physical unit/module, or may be implemented by a combination of multiple physical units/modules, where the physical implementation manner of the logic unit/module itself is not the most important, and the combination of functions implemented by the logic unit/module is the key to solve the technical problem posed by the present application. Furthermore, to highlight the innovative part of the present application, the above-described device embodiments of the present application do not introduce units/modules that are less closely related to solving the technical problems presented by the present application, which does not indicate that the above-described device embodiments do not have other units/modules.
It should be noted that in the examples and descriptions of this patent, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
While the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.
Claims (26)
1. A data synchronization method applied to a first electronic device, comprising:
receiving a data synchronization message from a second electronic device, wherein the data synchronization message comprises M check codes, the check codes are used for identifying the data content of the corresponding data packet, and M is more than or equal to 1;
comparing the M check codes with N check codes of N data packets stored on the first electronic device to determine different check codes, wherein N is more than or equal to 1;
and updating N data packets stored on the first electronic device into M data packets identified by the M check codes based on the determined different check codes.
2. The method of claim 1, wherein M is equal to N, and wherein the M check codes have a one-to-one correspondence with the N check codes; and is also provided with
The updating the N data packets stored on the first electronic device to M data packets identified by the M check codes based on the determined different check codes includes:
and when a first check code exists in the N check codes and a second check code corresponding to the first check code in the M check codes is different from the first check code, updating a first data packet corresponding to the first check code stored on the first electronic equipment into a second data packet corresponding to the second check code.
3. The method of claim 1, wherein updating the N data packets stored on the first electronic device to the M data packets identified by the M check codes based on the determined different check codes comprises:
deleting a third data packet stored on the first electronic device and corresponding to a third check code when the third check code exists in the N check codes and does not exist in the M check codes; or alternatively
And storing a fourth data packet corresponding to a fourth check code on the first electronic device when the fourth check code exists in the M check codes and the fourth check code does not exist in the N check codes.
4. The method of claim 1, wherein the check code of the data packet is determined by a message digest of each data in the data packet.
5. The method of claim 4, wherein the check code of the data packet is determined by a message digest of each data in the data packet, comprising:
the check code of the data packet is obtained by performing exclusive OR operation on message digests of all data in the data packet one by one.
6. The method of claim 1, wherein the data packet to which each data belongs is determined based on a character of a preset field in the data.
7. The method of claim 6, wherein the preset field comprises at least one of the following fields:
in the case that the data includes contact information, the preset field includes a phone number of the contact;
when the data comprises a short message, the preset field comprises the number of a receiver or a sender of the short message;
in the case that the data includes a memo, the preset field includes a creation time of the memo;
in the case that the data includes mail, the preset field includes sender or recipient information, wherein the sender or recipient information includes an email address and/or name;
in the case of the data instant message, the preset field includes a transmission or reception time of the instant message.
8. The method of claim 1, wherein the data content in the data packet comprises at least one of: contact information, text messages, memos, mails, instant messages.
9. The method according to any one of claims 1 to 8, wherein a first application or a first service is installed in both the first electronic device and the second electronic device; and is also provided with
Receiving, by a first application or a first service installed in the first electronic device, the data synchronization message from the first application or the first service installed in the first electronic device;
comparing the M check codes with N check codes of N data packets stored on the first electronic device by a first application or a first service in the first electronic device to determine different check codes;
and updating the N data packets stored on the first electronic device into M data packets identified by the M check codes by using the different check codes determined by the first application or the first service in the first electronic device.
10. The method of claim 9, wherein the first application comprises one of: contact applications, memo applications, short message applications, mail applications, instant messaging applications.
11. A data synchronization method applied to a second electronic device, comprising:
P check codes are obtained, wherein the check codes are used for identifying the data content of the corresponding data packet, and P is more than or equal to 1;
and sending a data synchronization message to the first electronic device, wherein the data synchronization message comprises the P check codes, and the P check codes are used for determining the data packets to be synchronized to the first electronic device in the P data packets corresponding to the P check codes.
12. The method as recited in claim 11, further comprising:
a check code for a data packet is determined based on a message digest of each data stored in the data packet.
13. The method of claim 12, wherein the determining the check code of the data packet based on the message digest of each data stored in the data packet comprises:
and performing exclusive OR operation on the message summaries of all the data in the data packet one by one to obtain the check code of the data packet.
14. The method of claim 13, wherein the determining the check code of the data packet based on the message digest of each data stored in the data packet further comprises:
updating a check code of a fifth data packet to be an exclusive or operation result of an information abstract of the first data and a current check code of the fifth data packet under the condition that the first data in the fifth data packet is detected to be deleted, wherein the fifth data packet is one of data packets corresponding to the P check codes; or alternatively
Under the condition that second data are newly added in a sixth data packet, updating the check code of the sixth data packet into an exclusive OR operation result of the information abstract of the second data and the current check code of the sixth data packet, wherein the sixth data packet is one of data packets corresponding to the P check codes; or alternatively
And under the condition that the third data in the seventh data packet is detected to be modified into fourth data, updating the check code of the seventh data packet into an exclusive OR operation result of the information abstract of the third data, the information abstract of the fourth data and the current check code of the seventh data packet one by one, wherein the seventh data packet is one of the data packets corresponding to the P check codes.
15. The method of claim 14, wherein the data packet to which each data belongs is determined based on a character of a preset field in the data.
16. The method of claim 15, wherein the preset field comprises at least one of the following fields:
in the case that the data includes contact information, the preset field includes a phone number of the contact;
When the data comprises a short message, the preset field comprises the number of a receiver or a sender of the short message;
in the case that the data includes a memo, the preset field includes a creation time of the memo;
in the case that the data includes mail, the preset field includes sender or recipient information, wherein the sender or recipient information includes an email address and/or name;
in the case of the data instant message, the preset field includes a transmission or reception time of the instant message.
17. A data synchronization system, wherein the data synchronization system comprises a first electronic device and a second electronic device; and is also provided with
The second electronic device is used for sending a data synchronization message to the first electronic device, wherein the data synchronization message comprises R check codes, the check codes are used for identifying the data content of the corresponding data packet, and R is more than or equal to 1;
the first electronic device is configured to receive the data synchronization message, compare the R check codes with S check codes of S data packets stored on the first electronic device, determine different check codes, and update the S data packets stored on the first electronic device to R data packets identified by the R check codes based on the determined different check codes, where S is greater than or equal to 1.
18. The system of claim 17, wherein the check code of the data packet is exclusive-ored from the message digest of each data in the data packet.
19. The system of claim 18, wherein the second electronic device is further configured to:
updating a check code of an eighth data packet to be an exclusive or operation result of an information abstract of the fifth data and a current check code of the eighth data packet under the condition that the deletion of the fifth data in the eighth data packet is detected, wherein the eighth data packet is one of the data packets corresponding to the R check codes; or alternatively
Updating a check code of a ninth data packet to be an exclusive or operation result of an information abstract of the sixth data and a current check code of the ninth data packet under the condition that new sixth data is added in the ninth data packet, wherein the ninth data packet is one of the data packets corresponding to the R check codes; or alternatively
And under the condition that the seventh data in the tenth data packet is detected to be modified into eighth data, updating the check code of the tenth data packet into an exclusive OR operation result of the information digest of the seventh data, the information digest of the eighth data and the current check code of the tenth data packet one by one, wherein the tenth data packet is one of the data packets corresponding to the R check codes.
20. The system of any of claims 17 to 19, wherein the first electronic device and the second electronic device are terminal devices, or wherein the first electronic device is a terminal device and the second electronic device is a server.
21. The system of any of claims 17 to 19, wherein the data synchronization system further comprises a third electronic device for receiving the data synchronization message from the second electronic device and transmitting the data synchronization message to the first electronic device.
22. The system of claim 21, wherein the first electronic device and the second electronic device are terminal devices and the third electronic device is a server.
23. The system of any one of claim 20 or claim 22, wherein the terminal device comprises at least one of a cell phone, a car phone, a wearable device, a tablet computer, a smart television.
24. A readable storage medium having stored thereon instructions that, when executed on an electronic device, cause the electronic device to implement the data synchronization method of any one of claims 1 to 16.
25. An electronic device, comprising:
a memory for storing instructions for execution by one or more processors of the electronic device;
and a processor, one of the processors of the electronic device, for executing the instructions stored in the memory to implement the data synchronization method of any one of claims 1 to 16.
26. A computer program product, characterized in that it comprises instructions that, when executed on an electronic device, cause the electronic device to implement the data synchronization method of any one of claims 1 to 16.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210671444.2A CN117271655A (en) | 2022-06-14 | 2022-06-14 | Data synchronization method, system, medium, program product and electronic device |
PCT/CN2023/099963 WO2023241582A1 (en) | 2022-06-14 | 2023-06-13 | Data synchronization method and system, and medium, program product and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210671444.2A CN117271655A (en) | 2022-06-14 | 2022-06-14 | Data synchronization method, system, medium, program product and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117271655A true CN117271655A (en) | 2023-12-22 |
Family
ID=89192285
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210671444.2A Pending CN117271655A (en) | 2022-06-14 | 2022-06-14 | Data synchronization method, system, medium, program product and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117271655A (en) |
WO (1) | WO2023241582A1 (en) |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7222139B2 (en) * | 2002-07-30 | 2007-05-22 | International Business Machines Corporation | Method, system and program for synchronizing data |
CN104243508A (en) * | 2013-06-07 | 2014-12-24 | 富鸿康科技(深圳)有限公司 | Server, client side and file synchronization method |
FR3021774B1 (en) * | 2014-05-28 | 2017-02-24 | Preezms | METHOD FOR AUTOMATICALLY PROCESSING THE UPDATING OF A DATABASE |
CN104639651A (en) * | 2015-03-04 | 2015-05-20 | 成都维远艾珏信息技术有限公司 | Mobile equipment information transmission method |
CN106528125A (en) * | 2016-10-26 | 2017-03-22 | 腾讯科技(深圳)有限公司 | Data file incremental updating method, server, client and system |
CN110083614B (en) * | 2019-04-04 | 2023-06-06 | 中国银联股份有限公司 | Data processing method and server |
-
2022
- 2022-06-14 CN CN202210671444.2A patent/CN117271655A/en active Pending
-
2023
- 2023-06-13 WO PCT/CN2023/099963 patent/WO2023241582A1/en unknown
Also Published As
Publication number | Publication date |
---|---|
WO2023241582A1 (en) | 2023-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10452349B2 (en) | Electronic device and operation control method therefor | |
CN109766066B (en) | Message processing method, related device and system | |
CN114125786B (en) | Message synchronization method, readable medium and electronic device | |
CN113885759B (en) | Notification message processing method, device, system and computer readable storage medium | |
CN113609498B (en) | Data protection method and electronic equipment | |
US20230422154A1 (en) | Method for using cellular communication function, and related apparatus and system | |
CN116360725B (en) | Display interaction system, display method and device | |
CN110149491B (en) | Video encoding method, video decoding method, terminal and storage medium | |
CN114553814B (en) | Method and device for processing push message | |
WO2023065931A1 (en) | Method for charging electronic device, and electronic device | |
CN111526068B (en) | Fault reporting method and terminal | |
CN113709024B (en) | Data transmission method, medium and electronic device thereof | |
CN111062224B (en) | Content transmission method and terminal equipment | |
CN107800720B (en) | Hijacking reporting method, device, storage medium and equipment | |
CN115017498B (en) | Method for operating applet and electronic device | |
CN117271655A (en) | Data synchronization method, system, medium, program product and electronic device | |
CN115550423A (en) | Data communication method, electronic device, and storage medium | |
CN113721836A (en) | Data deduplication method and device | |
EP4290375A1 (en) | Display method, electronic device and system | |
US20240305591A1 (en) | Message processing method and apparatus | |
CN118153110B (en) | Data processing method and related device | |
CN113885785B (en) | Data deduplication method and device | |
CN114006969B (en) | Window starting method and electronic equipment | |
CN116723265A (en) | Image processing method, readable storage medium, program product, and electronic device | |
CN115718560A (en) | Method and electronic device for triggering service execution |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |