CN113672678A - Data synchronization method, device and system - Google Patents

Data synchronization method, device and system Download PDF

Info

Publication number
CN113672678A
CN113672678A CN202010409485.5A CN202010409485A CN113672678A CN 113672678 A CN113672678 A CN 113672678A CN 202010409485 A CN202010409485 A CN 202010409485A CN 113672678 A CN113672678 A CN 113672678A
Authority
CN
China
Prior art keywords
data information
data
software service
user side
updated
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.)
Granted
Application number
CN202010409485.5A
Other languages
Chinese (zh)
Other versions
CN113672678B (en
Inventor
戚世葛
孙承华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Haikang Storage Technology Co ltd
Original Assignee
Hangzhou Haikang Storage Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Haikang Storage Technology Co ltd filed Critical Hangzhou Haikang Storage Technology Co ltd
Priority to CN202010409485.5A priority Critical patent/CN113672678B/en
Publication of CN113672678A publication Critical patent/CN113672678A/en
Application granted granted Critical
Publication of CN113672678B publication Critical patent/CN113672678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data synchronization method, device, equipment and system, and belongs to the technical field of information. The method is applied to a computer device provided with an operating system and a software service, and comprises the following steps: under the condition that first data information of data stored in a data storage position of a software service is changed, performing synchronism detection on the first data information and second data information generated by data operation performed through the software service, and if the first data information and the second data information are detected to be out of synchronism, updating the second data information based on the first data information through the software service; wherein the data stored in the data storage locations is operable by an operating system. Therefore, the data synchronization of the first data information and the second data information can be ensured, and the data synchronization between the user side access data and the local storage data of the computer equipment is further ensured when the user side accesses the software service.

Description

Data synchronization method, device and system
Technical Field
The present application relates to the field of information technologies, and in particular, to a data synchronization method, apparatus, and system.
Background
With the development of information technology, data needs to be kept different in many scenarios. For example, for a scenario in which a primary device and a backup device exist, data synchronization between the primary device and the backup device needs to be maintained; for the scenario that the user accesses the application program, it is necessary to maintain data synchronization between the user and the background server of the application program.
Currently, a computer device is provided with an operating system and software services for facilitating remote operation at a user end. The software service is software running in the computer equipment and can provide remote access service for the user terminal. Moreover, the software service may use the first storage location of the computer device as its data storage space, the software service is provided with a network access interface, and the user end may remotely access the software service in the computer device through the network and may perform data operations through the software service, such as adding, deleting, searching, or changing data in the first storage location. In addition, the software service can also use the second storage location of the computer device as a database for recording data information generated by data operation performed by the software service, and in the process of data operation performed by the user side through the software service, the software service can record the data information generated by data operation into the second storage location. In addition, because the computer device is further provided with an operating system, a local user of the computer device can also operate the data in the first storage location through the operating system of the computer device, so that the data in the first storage location is changed, but data information generated by the operation through the local operating system is not recorded in the second storage location, in this case, data asynchronization between the locally stored data of the computer device and the software service data may be caused, and further, data access of the user side is asynchronous with the locally stored data of the computer device. Therefore, there is a need for a method for maintaining data synchronization between client-side access data and locally stored data of a computer device.
Disclosure of Invention
The application provides a data updating method, a data updating device and a data updating system, which can solve the problem of data asynchronism between user side access data and local storage data of computer equipment in the related technology. The technical scheme is as follows:
in one aspect, a data synchronization method is provided, and is applied to a computer device, where the computer device is installed with an operating system and a software service, and the method includes:
through the software service, under the condition that first data information of data stored in a first storage position is changed, carrying out synchronism detection on the first data information and second data information generated by data operation through the software service;
wherein the first storage location is a data storage location of the software service, and data stored in the first storage location is operable by the operating system;
and if the first data information and the second data information are detected to be asynchronous, updating the second data information based on the first data information through the software service.
Optionally, before the detecting the synchronism of the first data information and the second data information generated by performing data operation through the software service, the method further includes:
obtaining, by the software service, first data information for data stored in the first storage location;
if it is detected that the first data information is changed relative to the historical first data information and the change is caused by the operating system operating on the data stored in the first storage location, performing a step of detecting, by the software service, synchronicity of the first data information with second data information generated by the software service operating on the data.
Optionally, the obtaining, by the software service, first data information of the data stored in the first storage location includes:
obtaining, by the software service, first data information of data stored in the first storage location from a file system log of the computer device; or,
and calling a file scanning function to scan the file of the first storage position through the software service, and acquiring the first data information according to a file scanning result.
Optionally, the updating the second data information based on the first data information includes:
determining out-of-sync data information between the first data information and the second data information;
updating the second data information based on the out-of-sync data information.
Optionally, after the data updating the second data information based on the first data information, the method further includes:
and when the user side accesses the software service through the network, displaying the updated second data information to the user side.
Optionally, the displaying the updated second data information to the user side includes:
when a data access instruction of the user side is received, the updated second data information is sent to the user side, and the user side refreshes a display interface based on the updated second data information; or,
and sending a data updating notice to the user side, wherein the data updating notice is used for indicating the user side to acquire the updated second data information, and refreshing a display interface based on the updated second data information.
In another aspect, a data synchronization apparatus is integrated in a computer device, the computer device being installed with an operating system and a software service, the apparatus comprising:
the detection module is used for carrying out synchronism detection on first data information and second data information generated by data operation of the software service under the condition that the first data information of data stored in a first storage position is changed through the software service;
wherein the first storage location is a data storage location of the software service, and data stored in the first storage location is operable by the operating system;
and the updating module is used for updating the second data information based on the first data information through the software service if the first data information and the second data information are detected to be asynchronous.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring first data information of data stored in the first storage position through the software service;
the trigger module is used for triggering the detection module to perform synchronization detection on the first data information and second data information generated by data operation performed by the software service through the software service if the first data information is detected to be changed relative to historical first data information and the change is caused by the operation of the operating system on the data stored in the first storage location;
the acquisition module comprises at least one of a first acquisition unit and a second acquisition unit;
the first obtaining unit is used for obtaining first data information of data stored in the first storage position from a file system log of the computer equipment through the software service;
the second obtaining unit is configured to invoke a file scanning function to perform file scanning on the first storage location through the software service, and obtain the first data information according to a file scanning result.
Optionally, the update module is configured to:
determining out-of-sync data information between the first data information and the second data information;
updating the second data information based on the out-of-sync data information.
Optionally, the apparatus further comprises:
the display module is used for displaying the updated second data information to the user side when the user side accesses the software service through the network;
wherein the display module comprises at least one of a first display unit and a second display unit;
the first display unit is used for sending the updated second data information to the user side when receiving the data access instruction of the user side, and the user side refreshes a display interface based on the updated second data information;
the second display unit is configured to send a data update notification to the user side, where the data update notification is used to instruct the user side to obtain updated second data information, and a display interface is refreshed based on the updated second data information.
In another aspect, a computer device is provided, which includes a processor and a memory, the memory is used for storing computer programs, and the processor is used for executing the programs stored in the memory to realize the steps of the data synchronization method.
On the other hand, a data synchronization system is provided, the system comprises a user side and computer equipment, and the computer equipment is provided with an operating system and software services;
the user side is used for accessing the software service of the computer equipment through a network;
the computer equipment is used for carrying out synchronism detection on first data information and second data information generated by data operation of the software service under the condition that the first data information of data stored in a first storage position is changed through the software service; if the first data information and the second data information are detected to be out of synchronization, updating the second data information based on the first data information through the software service; wherein the first storage location is a data storage location of the software service, and data stored in the first storage location is operable by the operating system.
Optionally, the computer device is further configured to, after the second data information is updated based on the first data information by the software service, display the updated second data information to the user side when the user side accesses the software service through a network. A
Optionally, the computer device is further configured to send the updated second data information to the user side when receiving a data access instruction of the user side through the software service;
and the user side is further used for receiving the updated second data information sent by the computer equipment and refreshing the display interface based on the updated second data information.
Optionally, the computer device is further configured to send a data update notification to the user side through the software service;
and the user side is further configured to obtain the updated second data information from the computer device according to the data update notification, and refresh the display interface based on the updated second data information.
In another aspect, a computer-readable storage medium is provided, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the data synchronization method described above.
In another aspect, a computer program product comprising instructions is provided, which when run on a computer, causes the computer to perform the steps of the data synchronization method described above.
The technical scheme provided by the application can at least bring the following beneficial effects:
through the software service, under the condition that first data information of data stored in a first storage position changes, synchronism detection is carried out on the first data information and second data information generated by data operation through the software service, and when the first data information and the second data information are asynchronous, the second data information is synchronized based on the first data information.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic illustration of an implementation environment to which embodiments of the present application relate;
fig. 2 is a data synchronization method provided in an embodiment of the present application;
FIG. 3 is a flow chart of another data synchronization method provided by an embodiment of the present application;
fig. 4 is a block diagram of a data synchronization apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of a computer device according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
For the convenience of understanding of the present application, a brief description of an implementation environment related to the embodiments of the present application will be provided.
Referring to fig. 1, fig. 1 is a schematic diagram of an implementation environment according to an embodiment of the present application, and as shown in fig. 1, the implementation environment includes a user terminal 10 and a computer device 20. Wherein the computer device 20 is installed with an operating system 21 and software services 22. The user terminal 10 may be a mobile phone, a tablet computer, a computer, or the like, and the computer device 20 may be a computer, a server, or the like, and of course, as the computing capability of the terminal improves, the computer device 20 may also be a mobile terminal such as a mobile phone, a tablet computer, or the like.
The operating system 21 may be a computer program for managing computer hardware and software resources, and may be an operating system such as Windows (microsoft), Linux, or Android (Android).
The software service 22 is software running in a computer device that provides remote access services to the user terminal 10. Furthermore, the software service 22 may have a first storage location 23 in the computer device 20 as its data storage space and a second storage location of the computing device 20 as its database 24, the database 24 being used to record data information resulting from data manipulation by the software service. In addition, the software service 22 is externally provided with the following two operation interfaces:
1) the software service 22 is provided with a network access interface, and the user terminal 10 can remotely access the software service 22 in the computer device 20 through the network and perform data operations, such as file adding, deleting, searching or changing operations, for example, adding, deleting, searching or changing operations on data in the first storage location through the software service 22. Illustratively, the user terminal 10 may access the software service 22 in the computer device 20 through installed client software. During the data operation of the user terminal 10 through the software service 22, the software service 22 also records the data information generated by the data operation into the database 24 of the software service 22.
2) The software service 22 may provide a software service interface for the computer device 20, where the software service interface is a service window provided by the software service 22 for the computer device 20, and a user of the computer device 20 may perform data operations, such as adding, deleting, checking, or changing files, for example, adding, deleting, checking, or changing data in the first storage location. During the data manipulation through the software service interface, the software service 22 also records data information generated by the data manipulation into the database 24 of the software service 22.
In both of the above-described modes of operation, the software service 22 is directly informed of changes in the data produced by the operation. After identifying the change to the data, software service 22 may generate data information for the changed data, which is then recorded in a database.
However, in addition to the two operations described above, which may alter the data of the first storage location 23, the local operations of the computer device 20 may also alter the data of the first storage location 23. The local operation described herein refers to an operation performed on the data stored in the first storage location 23 directly through the operating system, not through the network access software service 22, but through the software service interface. As an example, the file management system may be invoked through a user interface provided by the operating system, through which the data in the first storage location 23 is operated. For example, the user may operate a user interface provided by an operating system through a mouse or a keyboard to invoke the file management system, and then operate the data in the first storage location 23 through the file management system. As another example, the data in the first storage location 23 may also be manipulated through a file management interface provided by an operating system. For example, a user may operate on data in the first storage location 23 by a command line calling a file management interface of an operating system.
Since the above-mentioned local operation of the service device 20 does not pass through the software service 22, and the software service 22 cannot directly know such a change, the change of the data in the first storage location 23 by the local operation is not recorded by the database 24 of the software service 22, which results in the data being out of synchronization between the first storage location 23 and the database 24. In addition, since the data accessed by the user terminal 10 is provided by the database 24 when accessing the software service 22, the data accessed by the user terminal 10 is further out of synchronization with the locally stored data of the computer device 20.
In order to solve the above problem, an embodiment of the present application provides a method for ensuring data synchronization between user-side access data and locally stored data of a computer device, which is described in detail in the embodiment of fig. 2 below.
Fig. 2 is a flowchart of a data synchronization method provided in an embodiment of the present application, where the method is applied to the computer device shown in fig. 1, and as shown in fig. 2, the method includes the following steps:
step 201: in the case that first data information of data stored in a first storage position is changed, the first data information and second data information generated by data operation performed by a software service are subjected to synchronism detection through the software service, so that whether the first data information and the second data information are synchronous or not is detected.
The first storage position is a data storage position of the software service, and data stored in the first storage position can be operated through an operating system. The first storage location may be any storage location in the computer device, and may specifically be a file directory, a partition, a disk, or an array, which is not limited in this embodiment of the present application.
It should be noted that the first storage location may be specified by a software service, or may be set by a user in a customized manner, which is not limited in this embodiment of the application.
As an example, a default storage location set by the system may be determined as the first storage location. For example, during the process of installing the software service or initializing the software service, the default storage location set by the system is used as the data storage location of the software service.
As another example, a data storage location setting interface of the software service may be displayed during installation of the software service or initialization of the software service, and then a storage location set through the data storage location setting interface may be used as the first storage location.
That is, the user can freely define and set the data storage location of the software service through the data storage location setting interface, and then use the storage location set by the user as the first storage location.
Wherein the second data information generated by the data manipulation by the software service may be stored in a second storage location of the computer device. That is, the software service may use the second storage location of the computer device as its database for storing the second data information generated by the data manipulation performed by the software service.
The first data information and the second data information may include data attributes or data sources, and the like. Data attributes may include data type, data classification, or data summary, among others. The data Digest may be the MD5(Message-Digest Algorithm MD5, MD5 Message Digest Algorithm) value of the data, or the like.
For example, the first data information may include a classification of data stored in the first storage location, an MD5 value, or a data source, etc. The data source is used to indicate which user terminal the data is uploaded through, and may be an identifier, an IP address (Internet Protocol ), a physical address, or the like of the user terminal that uploads the data.
The second data information may include a classification of the data, an MD5 value of the data, or a data source, among others. For example, the second data information may include a classification of the picture (e.g., person, landscape, business card, etc.) identified by the software service, a calculated MD5 value of the picture, and a source of the picture (e.g., through which user's mobile phone to upload), etc.
It should be noted that the data stored in the first storage location has 3 operation modes: 1, a user side accesses a software service through a network and carries out remote operation through the software service; 2, the user of the computer equipment operates through the software service interface; and 3, the user of the computer equipment carries out local operation through the operating system of the computer equipment.
In the related art, the software service may directly learn the changes made to the data in the first two ways, and record the second data information generated by the changes to the data, for example, to the second storage location. In the third method, since the software service is not performed, the software service cannot directly learn the change of the data, and cannot record the data information generated by the operation into the second storage location, which may cause the data information of the first storage location and the second storage location to be out of synchronization.
In the embodiment of the present application, it can be known through analysis of the above operations that the change of the first data information may be caused by data operation performed through a software service, or may be caused by a local user of the computer device performing operation on data stored in the first storage location through an operating system. If the data operation is caused by the software service, the change of the first data information is automatically recorded into the second data information, so that the first data information and the second data information are kept synchronous. If the data operation is performed through the operating system, the change of the first data information is not recorded in the second data information, in this case, the first data information and the second data information cannot be kept synchronous.
In the embodiment of the present application, in order to avoid data asynchronization caused by performing data operation through an operating system, when the first data information changes relative to the historical first data information, if the change is caused by performing data operation through the operating system, the software service may also be triggered to perform synchronization detection on the first data information and the second data information, so as to perform data synchronization when the first data information and the second data information are not synchronized.
As an example, the operation of detecting the synchronicity of the first data information and the second data information includes: and comparing the first data information with the second data information, if the first data information and the second data information are detected to be different, determining that the first data information and the second data information are asynchronous, and if the first data information and the second data information are detected to be the same, determining that the first data information and the second data information are synchronous.
Step 202: and if the first data information and the second data information are detected to be out of synchronization, updating the second data information based on the first data information.
If it is detected that the first data information and the second data information are not synchronized, it may be determined that the change of the first data information is caused by an operation performed by the operating system on the data stored in the first storage location, in this case, the second data information needs to be updated based on the first data information, so as to ensure that the second data information and the first data information are synchronized.
As an example, the operation of updating the second data information based on the first data information includes: determining out-of-sync data information between the first data information and the second data information; based on the out-of-sync data information, the second data information is updated to maintain data synchronization between the two.
That is, only the asynchronous data information between the two is synchronized, and other synchronous data is not operated, so that the data processing amount can be reduced, and the data processing efficiency can be improved.
Step 203: and when the user side accesses the software service through the network, displaying the updated second data information to the user side.
After the second data information is updated based on the first data information, the computer device can also display the updated second data information to the user side when the user side accesses the software service through the network, that is, the updated data information of the database is synchronized to the user side accessing the software service in time, so that the user side can obtain the local storage data of the computer device in time.
As an example, the computer device may send the updated second data information to the user terminal when receiving the data access instruction from the user terminal, and the user terminal refreshes the display interface based on the updated second data information.
As another example, the computer device may also send a data update notification to the user terminal, where the data update notification is used to instruct the user terminal to obtain the updated second data information, and refresh the display interface based on the updated second data information.
Step 204: and if the first data information and the second data information are detected to be synchronous, ending the operation.
If the first data information and the second data information are detected to be synchronous, it is indicated that the remote user end or the local user of the computer equipment does not perform data operation through the software service, and the local user does not perform data operation on the data storage position of the software service through the operating system, and in this case, data synchronization is not needed.
In the embodiment of the application, in the case that the first data information of the data stored in the first storage location is changed, through the software service, the first data information is subjected to synchronism detection with second data information generated by data operation through a software service, when the first data information and the second data information are asynchronous, the second data information is synchronized based on the first data information, the data stored in the first storage position can be operated by the computer equipment through local operation, when the first data information is changed, the data synchronization is carried out on the first data information and the second data information in time, the data synchronization of the first data information and the second data information is ensured, and further, when the user side accesses the software service, the data synchronization between the user side access data and the local storage data of the computer equipment is ensured, so that the user side can timely obtain the data result of the local operation of the computer equipment.
Fig. 3 is a flowchart of another data synchronization method provided in an embodiment of the present application, where the method is applied to the computer device shown in fig. 1, and as shown in fig. 3, the method includes the following steps:
step 301: first data information of data stored in the first storage location is obtained through a software service.
In this embodiment of the application, after the software service is started, the software service may monitor the first storage location to monitor a change of first data information of data stored in the first storage location, so as to perform synchronization detection on the first data information and the second data information when the first data information is changed.
As an example, when the first data information of the data stored in the first storage location is acquired by the software service, the acquisition may be performed according to a specified policy. For example, the acquisition is periodically performed, or triggered by a preset trigger policy.
For example, the first data information may be obtained by a software service when the computer device is detected to be in an idle state or the load is less than a load threshold. Therefore, the processing load of the computer equipment can be reduced, and the influence on other tasks is avoided.
As an example, obtaining, by a software service, first data information of data stored in a first storage location may include the following two implementations:
the first implementation mode comprises the following steps: first data information of data stored in the first storage location is obtained from a file system log of the computer device through a software service.
That is, the first data information may be read from the file system log.
In the embodiment of the application, the first data information may be periodically acquired from the file system log through a software service, or may be non-periodically acquired. For example, the first data information may be obtained from a file system log when the computer device is detected to be in an idle state or when the load is less than a load threshold.
The second implementation mode comprises the following steps: and calling a file scanning function to scan the file of the first storage position through software service, and acquiring first data information according to a file scanning result.
That is, the file scanning function may be used to scan the file, and further read the first data information.
In the embodiment of the application, the first data information may be obtained by periodically scanning the file in the first storage location through the software service, or may be obtained by non-periodically scanning the file. For example, when it is detected that the computer device is in an idle state or the load is smaller than the load threshold, the file scanning function may be invoked to perform file scanning on the first storage location, and the first data information may be obtained according to a file scanning result.
Step 302: detecting, by the software service, whether the first data information has changed relative to the historical first data information.
The historical first data information refers to first data information obtained last time by the software service.
The software service may compare the currently acquired first data information with the last acquired first data information, and if the currently acquired first data information changes with respect to the last acquired first data information, it may be determined that the first data information of the data stored in the first storage location has changed.
Step 303: if the first data information is changed relative to the historical first data information and the change is caused by data operation through an operating system, performing synchronism detection on the first data information and second data information generated by data operation through a software service through the software service so as to detect whether the first data information and the second data information are synchronous or not.
It should be noted that, if the change of the first data information is caused by data operation performed by the software service, the software service will automatically synchronize the change of the first data information to the second data information, and keep the synchronization of the first data information and the second data information. However, if the change of the first data message is caused by data operation through the operating system, the software service is not aware of the change, which causes the first data message to be out of synchronization with the second data message.
In the embodiment of the application, in order to avoid data asynchronization caused by data operation through an operating system, under the condition that the first data information is changed relative to the historical first data information, if the changed first data information is caused by data operation through the operating system, the first data information and the second data information can be subjected to synchronism detection through a software service, so that data synchronization is performed when the first data information and the second data information are not synchronized.
Step 304: and if the first data information and the second data information are detected to be out of synchronization, updating the second data information based on the first data information through software service.
Step 305: and when the user side accesses the software service through the network, displaying the updated second data information to the user side through the software service.
Step 306: and if the first data information and the second data information are detected to be synchronous, ending the operation.
It should be noted that, the steps 304-306 are similar to the steps 202-204 in the embodiment of fig. 2, and the specific implementation manner can refer to the related description of the steps 202-204, and the detailed description of the embodiment of the present application is not repeated herein.
In the embodiment of the application, the software service may acquire first data information of data stored in the first storage location, and when it is detected that the first data information is changed and the change is caused by data operation performed through the operating system, synchronization detection is automatically triggered on the first data information and second data information generated by data operation performed through the software service, and when the first data information and the second data information are not synchronized, the second data information may be synchronized based on the first data information. Therefore, when the computer equipment operates the data stored in the first storage position through local operation and the first data information changes, the data synchronization of the first data information and the second data information is timely performed, the data synchronization of the first data information and the second data information is ensured, and further the data synchronization between the user side access data and the local storage data of the computer equipment is ensured when the user side accesses the software service, so that the user side can timely obtain the data result of the local operation of the computer equipment.
Fig. 4 is a block diagram of a data synchronization apparatus provided in an embodiment of the present application, and as shown in fig. 4, the apparatus includes a detection module 401 and an update module 402.
A detection module 401, configured to perform, by a software service, synchronization detection on first data information of data stored in a first storage location and second data information generated by performing a data operation by the software service when the first data information is changed;
the first storage position is a data storage position of the software service, and data stored in the first storage position can be operated through an operating system;
an updating module 402, configured to update, by the software service, the second data information based on the first data information if it is detected that the first data information and the second data information are not synchronized.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring first data information of data stored in the first storage position through the software service;
a triggering module, configured to, if it is detected that the first data information changes with respect to historical first data information, and the change is caused by an operation performed by an operating system on data stored in a first storage location, trigger the detecting module 401 to perform, by using the software service, a step of detecting synchronization between the first data information and second data information generated by performing a data operation by using the software service;
optionally, the obtaining module includes at least one of a first obtaining unit and a second obtaining unit;
the first obtaining unit is used for obtaining first data information of data stored in the first storage position from a file system log of the computer equipment through the software service;
the second obtaining unit is configured to invoke a file scanning function to perform file scanning on the first storage location through the software service, and obtain the first data information according to a file scanning result.
Optionally, the updating module 402 is configured to:
determining out-of-sync data information between the first data information and the second data information;
the second data information is updated based on the out-of-sync data information.
Optionally, the apparatus further comprises:
the display module is used for displaying the updated second data information to the user side when the user side accesses the software service through the network;
optionally, the display module comprises at least one of a first display unit and a second display unit;
the first display unit is used for sending the updated second data information to the user side when receiving the data access instruction of the user side, and the user side refreshes the display interface based on the updated second data information;
the second display unit is configured to send a data update notification to the user side, where the data update notification is used to instruct the user side to obtain updated second data information, and the display interface is refreshed based on the updated second data information.
In the embodiment of the application, in the case that the first data information of the data stored in the first storage location is changed, through the software service, the first data information is subjected to synchronism detection with second data information generated by data operation through a software service, when the first data information and the second data information are asynchronous, the second data information is synchronized based on the first data information, the data stored in the first storage position can be operated by the computer equipment through local operation, when the first data information is changed, the data synchronization is carried out on the first data information and the second data information in time, the data synchronization of the first data information and the second data information is ensured, and further, when the user side accesses the software service, the data synchronization between the user side access data and the local storage data of the computer equipment is ensured, so that the user side can timely obtain the data result of the local operation of the computer equipment.
It should be noted that: in the data synchronization device provided in the above embodiment, only the division of the functional modules is illustrated when performing data synchronization, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data synchronization device and the data synchronization method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 5 is a block diagram of a computer device 500 according to an embodiment of the present disclosure. The computer device 500 may be an electronic device such as a mobile phone, a tablet computer, a smart television, a multimedia playing device, a wearable device, a desktop computer, a server, and the like. The computer device 500 may be used to implement the data synchronization methods provided in the above embodiments.
Generally, the computer device 500 includes: a processor 501 and a memory 502.
The processor 501 may include one or more processing cores, such as a 5-core processor, an 8-core processor, and so on. The processor 501 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 501 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 501 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, processor 501 may also include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.
Memory 502 may include one or more computer-readable storage media, which may be non-transitory. Memory 502 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 502 is used to store at least one instruction for execution by processor 501 to implement the data synchronization methods provided by method embodiments herein.
In some embodiments, the computer device 500 may further optionally include: a peripheral interface 503 and at least one peripheral. The processor 501, memory 502 and peripheral interface 503 may be connected by a bus or signal lines. Each peripheral may be connected to the peripheral interface 503 by a bus, signal line, or circuit board. Specifically, the peripheral device may include: at least one of a display 504, audio circuitry 505, a communication interface 506, and a power supply 507.
Those skilled in the art will appreciate that the configuration shown in FIG. 5 does not constitute a limitation of the computer device 500, and may include more or fewer components than those shown, or combine certain components, or employ a different arrangement of components.
In an exemplary embodiment, a computer-readable storage medium is also provided, having stored thereon instructions, which when executed by a processor, implement the above-described data synchronization method.
It is noted that the computer-readable storage medium referred to herein may be a non-volatile storage medium, in other words, a non-transitory storage medium.
It should be understood that all or part of the steps for implementing the above embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions may be stored in the computer-readable storage medium described above.
In an exemplary embodiment, a computer program product is also provided for implementing the above-described data synchronization method when the computer program product is executed.
The above-mentioned embodiments are provided not to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (15)

1. A data synchronization method is applied to computer equipment, wherein the computer equipment is provided with an operating system and software services, and the method comprises the following steps:
under the condition that first data information of data stored in a first storage position is changed, performing synchronism detection on the first data information and second data information generated by data operation of the software service through the software service;
wherein the first storage location is a data storage location of the software service, and data stored in the first storage location is operable by the operating system;
and if the first data information and the second data information are detected to be asynchronous, updating the second data information based on the first data information through the software service.
2. The method of claim 1, wherein prior to detecting the synchronicity of the first data information with second data information generated by the data operation performed by the software service, further comprising:
obtaining, by the software service, first data information for data stored in the first storage location;
if it is detected that the first data information is changed relative to the historical first data information and the change is caused by the operating system operating on the data stored in the first storage location, performing a step of detecting, by the software service, synchronicity of the first data information with second data information generated by the software service operating on the data.
3. The method of claim 2, wherein said obtaining, by the software service, first data information for data stored in the first storage location comprises:
obtaining, by the software service, first data information of data stored in the first storage location from a file system log of the computer device; or,
and calling a file scanning function to scan the file of the first storage position through the software service, and acquiring the first data information according to a file scanning result.
4. The method of claim 1, wherein the updating the second data information based on the first data information comprises:
determining out-of-sync data information between the first data information and the second data information;
updating the second data information based on the out-of-sync data information.
5. The method of any of claims 1-4, wherein after the data updating the second data information based on the first data information, further comprising:
and when the user side accesses the software service through the network, displaying the updated second data information to the user side.
6. The method of claim 5, wherein the presenting the updated second data information to the user terminal comprises:
when a data access instruction of the user side is received, the updated second data information is sent to the user side, and the user side refreshes a display interface based on the updated second data information; or,
and sending a data updating notice to the user side, wherein the data updating notice is used for indicating the user side to acquire the updated second data information, and refreshing a display interface based on the updated second data information.
7. A data synchronization device, applied to a computer device, wherein the computer device is installed with an operating system and a software service, the device comprises:
the detection module is used for carrying out synchronism detection on first data information and second data information generated by data operation of the software service under the condition that the first data information of data stored in a first storage position is changed through the software service;
wherein the first storage location is a data storage location of the software service, and data stored in the first storage location is operable by the operating system;
and the updating module is used for updating the second data information based on the first data information through the software service if the first data information and the second data information are detected to be asynchronous.
8. The apparatus of claim 7, wherein the apparatus further comprises:
the acquisition module is used for acquiring first data information of data stored in the first storage position through the software service;
the trigger module is used for triggering the detection module to perform synchronization detection on the first data information and second data information generated by data operation performed by the software service through the software service if the first data information is detected to be changed relative to historical first data information and the change is caused by the operation of the operating system on the data stored in the first storage location;
the acquisition module comprises at least one of a first acquisition unit and a second acquisition unit;
the first obtaining unit is used for obtaining first data information of data stored in the first storage position from a file system log of the computer equipment through the software service;
the second obtaining unit is configured to invoke a file scanning function to perform file scanning on the first storage location through the software service, and obtain the first data information according to a file scanning result.
9. The apparatus of claim 7, wherein the update module is to:
determining out-of-sync data information between the first data information and the second data information;
updating the second data information based on the out-of-sync data information.
10. The apparatus of any of claims 7-9, wherein the apparatus further comprises:
the display module is used for displaying the updated second data information to the user side when the user side accesses the software service through the network;
wherein the display module comprises at least one of a first display unit and a second display unit;
the first display unit is used for sending the updated second data information to the user side when receiving the data access instruction of the user side, and the user side refreshes a display interface based on the updated second data information;
the second display unit is configured to send a data update notification to the user side, where the data update notification is used to instruct the user side to obtain updated second data information, and a display interface is refreshed based on the updated second data information.
11. A computer device, characterized in that the computer device comprises a processor and a memory, the memory being adapted to store a computer program, the processor being adapted to execute the computer program stored on the memory to implement the steps of the method according to any of claims 1-6.
12. A data synchronization system is characterized by comprising a user side and computer equipment, wherein the computer equipment is provided with an operating system and software service;
the user side is used for accessing the software service of the computer equipment through a network;
the computer equipment is used for carrying out synchronism detection on first data information and second data information generated by data operation of the software service under the condition that the first data information of data stored in a first storage position is changed through the software service; if the first data information and the second data information are detected to be out of synchronization, updating the second data information based on the first data information through the software service; wherein the first storage location is a data storage location of the software service, and data stored in the first storage location is operable by the operating system.
13. The system of claim 12,
the computer device is further configured to display the updated second data information to the user side when the user side accesses the software service through the network after the second data information is updated based on the first data information through the software service.
14. The system of claim 13,
the computer device is further configured to send the updated second data information to the user side when receiving the data access instruction of the user side through the software service;
and the user side is further used for receiving the updated second data information sent by the computer equipment and refreshing the display interface based on the updated second data information.
15. The system of claim 13,
the computer device is further configured to send a data update notification to the user side through the software service;
and the user side is further configured to obtain the updated second data information from the computer device according to the data update notification, and refresh the display interface based on the updated second data information.
CN202010409485.5A 2020-05-14 2020-05-14 Data synchronization method, device and system Active CN113672678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010409485.5A CN113672678B (en) 2020-05-14 2020-05-14 Data synchronization method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010409485.5A CN113672678B (en) 2020-05-14 2020-05-14 Data synchronization method, device and system

Publications (2)

Publication Number Publication Date
CN113672678A true CN113672678A (en) 2021-11-19
CN113672678B CN113672678B (en) 2024-08-09

Family

ID=78537423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010409485.5A Active CN113672678B (en) 2020-05-14 2020-05-14 Data synchronization method, device and system

Country Status (1)

Country Link
CN (1) CN113672678B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140181027A1 (en) * 2012-12-21 2014-06-26 Zetta, Inc. Systems and methods for state consistent replication
CN105306556A (en) * 2015-09-30 2016-02-03 深圳市先河系统技术有限公司 File management method, server and network auxiliary storage equipment
US9448893B1 (en) * 2015-08-26 2016-09-20 Zetta, Inc. Asynchronous replication correctness validation
CN108021590A (en) * 2016-10-28 2018-05-11 阿里巴巴集团控股有限公司 A kind of destination object attribute determining method, attribute update method and device
EP3429130A1 (en) * 2017-07-13 2019-01-16 Cisco Technology, Inc. Os start event detection, os fingerprinting, and device tracking using enhanced data features
CN110990360A (en) * 2019-12-04 2020-04-10 深圳市迅雷网络技术有限公司 File synchronization method based on network storage device and related components

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140181027A1 (en) * 2012-12-21 2014-06-26 Zetta, Inc. Systems and methods for state consistent replication
US9448893B1 (en) * 2015-08-26 2016-09-20 Zetta, Inc. Asynchronous replication correctness validation
CN105306556A (en) * 2015-09-30 2016-02-03 深圳市先河系统技术有限公司 File management method, server and network auxiliary storage equipment
CN108021590A (en) * 2016-10-28 2018-05-11 阿里巴巴集团控股有限公司 A kind of destination object attribute determining method, attribute update method and device
EP3429130A1 (en) * 2017-07-13 2019-01-16 Cisco Technology, Inc. Os start event detection, os fingerprinting, and device tracking using enhanced data features
CN110990360A (en) * 2019-12-04 2020-04-10 深圳市迅雷网络技术有限公司 File synchronization method based on network storage device and related components

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王云鹏, 郭学旭, 潘翔, 雷毅: "计算机辅助协同设计中的数据管理研究", 计算机辅助设计与图形学学报, no. 11 *

Also Published As

Publication number Publication date
CN113672678B (en) 2024-08-09

Similar Documents

Publication Publication Date Title
US11221995B2 (en) Data replication from a cloud-based storage resource
CN109902255B (en) Page mixed browsing record generation method, device, equipment and storage medium
US20200019559A1 (en) Synchronizing object in local object storage node
CN107423404B (en) Flow instance data synchronous processing method and device
CN112612853A (en) Data processing method and device based on database cluster and electronic equipment
CN110633046A (en) Storage method and device of distributed system, storage equipment and storage medium
WO2021212493A1 (en) Data synchronization method and device, data storage system and computer-readable medium
CN111338834B (en) Data storage method and device
CN113064919B (en) Data processing method, data storage system, computer device and storage medium
WO2022252322A1 (en) Method for synchronizing memory database and relational database of feature tag-based power grid monitoring system
CN109165078B (en) Virtual distributed server and access method thereof
CN112395297B (en) Method, device and server for synchronizing work information
CN106547485B (en) Data migration method and device
CN117435569A (en) Dynamic capacity expansion method, device, equipment, medium and program product for cache system
CN109445966B (en) Event processing method, device, medium and computing equipment
CN114840562B (en) Distributed caching method and device for business data, electronic equipment and storage medium
CN114928620B (en) User information synchronization method, apparatus, device, storage medium, and program product
CN113672678B (en) Data synchronization method, device and system
CN108509281B (en) Message storage method and device
CN106790521B (en) System and method for distributed networking by using node equipment based on FTP
CN115454666A (en) Data synchronization method and device among message queue clusters
CN115348352A (en) Page access method and system
CN114489892A (en) Data processing method, data processing device, computer readable storage medium and computer equipment
CN114925078A (en) Data updating method, system, electronic device and storage medium
CN113760631A (en) Page loading duration determination method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant