CN114048178A - Dual-mode storage and synchronization method of data - Google Patents

Dual-mode storage and synchronization method of data Download PDF

Info

Publication number
CN114048178A
CN114048178A CN202111436401.8A CN202111436401A CN114048178A CN 114048178 A CN114048178 A CN 114048178A CN 202111436401 A CN202111436401 A CN 202111436401A CN 114048178 A CN114048178 A CN 114048178A
Authority
CN
China
Prior art keywords
data
file
text file
synchronization
cloud
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
CN202111436401.8A
Other languages
Chinese (zh)
Other versions
CN114048178B (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.)
Zhonghe Space Beijing Technology Co ltd
Original Assignee
Zhonghe Space Beijing 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 Zhonghe Space Beijing Technology Co ltd filed Critical Zhonghe Space Beijing Technology Co ltd
Priority to CN202111436401.8A priority Critical patent/CN114048178B/en
Publication of CN114048178A publication Critical patent/CN114048178A/en
Application granted granted Critical
Publication of CN114048178B publication Critical patent/CN114048178B/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/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • 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/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • 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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs
    • 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/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • 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
    • G06F16/2358Change logging, detection, and notification
    • 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
    • G06F16/275Synchronous replication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/80Database-specific techniques

Abstract

The invention relates to a dual-mode storage and synchronization method of data, belongs to the technical field of data processing, and aims to solve the problem of data synchronization in the dual-mode storage process of the data. A dual-mode storage and synchronization method of data, comprising: when one of the cloud file system and the database-based form system receives a data operation instruction, executing data operation in the data operation instruction, judging whether the data operation is triggered by a user request, and if so, triggering the synchronization system to execute synchronization operation: synchronously triggering the other one of the cloud file system and the form system to execute the data operation synchronized with the data operation; the form system is used for storing data in a database mode; the cloud file system is used for storing data in a file mode; the synchronization system is used for realizing synchronization between the file mode and the data stored in the database mode. The dual-mode storage and synchronization method of the data can complete the data synchronization work without manual interference.

Description

Dual-mode storage and synchronization method of data
Technical Field
The invention relates to the technical field of data processing, in particular to a dual-mode storage and synchronization method of data.
Background
In the computer field, a piece of data material extracted from production and life is stored in a computer, and from the application point of view, there are two modes of file storage (text file mode is the most common method) and database storage. "data" itself is an abstract concept. In different transactions, a "piece of data" has different richness of content. One piece of data in the data of the students in the class of the school comprises personal complete information of the name, the sex, the school number and the like of one student, and even a photo of the student can be taken as a part of the data; in a transaction with an album as a whole, one piece of data may be only one picture, and no other. Generally speaking, a "piece of data" refers to data having a minimum logical unit of relatively independent information under the premise of the same type of transaction environment, and refers to a data set without structurally similar repetitive individuals.
The basis of the file storage data is binary. By means of ASCII encoding and other methods, people map and convert binary and daily used characters, so that the universal text file type is provided. The biggest characteristic of the type is that almost all computer software systems directly support reading, storing and editing of the type file without any additional software function support. The method not only comprises intelligent computer equipment such as personal computers and mobile phones which are used daily, but also has the most basic use support for text files by connecting simple single-chip microcomputers, embedded systems and the like. Of course, the text file has some limitations, and the support for data forms other than words, such as multimedia information like pictures, sound, video, etc., is not good. However, by performing some special transcoding on binary data (e.g., base64, etc.), it is still possible to record the data in a text file; although such text files are opened, people cannot directly read and understand the converted information, but the converted information can be inversely encoded by software and then used. Based on the above description, it is apparent that a piece of data can be stored in a single text file.
The database system is a very important data application system in the field of computer software, and can be used for storing a plurality of pieces of data with the same format by defining the structure describing one piece of data into a data table; and maintains the connection between the data inside or other data outside to realize various possible data interaction. At present, a plurality of database systems exist in the field of computer science, and the method does not carry out differential analysis on various database systems and only focuses on the commonality of 'comprehensive data management'. It should be noted that, in the operating system level, all data generated during the running process of the computer are finally stored on the storage medium in a file storage manner, and a database system is not exceptional, that is, the storage files corresponding to most databases are in a binary mode, and must be read and written by using related programs. It is not uncommon for a piece of data to be stored in a database regardless of the final storage form.
From the foregoing description, although both storage modes have similarities in the underlying implementation (both ultimately being stored on media in the file storage mode of the computer system). However, when a piece of data is stored in a computer, the different storage modes are greatly different in combination with an interface for a user to access the data later, and the main difference is as shown in table 1.
TABLE 1 compare characteristics of a piece of data stored in a single text file, stored in a database
Figure BDA0003381663390000021
In real life, one piece of data is stored in a single text file or a database, and the two storage methods have the advantages and disadvantages of being suitable for occasions. However, if two modes of storage can be started for one piece of data at the same time, the advantages of the two modes can be combined, the disadvantages of the two modes can be avoided, and a more flexible and powerful data function system can be formed.
However, if dual mode storage is to be implemented, the following problems must be faced.
(1) Designing a data format matched with database storage in text file
The text file itself is free to contain data, but if the stored data does not have a strict format constraint, it becomes difficult to extract the data from the text file by program later, which is not favorable for daily use. It is therefore necessary to design a format for storing data for text files to make constraints.
(2) Providing certain encryption capabilities in text files to protect data
Text files can be opened directly to access their contents in almost all computer systems. If the content is to be given security, the original content of the text file can be converted by providing a plurality of encryption modes. These encryption algorithms must be reversible and require a key to decrypt. The storage and use of the key also requires a companion system to support it.
(3) File system security supplementation for data-stored text files
Note that this security supplement means that when all text files storing data are collectively stored in a specific file system, security supplement is performed; these security measures are going to fail when the text file leaves the file system by means of copying, network transmission, etc. If the extracted file still has certain security in other systems, the encryption measures of the file are required.
(4) Method for automatically synchronizing data stored in two modes
After the data is stored in two different modes, at least two copies of the data are generated. In daily use, after data in different modes are changed, a synchronous requirement exists, otherwise, the data contents are not matched, and the application advantages embodied by the modes are not meaningful.
Synchronizing data under two modes to keep the content consistent all the time is the most central process in a data dual-mode storage scheme.
Disclosure of Invention
In view of the foregoing analysis, the embodiments of the present invention are directed to a dual-mode data storage and synchronization method, so as to solve the problem of data synchronization during the dual-mode data storage.
The embodiment of the invention discloses a dual-mode storage and synchronization method of data, which comprises the following steps:
when one of the cloud file system and the database-based form system receives a data manipulation instruction,
the data operation in the data operation instruction is performed,
and judging whether the data operation is triggered by a user request, if so, triggering a synchronization system to execute the synchronization operation: synchronously triggering the other one of the cloud file system and the form system to execute the data operation synchronized with the data operation;
the form system is used for storing data in a database mode; the cloud file system is used for storing data in a file mode; the synchronization system is used for realizing synchronization between the file mode and the data stored in the database mode.
On the basis of the scheme, the invention also makes the following improvements:
further, in the cloud file system, a piece of data is stored as an independent data text file, and the data text file comprises a data structure, a data structure unique identifier, a data value matched with the data structure and a data value unique identifier; wherein the content of the first and second substances,
a data structure for textually describing key fields in the data;
the data structure unique identification is used for uniquely identifying the data structure;
the data value is used for describing the value of the key field in the data in a text form;
and the data value unique identifier is used for uniquely identifying the data value.
Further, a form template in the form system consists of a data format and a plurality of data lines; one piece of data in the form template only corresponds to one data packet, and the data packet comprises a data format, a data format unique identifier, a data line matched with the data format and a data line unique identifier; wherein the content of the first and second substances,
a data format for describing key fields in the data in tabular form;
the data format unique identification is used for uniquely identifying the data format;
the data row is used for describing the value of the key field in the data in a tabular form;
and the data line unique identifier is used for uniquely identifying the data line.
Further, when the data operation instruction is a file new instruction, executing:
step YX 1: the cloud file system receives a file new command, judges whether the file new command comes from a user request,
if yes, a data text file is newly built according to the file new building instruction and stored in the cloud file system; jumping to step YX 2;
if not, directly creating a data text file according to the file creation instruction, storing the data text file in a cloud file system, and completing the creation of the data text file;
step YX 2: the synchronization system monitors a newly-built data text file in the cloud file system, and the synchronization operation starts:
step YX 21: a control list system creates an empty data packet and associates the empty data packet with the newly-created data text file;
step YX 22: analyzing the newly-built data text file into a data packet, and sending the data packet to a form system;
step YX 3: the form system processes the data packet, and executes corresponding database operation according to the content contained in the data packet to obtain a database operation result; the database operation result is that the data packet is deleted, or the data packet is updated to the form system;
step YX 4: after monitoring that the data packet is updated to the form system, the synchronization system packs the updated data packet into a data text file and sends the data text file to the cloud file system;
step YX 5: the cloud file system fills a newly-built data text file based on the received data text file, and at the moment, the newly-built data text file is an associated state file; completing the new creation of the data text file;
step YX 6: after monitoring that the data packet is deleted, the synchronization system feeds back data incompatibility error report to the cloud file system;
step YX 7: after the cloud file system receives the data incompatibility error report, the newly-built data text file is stored in the cloud file system as an isolated text; and finishing the new data text file.
Further, when the data operation instruction is a file editing instruction, executing:
step YB 1: the cloud file system receives a file editing instruction, judges whether the file editing instruction comes from a user request,
if so, editing the data text file for execution; jumping to the step YB 2;
if not, directly editing the data text file according to the file editing instruction, storing the data text file in a cloud file system, and finishing editing the data text file;
step YB 2: when the synchronous system monitors the execution of the edited data text file, the synchronous operation starts:
judging whether the data text file to be edited is isolated,
if the file data is isolated, the cloud file system randomly edits the file data to obtain an edited data text file which is an isolated file and stores the edited data text file in the cloud file system; finishing editing the data text file;
if not, the synchronization system acquires a data packet related to the data text file from the form system, packages the data packet into the data text file and then sends the data text file to the cloud file system;
step YB 3: the cloud file system generates a copy of a data text file to be edited based on the received data text file, limited edits data of the copy of the data text file, and stores the edited data text file in the cloud file system;
step YB 4: the synchronization system associates the original data packet with the edited data text file; analyzing the edited data text file into a data packet, and sending the data packet to a form system;
step YB 5: the form system refills the data line information of the associated data packet according to the received data packet and updates the data packet to the form system;
step YB 6: after monitoring that the data packet is updated to the form system, the synchronization system feeds back the completion of the synchronization operation to the cloud file system;
step YB 7: and after the cloud file system receives the completion of the synchronous operation, the edited data text file is a related state file, and the editing of the data text file is completed.
Further, when the data operation instruction is to insert a new piece of data or update a piece of data, executing:
inserting a new piece of data or updating a piece of data in the form system;
determining whether the data operation instruction is from a user request,
if so, recording the inserted new data or updated data as a data packet;
if not, storing the inserted new data or updated data, and finishing;
after the synchronous system monitors the data packet, the synchronous operation starts:
controlling a cloud file system to create an empty memory data text file;
associating the data packet to an empty memory data text file;
packaging the data packet into a data text file, and sending the data text file to a cloud file system;
the cloud file system fills the empty memory data text file based on the content of the data text file to complete the new creation of the data text file;
after monitoring that the new data text file is completed, the synchronization system feeds back the completion of the synchronization operation to the form system;
and after the form system receives the completion of the synchronous operation, storing the inserted new data or updated data to complete the operation.
Further, when the synchronization system executes the synchronization operation, one or more of the following operations are executed:
association maintenance, which includes three meta-operations: judging whether a data packet is isolated or not and whether a data text file is isolated or not, and associating a data packet with a data text file;
data analysis, namely synchronizing the data in the data text file into a data packet;
and (5) data packaging, namely synchronizing the data in the data package into a data text file.
Further, in the maintenance of the association,
associating a data packet to a data text file: associating the data packet to a corresponding data text file by setting a pointer relationship which is initiated from the data packet and points to the data text file;
judging whether the data packet is isolated: if the data packet is associated with a data text file, the data packet is not isolated; otherwise, the data packet is isolated;
judging whether the data text file is isolated: if a data packet is associated with the data text file, the data text file is not isolated; otherwise, the data text file is isolated.
Further, the data analysis process is as follows:
step J1: reading the unique identifier of the data structure in the data text file, judging whether the unique identifier of the data structure exists, if so, recording the unique identifier of the data structure, and then jumping to J2; if not, directly jumping to J2;
step J2: reading data structure information in the data text file, and converting the data structure information into a data format;
step J3: reading the unique data value identifier in the data text file, judging whether the unique data value identifier is contained, if so, recording the unique data value identifier, and then jumping to J4; if not, directly jumping to J4;
step J4: reading a data value in the data text file, and converting the data value into a data line;
step J5: and taking the data structure unique identifier as a data format unique identifier and the data value unique identifier as a data line unique identifier, and organizing the data format unique identifier, the data format, the data line unique identifier and the data line according to the form of the data packet to obtain the analyzed data packet.
Further, the data packing process is as follows:
reading the data packet, and sequentially extracting and recording the unique data format identifier, the data format information, the unique data row identifier and the data row;
and taking the data format unique identifier as a data structure unique identifier and the data line unique identifier as a data value unique identifier, converting the data format into a data structure and converting the data line into a data value, and organizing the data structure unique identifier, the data structure, the data value unique identifier and the data value according to the form of the data text file to obtain the packed data text file.
Compared with the prior art, the invention can realize at least one of the following beneficial effects:
the dual-mode storage and synchronization method of data provided by the invention has the following advantages:
1. flexible application file schema and database schema for special applications
According to the application occasion of the data, one of the two storage modes can be freely selected and used, the advantages of database storage and file storage in practical application are reflected, and the disadvantages of the database storage and the file storage can be avoided. For example, where data analysis is required, a database storage mode of the data is enabled; and carry, transfer data at ordinary times, use the file mode of the data.
2. Providing dual storage insurance for data
Dual mode storage brings data redundancy. In a sense, this is just a kind of double storage insurance for data. The data stored in the file mode can be freely copied and dispersed to independent file storage equipment; the database stores schema data and also has stored copies of the data. No matter which mode stores the data, at least another mode of data is available for restoration.
3. The synchronous system completes data synchronization without manual interference
One disadvantage of data redundancy is that when a portion of data is changed, the redundant portion must also be changed, otherwise data confusion can result. The invention particularly provides the automatic synchronization work of the data, which is carried out by the synchronization system for the dual-mode storage of the data, thereby solving the most critical problem in data change.
4. Providing convenient file mode applications using cloud file systems
In the synchronization system, the synchronization system is connected with a file mode and a database mode of data, and a cloud file system and a form system based on a database are respectively provided for storing data of the two modes and keeping synchronization between the two modes.
The cloud file system has powerful functions for processing data text files:
(1) as a cloud file system, a data text file provider can conveniently upload respective files through a network;
(2) the file management function of the cloud file system can well record the uploading time of a single data text file, upload metadata information of users and the like in detail, and the traceability of data is ensured.
(3) The file security of the cloud file system can provide system-level security characteristics for access reading of files
(4) The cloud file system has a recording function of historical versions of files, so that a historical data change tracing function of one piece of data in a database can be realized (to realize the same function in the database system, a relatively complex data redundancy storage function needs to be specially developed, namely, all the data in any way have the historical tracing function, and the development cost is high).
(5) A unique display scheme is provided for opening a data text file in a cloud file system: although the data is stored in the text file, the cloud file system can analyze the structure and present the file in a form mode because of the structure information, and therefore the reading of a single file is more intuitive.
5. The method for displaying the data in the database by using the form system based on the database has strong expansibility
(1) The form system based on the database provides the capability of dynamic expansion for the data in the data text file corresponding to the database data:
(2) the data in the data text file can describe data objects with different structures as long as the data conform to a certain format specification. The form system can automatically expand the storage structure of the database according to different structures without separately developing programs for specific structural data.
(3) The data-form system directly provides a universal data form mode to display the data in the database without independently developing the finally stored database, so that the user can directly use the data. In addition, the spreadsheet system may provide even more versatile presentation schemes for presenting data.
In the invention, the technical schemes can be combined with each other to realize more preferable combination schemes. Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and drawings.
Drawings
The drawings are only for purposes of illustrating particular embodiments and are not to be construed as limiting the invention, wherein like reference numerals are used to designate like parts throughout.
FIG. 1 is a schematic diagram of a dual-mode storage and synchronization system for data;
FIG. 2 is a schematic diagram of the operation of the synchronization system;
FIG. 3 is a schematic diagram of an association relationship between a data text file and a data packet;
FIG. 4 is a flow chart of data parsing;
FIG. 5 is a flow chart of data packing;
FIG. 6 is a schematic diagram of the interaction among the file system, the synchronization system, and the form system during the synchronization operation;
FIG. 7 is a flow chart of a dual mode method of storage and synchronization of data;
FIG. 8 is a flowchart of a synchronization process for a newly created data text file in a cloud file system;
FIG. 9 is a flowchart of a synchronization process for editing a data text file in a cloud file system;
FIG. 10 is a flowchart of a synchronization process for deleting a data text file in a cloud file system;
FIG. 11 is a flow chart of a synchronization process for inserting a new piece of data in the spreadsheet system;
FIG. 12 is a flow chart of a synchronization process for updating a piece of data in a spreadsheet system;
FIG. 13 is a flow chart of a synchronization process for deleting a new piece of data in the spreadsheet system;
FIG. 14 is a schematic view illustrating a common processing flow of operations of a cloud file system and a form system under a synchronization operation of a synchronization system;
FIG. 15 is a diagram of a dual-mode in-storage, file-storage schema that can provide data history version traceability for a database-storage schema.
Detailed Description
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate preferred embodiments of the invention and together with the description, serve to explain the principles of the invention and not to limit the scope of the invention.
The embodiment of the invention discloses a dual-mode storage and synchronization method of data, which is realized based on a corresponding system, and introduces a dual-mode storage and synchronization system of data for convenience of literary composition, wherein a structural schematic diagram is shown in figure 1 and comprises the following steps:
a database-based form system for storing data in a database mode;
the cloud file system is used for storing data in a file mode;
and the synchronization system is used for realizing synchronization between the file mode and the data stored in the database mode.
As shown in fig. 1, in the dual-mode data storage and synchronization system, after a piece of data is stored as a piece of data in a database (a docking form system) or as an independent data text file in a cloud file system, two groups of data are docked into the synchronization system, and synchronization between the stored data in the two modes is realized in the synchronization system. In addition, for the convenience of user operation, the dual-mode data storage and synchronization system can also provide a user operation interface corresponding to two storage modes for the user, which are respectively: the database operation interface is used for operating the form system and providing an operation interface in a data form for a user; the file operation interface used for operating the cloud file system can provide an operation interface in a file form for a user, and in the operation process, a data text file can be opened in a file management mode and presented in a file form.
In this embodiment, the synchronization system is a core link for implementing the entire scheme. Further details can be seen by further parsing the dual mode storage and synchronization system of data in this embodiment. As shown in fig. 2, the following elements can be seen in the synchronization system working diagram:
1. cloud file system and data text file stored in cloud file system
2. Form system and data package
3. File operation of the data text file in the cloud file system: file new creation, file editing and file deletion operations
4. Database operations related to data format and data rows in the data packet: creating a form, inserting data, updating data and deleting data;
5. three working flows of the synchronous system are as follows: association maintenance, data parsing and packaging, and synchronous operation
The detailed implementation of this embodiment will be explained based on the above 5 elements. Firstly, the basic features of the cloud file system, the form system and the synchronization system are introduced as follows:
first, cloud file system
1. In the cloud file system, one piece of data is stored as an independent data text file, and the data text file comprises a data structure, a data structure unique identifier, a data value matched with the data structure and a data value unique identifier; the data structure is used for describing key fields in the data in a text form; the data structure unique identification is used for uniquely identifying the data structure; the data value is used for describing the value of the key field in the data in a text form; and the data value unique identifier is used for uniquely identifying the data value. Note that the non-empty data text file must contain a data structure, the data value may be empty, and the data structure unique identifier and the data value unique identifier may be filled in via a synchronization operation of the synchronization system during the file new process.
2. As sharable cloud file space, a user can store the data text file into the cloud file system through the file transmission source or copy the data text file from the cloud file system.
3. As a sharable cloud file space, the cloud file system has a certain authority management function, and can control data text files stored on the cloud file system to have the characteristics of visibility (visible/hidden settings for a specific user), readability (readable settings for the specific user), writeability (content editing, but the authority of the file cannot be modified), and manageability (all the authorities for the specific user). It is emphasized that the synchronization system is limited to the authority management function of the cloud file system for the data text file when synchronization between the file schema and the data stored in the database schema is realized. Specifically, at the cloud file system side, only data text files meeting the authority management function can execute corresponding file operations; on the form system side, the authority management function of one piece of data is the authority management function of a data text file associated with a data packet matched with the data, and corresponding database operation can be executed only by the data meeting the authority management function; for example, if a certain data text file is not writable, it cannot be subjected to file editing. Similarly, if the data text file is associated with a data packet in the form system, the data matching the data packet in the form system cannot be updated. Therefore, only the data text file or data packet with the corresponding authority management function can enter the synchronization process of fig. 8-13.
4. The file history version recording function is provided. During the process of implementing data synchronization (such as performing file editing, or updating data and other operations), the latest data in the form system is only associated with the latest version of the corresponding data text file in the cloud file system, and the historical version of the data text file is still stored in the cloud file system. Therefore, the edited data text file is actually stored as a new copy of the data text file, and follows all the authority settings of the old version to perform "file archiving" on the historical version. The number of the historical versions is controllable.
5. Has the function of filing files. The function means that after one piece of data in the form system is disconnected from one data text file and is then connected with another data text file, the originally connected data text file is filed, namely, the originally connected data text file is completely hidden from conventional file management and is changed into 'auxiliary data' supporting the display of the latest data text file content. The archived historical version data text file can still be taken out independently through special operations, but cannot be edited and set for management any more (the user authority is enough and cannot be changed any more), so that the archived historical version data text file becomes an absolute 'read-only' file.
6. The data text file is finally stored in an ASCII code manner so that the data text file still has a certain availability after the data text file is separated from the synchronization environment in the embodiment.
7. The data text file needs to follow a set structured text specification, and the structured text specification can be described by using methods such as XML (extensive Makeup language), JSON (Java Server pages) and the like; the present embodiment does not limit the structured text specification that is followed. However, if dual-mode storage and synchronization of a piece of data is to be achieved, this structured text specification must be uniquely determined and cannot be intermixed with multiple specifications.
When the data text file is stored in the cloud file system, the cloud file system and the data text file stored therein are both controlled by the synchronization system, and the data text file is specifically embodied as follows:
8. the cloud file system monitors file operations of the data file and the text file by the synchronization system;
9. the content of the data text file is monitored by the synchronization system, so that the data analysis and packaging process is realized.
10. The storage of the data text file is monitored by the synchronization system, so that the correlation maintenance function of the data packet corresponding to the form system is realized.
The functional characteristics are requirements for the cloud file system and the data text file in the function of the synchronization system. In the following functional description, the above functional features will be used.
Note that a data text file is copied to the outside through a file transmission source, and after leaving the synchronization system, the data text file is not limited by any synchronization system and can be edited and changed; however, if it is desired to re-copy the changes back to the dual-mode storage and synchronization system after editing the changes, the external changes are required to still conform to the structured text specification within the dual-mode storage and synchronization system and the structure of the data text file-if not, the file is no longer a data text file that can be used for synchronization processing, and synchronization processing is ignored in the dual-mode storage and synchronization system.
Second, form system
1. Based on database source development, all form data generated and used is created and implemented based on standard database tables.
2. Tables in various new formats can be created under the agreed structured text specification. The structured text specification is consistent with the structured text specification requirements of the data text file in the cloud file system.
3. Basic database operations such as data insertion, data updating, data deletion and the like are supported for data sheets in various formats.
4. The form template in the form system consists of a data format and a plurality of data lines; one piece of data in the form template only corresponds to one data packet, and the data packet refers to all contents of one piece of data in the form template: the data packet comprises a data format, a data format unique identifier, a data line matched with the data format and a data line unique identifier; the data format is used for describing key fields in the data in a table form; the unique data format identifier is used for uniquely identifying the data format, and data in different data formats can be distinguished through the unique data format identifier; the data row is used for describing the value of the key field in the data in a tabular form; and the data line unique identifier is used for uniquely identifying the data line, and different data line information under the same data format can be distinguished through the data line unique identifier. Based on the above description, it can be seen that, in essence, the same data is embodied in the same content of the data packet and the data text file, and only the representation forms are different, one is in a table form and one is in a file form. Note that the non-empty data packet must contain a data format, a data line may be empty, and the unique identifier of the data format and the unique identifier of the data line may be filled through a form system.
Thirdly, file operation of the data text file in the cloud file system
1. Newly creating a file: the method comprises two modes: directly creating an empty data text file in a cloud file system, and then manually filling and storing the empty data text file; or, a data text file with data content copied by the file transmission source; in accordance with the foregoing description, no matter which way the file creation is performed, the data structure information must be included in the newly created data text file.
2. Editing the file: essentially, a process of generating a new copy of the data text file based on an existing data text file, and then writing and saving new data values in the new copy of the data text file. If the new data text file copy is finally stored, the original data text file is replaced in the synchronous system and is associated with the corresponding data packet in the form system; the original data text file is subjected to file archiving operation, so that the original data text file is hidden in the cloud file system.
3. And (3) deleting the file: in essence, existing data text files are "archived", i.e., hidden in a cloud file system, directly.
Fourthly, creating a form, inserting data, updating data and deleting data related to data format and data line in the data packet
1. Creating a form: generating a new form template according to the data format in the data packet, taking the data format as the data format of the form template, and generating and recording a unique data format identifier;
2. inserting data: and according to the data lines (without the data line unique identification) in the data packet, creating a new data line record in the specified form template, and generating and recording the data line unique identification.
3. Updating data: updating an existing piece of data according to the unique data line identifier in the specified form template according to the data line (having the unique data line identifier) in the data packet;
4. and (4) deleting data: and deleting an existing piece of data according to the data line unique identification in the specified form template according to the data line (having the data line unique identification) in the data packet.
It should be noted that, considering that the form system has strict format requirements, the form system is relatively easy to implement by adding a unique identifier; when a file is created through the cloud file system or a data value is added to the created file, a user may use various different file editing tools, and thus a unique identifier may not be conveniently set. Thus, in this embodiment, the unique identifier is generated only on the system side of the form and then synchronized to the associated data text file by the synchronization system. Illustratively, the unique identifier may be generated based on a globally unique identification.
Fifth, work flow of synchronous system
The synchronization system monitors the synchronization process of the related data text file and the data packet, and mainly comprises the following three automatic working processes: and performing association maintenance, data analysis and packaging and synchronous operation. Specifically, the method comprises the following steps:
1. association maintenance
The association maintenance includes three meta-operations: judging whether a data packet is isolated or not and whether a data text file is isolated or not, and associating a data packet with a data text file; in particular, the amount of the solvent to be used,
associating a data packet to a data text file: associating the data packet to a corresponding data text file by setting a pointer relationship which is initiated from the data packet and points to the data text file;
judging whether the data packet is isolated: if the data packet is associated with a data text file, the data packet is not isolated; otherwise, the data packet is isolated;
judging whether the data text file is isolated: if a data packet is associated with the data text file, the data text file is not isolated; otherwise, the data text file is isolated;
a schematic diagram of the association maintenance is shown in fig. 3. In this embodiment, the association relationship between the data text file and the data package is described as a pointer relationship that is initiated from the data package and points to the data text file. Illustratively, the pointer is a storage physical path of the data text file associated with the data packet; the storage physical path is directly stored in the data packet or has a one-to-one mapping relation with the data packet. Generally, a data text file and a data packet for establishing an association relationship must have a strict correspondence: the data format unique identification is consistent with the data structure unique identification, the data format is consistent with the data structure, the data line is consistent with the data value, and the data line unique identification is consistent with the data value unique identification. However, when performing a synchronization operation, to simplify the operation procedure, there may be the following special cases: at the beginning of establishing the association, one of the data packet and the data text file is empty, at this time, the synchronization system firstly sets a pointer relation which is initiated from the data packet and points to the data text file, and establishes a preliminary association relation between the data packet and the data text file; and then, the synchronization system performs data filling on the empty party through data analysis or data packaging operation, so that the data text file and the data packet which establish the association relationship have strict correspondence. Therefore, from the view of synchronization result, the data text file and the data packet which establish the association relationship have strict correspondence relationship.
The association maintenance workflow, although simple, is a prerequisite for the entire dual-mode storage and synchronization process, and is self-evident. For most file operations and database operations, in the workflow of data analysis and packaging, the data text files and data packets participating in the workflow must have an association relationship; in the workflow of performing the synchronization operation, there are various more detailed requirements on the association maintenance. If isolated data text files or data packets without association relation are encountered, dual-mode storage and synchronization of one piece of data cannot be realized. That is, if not specifically stated, the data text files and the data packets mentioned in this embodiment are all associated one by one, and an isolated individual cannot achieve synchronization of data (but may achieve some other functional effects, which will be specifically pointed out later).
Note that: one data packet is associated to at most one data text file. The reason is that when the operation of "associating one data packet to another data text file" is performed on the premise that one data packet has already been associated with one data text file, the newly associated data text file and the originally associated data text file are not consistent, which may cause the originally associated data text file to become an isolated data text file.
2. Data parsing and packaging
The data analysis and packaging are established on the premise that the data text file and the data package have an association relationship (there are two conditions: association is already existed, or association can be realized in the data analysis and packaging process). If the data text file or data package is isolated, data parsing and packaging cannot be performed. According to different directions of the synchronous system for executing the synchronous process, the data analysis and the data packaging are carried out; wherein the content of the first and second substances,
data analysis, namely synchronizing the data in the data text file into a data packet; illustratively, the present embodiment provides a way for the synchronization system to perform a data parsing process, and the flowchart is shown in fig. 4. The specific process is described as follows:
step J1: reading the unique identifier of the data structure in the data text file, judging whether the unique identifier of the data structure (namely the 'structure identifier' in figure 4) exists or not, if so, recording the unique identifier of the data structure, and then jumping to J2; if not, directly jumping to J2;
step J2: reading data structure information in the data text file, and converting the data structure information into a data format;
step J3: reading the data value unique identifier in the data text file, judging whether the data value unique identifier (namely the value identifier in the figure 4) exists or not, if so, recording the data value unique identifier, and then jumping to J4; if not, directly jumping to J4;
step J4: reading a data value in the data text file, and converting the data value into a data line;
step J5: and taking the data structure unique identifier as a data format unique identifier and the data value unique identifier as a data line unique identifier, and organizing the data format unique identifier, the data format, the data line unique identifier and the data line according to the form of the data packet to obtain the analyzed data packet.
It should be noted that, in the data parsing process, the data structure unique identifier and the data value unique identifier may be null, and at this time, the corresponding data format unique identifier and the data line unique identifier are also null.
Data packaging, namely synchronizing the data in the data package into a data text file; illustratively, the present embodiment further provides a data packing manner, and a schematic diagram is shown in fig. 5. The specific process is described as follows:
step D1: reading the data packet, and sequentially extracting and recording the unique data format identifier, the data format information, the unique data row identifier and the data row;
step D2: and taking the data format unique identifier as a data structure unique identifier and the data line unique identifier as a data value unique identifier, converting the data format into a data structure and converting the data line into a data value, and organizing the data structure unique identifier, the data structure, the data value unique identifier and the data value according to the form of the data text file to obtain the packed data text file.
Similarly, in the data packing process, the data format unique identifier and the data line unique identifier may be null, and at this time, the corresponding data structure unique identifier and the data value unique identifier are also null.
3. Synchronous operation
The synchronous operation means that when the cloud file system performs file operation on the data text file in the synchronous system, the synchronous system synchronously triggers data operation on the data packet in the corresponding form system for the file operation, so that the effect of data synchronization is achieved; conversely, the data operation of the form system on the data packet can also trigger the cloud file system to perform the file operation on the data text file. Therefore, file operations in the cloud file system and data operations in the form system may be triggered by a user request or a synchronization system.
It should be noted that, when executing a file operation in the cloud file system, a data operation in the form system may be triggered in a linkage manner through a synchronization operation. On the contrary, when the data operation in the form system is executed, the file operation in the cloud file system may be triggered in a linkage manner through the synchronous operation. Resulting in a loop call. FIG. 6 is a schematic diagram of the interaction among the file system, the synchronization system, and the form system during the synchronization operation. The first graph is a schematic diagram of checking mutual triggering operation in linkage, and the second graph and the third graph are actual execution effect graphs.
Therefore, in order to avoid the call loop caused by indirect initiation, the present embodiment proposes a dual-mode storage and synchronization method for the following data, and the flowchart is shown in fig. 7, and includes:
when one of the cloud file system and the database-based form system receives a data manipulation instruction,
the data operation in the data operation instruction is performed,
and judging whether the data operation is triggered by a user request, if so, triggering a synchronization system to execute the synchronization operation: synchronously triggering the other one of the cloud file system and the form system to execute the data operation synchronized with the data operation;
the form system is used for storing data in a database mode; the cloud file system is used for storing data in a file mode; the synchronization system is used for realizing synchronization between the file mode and the data stored in the database mode.
Here, the data operation performed in the cloud file system is a file operation, and the data operation performed in the form system is a database operation. It should be noted that, in the data synchronization process, if the data operation is triggered by a user request, both the receiver and the synchronizer of the data operation instruction execute the data operation on the memory level first, and only after the data operations of both the receivers are completed, the actual data adjustment is executed on the disk. Therefore, synchronization between the data stored in the cloud synchronization system and the data stored in the form system is ensured. It is also emphasized that all the requirements for the cloud file system, the synchronization system, and the form system in the dual-mode storage and synchronization system are also applicable to the dual-mode storage and synchronization method.
In the specific implementation process, the data operation at the form system side is considered to be simpler and more direct, so that the data synchronization of the cloud file system and the form system is ensured, and the operation efficiency of the dual-mode storage and synchronization system is improved; the following execution order is preferred:
if the receiver of the data operation instruction is the cloud file system, firstly executing user request judgment and then executing corresponding file operation; if the receiver of the data operation instruction is a form system, executing corresponding database operation, and then executing corresponding user request judgment; specifically, the method comprises the following steps:
when executing file operation, the cloud file system firstly needs to judge whether the file operation is triggered to a user request or a synchronous system, and when the file operation is triggered to the user request, the cloud file system executes corresponding file operation according to the user request; and performing, by the synchronization system, a synchronization operation: synchronously triggering the form system to execute corresponding database operation on the data packet; and when the file operation is triggered to the synchronization system, the cloud file system directly executes the corresponding file operation.
When executing the database operation, the form system firstly executes the corresponding database operation, then judges whether the database operation is triggered to the user request or the synchronous system, and when the database operation is triggered to the user request, the synchronous system executes the synchronous operation: synchronously triggering a cloud file system to execute corresponding file operation on the data text file; when the database operation is triggered in the synchronization system, the form system directly saves the corresponding database operation.
The synchronous operation of the synchronous system involves the previously described association maintenance, data parsing and data packaging. These synchronization operations will be described by the following flowcharts.
(1) Cloud file system-new data text file
The synchronization process of the newly built data text file in the cloud file system is shown in fig. 8; the specific process is described as follows:
step YX 1: the cloud file system receives a file new command, judges whether the file new command comes from a user request,
if yes, a data text file is newly built according to the file new building instruction and stored in the cloud file system; (the new file has two situations of external copy and manual filling, which have already been explained and are not described herein again); jumping to step YX 2;
if not, directly creating a data text file according to the file creation instruction, storing the data text file in a cloud file system, and completing the creation of the data text file; (the file new here is triggered to the synchronization system);
step YX 2: the synchronization system monitors a newly-built data text file in the cloud file system, and the synchronization operation starts:
step YX 21: a control list system creates an empty data packet and associates the empty data packet with the newly-created data text file; (association procedure see association maintenance);
step YX 22: analyzing the newly-built data text file into a data packet, and sending the data packet to a form system; (see data parsing for parsing process);
step YX 3: the form system processes the data packet, and executes corresponding database operation according to the content contained in the data packet to obtain a database operation result; the database operation result is that the data packet is deleted, or the data packet is updated to the form system;
the specific implementation process is described as follows:
step YX 31: filling the created empty data packet based on the data packet to obtain an analyzed data packet;
step YX 32: reading the unique data format identification and the data format information in the analyzed data packet to obtain a corresponding form template; in particular, the amount of the solvent to be used,
judging whether the data packet contains the unique data format identifier (i.e. "format identifier" in fig. 6), if so, then judging whether a form template consistent with the data format of the data packet is stored in the form system,
if not, a new form template is created by using the unique identifier of the data format and the data format in the data packet; and jumps to step YX 33;
if yes, the query returns the form template (with the format identification), and the step YX33 is executed;
if not, generating a new unique data format identifier, and creating a form template by using the new unique data format identifier and the data format in the data packet; and jumps to step YX 33;
step YX 33: after the form template is obtained, judging whether the form template is matched with a data format in the data packet, if so, reading the unique data line identification and the data line information in the data packet, and performing data insertion or data updating in the form template; if not, deleting the data packet; and jumps to step YX 6;
when the form template matches the data format in the data package, specifically, performing:
determining whether the data packet contains a unique data line identifier (i.e., "data line identifier" in fig. 6), and if so, then determining whether there is a matching data line in the table system,
if not, inserting a new piece of data by using the unique identifier of the given data line and the data line information in the data packet; at this time, after updating a piece of data, the data packet is updated to the form system;
if yes, inquiring a data line (having a data line identifier) of the returned form, and updating a piece of data; at this time, the data packet is updated to the form system;
if not, generating a new data line unique identifier, and inserting a new piece of data by using the new data line unique identifier and the data line information in the data packet; at this time, after updating a piece of data, the data packet is updated to the form system;
step YX 4: after monitoring that the data packet is updated to the form system, the synchronization system packs the updated data packet into a data text file and sends the data text file to the cloud file system;
step YX 5: the cloud file system fills a newly-built data text file based on the received data text file, and at the moment, the newly-built data text file is an associated state file; completing the new creation of the data text file;
step YX 6: after monitoring that the data packet is deleted, the synchronization system feeds back data incompatibility error report to the cloud file system;
step YX 7: after the cloud file system receives the data incompatibility error report, the newly-built data text file is stored in the cloud file system as an isolated text; and finishing the new data text file.
As can be seen from fig. 8, in the cloud file system, during the process of "creating a new data text file", through the synchronization operation, the operations of "creating a new form template", "inserting a new piece of data", and "updating a piece of data" in the form system may be triggered in a linkage manner. Similarly, the "create new data text file" process may be a direct request from the user, or may be indirectly initiated by the synchronization system when other operations in the form system are performed. In order to avoid call circulation caused by indirect initiation, at the beginning of file creation, whether a current instruction comes from a user request is judged; if not, executing the corresponding file operation. This analysis indirectly evidences the importance of making the user request determination in the foregoing.
It should be emphasized that the newly created data text file must contain a data structure, and the data value may be empty or complete. If the data value is null, a form template with null data behavior is obtained synchronously.
To facilitate a better understanding of the solution in the present embodiment, the following description is made: in the cloud file system and the form system of fig. 8-14, the dark background blocks will perform the actions of "save to disk" or "implement data write to database"; white background squares may all be understood as memory operations. Furthermore, in the synchronization system of fig. 8-14, the dark background blocks perform operations consistent with those of fig. 3-5.
(2) Cloud File System-editing data text files
The synchronization process for editing a data text file in a cloud file system is shown in fig. 9; the specific process is described as follows:
step YB 1: the cloud file system receives a file editing instruction, judges whether the file editing instruction comes from a user request,
if so, editing the data text file for execution; jumping to the step YB 2;
if not, directly editing the data text file according to the file editing instruction, storing the data text file in a cloud file system, and finishing editing the data text file; (file editing here is triggered on the synchronization system);
step YB 2: when the synchronous system monitors the execution of the edited data text file, the synchronous operation starts:
judging whether the data text file to be edited is isolated,
if the file data is isolated, the cloud file system randomly edits the file data to obtain an edited data text file which is an isolated file and stores the edited data text file in the cloud file system; finishing editing the data text file;
if not, the synchronization system acquires a data packet related to the data text file from the form system, packages the data packet into the data text file and then sends the data text file to the cloud file system; (by acquiring the associated data packet, the data for executing file editing in the cloud file system can be ensured to be the latest data stored in the form system, so as to ensure the uniformity of the data processing of the cloud file system and the form system).
Step YB 3: the cloud file system generates a copy of a data text file to be edited based on the received data text file, limited edits data of the copy of the data text file, and stores the edited data text file in the cloud file system;
step YB 4: the synchronization system associates the original data packet with the edited data text file (in an associated state after association); analyzing the edited data text file into a data packet, and sending the data packet to a form system;
step YB 5: the form system refills the data line information of the associated data packet according to the received data packet, inquires the data line of the returned form, and updates a piece of data according to the unique identification of the existing data line and the data line information of the data packet; at this time, the data packet is updated to the form system;
step YB 6: after monitoring that the data packet is updated to the form system, the synchronization system feeds back the completion of the synchronization operation to the cloud file system;
step YB 7: and after the cloud file system receives the completion of the synchronous operation, the edited data text file is a related state file, and the editing of the data text file is completed.
Two points need to be specified in the flow of fig. 9:
1. editing of a data text file (under the non-isolated condition, editing under the isolated condition cannot be linked with a form system), namely a process of actually keeping an original data text file unchanged, generating a new data text file copy, performing data modification and storage in the new data text file copy, and then associating a data packet with the copy again. Such a process, after the "associate original package to new copy of data text file" process, actually produces an isolated file — the original "data text file" before editing. This file, in isolation, does not participate in the synchronization of the synchronization system, but can well leave a history of data changes (historical version of the file) useful in special situations. With respect to the historical version of the file, the following is described: (1) all data text files with the same structure identification and value identification form a historical version record of the same data packet; (2) only the data text file associated with the data packet in the current database is the latest one in all the historical version records; others are ordered into different versions according to the last modification time of the file.
2. The data text file data is edited in a limited mode, wherein limited editing means that a user can only modify data contents (namely data values) in a limited format during editing the data text file, namely, the editing operation does not allow the data structure to be changed and cannot change the structure identification and the data value identification. Because of such limited editing operations, when the form system updates the contents of the data form correspondingly, the form system does not need to judge information such as format identification, format matching condition and the like, the data value identification is also present, and all changes are concentrated on updating one piece of data for the form system by using the data value information in the data packet.
In this embodiment, the limited constraint on editing of the data text file is also a special function of the cloud file system for this type of file — if the data text file is separated from the cloud file system, the data text file may be modified arbitrarily outside, and then the data text file is stored back to the cloud file system, and then the concept of "file editing" is not performed, but the process of "file new creation" is performed again.
(3) Cloud File System-delete data text files
The synchronization process for deleting a data text file in the cloud file system is shown in fig. 10; the specific process is described as follows:
step YS 1: the cloud file system receives a file deleting instruction, judges whether the file deleting instruction is from a user request, and if so, deletes the data text file to execute;
if not, directly deleting the data text file from the cloud file system, and finishing deleting the data text file;
step YS 2: when the synchronous system monitors that the data text file is deleted, the synchronous operation starts:
judging whether the data text file to be deleted is isolated,
if the data is isolated, the synchronous operation is completed; skipping to step YS 4;
if not, the synchronous system controls the list system to obtain the data packet related to the data text file;
step YS 3: the form system inquires a data line of a returned form, and deletes a piece of data according to the existing data line identifier; the synchronous operation is completed;
step YS 4: the synchronization system feeds back the completion of the synchronization operation to the cloud file system;
step YS 5: and after the cloud file system receives the completion of the feedback synchronization operation of the cloud file system, deleting the data text file to be deleted, and completing the deletion of the data text file.
In a cloud file system, sometimes some special file operations may occur:
1. when a data text file is copied to a cloud file system through an external data source, a file renaming phenomenon may occur between a new file and an existing data text file. In this case, the forced copying may be performed by first deleting a file existing in the cloud file system, and then performing a process of "creating a new data text file" once again.
2. When a data text file is copied to a cloud file system through an external data source, a data duplication phenomenon may occur between a new file and an existing data text file: that is, the content of the new data text file has the same data structure and data value identification as the data recorded in the existing data text file. In this case, the execution is still performed according to the flow of "newly creating a data text file", but the execution effect is similar to that of "editing a data text file" — after the execution, the new file replaces the original data text file, and the association is established with the data packet of the identifier; the original data text file becomes an isolated file and is stored in a cloud file system as a historical version of a new data text file.
(4) Form System-inserting a New data
The synchronization process for inserting a new piece of data in the form system is shown in FIG. 11; the specific process is described as follows:
step BC 1: inserting a new piece of data in the form system; in particular, the amount of the solvent to be used,
step BC 11: acquiring a form template and a data format unique identifier (namely, a data format identifier in fig. 11) of a target form into which data is inserted;
step BC 12: newly creating a data empty line and a data line unique identifier (namely the data line identifier in fig. 11) under the corresponding form template;
step BC 13: filling data in the newly-built data empty row;
step BC 2: it is determined whether the instruction to insert new data is from a user request,
if so, recording the newly-built data as a data packet;
if not, storing the inserted new data, and finishing;
step BC 3: after the synchronous system monitors the data packet, the synchronous operation starts:
step BC 31: controlling a cloud file system to create an empty memory data text file;
step BC 32: associating the data packet to an empty memory data text file;
step BC 33: packaging the data packet into a data text file, and sending the data text file to a cloud file system;
step BC 4: the cloud file system fills the empty memory data text file based on the content of the data text file to complete the new creation of the data text file;
step BC 5: after monitoring that the new data text file is completed, the synchronization system feeds back the completion of the synchronization operation to the form system;
step BC 6: and after the form system receives the completion of the synchronous operation, storing the inserted new data to complete the operation.
Here, creating the table is implicit in inserting new data. This greatly simplifies the user experience and makes the process of creating the table more natural: if the data is the existing format data, finding the existing corresponding table to insert; if the data is in a new format, the data is inserted after the table is created, so that the data is smoother.
(5) Form System-updating a piece of data
The synchronization process for updating a piece of data in a spreadsheet system is shown in FIG. 12; the specific process is described as follows:
step BG 1: updating a piece of data in the form system; in particular, the amount of the solvent to be used,
step BG 11: acquiring a data line to be updated according to the data format unique mark and the data line unique mark (corresponding to the data mark in fig. 12);
step BG 12: updating the obtained data line according to the new data;
step BG 2: it is determined whether the instruction to update the data is from a user request,
if yes, recording the updated data as a data packet;
if not, storing the updated data, and finishing;
step BG 3: after the synchronous system monitors the data packet, the synchronous operation starts:
step BG 31: controlling a cloud file system to create an empty memory data text file;
step BG 32: associating the data packet to an empty memory data text file;
step BG 33: packaging the data packet into a data text file, and sending the data text file to a cloud file system;
step BG 4: the cloud file system fills the empty memory data text file based on the content of the data text file to complete the new creation of the data text file;
step BG 5: after monitoring that the new data text file is completed, the synchronization system feeds back the completion of the synchronization operation to the form system;
step BC 6: and after the form system receives the completion of the synchronous operation, the updated data is stored, and the completion is completed.
As shown in fig. 12, during the process of "updating a piece of data" in the form system, the operation of "creating a new data text file" in the cloud file system may be triggered in a linkage manner through a synchronization operation. It can also be seen that, after the instruction is successfully judged by the user's direct request, the form is linked in the cloud file system via the synchronization system after updating a piece of data, which is practically the same as the processing of "inserting a piece of new data" — that is, in the cloud file system, a data text file consistently associated with the inserted or updated data is actually newly created no matter whether the new data is inserted or the original data is updated. As can be seen with reference to fig. 9 with respect to the process of editing a data text file in a cloud file system, this is consistent with the manner in which the process herein is processed.
(6) Form System-deleting a piece of data
The synchronization process for deleting a piece of data in a spreadsheet system is shown in FIG. 13; the specific process is described as follows:
step BS 1: according to the data format unique mark and the data line unique mark (corresponding to the data mark in fig. 13), acquiring a data line to be deleted, and deleting the data line from the form system;
step BS 2: it is determined whether the instruction to delete data is from a user request,
if so, recording the acquired data as a data packet;
if not, deleting the data, and finishing;
step BS 3: after the synchronous system monitors the data packet, the synchronous operation starts:
it is determined whether the data packet is isolated,
if the data is isolated, the synchronous operation is completed; jumping to step BS 5;
if not, the synchronization system controls the cloud file system to acquire and delete the data text file associated with the data packet; the synchronous operation is completed;
step BS 4: the synchronous system feeds back the completion of the synchronous operation to the form system;
step BS 5; and after the form system receives the completion of the synchronous operation, deleting the data to complete the synchronous operation.
Fig. 13 describes a process of "delete a piece of data" started by the form system, if the operation user directly requests to start, the operation user acquires the data text file associated with the data packet to be deleted via the synchronization system, executes an operation of "delete the data text file" in the cloud file system, and then completes the actual deletion of the corresponding data in the form system.
(7) Commonality of cloud file system and form system synchronous operation
The synchronization operations described above are from the cloud file system (meaning that the dual-mode data is used by way of file operations) and from the form system (meaning that the dual-mode data is used by way of database operations). Due to the existence of a synchronous system, the automatic synchronous process of another mode can be triggered by operating data in any mode. The common mode of operation is shown in figure 14.
When the synchronization operation of the synchronization system is triggered, the synchronization operation may be successful or may fail. Regardless of success or failure, after the synchronization operation is completed, the operation returns to the operation in the system that starts the synchronization system, and there are two possibilities:
if the synchronization operation fails, the own operation should also abort execution.
Even if the synchronization operation fails (of course, the synchronization operation succeeds better), the self-operation needs to be completed.
Specifically, it states that: for the editing operation of data, under the condition that the data is stored in a text file mode, an original data text file is not directly modified all the time, but a new file copy is created to record the latest modified data, the latest modified data is kept consistent with the data stored in a database mode, and the latest modified data is called incremental file storage, namely the historical version data stored in the mode is used as a historical tracing basis of a certain piece of data in a conventional database system. As shown in fig. 15, the form system where the data a is located only records the latest version of the data, and the database itself cannot trace back the multiple history versions of one piece of data; however, historical version tracing can be achieved indirectly through the function of the text file of the associated data A; that is, the text files stored in the data a are stored in the same cloud text system, have the same file characteristics, and can be used for history retrieval in terms of modification time, modification persons and the like.
Those skilled in the art will appreciate that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program, which is stored in a computer readable storage medium, to instruct related hardware. The computer readable storage medium is a magnetic disk, an optical disk, a read-only memory or a random access memory.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention.

Claims (10)

1. A method for dual-mode storage and synchronization of data, comprising:
when one of the cloud file system and the database-based form system receives a data manipulation instruction,
the data operation in the data operation instruction is performed,
and judging whether the data operation is triggered by a user request, if so, triggering a synchronization system to execute the synchronization operation: synchronously triggering the other one of the cloud file system and the form system to execute the data operation synchronized with the data operation;
the form system is used for storing data in a database mode; the cloud file system is used for storing data in a file mode; the synchronization system is used for realizing synchronization between the file mode and the data stored in the database mode.
2. The dual-mode data storage and synchronization method of claim 1, wherein in the cloud file system, a piece of data is stored as an independent data text file, and the data text file comprises a data structure, a data structure unique identifier, a data value matched with the data structure, and a data value unique identifier; wherein the content of the first and second substances,
a data structure for textually describing key fields in the data;
the data structure unique identification is used for uniquely identifying the data structure;
the data value is used for describing the value of the key field in the data in a text form;
and the data value unique identifier is used for uniquely identifying the data value.
3. The dual-mode storage and synchronization method of data as claimed in claim 2, wherein the form template in the form system is composed of a data format and a plurality of data lines; one piece of data in the form template only corresponds to one data packet, and the data packet comprises a data format, a data format unique identifier, a data line matched with the data format and a data line unique identifier; wherein the content of the first and second substances,
a data format for describing key fields in the data in tabular form;
the data format unique identification is used for uniquely identifying the data format;
the data row is used for describing the value of the key field in the data in a tabular form;
and the data line unique identifier is used for uniquely identifying the data line.
4. The dual-mode storage and synchronization method of data according to claim 3, wherein when the data operation command is a file new command, the following steps are executed:
step YX 1: the cloud file system receives a file new command, judges whether the file new command comes from a user request,
if yes, a data text file is newly built according to the file new building instruction and stored in the cloud file system; jumping to step YX 2;
if not, directly creating a data text file according to the file creation instruction, storing the data text file in a cloud file system, and completing the creation of the data text file;
step YX 2: the synchronization system monitors a newly-built data text file in the cloud file system, and the synchronization operation starts:
step YX 21: a control list system creates an empty data packet and associates the empty data packet with the newly-created data text file;
step YX 22: analyzing the newly-built data text file into a data packet, and sending the data packet to a form system;
step YX 3: the form system processes the data packet, and executes corresponding database operation according to the content contained in the data packet to obtain a database operation result; the database operation result is that the data packet is deleted, or the data packet is updated to the form system;
step YX 4: after monitoring that the data packet is updated to the form system, the synchronization system packs the updated data packet into a data text file and sends the data text file to the cloud file system;
step YX 5: the cloud file system fills a newly-built data text file based on the received data text file, and at the moment, the newly-built data text file is an associated state file; completing the new creation of the data text file;
step YX 6: after monitoring that the data packet is deleted, the synchronization system feeds back data incompatibility error report to the cloud file system;
step YX 7: after the cloud file system receives the data incompatibility error report, the newly-built data text file is stored in the cloud file system as an isolated text; and finishing the new data text file.
5. The dual-mode storage and synchronization method of data according to claim 3, wherein when the data operation instruction is a file editing instruction, performing:
step YB 1: the cloud file system receives a file editing instruction, judges whether the file editing instruction comes from a user request,
if so, editing the data text file for execution; jumping to the step YB 2;
if not, directly editing the data text file according to the file editing instruction, storing the data text file in a cloud file system, and finishing editing the data text file;
step YB 2: when the synchronous system monitors the execution of the edited data text file, the synchronous operation starts:
judging whether the data text file to be edited is isolated,
if the file data is isolated, the cloud file system randomly edits the file data to obtain an edited data text file which is an isolated file and stores the edited data text file in the cloud file system; finishing editing the data text file;
if not, the synchronization system acquires a data packet related to the data text file from the form system, packages the data packet into the data text file and then sends the data text file to the cloud file system;
step YB 3: the cloud file system generates a copy of a data text file to be edited based on the received data text file, limited edits data of the copy of the data text file, and stores the edited data text file in the cloud file system;
step YB 4: the synchronization system associates the original data packet with the edited data text file; analyzing the edited data text file into a data packet, and sending the data packet to a form system;
step YB 5: the form system refills the data line information of the associated data packet according to the received data packet and updates the data packet to the form system;
step YB 6: after monitoring that the data packet is updated to the form system, the synchronization system feeds back the completion of the synchronization operation to the cloud file system;
step YB 7: and after the cloud file system receives the completion of the synchronous operation, the edited data text file is a related state file, and the editing of the data text file is completed.
6. A dual-mode storage and synchronization method for data as claimed in claim 3, wherein when the data operation command is to insert a new piece of data or update a piece of data, the following steps are performed:
inserting a new piece of data or updating a piece of data in the form system;
determining whether the data operation instruction is from a user request,
if so, recording the inserted new data or updated data as a data packet;
if not, storing the inserted new data or updated data, and finishing;
after the synchronous system monitors the data packet, the synchronous operation starts:
controlling a cloud file system to create an empty memory data text file;
associating the data packet to an empty memory data text file;
packaging the data packet into a data text file, and sending the data text file to a cloud file system;
the cloud file system fills the empty memory data text file based on the content of the data text file to complete the new creation of the data text file;
after monitoring that the new data text file is completed, the synchronization system feeds back the completion of the synchronization operation to the form system;
and after the form system receives the completion of the synchronous operation, storing the inserted new data or updated data to complete the operation.
7. A dual mode method for storage and synchronization of data according to claims 4-6, wherein the synchronization system performs the synchronization operation by performing one or more of the following operations:
association maintenance, which includes three meta-operations: judging whether a data packet is isolated or not and whether a data text file is isolated or not, and associating a data packet with a data text file;
data analysis, namely synchronizing the data in the data text file into a data packet;
and (5) data packaging, namely synchronizing the data in the data package into a data text file.
8. The dual-mode method for storage and synchronization of data according to claim 7, wherein, in said association maintenance,
associating a data packet to a data text file: associating the data packet to a corresponding data text file by setting a pointer relationship which is initiated from the data packet and points to the data text file;
judging whether the data packet is isolated: if the data packet is associated with a data text file, the data packet is not isolated; otherwise, the data packet is isolated;
judging whether the data text file is isolated: if a data packet is associated with the data text file, the data text file is not isolated; otherwise, the data text file is isolated.
9. The dual-mode data storage and synchronization method of claim 7, wherein the data parsing process comprises:
step J1: reading the unique identifier of the data structure in the data text file, judging whether the unique identifier of the data structure exists, if so, recording the unique identifier of the data structure, and then jumping to J2; if not, directly jumping to J2;
step J2: reading data structure information in the data text file, and converting the data structure information into a data format;
step J3: reading the unique data value identifier in the data text file, judging whether the unique data value identifier is contained, if so, recording the unique data value identifier, and then jumping to J4; if not, directly jumping to J4;
step J4: reading a data value in the data text file, and converting the data value into a data line;
step J5: and taking the data structure unique identifier as a data format unique identifier and the data value unique identifier as a data line unique identifier, and organizing the data format unique identifier, the data format, the data line unique identifier and the data line according to the form of the data packet to obtain the analyzed data packet.
10. The dual-mode data storage and synchronization method of claim 7, wherein the data packing process comprises:
reading the data packet, and sequentially extracting and recording the unique data format identifier, the data format information, the unique data row identifier and the data row;
and taking the data format unique identifier as a data structure unique identifier and the data line unique identifier as a data value unique identifier, converting the data format into a data structure and converting the data line into a data value, and organizing the data structure unique identifier, the data structure, the data value unique identifier and the data value according to the form of the data text file to obtain the packed data text file.
CN202111436401.8A 2021-11-29 2021-11-29 Dual-mode storage and synchronization method of data Active CN114048178B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111436401.8A CN114048178B (en) 2021-11-29 2021-11-29 Dual-mode storage and synchronization method of data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111436401.8A CN114048178B (en) 2021-11-29 2021-11-29 Dual-mode storage and synchronization method of data

