Data backup recovery method and device, electronic equipment and storage medium

By performing real-time data monitoring and compression processing of OA office systems in the information creation environment, the compatibility and performance optimization problems of OA office systems in the information creation environment are solved in the information creation environment, and efficient data protection and recovery are achieved.

CN119668945AInactive Publication Date: 2025-03-21CAPITAL INFORMATION TECH DEV CO LTD

Patent Information

Application Number
CN202510186463.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-03-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the information innovation environment, OA office systems face compatibility issues and performance optimization requirements in data backup and recovery, making it difficult to achieve efficient real-time data protection, resulting in an increase in the possibility of data loss.

Method used

By monitoring the database and file system in real time, capturing data modification events, obtaining incremental updates of part or overall compressed files based on data types (database tables, document files or picture files), and performing compression and version identification management to achieve efficient data backup and recovery.

Benefits of technology

Improve the efficiency of data backup and recovery, reduce the storage space required for data backup, and ensure the security and integrity of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668945A_ABST
    Figure CN119668945A_ABST
Patent Text Reader

Abstract

The invention provides a data backup recovery method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the real-time data monitoring of a database and a file system, and capturing a data modification event; if the modified data is a database table or a document file, acquiring an incremental updating part of the modified data relative to the previous backup moment, performing compression based on the incremental updating part to obtain an updating compressed file at the current backup moment, creating a version identifier of the updating compressed file and a mapping relation between the version identifier and the modified data, and then backing up the updating compressed file; if the file is a picture file, compressing the modified data to obtain an overall compressed file at the current backup moment, creating a version identifier of the overall compressed file and a mapping relation between the version identifier and the modified data, and then backing up the overall compressed file; based on the version identifier corresponding to the modified data selected by the user, the updated compressed file or the overall compressed file corresponding to the version identifier is obtained, data recovery is performed accordingly, and data security and integrity are maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data backup technology, and in particular to a data backup and recovery method, device, electronic equipment and storage medium. Background Art

[0002] In the context of the rapid development of the information and innovation industry, OA office systems have gradually migrated to domestic basic software and hardware environments. However, OA office systems in the information and innovation environment face new challenges in data backup and recovery, such as compatibility issues and performance optimization requirements. Therefore, in order to meet the urgent needs of OA office systems for real-time data protection in the information and innovation environment, an efficient real-time backup and recovery mechanism is needed to ensure that the generated database data and files can be captured and saved in a timely manner, minimizing the possibility of data loss. Summary of the invention

[0003] The present invention provides a data backup and recovery method, device, electronic equipment and storage medium, which are used to realize efficient data backup and recovery and protect data security.

[0004] The present invention provides a data backup and recovery method, comprising: Real-time data monitoring of databases and file systems to capture data modification events; Based on the data modification event, determine the modified data and its data type; the data type includes database table, document file and picture file; If the data type of the modified data is a database table or a document file, then obtaining an incremental update portion of the modified data relative to a previous backup time, compressing the incremental update portion to obtain an updated compressed file at the current backup time, creating a version identifier of the updated compressed file and a mapping relationship between the updated compressed file and the modified data, and then backing up the updated compressed file; If the data type of the modified data is a picture file, compress the modified data to obtain an overall compressed file at the current backup time, create a version identifier of the overall compressed file and a mapping relationship between the overall compressed file and the modified data, and then back up the overall compressed file; Based on the version identifier corresponding to the modified data selected by the user, an updated compressed file or an entire compressed file corresponding to the version identifier is obtained, and data recovery is performed based on the updated compressed file or the entire compressed file.

[0005] According to a data backup and recovery method provided by the present invention, if the data type of the modified data is a picture file, the modified data is compressed to obtain an overall compressed file at the current backup time, including: Compressing the modified data based on an image compression model to obtain an overall compressed file at the current backup time; Wherein, the image compression model includes an encoder, a quantization module, an arithmetic coding module, an arithmetic decoding module and a decoder; The encoder comprises a first downsampling unit, a second downsampling unit, a first image window attention module, a third downsampling unit, a fourth downsampling unit and a second image window attention module connected in sequence; The decoder comprises a third image window attention module, a first upsampling unit, a second upsampling unit, a fourth image window attention module, a third upsampling unit and a fourth upsampling unit connected in sequence; The first image window attention module, the second image window attention module, the third image window attention module and the fourth image window attention module are used to divide the input feature map into multiple windows of the same size, use the feature points in each window as nodes to construct a feature point structure graph, perform attention transformation on each node of each feature point structure graph to obtain the attention feature value of each node, and construct the output feature map based on the attention feature value of each node of each feature point structure graph.

