A cloud database migration method based on incremental synchronization
By constructing an association integral matrix and using Volterra filters to smooth the event rate, and combining Shur complement decomposition and Bellman optimal equations to optimize the transmission rate, the migration efficiency and consistency issues in the cloud environment are solved, achieving efficient utilization of bandwidth resources and effective adjudication of cross-node transaction conflicts.
Patent Information
- Application Number
- CN202611376616.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-24
AI Technical Summary
In complex cloud environments, existing incremental synchronization schemes struggle to balance migration efficiency and data consistency. This is especially true in cloud networks with multi-tenant sharing and time-varying link jitter, where traditional methods struggle to obtain accurate bandwidth equivalent parameters, leading to wasted bandwidth resources or transmission congestion. Furthermore, cross-node transaction conflicts frequently occur in distributed multi-replica target architectures.
The event logs are parsed by a log collection agent, the correlation integral matrix is constructed and the phase space parameters are solved, and the event rate is smoothed using a Volterra filter. The bandwidth state transition probability matrix is constructed, the Markov steady-state distribution is solved by Shur complement decomposition, the spatiotemporal domain is discretized and the Bellman optimal equation is constructed to obtain the real-time optimal transmission rate. Based on the event primary key partitioning and the optimal rate calculation, the storage topology potential weight is constructed, and the conflict is adjudicated by the gray number decision and the execution sequence is generated.
It adapts to time-varying jitter in cloud network links, improves bandwidth resource utilization, reduces transmission queue congestion, reduces data consistency risks caused by cross-node transaction conflicts, and enables efficient cloud database migration.
Smart Images