Publications (2)

Publication Number Publication Date
CN114048178A true CN114048178A (en) 2022-02-15
CN114048178B CN114048178B (en) 2022-07-26

Family

ID=80211678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111436401.8A Active CN114048178B (en) 2021-11-29 2021-11-29 Dual-mode storage and synchronization method of data

Country Status (1)

Country Link
CN (1) CN114048178B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120066180A1 (en) * 2010-09-10 2012-03-15 Microsoft Corporation File-backed in-memory structured storage for service synchronization
CN105306556A (en) * 2015-09-30 2016-02-03 深圳市先河系统技术有限公司 File management method, server and network auxiliary storage equipment
CN108170768A (en) * 2017-12-25 2018-06-15 腾讯科技(深圳)有限公司 database synchronization method, device and readable medium
CN111309313A (en) * 2019-10-17 2020-06-19 天津大学 Method for quickly generating HTML (hypertext markup language) and storing form data
CN111400326A (en) * 2020-02-28 2020-07-10 深圳市赛为智能股份有限公司 Smart city data management system and method thereof
CN111813742A (en) * 2020-06-29 2020-10-23 北京百度网讯科技有限公司 File management method, device, equipment and medium
CN112231402A (en) * 2020-10-14 2021-01-15 广东亿迅科技有限公司 Real-time synchronization method, device, equipment and storage medium for heterogeneous data
CN112286941A (en) * 2020-12-23 2021-01-29 武汉物易云通网络科技有限公司 Big data synchronization method and device based on Binlog + HBase + Hive
CN112380178A (en) * 2020-11-25 2021-02-19 北京明略软件系统有限公司 File storage and management method and system
CN113157808A (en) * 2021-04-27 2021-07-23 北京计算机技术及应用研究所 Configuration file synchronization system and method based on memory and lightweight database
US20210365329A1 (en) * 2020-05-19 2021-11-25 EMC IP Holding Company LLC Efficient synchronization of cloud enabled file system database during snapshot restore operation
CN113704213A (en) * 2021-08-20 2021-11-26 辽宁振兴银行股份有限公司 Sqlldr2 and ogg data synchronization-based implementation method

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120066180A1 (en) * 2010-09-10 2012-03-15 Microsoft Corporation File-backed in-memory structured storage for service synchronization
CN105306556A (en) * 2015-09-30 2016-02-03 深圳市先河系统技术有限公司 File management method, server and network auxiliary storage equipment
CN108170768A (en) * 2017-12-25 2018-06-15 腾讯科技(深圳)有限公司 database synchronization method, device and readable medium
CN111309313A (en) * 2019-10-17 2020-06-19 天津大学 Method for quickly generating HTML (hypertext markup language) and storing form data
CN111400326A (en) * 2020-02-28 2020-07-10 深圳市赛为智能股份有限公司 Smart city data management system and method thereof
US20210365329A1 (en) * 2020-05-19 2021-11-25 EMC IP Holding Company LLC Efficient synchronization of cloud enabled file system database during snapshot restore operation
CN111813742A (en) * 2020-06-29 2020-10-23 北京百度网讯科技有限公司 File management method, device, equipment and medium
CN112231402A (en) * 2020-10-14 2021-01-15 广东亿迅科技有限公司 Real-time synchronization method, device, equipment and storage medium for heterogeneous data
CN112380178A (en) * 2020-11-25 2021-02-19 北京明略软件系统有限公司 File storage and management method and system
CN112286941A (en) * 2020-12-23 2021-01-29 武汉物易云通网络科技有限公司 Big data synchronization method and device based on Binlog + HBase + Hive
CN113157808A (en) * 2021-04-27 2021-07-23 北京计算机技术及应用研究所 Configuration file synchronization system and method based on memory and lightweight database
CN113704213A (en) * 2021-08-20 2021-11-26 辽宁振兴银行股份有限公司 Sqlldr2 and ogg data synchronization-based implementation method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
USELPA: "Keeping my database and file system in sync", 《HTTPS://STACKOVERFLOW.COM/QUESTIONS/15440172/KEEPING-MY-DATABASE-AND-FILE-SYSTEM-IN-SYNC》 *
方诗伟: "基于HBase的医疗卫生数据中心构建与异构数据库同步研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
明亚晶: "不同数据库间实现数据同步的解决方案", 《数字石油和化工》 *