[0006] According to a data backup and recovery method provided by the present invention, the step of using the feature points in each window as nodes to construct a feature point structure graph includes: For the feature points in any window, construct the nodes corresponding to each feature point; Based on the positional relationship between each feature point in any window, edges and edge weights between nodes corresponding to each feature point are generated; the edge weights are determined based on the similarity between the feature points corresponding to the nodes connected by the corresponding edges.

[0007] According to a data backup and recovery method provided by the present invention, the attention transformation is performed on each node of each feature point structure graph to obtain the attention feature value of each node, including: For any node of any feature point structure graph, determine a neighborhood corresponding to the any node; Obtaining the attention weight between each node in the neighborhood corresponding to the any node and the any node; The attention feature value of any node is determined based on the following formula:

[0008] Among them, x(i) is the eigenvalue of the feature point corresponding to any node, x upd (i) is the attention feature value of any node, W z and W g is the learnable attention matrix, N(i) is the neighborhood corresponding to any node, αi,j is the attention weight between node j and any of the above nodes, and x(j) is the feature value of the feature point corresponding to node j.

[0009] According to a data backup and recovery method provided by the present invention, the second down-sampling unit, the fourth down-sampling unit and the second up-sampling unit include a convolution layer and an affine module; The affine module includes two affine transformation submodules and a fusion submodule; the affine transformation submodule is composed of two 1×1 convolutional layers; The affine module is used to perform convolution processing on the input feature map based on the two affine transformation sub-modules respectively, and to fuse the feature maps output by the two affine transformation sub-modules and the input feature map based on the fusion sub-module.

[0010] According to a data backup and recovery method provided by the present invention, if the data type of the modified data is a database table, an incremental update part of the modified data relative to the previous backup time is obtained, and an updated compressed file at the current backup time is obtained based on the incremental update part. The method includes: Obtaining row data of each database table in the modified data, dividing each row of data into blocks according to the fields of the corresponding database table, and obtaining block data corresponding to each row of data; Determine a comparison result between the block data corresponding to each row of data in each database table in the modified data and the block data corresponding to the corresponding row of data in the corresponding database table at the previous backup time, and obtain the changed block data in the modified data; the changed block data constitutes the incremental update part; Each of the changed block data is compressed to obtain an updated compressed file at the current backup time.

[0011] According to a data backup and recovery method provided by the present invention, if the data type of the modified data is a document file, an incremental update part of the modified data relative to the previous backup time is obtained, and an updated compressed file at the current backup time is obtained based on the incremental update part. The method includes: Acquire the content block of the modified data based on a document parsing tool; Determine the comparison result between each content block in the modified data and the content block of the corresponding document file at the previous backup time, and obtain the changed content blocks in the modified data; the changed content blocks constitute the incremental update part; Each of the changed content blocks is compressed to obtain an updated compressed file at the current backup time.

[0012] The present invention also provides a data backup and recovery device, comprising: The modification event monitoring unit is used to monitor the database and file system in real time and capture data modification events; An event analysis unit, used to determine the modified data and its data type based on the data modification event; the data type includes a database table, a document file, and a picture file; A first data compression unit is used for obtaining, if the data type of the modified data is a database table or a document file, an incremental update part of the modified data relative to a previous backup time, compressing the incremental update part to obtain an updated compressed file at the current backup time, creating a version identifier of the updated compressed file and a mapping relationship between the updated compressed file and the modified data, and then backing up the updated compressed file; A second data compression unit is used for compressing the modified data to obtain an overall compressed file at the current backup time if the data type of the modified data is a picture file, creating a version identifier of the overall compressed file and a mapping relationship between the version identifier and the modified data, and then backing up the overall compressed file; The data recovery unit is used to obtain the updated compressed file or the whole compressed file corresponding to the version identifier corresponding to the modified data selected by the user, and perform data recovery based on the updated compressed file or the whole compressed file.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned data backup and recovery methods is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the data backup and recovery method described in any one of the above methods is implemented.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned data backup and recovery methods.

