A method and system for backing up and restoring domestically produced databases
By employing a scientific partitioning method for the domestic IT database, utilizing data vectors and spatial heat for partitioning, the problem of low backup and recovery efficiency in existing technologies is solved, achieving efficient and accurate database backup and recovery.
Patent Information
- Application Number
- CN202511186601.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-08-25
AI Technical Summary
Existing backup and recovery algorithms for domestically developed databases are unable to fully reflect the comprehensive differences between samples when faced with large-scale, massive attribute data, resulting in insufficient partitioning rationality and affecting the efficiency, accuracy, and reliability of backup and recovery.
By abstracting the features of each row of data in the information technology innovation database, a data vector is obtained. Based on the spatial heat and nearest neighbor relationship of the data points, a termination evaluation sequence is determined, scientific partitioning is performed, and the data of each partition is exported as a target file for backup and recovery.
It enables rapid data location and accurate restoration, improves the efficiency, accuracy and reliability of backup and recovery, reduces the risk of data corruption, and ensures the integrity and security of the database.
Smart Images

Figure CN120723540B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a method and system for backing up and restoring a domestically developed database. Background Technology
[0002] With the continuous advancement of information technology application innovation, domestically developed databases, as a complete and independently controllable database ecosystem, are gradually becoming the core support for data storage and management across various industries. Leveraging their flexible utilization of network hardware at different levels, they can fully mobilize various resources from software to hardware during database backup and recovery, significantly improving overall performance utilization and providing a solid foundation for data security and business continuity. In actual database backup and recovery operations, current mainstream solutions maximize the preservation of the database's branch structure by splitting and indexing the collected data and placing the indexed data in the same partition. This design allows the recovery process to proceed step-by-step according to different branches. After a single partition is restored, the database can operate on that partition, effectively reducing downtime during backup and recovery. This enables earlier restoration of normal use even with partial functional limitations, greatly reducing losses caused by business interruptions.
[0003] However, existing algorithms still have significant limitations when dealing with massive attribute data in large-scale databases. In massive attribute databases, the more descriptive attributes a single object has, the more comprehensive the record of that object. However, existing backup algorithms can only sort according to the order of a single attribute and split the object by statistically analyzing the distribution of data on that attribute. This single-dimensional processing method is difficult to fully reflect the comprehensive differences between samples, resulting in insufficient partitioning rationality, which in turn affects the efficiency, accuracy, and reliability of backup and recovery of domestically developed databases. Summary of the Invention
[0004] To address the technical problems of low efficiency, accuracy, and reliability in the backup and recovery of domestically developed databases, the present invention aims to provide a method and system for the backup and recovery of domestically developed databases.
[0005] To solve the above technical problems, the specific technical solution adopted is as follows:
[0006] In a first aspect, embodiments of the present invention provide a method for backing up and restoring a domestically developed information technology database, comprising: abstracting the features of each row of data in the domestically developed information technology database to be backed up, obtaining a data vector for each row of data, wherein each row of data includes at least one information attribute; determining the spatial heat of each data point based on the distance between the nearest neighbor data points and each data point and the data vector formed by the nearest neighbor data points and each data point; determining the termination evaluation of each data point based on the spatial heat and the data vector, obtaining a termination evaluation sequence, and partitioning the data in the domestically developed information technology database based on the termination evaluation sequence to obtain multiple regions; exporting the data of each region as a target file to back up the data in the domestically developed information technology database, and restoring the data of each region in the target file to the corresponding partition of the domestically developed information technology database.
[0007] Optionally, determining the spatial heat of each data point based on the distance between each data point and its nearest neighbor data points, and the data vector formed by the nearest neighbor data points and each data point, includes: taking the current data point as the starting point and any nearest neighbor data point as the ending point, obtaining the data vector of the current data point and any nearest neighbor data point; taking the current data point as the starting point and the origin of the sample center as the ending point, obtaining the test vector of the current data point; calculating the angle between the data vectors of each nearest neighbor data point and the test vector of the current data point; and determining the spatial heat of the current data point based on the distance between each nearest neighbor data point and the current data point, and the angle between the data vectors of each nearest neighbor data point and the test vector of the current data point.
[0008] Optionally, determining the spatial heat of the current data point based on the distances between the current data point and its nearest neighbor data points, and the angles between the data vectors and test vectors of the current data point's nearest neighbors, includes: selecting the minimum and maximum distances from the distances, and determining the representative angle between the data vectors and test vectors of the nearest neighbor data points corresponding to the minimum distance; calculating a first ratio between the minimum and maximum distances, a first difference between the angles between the data vectors and test vectors of each nearest neighbor data point and the representative angle, and a second difference between the angles between the data vectors and test vectors of each pair of nearest neighbors; selecting the maximum difference from the second differences, and calculating a second ratio between the first and maximum differences; and determining the spatial heat of the current data point based on the first and second ratios.
[0009] Optionally, the window size for nearest neighbor data points is calculated based on the average and standard deviation of the distances between each data point and its nearest neighbor data point.
[0010] Optionally, based on the spatial heat and data vector of each data point, the termination evaluation of each data point is determined to obtain the termination evaluation sequence, including: sorting the spatial heat of each data point in descending order, selecting the data point corresponding to the highest spatial heat as the starting point for region division; taking all the nearest neighbor data points of the starting point as the initial region, and accumulating the data vectors of all data points in the initial region to obtain the first sum data vector of the initial region, the first sum data vector indicating the convergence characteristic between the nearest neighbor data points of the starting point; selecting the data point to be divided that is closest to the endpoint of the region data vector, and determining the data vector between the data point to be divided and its nearest neighbor data points; superimposing the data vectors between the data point to be divided and its nearest neighbor data points to obtain the updated second sum data vector; determining the termination evaluation of the data point based on the first sum data vector, the second sum data vector, the spatial heat of the data point to be divided, and the spatial heat of all data points in the initial region, and sorting the termination evaluations of each data point according to the acquisition order of the data points to obtain the termination evaluation sequence.
[0011] Optionally, the termination evaluation of data points is determined based on the first and second data vectors, the spatial heat of the data points to be divided, and the spatial heat of all data points in the initial area. This includes: calculating the angle between the first and second data vectors, the absolute value of the third difference between the first and second data vectors, and the fourth difference between the absolute value of the first and second data vectors and the absolute value of the third difference; calculating the mean and standard deviation of the spatial heat of all data points in the initial area; and determining the termination evaluation based on the angle between the first and second data vectors, the fourth difference, the mean and standard deviation of the heat.
[0012] Optionally, the data in the information technology innovation database can be partitioned based on the termination evaluation sequence to obtain multiple regions, including: taking the first-order difference of the termination evaluation of each data point in the termination evaluation sequence to obtain a difference value sequence; and partitioning the data in the information technology innovation database based on the sign of the difference values in the difference value sequence to obtain multiple regions.
[0013] Optionally, the data in the information technology innovation database is partitioned based on the sign of the difference values in the difference value sequence to obtain multiple regions, including: if the signs of the difference values before and after the current difference value in the difference value sequence are different from the sign of the current difference value, the sign of the current difference value is updated to the sign of the difference values before and after it, resulting in an updated difference value sequence; starting from the second difference value in the updated difference value sequence, it is determined whether the signs of the subsequent difference values of the second difference value in the updated difference value sequence are the same as the sign of the second difference value; when the sign of the first target difference value is different from the sign of the second difference value, the data point corresponding to the target difference value and in the subtraction position of the termination evaluation is not acquired; the remaining data points, except for the data point corresponding to the target difference value and in the subtraction position of the termination evaluation, are acquired to obtain the partitioned regions.
[0014] Optionally, after obtaining the remaining data points in the initial region except for the data points at the termination evaluation position corresponding to the target difference value, the method further includes: sorting all the obtained regions in descending order according to the number of data points in the region to obtain a region sequence, and obtaining the two target regions with the largest difference in the number of data points between adjacent sorted regions in the region sequence; taking the one with fewer data points in the two target regions as the starting region, and the region with the fewest data points in the region sequence as the ending region; taking all regions in the region sequence between the starting region and the ending region as fragment regions, and merging the fragment regions, the starting region, and the ending region to obtain a composite region.
[0015] Secondly, embodiments of the present invention provide a domestically developed database backup and recovery system, comprising: a processor and a memory; wherein the memory is used to store a computer program that can run on the processor; the processor is used to execute the program stored in the memory to implement the steps of the domestically developed database backup and recovery method mentioned in the first aspect.
[0016] This invention offers the following advantages: By abstracting the features of each row of data to obtain a data vector, the multi-dimensional information attributes of the data can be transformed into a quantifiable vector form, breaking through the limitations of traditional single-attribute sorting and comprehensively capturing the inherent relationships between data. Spatial heat is determined based on the distance between the nearest neighboring data points and the data vector, and a termination evaluation is obtained by combining spatial heat and data vectors, making the evaluation of data points more consistent with their actual distribution characteristics in the overall data space. Data is partitioned based on the termination evaluation sequence, considering the spatial heat and multi-dimensional feature differences of data points, allowing data with similar features and high correlation to cluster in the same area. This ensures the correlation and consistency of data within each area, making the partitioning more reasonable and laying the foundation for subsequent file backup and recovery. Furthermore, exporting the data from each area as a target file for backup allows for targeted backup based on the characteristics of each area, improving the utilization efficiency and efficiency of backup resources. During the recovery process, restoring the data from each area in the target file to the corresponding partition leverages the rationality of the partitioning to achieve rapid data location and accurate restoration, reducing data matching time during recovery and improving the efficiency and accuracy of data recovery. Therefore, by scientifically partitioning the domestic IT innovation database using the methods described above in this embodiment of the invention, the data in each partition is relatively independent and closely related internally. During backup, the risk of backup file corruption caused by data mixing can be reduced, resulting in high data security. During recovery, the data in each partition is restored to the designated partition, which can effectively avoid data corruption, ensure the integrity of the database structure and the accuracy of the data after recovery, and improve the overall efficiency, accuracy and reliability of domestic IT innovation database backup and recovery. Attached Figure Description
[0017] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of a method for backing up and restoring a domestically developed database, as disclosed in one embodiment of the present invention.
[0019] Figure 2 This is a schematic diagram of the structure of a domestic database backup and recovery system disclosed in one embodiment of the present invention. Detailed Implementation
[0020] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a database backup and recovery method and system based on the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0022] The specific scheme of the domestic database backup and recovery method disclosed in this invention will be described in detail below with reference to the accompanying drawings. Example 1:
[0023] Please see Figure 1 The document illustrates a flowchart of a database backup and recovery method provided by an embodiment of the present invention, comprising:
[0024] Step S101: Perform feature abstraction on each row of data in the database to be backed up to obtain a data vector for each row of data. Each row of data includes at least one information attribute.
[0025] Specifically, before backing up data, it is necessary to extract files from the current domestic IT innovation database to be backed up. In practical applications, the domestic IT innovation database runs in real time and files are constantly changing. Therefore, this embodiment of the invention takes a snapshot of the domestic IT innovation database at the start of the backup and extracts and analyzes the snapshot at the backup time to incrementally update the data for subsequent operations, thereby reducing the impact of backup updates on the operation of the domestic IT innovation database.
[0026] Furthermore, in this embodiment of the invention, for each row in the snapshot of the aforementioned domestic IT innovation database, data values are extracted according to row number order. These values are then abstracted using a word-to-vector (word2vec) algorithm to obtain word vectors corresponding to each information attribute in each row. These word vectors represent the feature values of each information attribute in the table, thus yielding their corresponding data vectors. Furthermore, since the information attributes stored in different rows within a single column of the aforementioned domestic IT innovation database are identical, data attribute alignment between different rows is achieved. The data points corresponding to all rows in the current table are then placed into the sample space and the following steps are performed.
[0027] Step S102: Determine the spatial heat of each data point based on the distance between each data point and its nearest neighbor data points, as well as the data vector formed by the nearest neighbor data points and each data point.
[0028] Specifically, if the trend of the stored data points is coordinated with that of other local data points in the sample space, it means that the fluctuation directions of these data are similar. Therefore, the superposition of the fluctuation trends of multiple data points can be used as effective data for partitioning, so that the partitioned data points can play a similar coordinated role in the information technology innovation database, thereby completing the dynamic adjustment of partitioning.
[0029] Further, as an optional embodiment of the present invention, determining the spatial heat of each data point based on the distance between each data point and its nearest neighbor data points, and the data vector formed by the nearest neighbor data points and each data point, includes: taking the current data point as the starting point and any nearest neighbor data point as the ending point to obtain the data vector of the current data point and any nearest neighbor data point; taking the current data point as the starting point and the origin of the sample center as the ending point to obtain the test vector of the current data point; calculating the angle between the data vectors of each nearest neighbor data point and the test vector of the current data point; and determining the spatial heat of the current data point based on the distance between each nearest neighbor data point and the current data point, and the angle between the data vectors of each nearest neighbor data point and the test vector. The window size of the nearest neighbor data points is calculated based on the average and standard deviation of the distance between each data point and its nearest data point.
[0030] Specifically, in this embodiment of the invention, the data points to be screened should have a low degree of isolation from other data points. Since the domestic IT innovation database stores only text distributed column-wise, the similarity measurement of data is unclear. However, when data points are extracted into data vectors, the similarity between data points can be judged from the sample space. Therefore, this embodiment of the invention constructs data vectors between each data point, and then uses these data vectors to judge the similarity between data points in the sample space.
[0031] More specifically, in this embodiment of the invention, the distance between each data point in the current sample space and its nearest data point is first calculated. mean and various Standard deviation The window size (number) of neighboring data points for each data point is [size missing]. For each data point, extract w data points within its window as its nearest neighbor data points.
[0032] More specifically, embodiments of the present invention use the current data points As the starting point, the current data point any nearest neighbor data point As the endpoint, the data vector is obtained. Iterate through the current data points. Given all w nearest neighbor data points, obtain w data vectors. Then, using the current data point... The current data point is obtained by using the origin of the sample center as the starting point and the origin as the ending point. test vector And calculate the data points respectively. The data vector of all w nearest neighbor data points With test vector The angle between Thus far, this embodiment of the invention has completed the analysis of the current data point. Analyzing the spatial distribution of the data points, the isolated data points in the database have different intervals from the other data points, and their distance from the clustering location leads to a concentrated distribution direction. This indicates that the current data point has a higher degree of deviation from other data points in the current database, thus indicating that the current data point is located far from the data concentration location.
[0033] Furthermore, as an optional embodiment of the present invention, determining the spatial heat of the current data point based on the distances between the current data point and its nearest neighbor data points, and the angles between the data vectors and test vectors of the current data point's nearest neighbor data points, includes: selecting the minimum distance and the maximum distance from the various distances, and determining the representative angle between the data vectors and test vectors of the nearest neighbor data points corresponding to the minimum distance; calculating a first ratio between the minimum distance and the maximum distance, a first difference between the angles between the data vectors and test vectors of each nearest neighbor data point and the representative angle, and a second difference between the angles between the data vectors and test vectors of each pair of nearest neighbor data points; selecting the maximum difference from the second differences, and calculating a second ratio between the first difference and the maximum difference; and determining the spatial heat of the current data point based on the first ratio and the second ratio.
[0034] Specifically, the embodiments of the present invention use the following formula to calculate spatial heat:
[0035]
[0036] In the above formula, Represents the current data point Spatial heat. Represents the current data point The minimum distance among the nearest neighboring data points within its window. Represents the current data point The maximum distance among the nearest neighboring data points within its window. The smaller the value, the better for the current data point. The greater the distance from the central region of the dataset, the more it indicates the current data point. The area it is located in is the edge region of the data distribution. Represents the current data point The number of neighboring data points within the middle window. Represents the current data point The j-th data vector within the middle window With test vector The angle between them. Represents the current data point The data vector and test vector of the nearest neighbor data points corresponding to the minimum distance within the middle window The angle between them. Represents the data vector and test vector of each pair of nearest neighbors. The second difference in the angle between them. () denotes the maximum function, used to take the maximum value from each second difference. This indicates the current data point Iterate through all nearest neighbor data points within the middle window; the larger the value, the stronger the current data point. The greater the difference in the distribution direction of neighboring data points in the middle window, the more... The deviation between the included angles is measured within the distribution range of the included angles to determine the current data point. The locations where the data is distributed are far from the concentrated areas of data distribution. The larger the value, the better for the current data point The further away the location is from the concentrated area of data distribution, the better.
[0037] In this way, by traversing all data points in the current sample space, the spatial heat corresponding to each data point can be obtained.
[0038] Step S103: Based on the spatial heat and data vector of each data point, determine the termination evaluation of each data point, obtain the termination evaluation sequence, and partition the data in the information technology innovation database based on the termination evaluation sequence to obtain multiple regions.
[0039] Specifically, in this embodiment of the invention, after obtaining the spatial heat of each data point, local high-heat areas are extracted based on the spatial heat of each data point, thereby obtaining the effective regions corresponding to outlier data. This reduces the waste of backup space caused by storing outlier data separately and the increased operation time during the recovery process due to the independent storage of regions, which affects recovery efficiency. Furthermore, outlier data is highly specific; therefore, the recovery process ensures that database regions maintain certain functions. Thus, outlier data is categorized into the same region to reduce the risk of data quality degradation caused by forcibly including it in other regions. Based on this, this embodiment of the invention divides regions outward from the spatial heat of the nearest neighboring data points.
[0040] Furthermore, as an optional embodiment of the present invention, determining the termination evaluation of each data point based on the spatial heat and data vector of each data point, and obtaining the termination evaluation sequence includes: sorting the spatial heat of each data point in descending order, selecting the data point corresponding to the highest spatial heat as the starting point for region division; taking all the nearest neighbor data points of the starting point as the initial region, and accumulating the data vectors of all data points in the initial region to obtain the first sum data vector of the initial region, wherein the first sum data vector indicates the convergence characteristic between the nearest neighbor data points of the starting point; selecting the data point to be divided that is closest to the endpoint of the region data vector, and determining the data vector between the data point to be divided and its nearest neighbor data points; superimposing the data vectors between the data point to be divided and its nearest neighbor data points to obtain the updated second sum data vector; determining the termination evaluation of the data point based on the first sum data vector, the second sum data vector, the spatial heat of the data point to be divided, and the spatial heat of all data points in the initial region, and sorting the termination evaluations of each data point according to the acquisition order of the data points to obtain the termination evaluation sequence.
[0041] Specifically, in this embodiment of the invention, the spatial heat of all data points is sorted in descending order, and the data point with the highest spatial heat is taken as the starting point for region division. Then, all neighboring data points within the window of the starting point are taken as the initial region p, and the data vectors of all neighboring data points within the window of the starting point are accumulated to obtain the first sum data vector of the initial region p. , This represents the convergence characteristic among all data points within a window starting from the starting point, thereby completing the filtering of similar data and making it easier to divide areas with consistent data functions. Furthermore, in this embodiment of the invention, distance is selected... The other data point closest to the endpoint , data points The data points to be divided in the initial region p are used as the endpoints. The data vectors between the data points to be divided and their nearest neighbors are determined according to the above embodiment. Then, the data vector between the data point to be divided and all its nearest neighbor data points. The sum is accumulated to obtain the updated second sum data vector. 。 Thus, in this embodiment of the invention, the termination evaluations are sorted according to the acquisition order of each data point to obtain the termination evaluation sequence, that is, the termination evaluation sequence is obtained by sorting according to the time order of calculating the termination evaluation of each data point.
[0042] Furthermore, as an optional embodiment of the present invention, determining the termination evaluation of data points based on the first and second data vectors, the spatial heat of the data points to be divided, and the spatial heat of all data points in the initial area includes: calculating the angle between the first and second data vectors, the absolute value of the third difference between the first and second data vectors, and the fourth difference between the absolute value of the first and second data vectors and the absolute value of the third difference; calculating the mean and standard deviation of the spatial heat of all data points in the initial area; and determining the termination evaluation based on the angle between the first and second data vectors, the fourth difference, the mean and standard deviation of the heat.
[0043] Specifically, the embodiments of the present invention use the following formula to calculate the termination evaluation:
[0044]
[0045] In the above formula, This represents the data points in the initial region p. Termination of evaluation. This represents the first sum data vector of the initial region p. This represents the second and data vectors. Represents the first and data vectors With the second and data vector The angle between them. Representing data points Spatial heat. This represents the average spatial heat value of all data points in the initial region p. This represents the standard deviation of the spatial heat of all data points in the initial region p. The larger the value, the more significant the data point. Adding the current initial region p causes excessive deviation from the vector, thus affecting the acquisition of data points. This will cause changes to the functionality of the initial area. Through data points A comparison between the theoretical change represented by the magnitude of the sum vector and the actual change represented by the magnitude of the difference between the sum and vectors. and The closer to the current data point The more significant the effect of changes on the current initial region p, the more likely it is that further acquisition of subsequent data points should be terminated to avoid deviations in the region's data characteristics. The larger the value, the more significant the data point. The heat distribution differs significantly from that in the initial region p, with data points... The larger the value of the termination evaluation, the more significant the difference becomes, while maintaining the non-negativity of the value. Here, the absolute value of a vector refers to its magnitude. The calculation method for the absolute value of a vector can be found in known techniques, and will not be elaborated upon here in this embodiment of the invention.
[0046] Thus, this embodiment of the invention has obtained the calculation for termination evaluation during the continuous acquisition of data points.
[0047] Furthermore, after acquiring new data points, it is necessary to cut off the data based on changes in the termination evaluation to reduce the inaccuracy of the region division. As an optional embodiment of the present invention, partitioning the data in the information technology innovation database based on the termination evaluation sequence to obtain multiple regions includes: taking the first-order difference of the termination evaluation of each data point in the termination evaluation sequence to obtain a difference value sequence; partitioning the data in the information technology innovation database based on the sign of the difference values in the difference value sequence to obtain multiple regions.
[0048] Specifically, in this embodiment of the invention, the termination evaluation of the initial region p of the data points is used as the starting point of the termination evaluation sequence. For each new data point acquired, its termination evaluation is calculated and placed after the starting point. Then, the first-order difference of the termination evaluation sequence is taken, that is, the previous termination evaluation is subtracted from the next termination evaluation, to obtain the difference value sequence of the termination evaluations.
[0049] Furthermore, as an optional embodiment of the present invention, the data in the information technology innovation database is partitioned based on the sign of the difference values in the difference value sequence to obtain multiple regions, including: if the signs of the difference values before and after the current difference value in the difference value sequence are different from the sign of the current difference value, then the sign of the current difference value is updated to the sign of the difference values before and after, resulting in an updated difference value sequence; starting from the second difference value in the updated difference value sequence, it is determined whether the sign of the subsequent difference values of the second difference value in the updated difference value sequence is the same as the sign of the second difference value; when the sign of the first target difference value is different from the sign of the second difference value, the data point corresponding to the target difference value and in the subtraction position of the termination evaluation is not acquired; the remaining data points, except for the data point corresponding to the target difference value and in the subtraction position of the termination evaluation, are acquired to obtain the partitioned regions.
[0050] Specifically, if the signs of the preceding and following difference values in the difference value sequence are all different from the current difference value (excluding cases where the difference value is 0), then the sign of the current difference value is updated to match the signs of the preceding and following difference values, resulting in an updated difference value sequence. Starting from the second difference value in the updated difference value sequence, it is determined whether the signs of subsequent difference values remain consistent. When the first different sign of a difference value appears, the data point corresponding to the termination evaluation at the subtraction position of the current difference value is not acquired. Instead, the remaining data points after the termination evaluation at that subtraction position in the difference value sequence are acquired, and the above steps are repeated to complete the segmentation. The remaining data points before the termination evaluation at that subtraction position in the difference value sequence can be considered as one segment.
[0051] Furthermore, the partitioned regions exhibit varying distribution patterns. Regions with high concentration consist of partitions of similar size and data characteristics, enabling rapid completion of storage recovery tasks. However, the remaining regions contain fragmented areas with minimal data content due to specific data. To minimize the need for additional storage heads in these fragmented areas during database backup and recovery, it is necessary to filter and merge these fragmented areas, thereby enabling intelligent adjustment of configuration strategies during the database backup and recovery process. As an optional embodiment of the present invention, after acquiring the remaining data points in the initial region except for the data points in the termination evaluation position corresponding to the target difference value, and obtaining the partitioned regions, the method further includes: sorting all the partitioned regions in descending order according to the number of data points in each region to obtain a region sequence, and acquiring the two target regions with the largest difference in the number of data points between adjacent sorted regions in the region sequence; taking the region with fewer data points as the starting region, and the region with the fewest data points in the region sequence as the ending region; taking all regions in the region sequence between the starting region and the ending region as fragment regions, and merging the fragment regions, the starting region, and the ending region to obtain a composite region.
[0052] Specifically, in this embodiment of the invention, all the split regions are first sorted in descending order according to the number of data points in each region, and the two regions with the largest difference in the number of data points between adjacent sorted regions are obtained. The region with fewer data points is taken as the starting point, and the region with the fewest data points in the sequence is taken as the ending point. The regions between the starting point and the ending point, as well as the regions corresponding to the starting point and the ending point, are taken as fragment regions. The data in these fragment regions are taken as the same region and merged, thus completing the merging of fragment regions and obtaining merged regions.
[0053] At this point, the merged area and other areas will be used as the new areas.
[0054] Step S104: Export the data of each region to a target file to back up the data of the information technology innovation database, and restore the data of each region in the target file to the corresponding partition of the information technology innovation database.
[0055] Specifically, after the region segmentation is completed in this embodiment of the invention, the database management system (DBMS) tool is used to export the region data as a Structured Query Language (SQL) file, which is a backup file. The SQL file stores the content of each region.
[0056] Furthermore, after obtaining the backup file, the file recovery process is performed. This embodiment of the invention first confirms the recovery scope, identifying the partition, table, or time point that needs to be recovered. Then, an isolation environment is built, and the recovery process is verified in a test environment. Finally, this embodiment imports the SQL file to restore the data to the domestically developed database, applies the transaction log to advance the data in the SQL file to the earliest time point of the data stored in the current partition, and then rolls back any uncommitted transactions to ensure database consistency.
[0057] For example, the following command can be used when importing an SQL file:
[0058] a)MySQL: mysql -u root -p my_database < backup.sql;
[0059] b) SQL Server: RESTORE DATABASE my_database FROM DISK = 'C:\backup\my_database.ba k';
[0060] By abstracting the features of each row of data to obtain data vectors, the multi-dimensional information attributes of the data can be transformed into quantifiable vector forms, breaking through the limitations of traditional single-attribute sorting and comprehensively capturing the inherent relationships between data. Spatial heat is determined based on the distance between the nearest neighbor data points and the data vectors, and a termination evaluation is obtained by combining spatial heat and data vectors, making the evaluation of data points more consistent with their actual distribution characteristics in the overall data space. Data is partitioned based on the termination evaluation sequence, considering the spatial heat and multi-dimensional feature differences of data points, allowing data with similar characteristics and high correlation to cluster in the same area. This ensures the correlation and consistency of data within each area, making the partitioning more reasonable and laying the foundation for subsequent file backup and recovery. Furthermore, exporting the data from each area as a target file for backup allows for targeted backup based on the characteristics of each area, improving the utilization efficiency and efficiency of backup resources. During the recovery process, restoring the data from each area in the target file to the corresponding partition allows for rapid data location and accurate restoration based on the reasonableness of the partitioning, reducing data matching time during the recovery process and improving the efficiency and accuracy of data recovery. Therefore, by scientifically partitioning the domestic IT innovation database using the methods described above in this embodiment of the invention, the data in each partition is relatively independent and closely related internally. During backup, the risk of backup file corruption caused by data mixing can be reduced, resulting in high data security. During recovery, the data in each partition is restored to the designated partition, which can effectively avoid data corruption, ensure the integrity of the database structure and the accuracy of the data after recovery, and improve the overall efficiency, accuracy and reliability of domestic IT innovation database backup and recovery. Example 2:
[0061] Corresponding to the domestically developed database backup and recovery method provided in the above embodiments, based on the same technical concept, this invention also provides a domestically developed database backup and recovery system, which is used to execute the above-described domestically developed database backup and recovery method. Figure 2 This is a schematic diagram of another domestically developed database backup and recovery system provided in one embodiment of the present invention, as shown below. Figure 2 As shown. The domestically developed database backup and recovery system can vary significantly due to differences in configuration or performance. It may include one or more processors 401 and memory 402. The memory 402 stores computer programs that can run on the processor 401. The processor 401 executes the programs stored in the memory 402 to achieve the above... Figure 1 The various steps in the method embodiment are described. The memory 402 can be temporary or persistent storage. The application stored in the memory 402 may include one or more modules (not shown in the figure), each module may include a series of computer-executable instructions for the domestic database backup and recovery system.
[0062] Furthermore, the processor 401 can be configured to communicate with the memory 402 and execute a series of computer-executable instructions stored in the memory 402 on the domestically developed database backup and recovery system. The domestically developed database backup and recovery system may also include one or more power supplies 403, one or more wired or wireless network interfaces 404, one or more input / output interfaces 405, and one or more keyboards 406.
[0063] Specifically, in this embodiment, the domestically developed database backup and recovery system includes a processor, a communication interface, a memory, and a communication bus; wherein, the processor, communication interface, and memory communicate with each other via the bus; the memory stores computer programs; and the processor executes the programs stored in the memory to achieve the above... Figure 1 The various steps in the method embodiments are the same as those in the above method embodiments, and have the same beneficial effects. To avoid repetition, the embodiments of the present invention will not be described again here.
[0064] It should be noted that the domestically developed database backup and recovery system provided in this embodiment of the invention and the domestically developed database backup and recovery method provided in this embodiment of the invention are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned domestically developed database backup and recovery method, and has the same or similar beneficial effects. Repeated parts will not be described again.
[0065] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0066] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0067] This invention also provides a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform... Figure 1 The methods disclosed in the embodiments shown achieve the functions and beneficial effects of the methods in the preceding method embodiments, and will not be repeated here.
[0068] The computer-readable storage media include read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for backing up and restoring a domestically developed database, characterized in that, include: Each row of data in the database to be backed up is abstracted to obtain a data vector for each row of data, and each row of data includes at least one information attribute. The spatial heat of each data point is determined based on the distance between each data point's nearest neighbor data point and each data point, as well as the data vector formed by the nearest neighbor data point and each data point. Based on the spatial heat of each data point and the data vector, the termination evaluation of each data point is determined to obtain a termination evaluation sequence. Based on the termination evaluation sequence, the data in the information technology innovation database is partitioned to obtain multiple regions. Export the data of each region to a target file to back up the data of the information technology innovation database, and restore the data of each region in the target file to the corresponding partition of the information technology innovation database; The termination evaluation for each data point is determined based on its spatial heat and the data vector, resulting in a termination evaluation sequence including: The spatial heat of each data point is sorted in descending order, and the data point with the highest spatial heat is selected as the starting point for the area division. All the nearest neighbor data points of the starting point are taken as the initial region, and the data vectors of all data points in the initial region are accumulated to obtain the first sum data vector of the initial region. The first sum data vector indicates the convergence characteristics between the nearest neighbor data points of the starting point. Select the data point to be divided that is closest to the endpoint of the first and data vectors, and determine the data vector between the data point to be divided and its nearest neighbor data points; The data vectors between the data point to be divided and its nearest neighbor data points are superimposed to obtain the updated second sum data vector; Based on the first sum data vector, the second sum data vector, the spatial heat of the data point to be divided, and the spatial heat of all data points in the initial area, the termination evaluation of the data point is determined; The termination evaluations of each data point are sorted according to the order in which the data points were acquired to obtain the termination evaluation sequence; The process of partitioning the data in the information technology innovation database based on the termination evaluation sequence yields multiple regions, including: The first-order difference is taken for the termination evaluation of each data point in the termination evaluation sequence to obtain the difference value sequence; The data in the information technology innovation database is partitioned based on the sign of the difference values in the difference value sequence to obtain multiple regions.
2. The method for backup and recovery of a domestically developed database according to claim 1, characterized in that, The step of determining the spatial heat of each data point based on the distance between each data point's nearest neighbor data points and the data vector formed by the nearest neighbor data points and the data points includes: Using the current data point as the starting point and any nearest neighbor data point of the current data point as the ending point, the data vector of the current data point and any nearest neighbor data point is obtained; Using the current data point as the starting point and the sample center origin as the ending point, the test vector of the current data point is obtained; Calculate the angle between the data vectors of each of the nearest neighbor data points of the current data point and the test vector; The spatial heat of the current data point is determined based on the distance between the current data point and each of its nearest neighbor data points, and the angle between the data vectors of the current data point and the test vector.
3. The method for backup and recovery of a domestically developed database according to claim 2, characterized in that, The step of determining the spatial heat of the current data point based on the distances between the current data point and its nearest neighbor data points, and the angles between the data vectors of the current data point's nearest neighbor data points and the test vector, includes: Select the minimum distance and the maximum distance from each of the distances, and determine the representative angle between the data vector of the nearest neighbor data point corresponding to the minimum distance and the test vector; Calculate the first ratio between the minimum distance and the maximum distance, the first difference between the angle between the data vector of each nearest neighbor data point and the test vector and the representative angle, and the second difference between the angle between the data vector of each pair of nearest neighbor data points and the test vector; Select the largest difference from the second differences, and calculate a second ratio between the first difference and the largest difference; The spatial heat of the current data point is determined based on the first ratio and the second ratio.
4. The method for backup and recovery of a domestically developed database according to claim 2, characterized in that, The window size for the nearest neighbor data points is calculated based on the average distance and standard deviation of each data point to its nearest neighbor data point.
5. The method for backup and recovery of a domestically developed database according to claim 1, characterized in that, The step of determining the termination evaluation of the data point based on the first sum data vector, the second sum data vector, the spatial heat of the data point to be divided, and the spatial heat of all data points in the initial area includes: Calculate the angle between the first sum data vector and the second sum data vector, the absolute value of the third difference between the first sum data vector and the second sum data vector, and the fourth difference between the absolute value of the first sum data vector and the absolute value of the third difference; Calculate the mean and standard deviation of the spatial heat of all data points in the initial region; The termination evaluation is determined based on the angle between the first and second sum data vectors, the fourth difference, the mean heat value, and the standard deviation.
6. The method for backup and recovery of a domestically developed database according to claim 1, characterized in that, The process of partitioning the data in the information technology innovation database based on the sign of the difference values in the difference value sequence yields multiple regions, including: If the signs of the preceding and following difference values in the difference value sequence are all different from the sign of the current difference value, then the sign of the current difference value is updated to the sign of the preceding and following difference values to obtain an updated difference value sequence; Starting from the second difference value in the updated difference value sequence, determine whether the sign of subsequent difference values in the updated difference value sequence is the same as the sign of the second difference value; When the sign of the first target difference value is different from that of the second difference value, the data point corresponding to the target difference value that is in the subtraction position for termination evaluation is not acquired; The remaining data points, excluding the data points at the subtraction position corresponding to the target difference value, are acquired to obtain the partitioned regions.
7. The method for backup and recovery of a domestically developed database according to claim 6, characterized in that, After acquiring the remaining data points (excluding the data points at the subtraction position corresponding to the target difference value) to obtain the partitioned regions, the method further includes: All the partitions obtained from the splitting are sorted in descending order according to the number of data points in each partition to obtain a partition sequence, and the two target partitions with the largest difference in the number of data points between adjacent partitions in the partition sequence are obtained. The region with fewer data points in the two target regions is taken as the starting region, and the region with the fewest data points in the region sequence is taken as the ending region. All regions in the region sequence located between the starting region and the ending region are taken as fragment regions. The fragment regions, the starting region, and the ending region are merged to obtain a composite region.
8. A database backup and recovery system for domestically developed databases, characterized in that, include: Processor and memory; wherein the memory is used to store computer programs that can run on the processor; A processor is used to execute a program stored in memory to implement the steps of the information technology database backup and recovery method as described in any one of claims 1-7.
Citation Information
Patent Citations
Database backup and recovery method and device in ERP system
CN101714107A
Data backup method, device, equipment, system, medium and program product
CN115904800A