Also Published As

Publication number Publication date
CN114048178B (en) 2022-07-26

Similar Documents

Publication Publication Date Title
US7546533B2 (en) Storage and utilization of slide presentation slides
US7590939B2 (en) Storage and utilization of slide presentation slides
AU2005225130B2 (en) Management and use of data in a computer-generated document
US8112396B2 (en) Backup and recovery of integrated linked databases
US7107527B2 (en) Method and system for management of structured document and medium having processing program therefor
CN104657382B (en) Method and apparatus for MySQL principal and subordinate's server data consistency detections
CN100498763C (en) Method for processing data using application program
US7523141B2 (en) Synchronization operations involving entity identifiers
US5687367A (en) Facility for the storage and management of connection (connection server)
TWI388994B (en) System and method for managing data using static lists, and computer accessible medium having a computer executable component for implementing the same
US7720885B2 (en) Generating a word-processing document from database content
CN110287192B (en) Search application data processing method and device, computer equipment and storage medium
US20020091716A1 (en) Replication system and program
CN109726192A (en) The system and method for master data model version and field separate management function is realized based on big data environment
JP2001306372A (en) Method for managing document and storage medium storing program for executing the method
CN114153659B (en) Dual-mode data storage and synchronization system
CN114048178B (en) Dual-mode storage and synchronization method of data
CN103180848B (en) A system and a method for copying data
Leone et al. Concept and architecture of an pervasive document editing and managing system
CN106354704B (en) Document project editing system based on language blocks
Curtis Efficient control of assets in a modern production pipeline
Jones et al. Islandora for archival access and discovery
Hsieh et al. A method for web application data migration based on RESTful API: A case study of ezScrum
Tawil et al. The Implementation of a Filestream based English Language Learning System
Pruckler et al. Achieving physical data independence in hypermedia databases

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