[0016] The data backup and recovery method, device, electronic device and storage medium provided by the present invention monitor the database and file system in real time, capture data modification events, and determine the modified data and its data type based on the data modification events; if the data type of the modified data is a database table or a document file, obtain the incremental update part of the modified data relative to the previous backup time, compress it based on the incremental update part to obtain the updated compressed file at the current backup time, create a version identifier of the updated compressed file and a mapping relationship between it and the modified data, and then back up the updated compressed file; if the data type of the modified data is a picture file, compress the modified data to obtain the overall compressed file at the current backup time, create a version identifier of the overall compressed file and a mapping relationship between it and the modified data, and then back up the overall compressed file; based on the version identifier corresponding to the modified data selected by the user, obtain the updated compressed file or the overall compressed file corresponding to the version identifier, and perform data recovery based on the updated compressed file or the overall compressed file, thereby improving the efficiency of data backup and recovery, reducing the storage space required for data backup, and maintaining data security and integrity. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is a flow chart of the data backup and recovery method provided by the present invention; Figure 2 It is a structural schematic diagram of the image compression model provided by the present invention; Figure 3 It is a structural schematic diagram of the data backup and recovery device provided by the present invention; Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] Figure 1 It is a flow chart of the data backup and recovery method provided by the present invention, such as Figure 1 As shown, the method includes: Step 110, real-time data monitoring of the database and file system to capture data modification events; Step 120, based on the data modification event, determine the modified data and its data type; the data type includes a database table, a document file, and a picture file; Step 130, if the data type of the modified data is a database table or a document file, then obtaining an incremental update portion of the modified data relative to the previous backup time, compressing the incremental update portion to obtain an updated compressed file at the current backup time, creating a version identifier of the updated compressed file and a mapping relationship between the updated compressed file and the modified data, and then backing up the updated compressed file; Step 140, if the data type of the modified data is a picture file, compress the modified data to obtain an overall compressed file at the current backup time, create a version identifier of the overall compressed file and a mapping relationship between the overall compressed file and the modified data, and then back up the overall compressed file; Step 150: based on the version identifier corresponding to the modified data selected by the user, obtain the updated compressed file or the whole compressed file corresponding to the version identifier, and perform data recovery based on the updated compressed file or the whole compressed file.

[0021] Here, for real-time data monitoring of the database system, the connection information of the database can be obtained and the parameters of the database connection pool can be configured, and listeners can be registered for the table operation types of the database table. Among them, the table operation types include insert, update and delete. Based on the database connection pool, listen to the database connection events. When the database connection event is captured, the table operation of the database table is listened to based on the listener corresponding to each table operation type, and a data modification event is constructed. Among them, the data modification event can include information such as the database table, data row, operation type and timestamp of the corresponding table operation change.

[0022] For real-time data monitoring of the file system, configuration information can be loaded when the system starts, including the file system directory to be monitored, the type of operation to be monitored (creation, modification, deletion, etc.), and the notification processing method, to prepare for the subsequent reception of notification events. According to the selected file system, use the API provided by it to register the monitoring request. Accurately specify the file system directory path to be monitored. This can be a single directory, multiple directories, or even the root directory of the entire file system. Define the type of operation to be monitored, such as file creation (creation), file modification (modification), file deletion (deletion), file renaming (renaming), etc. Determine that when the monitored operation occurs, the file system can pass the notification to the monitoring module by registering a callback function. That is, when a specific operation occurs, the file system automatically calls a pre-registered function to process the notification; or set a specific notification channel, such as a message queue, and the file system sends the notification information to the channel, and the monitoring module obtains the notification from the channel. Among them, information extraction extracts key information from the notification channel and packages it into data modification events, such as the type of operation (creation, modification, deletion), the file path involved, the time of the operation, etc. In addition, multi-threading or asynchronous processing is also used to improve the response speed and processing efficiency of monitoring.

[0023] Based on the data modification event, the modified data involved in the event and its data type can be determined, wherein the data type includes database tables, document files, and image files.

