A multi-scene application real-time database data synchronization method
By analyzing the database's change status and historical information, calculating the dataset's priority value and synchronization mode, the conflict problem of database synchronization in multiple application scenarios is resolved, achieving data consistency, security, and integrity, and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI MAJIE TECH CO LTD XIAN BRANCH
- Filing Date
- 2023-08-22
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies cannot effectively resolve synchronization conflicts between databases in various application scenarios, leading to data inconsistency, security and integrity issues, and impacting user experience.
By analyzing the change status and historical information of each database, the priority value and synchronization mode of the dataset are calculated, and an appropriate synchronization strategy is selected to achieve multi-dimensional data synchronization.
Priority settings were implemented during data synchronization, ensuring data consistency, reliability, security, and integrity, and improving user experience.
Smart Images

Figure CN117076564B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data synchronization technology, and specifically to a method for real-time database data synchronization in multiple application scenarios. Background Technology
[0002] Multi-scenario applications may involve multiple applications or modules that share and operate on the same set of data. To ensure data consistency, data needs to be synchronized to each application in real time. If data synchronization is untimely or inaccurate, it may lead to data inconsistencies between applications, thereby causing incorrect business logic or decisions.
[0003] When performing real-time data synchronization between multiple databases, conflicts arising from simultaneous modifications to the same data are called synchronization conflicts. Current technologies primarily prioritize data based on its update frequency in each database, resolving conflicts according to priority during synchronization. However, they do not analyze the data modification operations in each database, failing to display the priority of these operations and thus failing to demonstrate the multi-dimensional prioritization during data synchronization. This results in ineffective guarantees of data consistency and reliability, degrading the user experience. Furthermore, the lack of consideration for data security levels, network transmission rates between databases, and the performance of each database when selecting different synchronization modes further compromises data security and integrity, hindering smooth database operation and further reducing the user experience. Summary of the Invention
[0004] The purpose of this invention is to provide a real-time database data synchronization method for multi-scenario applications, which solves the problems existing in the background technology.
[0005] To solve the above technical problems, the present invention adopts the following technical solution: The present invention provides a real-time database data synchronization method for multi-scenario applications, the method comprising the following steps: S1, data change acquisition: acquiring the change status and change information of each dataset in each database at the current time point;
[0006] S2. Data Change Comparison: Based on the change status and change information of each dataset in each database at the current time, the source database corresponding to each dataset to be synchronized is obtained through analysis. The specific analysis process is as follows:
[0007] S21. If the change status of a dataset in a database is changed at the current time point, then the dataset is recorded as the dataset to be synchronized, and each database with the change status of the dataset to be synchronized is recorded as the target database corresponding to the dataset to be synchronized.
[0008] S22. If the number of target databases corresponding to the dataset to be synchronized is 1, then the target database is used as the source database corresponding to the dataset to be synchronized. If the number of target databases corresponding to the dataset to be synchronized is greater than 1, then step S23 is executed.
[0009] S23. Compare the change information of the target databases corresponding to the synchronized dataset. If the change information of the target databases corresponding to the dataset to be synchronized is the same, then select the preset target database as the source database corresponding to the dataset to be synchronized. Otherwise, proceed to step S24.
[0010] S24. Obtain historical change information of the dataset to be synchronized in each target database, extract the change information of the dataset to be synchronized in each target database, calculate the change priority value of the dataset to be synchronized in each target database, and sort the change priority values of the dataset to be synchronized in each target database in descending order. The target database with the highest priority is taken as the source database corresponding to the dataset to be synchronized. The source database corresponding to each dataset to be synchronized is obtained in this way.
[0011] S3. Data Synchronization Selection: Remove the source database corresponding to each dataset from each database and use the other databases as the corresponding databases to be synchronized. This allows us to obtain the transmission rate between the source database and each database to be synchronized, as well as the load information of each database to be synchronized, and then analyze the synchronization mode of each dataset in each database to be synchronized.
[0012] S4. Data Synchronization: Synchronize each dataset according to the synchronization mode of each dataset in each database.
[0013] Preferably, the change status includes both changed and unchanged;
[0014] The change information includes changes in location, change type, and change in data capacity;
[0015] The historical change information includes the time corresponding to each historical change and the volume of historical change data.
[0016] Preferably, the calculation of the change priority value of the dataset to be synchronized in each target database is carried out as follows: Based on the historical change information of the dataset to be synchronized in each target database, the update priority value of the dataset to be synchronized in each target database is calculated, denoted as α. i Where i represents the number corresponding to each target database, i = 1, 2, ..., n;
[0017] Based on the change information of the dataset to be synchronized in each target database, the synchronization priority value of the dataset to be synchronized in each target database is calculated and denoted as χ. i ;
[0018] According to the calculation formula β i =α i *ε1+χ i *ε2, obtains the change priority value β of the dataset to be synchronized in each target database. i ε1 and ε2 are the weight factors corresponding to the set update priority and synchronization priority, respectively.
[0019] Preferably, the calculation of the update priority value of the dataset to be synchronized in each target database is as follows: extract the time corresponding to each historical change of the dataset to be synchronized in each target database from the historical change information of the dataset to be synchronized in each target database, thereby obtaining the interval between each historical change of the dataset to be synchronized in each target database, and then calculate the average interval between each historical change of the dataset to be synchronized in each target database by averaging the interval between each historical change of the dataset to be synchronized in each target database, which is used as the historical change cycle of the dataset to be synchronized in each target database;
[0020] Simultaneously, extract the historical change data capacity corresponding to each historical change of the dataset to be synchronized in each target database from the historical change information of the dataset to be synchronized in each target database. Then, calculate the average historical change data capacity corresponding to each historical change of the dataset to be synchronized in each target database by averaging the historical change data capacity corresponding to each historical change of the dataset to be synchronized in each target database, and use it as the historical change data capacity corresponding to the dataset to be synchronized in each target database.
[0021] Through calculation formula Obtain the update priority value α of the dataset to be synchronized in each target database. i T i R i γ1 and γ2 represent the historical change period and historical change data capacity of the dataset to be synchronized in the i-th target database, respectively. T and R are the set reference historical change period and reference historical change data capacity, respectively. γ1 and γ2 are the weight factors corresponding to the set historical change period and historical change data capacity, respectively.
[0022] Preferably, the calculation of the synchronization priority value of the dataset to be synchronized in each target database is as follows: the change position of the dataset to be synchronized in each target database is compared with the preset importance level of each change position of the dataset to be synchronized to obtain the importance level of the dataset to be synchronized in each target database.
[0023] The change type of the dataset to be synchronized in each target database is compared with the preset operation level corresponding to each change type to obtain the operation level of the dataset to be synchronized in each target database for the change type.
[0024] According to the calculation formula
[0025] Obtain the synchronization priority value χ of the dataset to be synchronized in each target database. i G i Z i W i These represent the importance level of the dataset to be synchronized in each target database, the operation level of the change type, and the data volume to be changed, respectively. n represents the number of target databases, and μ1, μ2, and μ3 are the weight factors corresponding to the set importance level of the change location, the operation level of the change type, and the data volume to be changed, respectively.
[0026] Preferably, the load information includes CPU utilization, memory utilization, and network traffic.
[0027] Preferably, the analysis of the synchronization mode of each dataset to be synchronized in each database to be synchronized specifically involves the following steps: obtaining the change location and change type of each dataset to be synchronized in its source database, thereby obtaining the importance level of the change location and the operation level of the change type of each dataset to be synchronized in its source database, and obtaining the change data capacity of each dataset to be synchronized in its source database, thereby calculating the change security value corresponding to each dataset to be synchronized, denoted as φ. j i represents the number corresponding to each dataset to be synchronized, j = 1, 2, ..., m;
[0028] Based on the transmission rate between the source database and each database to be synchronized for each dataset, calculate the stable transmission value between the source database and each database to be synchronized for each dataset, denoted as F. jg g represents the number corresponding to each database to be synchronized, g = 1, 2, ..., y;
[0029] Based on the load information of each dataset to be synchronized and its corresponding database, the performance impact factor of each dataset to be synchronized and its corresponding database is calculated, denoted as k. jg Therefore, substitute this into the formula for calculating the transmission security value. In this process, the transmission security value ψ between the source database and each database to be synchronized is obtained for each dataset to be synchronized. jg , where e represents the natural constant and σ is the correction factor corresponding to the set transmission security value;
[0030] The transmission security value between the source database and each database to be synchronized is compared with the transmission security value range corresponding to each preset synchronization mode to obtain the synchronization mode between the source database and each database to be synchronized, which is used as the synchronization mode of each dataset in each database to be synchronized.
[0031] Preferably, the formula for calculating the change security value corresponding to each dataset to be synchronized is as follows: Where φ j G j Z j W j Let G, Z, and W represent the change security value, the importance level of the change location in its source database, the operation level of the change type, and the change data volume for the i-th dataset to be synchronized, respectively. Let G, Z, and W be the set reference importance level, reference operation level, and reference change data volume, respectively. These are the weighting factors corresponding to the set importance level and operation level, respectively, and θ is the set correction factor corresponding to the change in security value.
[0032] Preferably, the formula for calculating the transmission stability value between the source database and each database to be synchronized is as follows: Where v jg τ represents the transmission rate between the source database corresponding to the j-th dataset to be synchronized and the g-th dataset to be synchronized, v is the set reference transmission rate, and τ is the correction factor corresponding to the set transmission stability value.
[0033] Preferably, the formula for calculating the performance impact factor of each dataset to be synchronized for each database to be synchronized is as follows: Where q jg p jg a jg Let q, p, and a represent the CPU utilization, memory utilization, and network traffic of the j-th dataset to be synchronized corresponding to the g-th database to be synchronized, respectively. Let q, p, and a represent the set standard CPU utilization, standard memory utilization, and standard network traffic, respectively. Let ω1, ω2, and ω3 represent the set weight factors corresponding to the CPU utilization, memory utilization, and network traffic, respectively.
[0034] The beneficial effects of this invention are as follows: This invention provides a real-time database data synchronization method for multi-scenario applications. By analyzing the change information and historical change information of each dataset to be synchronized in each target database at the current time, the source database corresponding to each dataset to be synchronized is obtained. The synchronization mode of each dataset to be synchronized in each database to be synchronized is analyzed, and then the dataset is synchronized. This realizes a multi-dimensional setting of priority during data synchronization, effectively ensuring the consistency and reliability of data during synchronization. On the other hand, the corresponding synchronization mode is selected according to the security level of each data to be synchronized, the network transmission rate between the source database and each database to be synchronized, and the performance of each database to be synchronized. This reflects targeted analysis during data synchronization, ensuring the security and integrity of data during the synchronization process, and also effectively ensuring the smoothness and fluency of database operation, greatly improving the user experience. Attached Figure Description
[0035] To more clearly illustrate the technical solutions 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.
[0036] Figure 1 This is a schematic diagram of the implementation steps of the method of the present invention. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] Please see Figure 1 As shown, a real-time database data synchronization method for multi-scenario applications includes the following steps: S1, data change acquisition: acquiring the change status and change information of each dataset in each database at the current time point;
[0039] In the above, the change status includes changed and not changed; the change information includes change location, change type, and change data capacity.
[0040] It should be noted that when a dataset in any database is modified at the current point in time, a message will be published to the message middleware, and the location, type, and size of the modified dataset will be captured. This allows the information on the modification status and information of each dataset in each database at the current point in time.
[0041] S2. Data Change Comparison: Based on the change status and change information of each dataset in each database at the current time point, the source database corresponding to each dataset to be synchronized is analyzed. The specific analysis process is as follows: S21. If the change status of a dataset in a database at the current time point is changed, then the dataset is recorded as the dataset to be synchronized, and each database whose change status is changed is taken as the target database corresponding to the dataset to be synchronized.
[0042] S22. If the number of target databases corresponding to the dataset to be synchronized is 1, then the target database is used as the source database corresponding to the dataset to be synchronized. If the number of target databases corresponding to the dataset to be synchronized is greater than 1, then step S23 is executed.
[0043] S23. Compare the change information of the target databases corresponding to the synchronized dataset. If the change information of the target databases corresponding to the dataset to be synchronized is the same, then select the preset target database as the source database corresponding to the dataset to be synchronized. Otherwise, proceed to step S24.
[0044] S24. Obtain historical change information of the dataset to be synchronized in each target database, extract the change information of the dataset to be synchronized in each target database, calculate the change priority value of the dataset to be synchronized in each target database, and sort the change priority values of the dataset to be synchronized in each target database in descending order. The target database with the highest priority is taken as the source database corresponding to the dataset to be synchronized. The source database corresponding to each dataset to be synchronized is obtained in this way.
[0045] The historical change information mentioned above includes the time corresponding to each historical change and the historical change data volume.
[0046] It should be noted that the message middleware stores historical change information of each dataset in each database, and the change information of the dataset to be synchronized in each target database is extracted from the message middleware.
[0047] In one specific embodiment, the calculation of the change priority value of the dataset to be synchronized in each target database is carried out as follows: Based on the historical change information of the dataset to be synchronized in each target database, the update priority value of the dataset to be synchronized in each target database is calculated, denoted as α. i Where i represents the number corresponding to each target database, i = 1, 2, ..., n;
[0048] In the above, the calculation of the update priority value of the dataset to be synchronized in each target database is specifically calculated as follows: the time corresponding to each historical change of the dataset to be synchronized in each target database is extracted from the historical change information of the dataset to be synchronized in each target database, thereby obtaining the interval between each historical change of the dataset to be synchronized in each target database, and then the average interval between each historical change of the dataset to be synchronized in each target database is calculated by averaging the interval between each historical change of the dataset to be synchronized in each target database, which is used as the historical change cycle of the dataset to be synchronized in each target database;
[0049] Simultaneously, extract the historical change data capacity corresponding to each historical change of the dataset to be synchronized in each target database from the historical change information of the dataset to be synchronized in each target database. Then, calculate the average historical change data capacity corresponding to each historical change of the dataset to be synchronized in each target database by averaging the historical change data capacity corresponding to each historical change of the dataset to be synchronized in each target database, and use it as the historical change data capacity corresponding to the dataset to be synchronized in each target database.
[0050] Through calculation formula Obtain the update priority value α of the dataset to be synchronized in each target database. i T i R i γ1 and γ2 represent the historical change period and historical change data capacity of the dataset to be synchronized in the i-th target database, respectively. T and R are the set reference historical change period and reference historical change data capacity, respectively. γ1 and γ2 are the weight factors corresponding to the set historical change period and historical change data capacity, respectively.
[0051] Based on the change information of the dataset to be synchronized in each target database, the synchronization priority value of the dataset to be synchronized in each target database is calculated and denoted as χ. i ;
[0052] In the above, the specific calculation process for obtaining the synchronization priority value of the dataset to be synchronized in each target database is as follows: the change position of the dataset to be synchronized in each target database is compared with the preset importance level of each change position of the dataset to be synchronized to obtain the importance level of the dataset to be synchronized in each target database.
[0053] The change type of the dataset to be synchronized in each target database is compared with the preset operation level corresponding to each change type to obtain the operation level of the dataset to be synchronized in each target database for the change type.
[0054] According to the calculation formula
[0055] Obtain the synchronization priority value χ of the dataset to be synchronized in each target database. i G i Z i W i These represent the importance level of the dataset to be synchronized in each target database, the operation level of the change type, and the data volume to be changed, respectively. n represents the number of target databases, and μ1, μ2, and μ3 are the weight factors corresponding to the set importance level of the change location, the operation level of the change type, and the data volume to be changed, respectively.
[0056] According to the calculation formula β i =α i *ε1+χ i *ε2, obtains the change priority value β of the dataset to be synchronized in each target database. i ε1 and ε2 are the weight factors corresponding to the set update priority and synchronization priority, respectively.
[0057] S3. Data Synchronization Selection: Remove the source database corresponding to each dataset from each database and use the other databases as the corresponding databases to be synchronized. This allows us to obtain the transmission rate between the source database and each database to be synchronized, as well as the load information of each database to be synchronized, and then analyze the synchronization mode of each dataset in each database to be synchronized.
[0058] The load information mentioned above includes CPU utilization, memory utilization, and network traffic.
[0059] It should be noted that each database comes with its own monitoring tools, which can be used to monitor the transmission rate between the source database and each database to be synchronized, as well as the load information of each database to be synchronized.
[0060] In a specific embodiment, the analysis of the synchronization mode of each dataset to be synchronized in each database to be synchronized is carried out as follows: The change location and change type of each dataset to be synchronized in its source database are obtained, thereby determining the importance level of the change location and the operation level of the change type of each dataset to be synchronized in its source database. The changed data capacity of each dataset to be synchronized in its source database is also obtained, and the change security value corresponding to each dataset to be synchronized is calculated, denoted as φ. j i represents the number corresponding to each dataset to be synchronized, j = 1, 2, ..., m;
[0061] In the above, the formula for calculating the change security value corresponding to each dataset to be synchronized is as follows: Where φj G j Z j W j Let G, Z, and W represent the change security value, the importance level of the change location in its source database, the operation level of the change type, and the change data volume for the i-th dataset to be synchronized, respectively. Let G, Z, and W be the set reference importance level, reference operation level, and reference change data volume, respectively. These are the weighting factors corresponding to the set importance level and operation level, respectively, and θ is the set correction factor corresponding to the change in security value.
[0062] Based on the transmission rate between the source database and each database to be synchronized for each dataset, calculate the stable transmission value between the source database and each database to be synchronized for each dataset, denoted as F. jg g represents the number corresponding to each database to be synchronized, g = 1, 2, ..., y;
[0063] In the above, the formula for calculating the transmission stability value between the source database and each database to be synchronized is as follows: Where v jg τ represents the transmission rate between the source database corresponding to the j-th dataset to be synchronized and the g-th dataset to be synchronized, v is the set reference transmission rate, and τ is the correction factor corresponding to the set transmission stability value.
[0064] Based on the load information of each dataset to be synchronized and its corresponding database, the performance impact factor of each dataset to be synchronized and its corresponding database is calculated, denoted as k. jg Therefore, substitute this into the formula for calculating the transmission security value. In this process, the transmission security value ψ between the source database and each database to be synchronized is obtained for each dataset to be synchronized. jg , where e represents the natural constant and σ is the correction factor corresponding to the set transmission security value;
[0065] The formula for calculating the performance impact factor of each dataset to be synchronized for each database to be synchronized, as described above, is: Where q jg p jg a jg Let q, p, and a represent the CPU utilization, memory utilization, and network traffic of the j-th dataset to be synchronized corresponding to the g-th database to be synchronized, respectively. Let q, p, and a represent the set standard CPU utilization, standard memory utilization, and standard network traffic, respectively. Let ω1, ω2, and ω3 represent the set weight factors corresponding to the CPU utilization, memory utilization, and network traffic, respectively.
[0066] The transmission security value between the source database and each database to be synchronized is compared with the transmission security value range corresponding to each preset synchronization mode to obtain the synchronization mode between the source database and each database to be synchronized, which is used as the synchronization mode of each dataset in each database to be synchronized.
[0067] It should be noted that synchronization modes include normal mode, encrypted mode, etc.
[0068] S4. Data Synchronization: Synchronize each dataset according to the synchronization mode of each dataset in each database.
[0069] This invention, through analysis of the change information and historical change information of each dataset to be synchronized in each target database at the current time, obtains the source database corresponding to each dataset to be synchronized, and analyzes the synchronization mode of each dataset in each target database, thereby synchronizing the datasets. This achieves multi-dimensional setting of priorities during data synchronization, effectively ensuring the consistency and reliability of data during synchronization. On the other hand, by selecting the corresponding synchronization mode based on the security level of each dataset to be synchronized, the network transmission rate between the source database and each target database, and the performance of each target database, it reflects targeted analysis during data synchronization, ensuring the security and integrity of data during the synchronization process, and effectively ensuring the smooth and seamless operation of the database, greatly improving the user experience.
[0070] The above description is merely an example and illustration of the concept of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described or use similar methods to replace them, as long as they do not deviate from the concept of the invention or exceed the scope defined in the claims, they should all fall within the protection scope of the present invention.
Claims
1. A multi-scenario application real-time database data synchronization method, characterized in that, The method includes the following steps: S1. Data Change Acquisition: Acquire the change status and change information of each dataset in each database at the current point in time; S2. Data Change Comparison: Based on the change status and change information of each dataset in each database at the current time, the source database corresponding to each dataset to be synchronized is obtained through analysis. The specific analysis process is as follows: S21. If the change status of a dataset in a database is changed at the current time point, then the dataset is recorded as the dataset to be synchronized, and each database with the change status of the dataset to be synchronized is recorded as the target database corresponding to the dataset to be synchronized. S22. If the number of target databases corresponding to the dataset to be synchronized is 1, then the target database is used as the source database corresponding to the dataset to be synchronized. If the number of target databases corresponding to the dataset to be synchronized is greater than 1, then step S23 is executed. S23. Compare the change information of the target databases corresponding to the synchronized dataset. If the change information of the target databases corresponding to the dataset to be synchronized is the same, then select the preset target database as the source database corresponding to the dataset to be synchronized. Otherwise, proceed to step S24. S24. Obtain historical change information of the dataset to be synchronized in each target database, extract the change information of the dataset to be synchronized in each target database, calculate the change priority value of the dataset to be synchronized in each target database, and sort the change priority values of the dataset to be synchronized in each target database in descending order. The target database with the highest priority is taken as the source database corresponding to the dataset to be synchronized. The source database corresponding to each dataset to be synchronized is obtained in this way. S3. Data Synchronization Selection: Remove the source database corresponding to each dataset from each database and use the other databases as the corresponding databases to be synchronized. This allows us to obtain the transmission rate between the source database and each database to be synchronized, as well as the load information of each database to be synchronized, and then analyze the synchronization mode of each dataset in each database to be synchronized. S4. Data Synchronization: Synchronize each dataset according to the synchronization mode of each dataset in each database; The calculation yields the change priority value of the dataset to be synchronized in each target database. The specific calculation process is as follows: According to the historical change information of the to-be-synchronized data set in each target database, the update priority value of the to-be-synchronized data set corresponding to each target database is calculated, denoted as where i represents the number corresponding to each target database, i=1, 2,..., n; According to the change information of the to-be-synchronized data set in each target database, a corresponding synchronization priority value of the to-be-synchronized data set in each target database is calculated, denoted as ; According to the calculation formula This yields the change priority values of the dataset to be synchronized in each target database. ,in , These are the weight factors corresponding to the set update priority value and synchronization priority value, respectively.
2. The method of claim 1, wherein, The change status includes both changed and unchanged; The change information includes changes in location, change type, and change in data capacity; The historical change information includes the time corresponding to each historical change and the volume of historical change data.
3. The method of claim 2, wherein, The calculation yields the update priority value of the dataset to be synchronized in each target database. The specific calculation process is as follows: Extract the time corresponding to each historical change of the dataset to be synchronized in each target database from the historical change information of the dataset to be synchronized in each target database. This gives the interval between each historical change of the dataset to be synchronized in each target database. Then, calculate the average interval between each historical change of the dataset to be synchronized in each target database by averaging the interval between each historical change of the dataset to be synchronized in each target database. This average interval is used as the historical change cycle of the dataset to be synchronized in each target database. Simultaneously, extract the historical change data capacity corresponding to each historical change of the dataset to be synchronized in each target database from the historical change information of the dataset to be synchronized in each target database. Then, calculate the average historical change data capacity corresponding to each historical change of the dataset to be synchronized in each target database by averaging the historical change data capacity corresponding to each historical change of the dataset to be synchronized in each target database, and use it as the historical change data capacity corresponding to the dataset to be synchronized in each target database. Through calculation formula This yields the update priority values of the dataset to be synchronized in each target database. T i R i Let T and R represent the historical change period and historical change data capacity of the dataset to be synchronized in the i-th target database, respectively, and T and R be the set reference historical change period and reference historical change data capacity, respectively. , These are the weighting factors corresponding to the set historical change period and the historical change data volume, respectively.
4. The method of claim 2, wherein, The calculation yields the synchronization priority value of the dataset to be synchronized in each target database. The specific calculation process is as follows: The importance level of the dataset to be synchronized at each target database is obtained by comparing the change location of the dataset to be synchronized at each target database with the preset importance level of each change location of the dataset to be synchronized. The change type of the dataset to be synchronized in each target database is compared with the preset operation level corresponding to each change type to obtain the operation level of the dataset to be synchronized in each target database for the change type. According to the calculation formula This yields the synchronization priority value of the dataset to be synchronized in each target database. G i Z i W i These represent the importance level of the dataset to be synchronized in each target database, the operation level of the change type, and the data volume changed, respectively, where n represents the number of target databases. , , These are the importance level of the changed location, the operation level of the changed type, and the weight factor corresponding to the changed data volume, respectively.
5. The method of claim 4, wherein, The load information includes CPU utilization, memory utilization, and network traffic.
6. The multi-scenario application real-time database data synchronization method according to claim 5, characterized in that, The analysis of the synchronization patterns of each dataset to be synchronized in each database to be synchronized is described in detail below: Obtain the change location and change type of each dataset to be synchronized in its source database. From this, determine the importance level of the change location and the operation level of the change type for each dataset in its source database. Also, obtain the change data volume for each dataset in its source database. Calculate the change safety value for each dataset, denoted as [value to be filled in]. j represents the number corresponding to each dataset to be synchronized, j=1,2......m; Based on the transmission rate between the source database and each database to be synchronized for each dataset, calculate the stable transmission value between the source database and each database to be synchronized for each dataset, denoted as F. jg g represents the number corresponding to each database to be synchronized, g=1,2......y; Based on the load information of each dataset to be synchronized and its corresponding database, the performance impact factor of each dataset to be synchronized and its corresponding database is calculated, denoted as k. jg Therefore, substitute this into the formula for calculating the transmission security value. In this process, the transmission security value between the source database and each database to be synchronized is obtained for each dataset to be synchronized. Where e represents the natural constant, The correction factor corresponding to the set transmission security value; The transmission security value between the source database and each database to be synchronized is compared with the transmission security value range corresponding to each preset synchronization mode to obtain the synchronization mode between the source database and each database to be synchronized, which is used as the synchronization mode of each dataset in each database to be synchronized.
7. The method of claim 6, wherein, The formula for calculating the change security value corresponding to each dataset to be synchronized is as follows: ,in , , , Let G, Z, and W represent the change security value, the importance level of the change location in its source database, the operation level of the change type, and the change data volume for the j-th dataset to be synchronized, respectively. Let G, Z, and W be the set reference importance level, reference operation level, and reference change data volume, respectively. , These are the weighting factors corresponding to the set importance level and operation level, respectively. The correction factor corresponding to the set change security value.
8. The method of claim 6, wherein, The formula for calculating the transmission stability value between the source database and each database to be synchronized is as follows: ,in This represents the transmission rate between the source database corresponding to the j-th dataset to be synchronized and the g-th dataset to be synchronized, where v is the set reference transmission rate. This is the correction factor corresponding to the set transmission stability value.
9. The method of claim 6, wherein, The formula for calculating the performance impact factor of each dataset to be synchronized and corresponding to each database to be synchronized is as follows: ,in , , These represent the CPU utilization, memory utilization, and network traffic of the j-th dataset to be synchronized, corresponding to the g-th database to be synchronized. , , These are the set standard CPU utilization, standard memory utilization, and standard network traffic, respectively. , , These are the weighting factors for the set CPU utilization, memory utilization, and network traffic, respectively.
Citation Information
Patent Citations
Cross-room database synchronization method and system
CN103778136A
Data synchronization method, device and system
CN107040578A