Figure CN123157689A_ABST
Abstract
Description
Technical Field
[0001] This invention pertains to the field of database migration technology, specifically a cloud database migration method based on incremental synchronization. Background Technology
[0002] As enterprises accelerate their digital transformation and cloud migration, incremental synchronization migration of cloud databases is an important technology to ensure uninterrupted business migration. Current mainstream incremental synchronization solutions achieve data synchronization through database log parsing and multi-channel parallel transmission, but they have many problems in complex cloud environments, making it difficult to maintain migration efficiency and data consistency. Cloud networks are characterized by multi-tenant sharing and link time-varying jitter. Traditional bandwidth steady-state analysis methods for solving Markov steady-state distributions have high computational complexity and are difficult to obtain accurate bandwidth equivalent parameters. Transmission traffic scheduling can only be controlled through simple feedback, which cannot balance transmission efficiency and queue stability in bandwidth fluctuation scenarios, and is prone to bandwidth resource waste or transmission congestion. In the distributed multi-replica target architecture, cross-node transaction conflicts occur frequently, which is difficult to adapt to the scenario of incomplete indicator information and fluctuating values in the distributed environment, and the conflict resolution strategy is not adaptable enough. Therefore, a cloud database migration method based on incremental synchronization is needed to solve the above problems. Summary of the Invention
[0003] To address the technical problems mentioned in the background, this invention provides a cloud database migration method based on incremental synchronization.
[0004] The objective of this invention can be achieved through the following technical solutions: This invention provides a cloud database migration method based on incremental synchronization, comprising the following steps: Step 1: The log collection agent connects to the database's native log protocol, pulls and parses event logs, constructs the correlation integral matrix and solves the phase space parameters, constructs an extended input vector to drive Volterra filtering, and outputs pure incremental events and smoothed event rate sequences through Gaussian kernel smoothing. Step 2: Construct the bandwidth state transition probability matrix, solve the Markov steady-state distribution through Shur complement decomposition to obtain the steady-state bandwidth equivalent coefficient and fluctuation, discretize the spatiotemporal domain and construct the Bellman optimal equation, solve the optimal control law matrix through Gauss-Seidel value iteration, and obtain the real-time optimal transmission rate by interpolation. Step 3: Divide the pure incremental events into first-level fragments according to the primary key, split the second-level fragments based on the granularity threshold calculated by the optimal sending rate, construct the storage topology calculation node topology potential weight, determine the event priority through the gray number attribute, and generate an execution sequence and send it to the database after resolving conflicts.
[0005] In this application, based on step one, the log collection agent connects to the database's native log protocol, pulls and parses event logs, constructs a correlation integral matrix and solves for phase space parameters, constructs an extended input vector to drive Volterra filtering, and smooths the output of pure incremental events and smoothed event rate sequences using a Gaussian kernel. The specific steps are as follows: Establish a connection between the log collection agent and the database's native log protocol, stream and parse the event logs according to a fixed sampling period, and map each event log to a structured event tuple. The structured event tuple includes event ID, operation type, event core rate sequence, write operation event ratio, average number of operation rows per event, and event rollback rate. Based on the core rate sequence of the event, an association integral matrix is constructed, where rows correspond to different time window scales and columns correspond to different delay times. The column difference vector and row variance vector of the association integral matrix are obtained respectively. The delay time corresponding to the extreme point of the difference is the optimal delay time, and the embedding dimension corresponding to the minimum value of the variance is the optimal embedding dimension. The core rate sequence of the event is then subjected to delay embedding based on the optimal delay time and the optimal embedding dimension to obtain the phase point sequence in the phase space. A preset sliding time window is extracted, and a phase space trajectory matrix is constructed based on the preset sliding time window and the phase point sequence, where each row of the matrix corresponds to a phase point vector. Perform truncated singular value decomposition on the phase space trajectory matrix to obtain a clean space and a noisy space. Project the phase space trajectory matrix onto the clean space to obtain the effective trajectory matrix. An extended input vector ZS is established based on each phase point of the effective trajectory matrix, and its calculation logic is as follows: Where vec is the matrix vectorization operator, which stacks the matrix phase points column-wise into a vector, YS is the phase point, t is the time point, and T is the transpose of the phase point. The extended input vector is embedded into a Volterra filter to obtain the log sequence filtering model YR, whose construction logic is as follows: Where WE is the matrix representation of the Volterra filter, the tuples of each log structured event are input into the log sequence filtering model for filtering to obtain pure incremental events. The pure incremental events are then smoothed using a Gaussian kernel to obtain a smoothed event arrival rate sequence. The calculation logic is as follows: Where K is the Gaussian kernel function, To smooth the event arrival rate sequence, h is the smoothing bandwidth. For continuous integration, yc is the pure incremental event, r is the integration dummy variable, and tc is the current time.
[0006] In this application, based on step two, the bandwidth state transition probability matrix is constructed, the Markov steady-state distribution is solved through Shure complement decomposition to obtain the steady-state bandwidth equivalent coefficient and fluctuation, the spatiotemporal domain is discretized and the Bellman optimal equation is constructed, the optimal control law matrix is solved through Gauss-Seidel value iteration, and the real-time optimal transmission rate is obtained by table lookup interpolation. The specific steps are as follows: Maximum bandwidth of the link Generate bandwidth range for the upper limit The available bandwidth is evenly divided into several intervals, each interval corresponding to a bandwidth state. A bandwidth observation sequence is collected at several consecutive time points, and the number of transitions between broadband states in the sequence is counted to construct a bandwidth state transition frequency matrix. The bandwidth state transition frequency matrix is normalized row by row to obtain the Markov state transition probability matrix. Matching the bandwidth state transition frequency matrix with a smoothed event arrival rate sequence yields an arrival rate-bandwidth correlation matrix. Each row of this matrix stores the average event arrival rate and arrival rate variance for the corresponding bandwidth state. The Markov state transition probability matrix is transposed and then subtracted from the identity matrix to obtain the initial coefficient matrix. The last row of this initial coefficient matrix is replaced with a row vector of all ones to embed probability normalization constraints, generating a non-singular coefficient matrix. This non-singular coefficient matrix A is then divided into several block structures to obtain a block matrix. The block matrix includes... It is a strip-shaped main block. The scalar element in the bottom right corner. and The matrix is divided into edge column vectors and row vectors respectively; then the Shure complement (SD) of this block matrix is calculated, and the calculation logic is as follows: The tail component of the steady-state vector is solved using Schur complement. Its calculation logic is as follows: The tail component is embedded into the back-substitution equation to solve for the head component AJ. The calculation logic is as follows: The tail component and the head component are concatenated to obtain the steady-state distribution vector. Based on the steady-state distribution vector, the steady-state bandwidth equivalence coefficient and the steady-state bandwidth fluctuation variance are calculated. The calculation logic is as follows: , Where N is the total number of states in the bandwidth state space, i is the state number, MN is the steady-state distribution vector corresponding to the bandwidth state, bc is the central bandwidth value of the broadband state, and PS is the steady-state bandwidth equivalence coefficient. The variance of steady-state bandwidth fluctuation; The total migration time domain is discretized into several time slots, each time slot is matched with the arrival rate of events in the corresponding time period, the feasible range of the current transmission queue length is uniformly discretized into several state levels, a queue state set is generated, and the value matrix and optimal control law matrix corresponding to the number of rows and columns, the number of time slots, and the queue state set are constructed respectively. The feasible transmission rate range is discretized into several rate levels to form a candidate rate set. Using the steady-state bandwidth equivalence coefficient and steady-state bandwidth fluctuation variance, the corrected queue diffusion coefficient is calculated for any candidate rate and queue state. The calculation logic is as follows: ,in For queue status, the fluctuation amplitude of queue length change within a single time slot is obtained through the queue diffusion coefficient. Its calculation logic is as follows: ,in For a single time slot duration, obtain the maximum and minimum values of the fluctuation amplitude, generate the fluctuation interval, obtain the cumulative probability of the queue state falling within the fluctuation interval, and obtain the transition probability after normalization. Iterate through all queue states to generate the queue state transition probability matrix under the corresponding candidate rate. The expected cost of the current successor is obtained based on the queue state transition probability matrix and the value matrix at the next time step. The calculation logic is as follows: Where k is the time slot index, m is the state number that the next time slot queue may transition to, r is the current candidate transmission rate, and M is the total number of states that the next time slot queue may transition to. This is the queue state transition probability matrix. Using the elements of the value matrix, the Bellman optimality equation is constructed through the current and subsequent expected costs. Its calculation logic is as follows: ,in The set of candidate rates is LS, where LS is the instantaneous cost per time slot. Based on the Gauss-Seidel value iterative algorithm, starting from the last time slot, it iterates backward through all time slots, updating the value and control law of each state in ascending order of queue state index. Specifically, it iterates through all rate levels in the candidate rate set and calculates the total expected cost for each rate. It selects the rate level corresponding to the minimum cost and updates the control law matrix, then assigns the minimum cost to the value matrix. The updated queue state uses the latest value of the current time slot, while the unupdated queue state uses the historical value of the previous iteration. After each complete update of all time slots, it calculates the maximum absolute difference between the value matrices of the two iterations. When the difference is less than a preset convergence threshold, it is determined that the iteration has converged, and the optimal control law matrix is output. The optimal control law matrix is used to query the rate values of adjacent states in the corresponding time slot, and linear interpolation is performed on the rate values of adjacent states to obtain the real-time optimal transmission rate.
[0007] In this application, based on step three, the pure incremental events are divided into primary fragments according to the primary key, and secondary fragments are split based on the granularity threshold calculated according to the optimal sending rate. The storage topology calculation node topology potential weight is constructed, and the event priority is determined through multi-attribute decision-making using the gray number. After resolving conflicts, an execution sequence is generated and sent to the database. The events are then migrated to the target database. The specific steps are as follows: The pure incremental event set is divided into first-level fragments according to the primary key range of the data table, and then the second-level fragment granularity threshold Sth is obtained based on the optimal sending rate. The calculation logic is as follows: Where rc is the real-time optimal transmission rate. For a single frame transmission period, N is the total number of parallel transmission channels. The first-level fragment is split into multiple fragments. When the cumulative data volume of a single fragment reaches the second-level fragment granularity threshold, the fragment encapsulation is completed to obtain each second-level fragment. Several logical transmission channels are constructed and corresponding static weights are configured. An equivalent bandwidth rs is allocated to each logical channel based on the optimal transmission rate and the static weight. The calculation logic is as follows: Where we is the static weight, the weight value is positively correlated with the service priority carried by the channel, and WF is the total weight of all channels. The secondary shards are allocated to each logical channel for transmission based on the weighted round-robin scheduling algorithm. At the intermediate node of the logical channel, the secondary shards are adapted to the target database, including field type mapping, SQL syntax paradigm conversion and event dimension reorganization, to generate a queue of executable change statements for the target database. Using each storage center in the target database as a storage node and the synchronization links between storage nodes as storage edges, a storage relationship topology graph is established. Based on the storage relationship topology graph, the topological potential of each storage node is obtained. The calculation logic is as follows: Where g1 and g2 are the numbers of different storage nodes, G is the total number of storage nodes, mc is the intrinsic mass of the corresponding node, dw is the shortest path distance between nodes, tc is the topological potential influence factor, which is used to regulate the scope of the node's influence, and e is a constant; the topological potential of each storage node is normalized to obtain the node influence weight. Based on the change statement queue, conflict identification and detection are performed to obtain a set of conflict resolution candidates, including row-level write conflicts and event dependency conflicts; The number of data rows and related tables involved in the event are quantified to obtain the data impact scope attribute. The execution time of the event is obtained to obtain the execution cost attribute. The business importance level corresponding to the event is quantified to obtain the business priority attribute. The data impact scope attribute, execution cost attribute and business priority attribute are normalized and represented by gray numbers to form a gray number decision matrix. Using the column vectors of the gray number decision matrix as attribute sequences, the nullification image sequences corresponding to any two attributes in the attribute sequences are calculated respectively. Based on the two nullification image sequences, the corresponding integral area features are obtained. The calculation logic is as follows: , Where MF is the nullification image sequence, and Let be the attribute number, b be the event number, B be the total length of the attribute sequence, and SG be the integral area feature. The gray absolute correlation degree of the corresponding attribute is obtained through the integral area feature, and its calculation logic is as follows: Attributes with an absolute gray correlation greater than a preset correlation threshold are fused to obtain a gray-scale attribute matrix; The upper bound maximum value of the corresponding attribute for all events in the gray-scale attribute matrix is taken as the positive ideal bullseye, and the lower bound minimum value is taken as the negative ideal bullseye. Based on the node influence weight, the distance from the corresponding event to the positive ideal bullseye and the distance from the event to the negative ideal bullseye are obtained respectively, thus obtaining the positive ideal distance and the negative ideal distance. The conflict proximity degree (TC) of each event is calculated based on the positive ideal distance and the negative ideal distance. The calculation logic is as follows: ,in The negative ideal distance To obtain the ideal distance, all conflict events are sorted from largest to smallest according to their sudden proximity, resulting in a conflict event priority sequence. In row-level write conflicts, the event with the highest priority is granted execution rights and written to the database first. In event dependency conflicts, if the subsequent event has a higher priority than the predecessor event, the execution of the subsequent event is suspended and waited for the predecessor event to be completed before it is released. This generates an event execution sequence, which is then sent to the database. The secondary shards are migrated to the target database according to the event execution sequence.
[0008] Compared with the prior art, the beneficial effects of the present invention are: Based on the Shur complement decomposition to solve the Markov bandwidth steady-state distribution, the equivalent coefficient of steady-state bandwidth and the fluctuation variance are obtained to adapt to the time-varying jitter characteristics of cloud network links; based on the discrete time and space domain, the Bellman optimal equation is constructed, and the optimal control law matrix is solved by Gauss-Seidel value iteration to achieve global optimal dynamic control of the transmission rate, thereby improving bandwidth resource utilization and reducing transmission queue congestion. Based on the incompleteness and volatility of indicator information in a distributed environment, multi-attribute decision processing based on gray relational attributes fusion and gray target proximity sorting is used to complete the priority adjudication of conflicting transactions, resolve row-level write conflicts and transaction dependency conflicts, and reduce the data consistency risk caused by cross-node transaction conflicts. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. The following drawings are not drawn to scale according to the actual size, but are intended to illustrate the main idea of the present invention.
[0010] Figure 1 This is a diagram illustrating the method steps of the present invention. Detailed Implementation
[0011] The technical solutions in 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 also within the scope of protection of the present invention.
[0012] Please refer to Figure 1 As shown, this invention provides a cloud database migration method based on incremental synchronization, comprising the following steps: Step 1: The log collection agent connects to the database's native log protocol, pulls and parses event logs, constructs the correlation integral matrix and solves the phase space parameters, constructs an extended input vector to drive Volterra filtering, and outputs pure incremental events and smoothed event rate sequences through Gaussian kernel smoothing. Step 2: Construct the bandwidth state transition probability matrix, solve the Markov steady-state distribution through Shur complement decomposition to obtain the steady-state bandwidth equivalent coefficient and fluctuation, discretize the spatiotemporal domain and construct the Bellman optimal equation, solve the optimal control law matrix through Gauss-Seidel value iteration, and obtain the real-time optimal transmission rate by interpolation. Step 3: Divide the pure incremental events into first-level fragments according to the primary key, split the second-level fragments based on the granularity threshold calculated by the optimal sending rate, construct the storage topology calculation node topology potential weight, determine the event priority through the gray number attribute, and generate an execution sequence and send it to the database after resolving conflicts.
[0013] In this application, based on step one, the log collection agent connects to the database's native log protocol, pulls and parses event logs, constructs a correlation integral matrix and solves for phase space parameters, constructs an extended input vector to drive Volterra filtering, and smooths the output of pure incremental events and smoothed event rate sequences using a Gaussian kernel. The specific steps are as follows: Establish a connection between the log collection agent and the database's native log protocol, stream and parse the event logs according to a fixed sampling period, and map each event log to a structured event tuple. The structured event tuple includes event ID, operation type, event core rate sequence, write operation event ratio, average number of operation rows per event, and event rollback rate. Based on the core rate sequence of the event, an association integral matrix is constructed, where rows correspond to different time window scales and columns correspond to different delay times. The column difference vector and row variance vector of the association integral matrix are obtained respectively. The delay time corresponding to the extreme point of the difference is the optimal delay time, and the embedding dimension corresponding to the minimum value of the variance is the optimal embedding dimension. The core rate sequence of the event is then subjected to delay embedding based on the optimal delay time and the optimal embedding dimension to obtain the phase point sequence in the phase space. A preset sliding time window is extracted, and a phase space trajectory matrix is constructed based on the preset sliding time window and the phase point sequence, where each row of the matrix corresponds to a phase point vector. Perform truncated singular value decomposition on the phase space trajectory matrix to obtain a clean space and a noisy space. Project the phase space trajectory matrix onto the clean space to obtain the effective trajectory matrix. An extended input vector ZS is established based on each phase point of the effective trajectory matrix, and its calculation logic is as follows: Where vec is the matrix vectorization operator, which stacks the matrix phase points column-wise into a vector, YS is the phase point, t is the time point, and T is the transpose of the phase point. The extended input vector is embedded into a Volterra filter to obtain the log sequence filtering model YR, whose construction logic is as follows: Where WE is the matrix representation of the Volterra filter, the tuples of each log structured event are input into the log sequence filtering model for filtering to obtain pure incremental events. The pure incremental events are then smoothed using a Gaussian kernel to obtain a smoothed event arrival rate sequence. The calculation logic is as follows: Where K is the Gaussian kernel function, To smooth the event arrival rate sequence, h is the smoothing bandwidth. For continuous integration, yc is the pure incremental event, r is the integration dummy variable, and tc is the current time.
[0014] In this application, based on step two, the bandwidth state transition probability matrix is constructed, the Markov steady-state distribution is solved through Shure complement decomposition to obtain the steady-state bandwidth equivalent coefficient and fluctuation, the spatiotemporal domain is discretized and the Bellman optimal equation is constructed, the optimal control law matrix is solved through Gauss-Seidel value iteration, and the real-time optimal transmission rate is obtained by table lookup interpolation. The specific steps are as follows: It should be noted that, in view of the characteristics of multi-tenant sharing and time-varying jitter of cloud networks, the transmission link is periodically sampled, the continuous bandwidth space is discretized into a finite set of states, and a normalized probability transition matrix is constructed by statistically analyzing the state transition frequency, which provides a matrix basis for steady-state solution. Maximum bandwidth of the link Generate bandwidth range for the upper limit The available bandwidth is evenly divided into several intervals, each interval corresponding to a bandwidth state. A bandwidth observation sequence is collected at several consecutive time points, and the number of transitions between broadband states in the sequence is counted to construct a bandwidth state transition frequency matrix. The bandwidth state transition frequency matrix is normalized row by row to obtain the Markov state transition probability matrix. Matching the bandwidth state transition frequency matrix with a smoothed event arrival rate sequence yields an arrival rate-bandwidth correlation matrix. Each row of this matrix stores the average event arrival rate and arrival rate variance for the corresponding bandwidth state. The Markov state transition probability matrix is transposed and then subtracted from the identity matrix to obtain the initial coefficient matrix. The last row of this initial coefficient matrix is replaced with a row vector of all ones to embed probability normalization constraints, generating a non-singular coefficient matrix. This non-singular coefficient matrix A is then divided into several block structures to obtain a block matrix. The block matrix includes... It is a strip-shaped main block. The scalar element in the bottom right corner. and The matrix is divided into edge column vectors and row vectors respectively; then the Shure complement (SD) of this block matrix is calculated, and the calculation logic is as follows: The tail component of the steady-state vector is solved using Schur complement. Its calculation logic is as follows: The tail component is embedded into the back-substitution equation to solve for the head component AJ. The calculation logic is as follows: The tail component and the head component are concatenated to obtain the steady-state distribution vector. Based on the steady-state distribution vector, the steady-state bandwidth equivalence coefficient and the steady-state bandwidth fluctuation variance are calculated. The calculation logic is as follows: , Where N is the total number of states in the bandwidth state space, i is the state number, MN is the steady-state distribution vector corresponding to the bandwidth state, bc is the central bandwidth value of the broadband state, and PS is the steady-state bandwidth equivalence coefficient. The variance of steady-state bandwidth fluctuation; The total migration time domain is discretized into several time slots, and each time slot is matched with the arrival rate of events in the corresponding time period. The feasible range of the current transmission queue length is uniformly discretized into several state levels to generate a queue state set. The value matrix and optimal control law matrix corresponding to the number of rows and columns, the number of time slots, and the queue state set are constructed respectively. It should be noted that the value matrix is used to store the minimum expected total cost from the current time to the end of scheduling under the corresponding time slot and the corresponding queue length, and the optimal control law matrix is used to store the optimal transmission rate under the corresponding time slot and the corresponding queue length. The feasible transmission rate range is discretized into several rate levels to form a candidate rate set. Using the steady-state bandwidth equivalence coefficient and steady-state bandwidth fluctuation variance, the corrected queue diffusion coefficient is calculated for any candidate rate and queue state. The calculation logic is as follows: ,in For queue status, the fluctuation amplitude of queue length change within a single time slot is obtained through the queue diffusion coefficient. Its calculation logic is as follows: ,in For a single time slot duration, obtain the maximum and minimum values of the fluctuation amplitude, generate the fluctuation interval, obtain the cumulative probability of the queue state falling within the fluctuation interval, and obtain the transition probability after normalization. Iterate through all queue states to generate the queue state transition probability matrix under the corresponding candidate rate. The expected cost of the current successor is obtained based on the queue state transition probability matrix and the value matrix at the next time step. The calculation logic is as follows: Where k is the time slot index, m is the state number that the next time slot queue may transition to, r is the current candidate transmission rate level, and M is the total number of states that the next time slot queue may transition to. This is the queue state transition probability matrix. Using the elements of the value matrix, the Bellman optimality equation is constructed through the current and subsequent expected costs. Its calculation logic is as follows: ,in Let LS be the candidate rate set, and LS be the instantaneous cost per time slot. It should be noted that the instantaneous cost is calculated by the queue backlog penalty term, the penalty term for the transmission rate deviating from the steady-state reference, and the penalty term for the magnitude of the transmission rate change. Based on the Gauss-Seidel value iterative algorithm, starting from the last time slot, it iterates backward through all time slots, updating the value and control law of each state in ascending order of queue state index. Specifically, it iterates through all rate levels in the candidate rate set and calculates the total expected cost for each rate. It selects the rate level corresponding to the minimum cost and updates the control law matrix, then assigns the minimum cost to the value matrix. The updated queue state uses the latest value of the current time slot, while the unupdated queue state uses the historical value of the previous iteration. After each complete update of all time slots, it calculates the maximum absolute difference between the value matrices of the two iterations. When the difference is less than a preset convergence threshold, it is determined that the iteration has converged, and the optimal control law matrix is output. The optimal control law matrix is used to query the rate values of adjacent states in the corresponding time slot, and linear interpolation is performed on the rate values of adjacent states to obtain the real-time optimal transmission rate.
[0015] In this application, based on step three, the pure incremental events are divided into primary fragments according to the primary key, and secondary fragments are split based on the granularity threshold calculated according to the optimal sending rate. The storage topology calculation node topology potential weight is constructed, and the event priority is determined through multi-attribute decision-making using the gray number. After resolving conflicts, an execution sequence is generated and sent to the database. The events are then migrated to the target database. The specific steps are as follows: The pure incremental event set is divided into first-level fragments according to the primary key range of the data table, and then the second-level fragment granularity threshold Sth is obtained based on the optimal sending rate. The calculation logic is as follows: Where rc is the real-time optimal transmission rate. For a single frame transmission period, N is the total number of parallel transmission channels. The first-level fragment is split into multiple fragments. When the cumulative data volume of a single fragment reaches the second-level fragment granularity threshold, the fragment encapsulation is completed to obtain each second-level fragment. Several logical transmission channels are constructed and corresponding static weights are configured. An equivalent bandwidth rs is allocated to each logical channel based on the optimal transmission rate and the static weight. The calculation logic is as follows: Where we is the static weight, the weight value is positively correlated with the service priority carried by the channel, and WF is the total weight of all channels. The secondary shards are allocated to each logical channel for transmission based on the weighted round-robin scheduling algorithm. At the intermediate node of the logical channel, the secondary shards are adapted to the target database, including field type mapping, SQL syntax paradigm conversion and event dimension reorganization, to generate a queue of executable change statements for the target database. Using each storage center in the target database as a storage node and the synchronization links between storage nodes as storage edges, a storage relationship topology graph is established. Based on the storage relationship topology graph, the topological potential of each storage node is obtained. The calculation logic is as follows: Where g1 and g2 are the numbers of different storage nodes, G is the total number of storage nodes, mc is the intrinsic mass of the corresponding node, dw is the shortest path distance between nodes, tc is the topological potential influence factor, which is used to regulate the scope of the node's influence, and e is a constant; the topological potential of each storage node is normalized to obtain the node influence weight. Based on the change statement queue, conflict identification and detection are performed to obtain a set of conflict resolution candidates, including row-level write conflicts and event dependency conflicts. It should be noted that row-level write conflicts are when different events perform update and delete operations on the same primary key row, which poses a risk of data overwriting. Event dependency conflicts are when events with causal dependencies arrive out of order across nodes, which disrupts execution consistency. The number of data rows and related tables involved in the event are quantified to obtain the data impact scope attribute. The execution time of the event is obtained to obtain the execution cost attribute. The business importance level corresponding to the event is quantified to obtain the business priority attribute. The data impact scope attribute, execution cost attribute and business priority attribute are normalized and represented by gray numbers to form a gray number decision matrix. It should be noted that the business priority attribute is a qualitative-to-quantitative indicator of the business dimension. It is quantified and scored according to the importance level of the business line to which the transaction belongs, including core transactions, general business, and log backups, and is usually mapped to a continuous or discrete numerical range. The data impact scope attribute is a quantitative indicator of the data dimension. It is a weighted composite of two dimensions: the number of rows changed by the transaction and the number of related data tables. The more rows the transaction covers and the more complex the cross-table relationships, the wider the scope of data and business links will be affected if a conflict occurs and rollback or execution fails. The execution cost attribute is a quantitative indicator of the performance dimension. It is represented by the estimated execution time of the transaction and corresponds to the lock occupation time during database execution. Transactions with higher execution costs are considered to have higher execution costs. Using the column vectors of the gray number decision matrix as attribute sequences, the nullification image sequences corresponding to any two attributes in the attribute sequences are calculated respectively. Based on the two nullification image sequences, the corresponding integral area features are obtained. The calculation logic is as follows: , Where MF is the nullification image sequence, and Let be the attribute number, b be the event number, B be the total length of the attribute sequence, and SG be the integral area feature. The gray absolute correlation degree of the corresponding attribute is obtained through the integral area feature, and its calculation logic is as follows: Attributes with an absolute gray correlation greater than a preset correlation threshold are fused to obtain a gray-scale attribute matrix; The upper bound maximum value of the corresponding attribute for all events in the gray-scale attribute matrix is taken as the positive ideal bullseye, and the lower bound minimum value is taken as the negative ideal bullseye. Based on the node influence weight, the distance from the corresponding event to the positive ideal bullseye and the distance from the event to the negative ideal bullseye are obtained respectively, thus obtaining the positive ideal distance and the negative ideal distance. The conflict proximity degree (TC) of each event is calculated based on the positive ideal distance and the negative ideal distance. The calculation logic is as follows: ,in The negative ideal distance The ideal distance; The larger the value, the closer the event is to the ideal state, and the higher the priority. All conflicting events are sorted from largest to smallest according to their proximity to obtain the conflicting event priority sequence. In row-level write conflicts, the event with the highest priority is given the right to execute and is written to the database first. In event dependency conflicts, if the subsequent event has a higher priority than the predecessor event, the execution of the subsequent event is suspended and waited for the predecessor event to be completed before it is released. This generates an event execution sequence, which is then sent to the database. The secondary shards are migrated to the target database according to the event execution sequence. It should be noted that a preceding event is an event that must be executed first in the business logic. Its execution result is a prerequisite for the normal operation of another event, such as main table data insertion, account opening, and order creation events. A subsequent event is an event that depends on the execution result of the preceding event to be legally executed. It must be started after the preceding event has been executed, such as detail table data insertion, account recharge, and order payment events.
[0016] The above formulas all use dimensionless numerical calculations, which can be achieved through standardization, normalization, etc., and will not be elaborated here. The relevant expressions are obtained by collecting a large amount of die-cut product defect detection and polarization imaging working condition data and then performing simulation fitting, which closely reflects the actual production line operation status. The preset parameters in the formulas can be set by those skilled in the art according to the die-cut product type, production line speed and imaging environment.
[0017] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented as a computer program product, which contains one or more computer-executable instructions. When the instructions are loaded and run on a computing device, they fully or partially implement the processes and functions described in this invention. The device includes an industrial camera controller, an edge computing computer, a production line PLC, or a cloud computing platform. The instructions can be stored on a computer-readable storage medium or transmitted between devices via wired / wireless means. The readable storage medium includes industrial-grade storage media such as solid-state drives, USB flash drives, memory cards, hard disks, and optical discs.
[0018] The above formulas all use dimensionless numerical calculations, which can be achieved through standardization, normalization, etc., and will not be elaborated here. The relevant expressions are obtained by collecting a large amount of cloud database incremental synchronization and link bandwidth fluctuation data and then performing simulation fitting, which closely reflects the actual cloud environment operation. The preset parameters in the formulas can be set by those skilled in the art according to the cluster size, link bandwidth, business data volume and database type.
[0019] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented as a computer program product, which contains one or more computer-executable instructions. When loaded and executed on a computing device, the instructions fully or partially implement the processes and functions described in this invention. The device includes a source log collection agent, a synchronization gateway server, a cloud database node, a migration management platform, etc. The instructions can be stored on a computer-readable storage medium or transmitted between devices via wired / wireless means. Readable storage media include solid-state drives, USB flash drives, memory cards, disks, optical discs, cloud storage servers, and other available storage media.
[0020] The execution order of each process in this invention is based on functional and logical relationships, and is not limited by the number of the sequence. Those skilled in the art will understand that the units and algorithm steps described in this invention can be implemented using electronic hardware or a combination of hardware and software, and appropriate implementation methods can be selected for specific application scenarios, all of which are within the scope of protection of this invention.
[0021] The methods and systems disclosed in this invention can also be implemented in other non-illustrative ways. The unit division is only a logical functional division; other division methods can be used in practice. Multiple units or components can be combined or integrated, and some features can be omitted. The coupling and connection between units can be indirect, and can be electrical, network communication, or other forms.
[0022] The units described as separate components can be physically separated or not. The components shown as units can be physical units or distributed across multiple network nodes. Some or all units can be selected to achieve the purpose of the solution based on actual migration requirements.
[0023] If the functions of this invention are implemented as software functional units and sold or used as a product, they can be stored in a computer-readable storage medium. This software product includes several instructions for driving a database synchronization device, migration control node, or cloud server to execute all or part of the steps of this invention. The storage medium includes solid-state drives, flash drives, portable hard drives, read-only memory, random access memory, cloud storage resources, and other media capable of storing program code.
[0024] The above description is merely a specific embodiment of the present invention, but the scope of protection is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this invention should be included within the scope of protection. Therefore, the scope of protection is determined by the claims.
Claims
1. A cloud database migration method based on incremental synchronization, characterized in that, Includes the following steps: Step 1: The log collection agent connects to the database's native log protocol, pulls and parses event logs, constructs the correlation integral matrix and solves the phase space parameters, constructs a log sequence filtering model, and outputs pure incremental events and smoothed event rate sequences through Gaussian kernel smoothing. Step 2: Construct the bandwidth state transition probability matrix, solve the Markov steady-state distribution through Shur complement decomposition to obtain the steady-state bandwidth equivalent coefficient and fluctuation, discretize the spatiotemporal domain and construct the Bellman optimal equation, solve the optimal control law matrix through Gauss-Seidel value iteration, and obtain the real-time optimal transmission rate by interpolation. Step 3: Divide the pure incremental events into first-level fragments according to the primary key, split the second-level fragments based on the granularity threshold calculated by the optimal sending rate, construct the storage topology calculation node topology potential weight, determine the event priority through the gray number attribute, and generate an execution sequence and send it to the database after resolving conflicts.
2. The cloud database migration method based on incremental synchronization according to claim 1, characterized in that, In step two, the bandwidth state transition probability matrix is constructed, and the Markov steady-state distribution is solved by Schur complement decomposition to obtain the steady-state bandwidth equivalent coefficient and fluctuation. The specific steps are as follows: A bandwidth range is generated with the nominal maximum bandwidth of the link as the upper limit. The currently available broadband is evenly divided into several intervals. A bandwidth observation sequence of several consecutive time points is collected, and the number of transitions between broadband states in the sequence is counted. A bandwidth state transition frequency matrix is constructed. The bandwidth state transition frequency matrix is normalized row by row to obtain the Markov state transition probability matrix. The bandwidth state transition frequency matrix is matched with a smoothed event arrival rate sequence to obtain an arrival rate-bandwidth correlation matrix. Each row of the matrix stores the average event arrival rate and arrival rate variance under the corresponding bandwidth state. The Markov state transition probability matrix is transposed and then the identity matrix is subtracted to obtain the initial coefficient matrix. The last row of the initial coefficient matrix is replaced with a row vector of all 1s to embed probability normalization constraints, generating a non-singular coefficient matrix. The non-singular coefficient matrix is divided into several block structures to obtain a block matrix. The Schur complement of the block matrix is calculated, and the tail component of the steady-state vector is solved by the Schur complement. The tail component is embedded into the back substitution equation to solve the head component. The tail component and the head component are concatenated to obtain the steady-state distribution vector. The steady-state bandwidth equivalence coefficient and steady-state bandwidth fluctuation variance are calculated based on the steady-state distribution vector.
3. The cloud database migration method based on incremental synchronization according to claim 2, characterized in that, In step two, the specific steps for discretizing the spatiotemporal domain and constructing the Bellman optimal equation are as follows: The total migration time domain is discretized into several time slots, each time slot is matched with the arrival rate of events in the corresponding time period, the feasible range of the current transmission queue length is uniformly discretized into several state levels, a queue state set is generated, and the value matrix and optimal control law matrix corresponding to the number of rows and columns, the number of time slots, and the queue state set are constructed respectively. The feasible transmission rate range is discretized into several rate levels to form a candidate rate set. For any candidate rate and queue state, the corrected queue diffusion coefficient is calculated using the steady-state bandwidth equivalent coefficient and steady-state bandwidth fluctuation variance. The fluctuation amplitude of the queue length change within a single time slot is obtained through the queue diffusion coefficient. The maximum and minimum values of the fluctuation amplitude are obtained to generate the fluctuation interval. The cumulative probability of the queue state falling within the fluctuation interval is obtained and normalized to obtain the transition probability. The queue state transition probability matrix under the corresponding candidate rate is generated by traversing all queue states. The current expected cost of the successor is obtained based on the queue state transition probability matrix and the value matrix at the next time step, and the Bellman optimality equation is constructed based on the current expected cost of the successor.
4. The cloud database migration method based on incremental synchronization according to claim 3, characterized in that, In step two, the optimal control law matrix is solved by Gauss-Seidel value iteration, and the real-time optimal transmission rate is obtained by table lookup interpolation. The specific steps are as follows: Based on the Gauss-Seidel value iterative algorithm, starting from the last time slot, all time slots are traversed backwards in reverse order. The value and control law of each state are updated sequentially in ascending order of queue state index. After each round of full time slot update, the maximum absolute difference between the value matrices of the two rounds is calculated. When the difference is less than the preset convergence threshold, the iteration is considered to have converged, and the optimal control law matrix is output. The rate value of the adjacent state in the corresponding time slot is queried through the optimal control law matrix, and the rate value of the adjacent state is linearly interpolated to obtain the real-time optimal transmission rate.
5. The cloud database migration method based on incremental synchronization according to claim 1, characterized in that, In step three, the pure incremental events are divided into first-level fragments according to the primary key, and second-level fragments are split based on the granularity threshold calculated according to the optimal sending rate. The storage topology calculation node topology potential weight is constructed. The specific steps are as follows: The pure incremental event set is divided into first-level fragments according to the primary key range of the data table. Then, the second-level fragment granularity threshold is obtained based on the optimal sending rate. The first-level fragments are split. When the cumulative data volume of a single fragment reaches the second-level fragment granularity threshold, the fragment encapsulation is completed to obtain each second-level fragment. Several logical transmission channels are constructed and corresponding static weights are configured. Equivalent bandwidth is allocated to each logical channel according to the optimal transmission rate and static weight. The weight value is positively correlated with the service priority carried by the channel. WF is the total weight of all channels. Secondary fragments are allocated to each logical channel for transmission based on the weighted round-robin scheduling algorithm. At the intermediate node of the logical channel, the secondary fragments are adapted to the target database to generate a queue of executable change statements for the target database. Using each storage center in the target database as a storage node and the synchronization link between storage nodes as a storage edge, a storage relationship topology graph is established. Based on the storage relationship topology graph, the topological potential of each storage node is obtained, and the topological potential of each storage node is normalized to obtain the node influence weight.
6. The cloud database migration method based on incremental synchronization according to claim 5, characterized in that, In step three, the event priority is determined through multi-attribute decision-making based on gray numbers. After resolving conflicts, an execution sequence is generated and distributed to the database. The event is then migrated to the target database. The specific steps are as follows: Based on the change statement queue, conflict identification and detection are performed to obtain a set of conflict resolution candidates, including row-level write conflicts and event dependency conflicts; The data impact scope attribute, execution cost attribute, and business priority attribute are normalized and represented by gray numbers to form a gray number decision matrix. Using the column vectors of the gray number decision matrix as attribute sequences, the null image sequences corresponding to any two attributes in the attribute sequences are calculated respectively. Based on the two null image sequences, the corresponding integral area feature is obtained. The gray absolute correlation degree of the corresponding attribute is obtained through the integral area feature. Attributes with gray absolute correlation degree greater than the preset correlation threshold are fused to obtain the gray number attribute matrix. The upper bound maximum value of the corresponding attribute of all events in the gray number attribute matrix is taken as the positive ideal bullseye, and the lower bound minimum value is taken as the negative ideal bullseye. Based on the node influence weight, the distance from the corresponding event to the positive ideal bullseye and the distance from the event to the negative ideal bullseye are obtained respectively, thus obtaining the positive ideal distance and the negative ideal distance. Based on the positive ideal distance and the negative ideal distance, the conflict proximity of each event is calculated. All conflict events are sorted from largest to smallest according to the proximity, thus obtaining the conflict event priority sequence. In row-level write conflicts, the event with the highest priority is granted execution rights and written to the database first. In event dependency conflicts, if the subsequent event has a higher priority than the predecessor event, the execution of the subsequent event is suspended and waited for the predecessor event to be completed before it is released. An event execution sequence is generated and sent to the database. The secondary shards are then migrated to the target database according to the event execution sequence.
7. The cloud database migration method based on incremental synchronization according to claim 1, characterized in that, In step one, the log collection agent connects to the database's native log protocol, pulls and parses event logs, constructs the correlation integral matrix, and solves for the phase space parameters. The specific steps are as follows: Establish a connection between the log collection agent and the database's native log protocol, stream and parse the event logs at a fixed sampling period, and map each event log to a structured event tuple; A correlation integral matrix is constructed based on the core rate sequence of the event, where rows correspond to different time window scales and columns correspond to different delay times. The column difference vector and row variance vector of the correlation integral matrix are obtained respectively. The delay time corresponding to the extreme point of the difference is taken as the optimal delay time, and the embedding dimension corresponding to the minimum value of the variance is taken as the optimal embedding dimension. The core rate sequence of the event is delayed and embedded based on the optimal delay time and the optimal embedding dimension to obtain the phase point sequence in the phase space. A preset sliding time window is extracted, and a phase space trajectory matrix is constructed based on the preset sliding time window and the phase point sequence.
8. The cloud database migration method based on incremental synchronization according to claim 7, characterized in that, In step one, an extended input vector is constructed to drive the Volterra filter, and a pure incremental event and a smoothed event rate sequence are output through Gaussian kernel smoothing. The specific steps are as follows: Perform truncated singular value decomposition on the phase space trajectory matrix to obtain a clean space and a noisy space. Project the phase space trajectory matrix onto the clean space to obtain the effective trajectory matrix. An extended input vector is established based on each phase point of the effective trajectory matrix. The extended input vector is embedded into a Volterra filter to obtain a log sequence filtering model. The structured event tuples of each log are input into the log sequence filtering model for filtering to obtain pure incremental events. The pure incremental events are then smoothed using Gaussian kernels to obtain a smooth event arrival rate sequence.