[0024] In the case where the data type of the modified data is a database table and a document file, the incremental update part of the modified data relative to the previous backup time can be obtained, and compression can be performed based on the incremental update part to obtain the updated compressed file at the current backup time to achieve incremental update, thereby reducing the compression time and the storage space of the backup file. Subsequently, a version identifier of the updated compressed file and a mapping relationship between it and the modified data can be created and then the updated compressed file can be backed up. When data recovery is required, based on the version identifier corresponding to the modified data selected by the user, the updated compressed file or the overall compressed file corresponding to the version identifier is obtained, and data recovery is performed based on the updated compressed file or the overall compressed file. When data recovery is required, based on the version identifier corresponding to the modified data selected by the user, the updated compressed file mapped by the version identifier can be obtained, and data recovery is performed based on the updated compressed file, that is, starting from the original data, version by version recovery is performed until the data corresponding to the selected version identifier is restored.

[0025] In some embodiments, if the data type of the modified data is a database table, in the process of obtaining the incremental update part of the modified data relative to the previous backup time and compressing it, the row data of each database table in the modified data can be obtained, and each row of data can be divided into blocks according to the fields of the corresponding database table to obtain the block data corresponding to each row of data. Then, the comparison result of the block data corresponding to each row of data of each database table in the modified data and the block data corresponding to the corresponding row of data of the corresponding database table at the previous backup time is determined, so as to obtain the changed block data in the modified data to form the incremental update part. Then, each changed block data is compressed to obtain the updated compressed file at the current backup time.

[0026] In other embodiments, if the data type of the modified data is a document file, in the process of obtaining the incremental update part of the modified data relative to the previous backup time and compressing it, the content blocks of the modified data can be obtained based on the document parsing tool. Then, the comparison result of each content block in the modified data and the content block of the corresponding document file at the previous backup time is determined, so as to obtain the changed content blocks in the modified data to constitute the incremental update part. Then, each changed content block is compressed to obtain the updated compressed file at the current backup time.

[0027] If the data type of the modified data is an image file, the modified data is directly compressed to obtain the overall compressed file at the current backup time, and then a version identifier of the overall compressed file and a mapping relationship between the overall compressed file and the modified data are created and backed up. When data recovery is required, the overall compressed file mapped by the version identifier can be obtained based on the version identifier corresponding to the modified data selected by the user, and data recovery can be performed based on the overall compressed file.

[0028] In some embodiments, considering that there are many pictures in the OA office system and that there are certain requirements for the quality of the pictures after decompression, it is necessary to improve the compression efficiency and compression quality of the pictures. In this regard, when the modified data is a picture, the image compression model can be used to compress the modified data to obtain the overall compressed file at the current backup time. Figure 2As shown, the image compression model includes an encoder, a quantization module, an arithmetic coding module, an arithmetic decoding module and a decoder. When the image compression model is used to compress the input image, the encoder extracts the image features of the input image to obtain the feature map of the input image. After the quantization module converts the floating-point numbers in the feature map output by the encoder into integers, the arithmetic coding module performs arithmetic coding on the quantized feature map output by the quantization module to obtain compressed data corresponding to the input image. Correspondingly, when the compressed data is decompressed using the image compression model, the arithmetic decoding module performs arithmetic decoding on the compressed data, and then decodes the arithmetic decoded data output by the arithmetic decoding module based on the decoder to obtain the decompressed image data.

[0029] The encoder includes a first downsampling unit, a second downsampling unit, a first image window attention module, a third downsampling unit, a fourth downsampling unit and a second image window attention module connected in sequence. Each downsampling unit includes at least one convolution layer. The decoder includes a third image window attention module, a first upsampling unit, a second upsampling unit, a fourth image window attention module, a third upsampling unit and a fourth upsampling unit connected in sequence. Each downsampling unit and each upsampling unit includes at least one convolution layer.

[0030] In order to improve the compression efficiency, considering that the self-attention mechanism used in the existing encoder (such as Transformer) will introduce more redundant features, which will lead to a decrease in compression rate for the image compression task, the embodiment of the present invention adopts a graph window attention module to replace the attention module in the existing encoder. Among them, the operation mechanism of the first graph window attention module, the second graph window attention module, the third graph window attention module and the fourth graph window attention module are the same, and the following will be described uniformly as the graph window attention module.

[0031] Specifically, the graph window attention module is used to divide the input feature graph into multiple windows of the same size, and use the feature points in each window as nodes to construct a feature point structure graph. Different windows correspond to different feature point structure graphs. In some embodiments, for the feature points in any window, nodes corresponding to each feature point can be constructed, and based on the positional relationship of each feature point in the window, edges and edge weights between nodes corresponding to each feature point are generated. Here, there are edges between adjacent nodes in the feature graph, and the edge weight of the edge between two nodes is determined based on the similarity between the feature points corresponding to the nodes connected by the corresponding edges (which can be calculated based on the distance between the feature values ​​of the corresponding feature points in the feature graph).

[0032] For any feature point structure graph, the graph window attention module will perform attention transformation on each node of the feature point structure graph, obtain the attention feature value of each node, and reconstruct the feature graph based on the attention feature value of each node of each feature point structure graph for output. That is, the feature value of each feature point in the reconstructed feature graph is the attention feature value of the node corresponding to the feature point.

[0033] In some embodiments, for any node of any feature point structure graph, the neighborhood corresponding to the node in the feature point structure graph can be determined. Here, in order to reduce feature redundancy, the construction of node neighborhood is a key link. Among them, for any node i in the feature point structure graph, the correlation between the node i and other nodes in the feature point structure graph can be calculated, and several nodes with the highest correlation can be selected to construct the neighborhood corresponding to the node. When calculating the correlation between the node i and any other node j in the feature point structure graph, it will be determined based on the number of hops between the node and the other node j in the feature point structure graph and the distance between the feature value of the feature point corresponding to the node and the feature value of the feature point corresponding to the other node j. The smaller the number of hops, the greater the correlation between the node i and any other node j in the feature point structure graph; the smaller the distance between the feature value of the feature point corresponding to the node and the feature value of the feature point corresponding to the other node j, the greater the correlation between the node i and any other node j in the feature point structure graph.

[0034] Here, weights can be set for the number of hops between the node and the other node j in the feature point structure graph and the distance between the feature value of the feature point corresponding to the node and the feature value of the feature point corresponding to the other node j, respectively, so as to perform weighted summation and inverse calculation of the number of hops between the node and the other node j in the feature point structure graph and the distance between the feature value of the feature point corresponding to the node and the feature value of the feature point corresponding to the other node j, and obtain the degree of association between the node and any other node j in the feature point structure graph. It should be noted that the smaller the size of the feature graph input to the attention module of the current graph window (the feature graphs input to the attention modules of different graph windows are different), the higher the level of image semantics in the feature graph, and therefore the smaller the weight corresponding to the number of hops.

[0035] Then, the attention weight between each node in the neighborhood corresponding to the node and the node is obtained. The attention weight α between the node j in the neighborhood and the node i can be calculated based on the following formula: i,j :

[0036] Among them, x(i) and x(j) are the eigenvalues ​​of the feature points corresponding to node i and node j respectively, W θ and is the learnable attention matrix.

[0037] Next, the attention feature value of the node i is determined based on the following formula:

[0038] Among them, x upd (i) is the attention feature value of node i, W z and W g is the learnable attention matrix, and N(i) is the neighborhood corresponding to the node i.

[0039] In other embodiments, the image semantics in the feature map can be enriched through the ability of the upsampling unit and the downsampling unit to extract image features, which helps to build a more accurate neighborhood, thereby further reducing feature redundancy. Specifically, an affine module can be added to the second downsampling unit, the fourth downsampling unit, and the second upsampling unit, that is, the second downsampling unit, the fourth downsampling unit, and the second upsampling unit include a convolution layer and an affine module. Among them, the affine module includes two affine transformation sub-modules and a fusion sub-module; the affine transformation sub-module is composed of two 1×1 convolution layers. Here, the affine module is used to perform convolution processing on the input feature map based on the two affine transformation sub-modules, respectively, and to fuse the feature maps output by the two affine transformation sub-modules and the input feature map based on the fusion sub-module. For example, the fusion sub-module can fuse the feature maps output by the two affine transformation sub-modules and the input feature map based on the following formula:

[0040] Among them, Y is the output of the fusion submodule, X is the input feature map, and X s and X b They are the feature maps output by the two affine transformation sub-modules respectively.

[0041] In summary, the method provided by the embodiment of the present invention performs real-time data monitoring on the database and file system to capture data modification events, and determines the modified data and its data type based on the data modification events; if the data type of the modified data is a database table or a document file, the incremental update part of the modified data relative to the previous backup time is obtained, and compression is performed based on the incremental update part to obtain an updated compressed file at the current backup time, and a version identifier of the updated compressed file and a mapping relationship between the updated compressed file and the modified data are created, and then the updated compressed file is backed up; if the data type of the modified data is a picture file, the modified data is compressed to obtain an overall compressed file at the current backup time, and a version identifier of the overall compressed file and a mapping relationship between the overall compressed file and the modified data are created, and then the overall compressed file is backed up; based on the version identifier corresponding to the modified data selected by the user, the updated compressed file or the overall compressed file corresponding to the version identifier is obtained, and data recovery is performed based on the updated compressed file or the overall compressed file, thereby improving the efficiency of data backup and recovery, reducing the storage space required for data backup, and maintaining data security and integrity.

[0042] The data backup and recovery device provided by the present invention is described below. The data backup and recovery device described below and the data backup and recovery method described above can be referenced to each other.

[0043] Based on any of the above embodiments, Figure 3 It is a structural diagram of the data backup and recovery device provided by the present invention. Figure 3 As shown, the device comprises: A modification event monitoring unit 310 is used to perform real-time data monitoring on the database and file system and capture data modification events; An event analysis unit 320, configured to determine the modified data and its data type based on the data modification event; the data type includes a database table, a document file, and a picture file; A first data compression unit 330 is configured to obtain an incremental update portion of the modified data relative to a previous backup time if the data type of the modified data is a database table or a document file, perform compression based on the incremental update portion to obtain an updated compressed file at the current backup time, create a version identifier of the updated compressed file and a mapping relationship between the updated compressed file and the modified data, and then back up the updated compressed file; The second data compression unit 340 is used for compressing the modified data to obtain the overall compressed file at the current backup time if the data type of the modified data is a picture file, creating a version identifier of the overall compressed file and a mapping relationship between the version identifier and the modified data, and then backing up the overall compressed file; The data recovery unit 350 is used to obtain the updated compressed file or the whole compressed file corresponding to the version identifier corresponding to the modified data selected by the user, and perform data recovery based on the updated compressed file or the whole compressed file.

[0044] The device provided by the embodiment of the present invention performs real-time data monitoring on a database and a file system to capture data modification events, and determines the modified data and its data type based on the data modification events; if the data type of the modified data is a database table or a document file, the incremental update part of the modified data relative to the previous backup time is obtained, and compression is performed based on the incremental update part to obtain an updated compressed file at the current backup time, and a version identifier of the updated compressed file and a mapping relationship between the updated compressed file and the modified data are created, and then the updated compressed file is backed up; if the data type of the modified data is a picture file, the modified data is compressed to obtain an overall compressed file at the current backup time, and a version identifier of the overall compressed file and a mapping relationship between the overall compressed file and the modified data are created, and then the overall compressed file is backed up; based on the version identifier corresponding to the modified data selected by the user, the updated compressed file or the overall compressed file corresponding to the version identifier is obtained, and data recovery is performed based on the updated compressed file or the overall compressed file, thereby improving the efficiency of data backup and recovery, reducing the storage space required for data backup, and maintaining data security and integrity.

[0045] Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4As shown, the electronic device may include: a processor (processor) 410, a memory (memory) 420, a communication interface (Communications Interface) 430 and a communication bus 440, wherein the processor 410, the memory 420, and the communication interface 430 communicate with each other through the communication bus 440. The processor 410 can call the logic instructions in the memory 420 to execute the data backup and recovery method, which includes: real-time data monitoring of the database and file system to capture data modification events; based on the data modification events, determining the modified data and its data type; the data type includes database tables, document files and image files; if the data type of the modified data is a database table or a document file, then obtaining the incremental update part of the modified data relative to the previous backup time, compressing based on the incremental update part to obtain the updated compressed file at the current backup time, creating a version identifier of the updated compressed file and a mapping relationship between the updated compressed file and the modified data, and then backing up the updated compressed file; if the data type of the modified data is a picture file, compressing the modified data to obtain the overall compressed file at the current backup time, creating a version identifier of the overall compressed file and a mapping relationship between the overall compressed file and the modified data, and then backing up the overall compressed file; based on the version identifier corresponding to the modified data selected by the user, obtaining the updated compressed file or the overall compressed file corresponding to the version identifier, and performing data recovery based on the updated compressed file or the overall compressed file.

[0046] In addition, the logic instructions in the above-mentioned memory 420 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0047] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the data backup and recovery methods provided by the above methods, and the method includes: real-time data monitoring of a database and a file system to capture data modification events; based on the data modification events, determining the modified data and its data type; the data type includes a database table, a document file, and a picture file; if the data type of the modified data is a database table or a document file, obtaining the incremental update portion of the modified data relative to the previous backup time. , compress based on the incremental update part to obtain the updated compressed file at the current backup time, create a version identifier of the updated compressed file and a mapping relationship between it and the modified data, and then back up the updated compressed file; if the data type of the modified data is a picture file, compress the modified data to obtain the overall compressed file at the current backup time, create a version identifier of the overall compressed file and a mapping relationship between it and the modified data, and then back up the overall compressed file; based on the version identifier corresponding to the modified data selected by the user, obtain the updated compressed file or the overall compressed file corresponding to the version identifier, and perform data recovery based on the updated compressed file or the overall compressed file.

[0048] On the other hand, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to execute the above-mentioned data backup and recovery methods, the method comprising: real-time data monitoring of a database and a file system, capturing data modification events; based on the data modification events, determining the modified data and its data type; the data type includes a database table, a document file and a picture file; if the data type of the modified data is a database table or a document file, then obtaining the incremental update part of the modified data relative to the previous backup time, compressing based on the incremental update part, obtaining an updated compressed file at the current backup time, creating a version identifier of the updated compressed file and a mapping relationship between the updated compressed file and the modified data, and then backing up the updated compressed file; if the data type of the modified data is a picture file, compressing the modified data to obtain an overall compressed file at the current backup time, creating a version identifier of the overall compressed file and a mapping relationship between the overall compressed file and the modified data, and then backing up the overall compressed file; based on the version identifier corresponding to the modified data selected by the user, obtaining the updated compressed file or the overall compressed file corresponding to the version identifier, and performing data recovery based on the updated compressed file or the overall compressed file.

[0049] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0050] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0051] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data backup and recovery method, characterized in that: include: Real-time data monitoring of databases and file systems to capture data modification events; Based on the data modification event, determine the modified data and its data type; the data type includes database table, document file and picture file; If the data type of the modified data is a database table or a document file, then obtaining an incremental update portion of the modified data relative to a previous backup time, compressing the incremental update portion to obtain an updated compressed file at the current backup time, creating a version identifier of the updated compressed file and a mapping relationship between the updated compressed file and the modified data, and then backing up the updated compressed file; If the data type of the modified data is a picture file, compress the modified data to obtain an overall compressed file at the current backup time, create a version identifier of the overall compressed file and a mapping relationship between the overall compressed file and the modified data, and then back up the overall compressed file; Based on the version identifier corresponding to the modified data selected by the user, an updated compressed file or an entire compressed file corresponding to the version identifier is obtained, and data recovery is performed based on the updated compressed file or the entire compressed file.

2. The data backup and recovery method according to claim 1, characterized in that: If the data type of the modified data is a picture file, the modified data is compressed to obtain an overall compressed file at the current backup time, including: Compressing the modified data based on an image compression model to obtain an overall compressed file at the current backup time; Wherein, the image compression model includes an encoder, a quantization module, an arithmetic coding module, an arithmetic decoding module and a decoder; The encoder comprises a first downsampling unit, a second downsampling unit, a first image window attention module, a third downsampling unit, a fourth downsampling unit and a second image window attention module connected in sequence; The decoder comprises a third image window attention module, a first upsampling unit, a second upsampling unit, a fourth image window attention module, a third upsampling unit and a fourth upsampling unit connected in sequence; The first image window attention module, the second image window attention module, the third image window attention module and the fourth image window attention module are used to divide the input feature map into multiple windows of the same size, use the feature points in each window as nodes to construct a feature point structure graph, perform attention transformation on each node of each feature point structure graph to obtain the attention feature value of each node, and construct the output feature map based on the attention feature value of each node of each feature point structure graph.

3. The data backup and recovery method according to claim 2, characterized in that: The step of using the feature points in each window as nodes to construct a feature point structure graph includes: For the feature points in any window, construct the nodes corresponding to each feature point; Based on the positional relationship between each feature point in any window, edges and edge weights between nodes corresponding to each feature point are generated; the edge weights are determined based on the similarity between the feature points corresponding to the nodes connected by the corresponding edges.

4. The data backup and recovery method according to claim 2, characterized in that: The attention transformation is performed on each node of each feature point structure graph to obtain the attention feature value of each node, including: For any node of any feature point structure graph, determine a neighborhood corresponding to the any node; Obtaining the attention weight between each node in the neighborhood corresponding to the any node and the any node; The attention feature value of any node is determined based on the following formula: Among them, x(i) is the eigenvalue of the feature point corresponding to any node, x upd (i) is the attention feature value of any node, W z and W g is the learnable attention matrix, N(i) is the neighborhood corresponding to any node, α i,j is the attention weight between node j and any of the above nodes, and x(j) is the feature value of the feature point corresponding to node j.

5. The data backup and recovery method according to claim 2, characterized in that: The second down-sampling unit, the fourth down-sampling unit and the second up-sampling unit include a convolution layer and an affine module; The affine module includes two affine transformation submodules and a fusion submodule; the affine transformation submodule is composed of two 1×1 convolutional layers; The affine module is used to perform convolution processing on the input feature map based on the two affine transformation sub-modules respectively, and to fuse the feature maps output by the two affine transformation sub-modules and the input feature map based on the fusion sub-module.

6. The data backup and recovery method according to any one of claims 1 to 5, characterized in that: If the data type of the modified data is a database table, obtaining an incremental update portion of the modified data relative to a previous backup time, and compressing the incremental update portion to obtain an updated compressed file at the current backup time, including: Obtaining row data of each database table in the modified data, dividing each row of data into blocks according to the fields of the corresponding database table, and obtaining block data corresponding to each row of data; Determine a comparison result between the block data corresponding to each row of data in each database table in the modified data and the block data corresponding to the corresponding row of data in the corresponding database table at the previous backup time, and obtain the changed block data in the modified data; the changed block data constitutes the incremental update part; Each of the changed block data is compressed to obtain an updated compressed file at the current backup time.

7. The data backup and recovery method according to any one of claims 1 to 5, characterized in that: If the data type of the modified data is a document file, obtaining an incremental update portion of the modified data relative to a previous backup time, and compressing the incremental update portion to obtain an updated compressed file at the current backup time, including: Acquire the content block of the modified data based on a document parsing tool; Determine the comparison result between each content block in the modified data and the content block of the corresponding document file at the previous backup time, and obtain the changed content blocks in the modified data; the changed content blocks constitute the incremental update part; Each of the changed content blocks is compressed to obtain an updated compressed file at the current backup time.

8. A data backup and recovery device, characterized in that: include: The modification event monitoring unit is used to monitor the database and file system in real time and capture data modification events; An event analysis unit, used to determine the modified data and its data type based on the data modification event; the data type includes a database table, a document file, and a picture file; A first data compression unit is used for obtaining, if the data type of the modified data is a database table or a document file, an incremental update part of the modified data relative to a previous backup time, compressing the incremental update part to obtain an updated compressed file at the current backup time, creating a version identifier of the updated compressed file and a mapping relationship between the updated compressed file and the modified data, and then backing up the updated compressed file; A second data compression unit is used for compressing the modified data to obtain an overall compressed file at the current backup time if the data type of the modified data is a picture file, creating a version identifier of the overall compressed file and a mapping relationship between the version identifier and the modified data, and then backing up the overall compressed file; The data recovery unit is used to obtain the updated compressed file or the whole compressed file corresponding to the version identifier corresponding to the modified data selected by the user, and perform data recovery based on the updated compressed file or the whole compressed file.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the data backup and recovery method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data backup and recovery method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Dynamic block database incremental backup method

    CN107506260A

  • Data backup method and device for multiple storage engines, electronic equipment and storage medium

    CN115408200A

  • Data backup and recovery method, system, equipment and medium

    CN118132343A

  • Big data-based relational database backup recovery method and system

    CN119166428A

Cited By

  • Monitoring operation system for data disaster recovery backup control system

    CN121116742A