A bidirectional incremental intelligent merging method in distributed storage fault recovery
By mapping operation sequences to a multidimensional spatiotemporal coordinate system in a distributed storage system, generating a multidimensional spatiotemporal operation point set and constructing a causal interference graph, the problem of insufficient semantic understanding of operation conflicts and rigid serialization of conflict resolution paths in existing technologies is solved, realizing an efficient and intelligent data merging process.
Patent Information
- Application Number
- CN202511180006.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-08-22
AI Technical Summary
Existing distributed storage systems suffer from insufficient semantic understanding of operational conflicts and rigid serialization of conflict resolution paths during fault recovery. This results in low levels of automation and intelligence in the data merging process, requiring costly manual intervention or incurring the risk of data value loss.
By mapping the operation sequence to a multidimensional spatiotemporal coordinate system, a multidimensional spatiotemporal operation point set is generated. By constructing a geometric causal cone and a causal interference spectrum, interference is analyzed and spatiotemporal folding paths are searched, enabling a deep semantic understanding and flexible avoidance of conflicts, and generating the optimal spatiotemporal folding scheme.
It improves the accuracy and automation of data merging, achieves deep semantic understanding and flexible avoidance of operational conflicts, enhances the intelligence level of data merging, and reduces the risk of human intervention and data value loss.
Smart Images

Figure CN120688017B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of distributed data management, and particularly to a bidirectional incremental intelligent merging method in distributed storage fault recovery. BACKGROUND
[0002] Distributed storage technology, by dispersing data storage on multiple independent physical nodes, achieves excellent scalability, high availability and fault tolerance, providing a stable and reliable data foundation for upper-layer applications. However, the physical dispersion of distributed systems also endogenously exposes them to fault risks such as network partitioning, node downtime, and communication delay jitter. When a fault occurs and is recovered, a core task is how to handle the incremental data updates generated on different nodes or partitions during this period, intelligently, efficiently and correctly merging these divergent operation sequences to make the entire system converge to a globally consistent data state. Therefore, researching and designing advanced incremental data merging methods have important theoretical value and practical significance for ensuring the robustness of distributed systems, maintaining the integrity of data assets, and ensuring business continuity.
[0003] Currently, a series of mainstream technical solutions have been formed in the industry to address the data merging problem in distributed systems. In simple scenarios, the Last-Writer-Wins (LWW) strategy based on physical timestamps is widely used, which is known for its ease of implementation, but it is prone to accidental loss of data updates due to its inability to address network latency and clock skew. To address this issue, researchers have introduced logical clocks, with Vector Clocks being a representative technology. Vector Clocks maintain a version vector for each node, which can accurately capture the partial order causal relationship between operations, effectively identifying write-write conflicts caused by concurrent operations. In the field of data synchronization, research on Conflict-free Replicated Data Types (CRDTs) has also made significant progress, which is divided into state-based CRDTs and operation-based CRDTs. The former guarantees the final convergence of states by defining a merge function with commutative, associative and idempotent properties; the latter requires operations to satisfy the commutative law, ensuring consistency by ensuring that all replicas execute the same set of operations. In addition, the Three-way merge algorithm derived from version control systems such as Git, by comparing two conflicting versions with a common ancestor version, also provides a mature approach to handling data divergence.
[0004] However, the above existing solutions still expose a series of deep technical limitations in dealing with complex conflict scenarios, especially in the deep semantic understanding of conflicts and the flexibility of resolution strategies. Specifically, they generally have semantic blindness problems for inter-operation interference, and rigid serialization problems in conflict resolution paths. SUMMARY
[0005] The application aims to provide a bidirectional incremental intelligent merging method in distributed storage fault recovery to solve the above problems existing in the prior art.
[0006] The application provides a bidirectional incremental intelligent merging method in distributed storage fault recovery, comprising:
[0007] Receiving local and remote incremental operation sequences, mapping the operation sequences to a multi-dimensional space-time coordinate system to generate a multi-dimensional space-time operation point set;
[0008] Based on the multi-dimensional space-time operation point set, constructing a geometric causal cone for each operation point, and constructing a causal interference graph by analyzing the interference between geometric causal cones;
[0009] According to the causal interference graph and the multi-dimensional space-time operation point set, searching for a space-time folding path to avoid or minimize causal conflicts to obtain an optimal space-time folding scheme;
[0010] Projecting the high-dimensional path in the optimal space-time folding scheme into a one-dimensional execution sequence, and executing to achieve consistent data state.
[0011] The application has the beneficial effect of realizing deep semantic understanding and flexible avoidance of operation conflicts, improving the accuracy and automation level of data merging.
[0012] The above description is only a summary of the technical solutions of the application, in order to more clearly understand the technical means of the application, which can be implemented according to the content of the specification, and in order to make the above and other purposes, features and advantages of the application more obvious and easy to understand, the following specific embodiments of the application are described. BRIEF DESCRIPTION OF DRAWINGS
[0013] The drawings described herein are used to provide further understanding of the application, and form a part of the application. The schematic embodiments of the application and their descriptions are used to explain the application and do not constitute an improper limitation on the application. In the drawings:
[0014] Figure 1 The flowchart of the bidirectional incremental intelligent merging method in distributed storage fault recovery provided by the embodiments of the application is shown;
[0015] Figure 2 The flowchart of generating a multi-dimensional space-time operation point set provided by the embodiments of the application is shown;
[0016] Figure 3 A flowchart for constructing a causal interference map is provided for the embodiments of the present application.
[0017] Figure 4 A flowchart for obtaining an optimal spatiotemporal folding scheme is provided for the embodiments of the present application.
[0018] Figure 5 A flowchart for projecting a high-dimensional path in the optimal spatiotemporal folding scheme into a one-dimensional execution sequence is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0019] In order to enable persons skilled in the art to better understand the schemes of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the scope of protection of the present application.
[0020] It should be noted that the terms “comprising” and “having” and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0021] In the research, it is found that the existing merging methods mainly expose two core defects of insufficient understanding of conflict connotation and single solution means when dealing with complex conflicts. On the one hand, they can identify conflicts operating at the syntax level, such as two concurrent write operations acting on the same data, but cannot distinguish from the business semantics whether the conflict is benign, compatible, or highly destructive, and cannot quantitatively evaluate its interference strength. On the other hand, in terms of solution strategy, these methods are limited by one-dimensional linear thinking, and tend to put all operations into a single execution sequence through forced reordering, lacking intelligent mechanisms for flexibly bypassing or avoiding conflicts by transforming operations in higher dimensions. This semantic blindness of seeing but not understanding and the rigid solution path of only queuing together lead to low automation and intelligence level of data merging process, often requiring expensive manual intervention or bearing the risk of data value damage.
[0022] Specifically, the semantic blindness problem is reflected in that the prior art mostly stays at the syntax level of conflict detection. For example, vector clocks can accurately identify that two concurrent operations write to the same data key, but it cannot understand the business connotation of this conflict. It cannot distinguish between a benign modification that changes the price of a commodity from 100 yuan to 101 yuan and a malicious tampering that changes it to 200 yuan, nor can it distinguish between two users concurrently adding different goods to the same shopping cart list (which should be merged) and two administrators concurrently modifying the permissions of the same user (which needs to be arbitrated). The prior art lacks an effective mechanism to quantitatively analyze the strength of interference between two operations, and cannot qualitatively determine whether the interference is destructive (such as the price modification) or constructive (such as the shopping cart addition). The lack of semantic understanding results in a system that can only adopt a one-size-fits-all, coarse-grained conflict resolution method, either marking all conflicts for manual intervention or applying simple LWW strategies and risking data errors or loss, far from the level of intelligence.
[0023] The rigidity serialization problem is reflected in the means of conflict resolution. Once a conflict is detected, the core solution idea of the prior art is almost always operation reordering, that is, trying to find a linear execution order that satisfies the causality relationship for all conflicting and non-conflicting operations on a one-dimensional execution timeline. This solution paradigm is essentially one-dimensional and rigid. It fails to recognize that many conflicts may not be irreconcilable in a higher-dimensional spatiotemporal perspective. It lacks a more flexible solution mentality, that is, whether some operations can be temporarily transformed in space and time, such as moving their execution to an isolated data space (spatial folding) or arranging a logically parallel timeline for them (temporal folding), to actively avoid and bypass the conflict core area, rather than rigidly determining who comes first. The singularity of this solution path limits the system's ability to find a more optimal merging solution and fails to fully utilize the potential parallel opportunities in multi-dimensional space, resulting in difficulty in further improving the efficiency and quality of merging.
[0024] As shown in Figure 1 The present application proposes a bidirectional incremental intelligent merging method in distributed storage fault recovery, comprising the following steps:
[0025] Step 101, receiving the operation sequence of the local increment and the remote increment, mapping the operation sequence to a multi-dimensional spatiotemporal coordinate system, and generating a multi-dimensional spatiotemporal operation point set.
[0026] In this embodiment, the linear operation history generated at different nodes is converted into a mathematical object that can be geometrically analyzed in a high-dimensional space. Specifically, the local node generates an incremental operation sequence during fault recovery, and the incremental operation sequence is synchronized from other remote nodes. Among them, the local sequence usually contains operation type, target object, operation parameter and local physical timestamp, while the remote sequence may contain logical clock (such as vector clock) to record causality. For each independent operation, its multi-dimensional features are extracted, which together constitute the operation feature vector. The multi-dimensional features at least include: time features, such as physical time when the operation occurs, logical timestamp for tracking causal order. Spatial features, such as logical address of the data object affected by the operation, physical partition information where the data is located, and node identification for executing the operation. Semantic features, such as the type of operation (such as insert, delete, update), the range of data that the operation may affect, etc. The constructed multi-dimensional space-time coordinate system is not a simple Cartesian coordinate system, but a space with specific metrics. Among them, the time dimension can contain physical time axis and logical time axis; the space dimension can contain data topology dimension describing the logical adjacency relationship of data and node distribution dimension describing the physical distribution; in addition, a causality dimension can be constructed to represent the strength of the dependency relationship between operations. In order to quantify the distance between any two points in this space, a distance metric function needs to be defined for each dimension, which together constitutes a multi-dimensional space-time metric tensor. Apply one or more nonlinear mapping functions to convert each operation's feature vector into its specific coordinates in the multi-dimensional space-time coordinate system. The core goal of this mapping is to preserve distance, that is, to make two operations that are semantically similar or strongly related in the original business logic close to each other in the geometric distance in the mapped high-dimensional space. For example, the calculation can be performed in the form of coordinates=f(time features)⊕g(space features)⊕h(semantic features), where f, g, h are mapping functions, and is a dimension fusion operator that can effectively combine coordinate components of different dimensions. Finally, each operation obtains a unique high-dimensional coordinate, forming an operation space-time coordinate table. Embed all operation points in the operation space-time coordinate table into the constructed multi-dimensional space-time to form a space-time point cloud. By analyzing the point cloud, the distribution pattern of the operation can be revealed. For example, by calculating the local density distribution of the point cloud, the operation dense area can be identified, which is often a potential conflict hotspot; while the operation sparse area may be a safe merging area. Further, kernel density estimation and other statistical methods can be used to generate a continuous space-time density field, which intuitively shows the conflict risk distribution in the entire space-time, and finally obtains a multi-dimensional space-time operation point set and a space-time density distribution diagram.
[0027] In step 102, based on the multi-dimensional space-time operation point set, geometric causal cones are constructed for each operation point, and a causal interference map is constructed by analyzing the interference between geometric causal cones.
[0028] In this embodiment, the impact of each operation is geometrized and the conflict is quantified by the intersection of the geometries. Specifically, for each operation point in the multi-dimensional space-time operation point set, the system constructs a geometry in the space-time according to the type of the operation and its impact range, which is called a causal cone. The apex of the causal cone is located at the space-time coordinate position of the operation point. The cone extends along the positive time dimension, symbolizing the potential impact of the operation on the future. The thickness of the cone, i.e. its opening angle in high-dimensional space, is determined by the impact strength of the operation. For example, an operation that modifies a single row of data may have a very thin and long causal cone; while an operation that modifies the structure of a full table may have a very wide causal cone. The causal cones of all operations together form an independent causal cone set. Using high-dimensional geometric calculation methods, it is detected whether any two causal cones overlap or intersect in space-time. If the two cones intersect, it means that the potential impact range of the two operations overlaps, i.e. there may be causal interference. The degree of intersection can be quantified by calculating the volume V intersect of the intersection region. The larger the intersection volume, the higher the interference strength of the two operations in general. By calculating all possible operation pairs, a causal cone intersection matrix can be generated, which records the interference strength between any two operations. Only the interference strength is not enough, the nature of the interference also needs to be distinguished. Optionally, the interference mode can be divided into at least three categories: constructive interference: the effects of the two operations are mutually enhanced or compatible; destructive interference: the two operations conflict with each other, for example, modifying the same data with different content, which is the most attention-conflicting type; neutral interference: the two operations have overlapping impact ranges, but are independent of each other and do not cause semantic conflicts. The system can analyze the space-time density gradient of the intersection region and the semantics of the operation itself to determine the specific type of interference and label each pair of interference, forming an interference mode classification table. All the analysis results described above are integrated to construct a complete causal interference graph. In this graph, each node represents an operation, and the edges between the nodes represent the causal interference relationship between the two operations. The weight of the edge can be set as the interference strength (i.e. the intersection volume), while the color or label of the edge can be used to represent the type of interference (for example, red represents destructive interference, and green represents constructive interference). Through graph algorithms, such as identifying strongly connected components in the graph, conflict clusters composed of multiple operations can be quickly found, which are the key objects for subsequent processing.
[0029] Step 103, according to the causal interference graph and the multi-dimensional space-time operation point set, search for a space-time folding path to avoid or minimize causal conflicts and obtain an optimal space-time folding scheme.
[0030] In this embodiment, the goal of this step is not simply to determine a fixed order of operations, but to find a path in high-dimensional space that actively alters the causal relationships of certain operations through folding transformations, thereby circumventing conflicts. Specifically, based on the causal interferometry map, operations suitable for spatiotemporal folding are identified. These operations typically possess certain characteristics, such as being located at the edge of a destructive interference region, having a small causal cone angle (limited influence range, low adjustment cost), or exhibiting symmetry in certain dimensions, making them easy to transform. The system calculates a folding potential score for each candidate operation to filter out the most valuable folding objects, forming a set of candidate folding operations. One or more folding transformation function libraries are pre-defined. These transformations are mathematical transformations applied to the spatiotemporal coordinates of the operations, designed to change their spatiotemporal location or causal properties. For example: Time folding: By introducing a virtual time dimension, operations can bypass logical time, thus avoiding time conflicts; Spatial folding: By remapping the logical addresses of data objects, operations can jump in the data space, accessing a temporarily isolated space to avoid direct conflicts; Causal folding: By introducing a temporary intermediate buffer state in a causal dependency chain, soft connections of causal relationships are achieved, temporarily removing strong dependencies. Improved search algorithms (e.g.) are employed. The algorithm searches for the optimal merging path in multidimensional spacetime. The search objective is to reach a final state where all operations are successfully merged, starting from an initial state containing all pending operations. Each step of the path may involve regular operation execution or the application of folding transformations. To guide the search direction, a path cost function is defined, which comprehensively considers the path length (execution efficiency), the cumulative interference intensity of the regions traversed by the path (conflict cost), and the complexity of applying folding transformations (transformation cost). Through dynamic programming, the algorithm progressively constructs a path with the minimum total cost, forming a candidate folding path set, while allowing for spacetime folding of operations. The system rigorously verifies the searched candidate paths. This includes checking whether the operation sequence after a series of folding transformations still satisfies the most basic data consistency constraints (e.g., data cannot be created or deleted out of thin air), and verifying whether the folding process itself introduces new, unexpected causal paradoxes. The stability of each path under different perturbations can be evaluated using methods such as Monte Carlo simulations. Finally, the path with the highest comprehensive score is selected as the optimal spacetime folding scheme.
[0031] Step 104: Project the high-dimensional path in the optimal spatiotemporal folding scheme into a one-dimensional execution sequence, and execute the one-dimensional execution sequence to achieve a consistent data state.
[0032] In this embodiment, the abstract solution in high-dimensional space is converted back to a linear sequence of instructions that the computer can understand and execute. Specifically, the optimal space-time folding solution is read, which is a trajectory in high-dimensional space. By applying algorithms such as topological sorting, the relative execution order between all operations in the path (including the folded operations) can be determined. For operations that can be executed in parallel in the original high-dimensional space (i.e., they overlap in the time dimension but are separated in other dimensions), they need to be serialized according to the system's resource constraints (such as CPU, IO) when projected onto a one-dimensional timeline. The projection process must guarantee the monotonicity of causality, i.e., if operation A depends on operation B, then in the final one-dimensional sequence, B must come before A. After this process, a one-dimensional projected operation sequence is obtained. Compare the one-dimensional sequence after projection with the original causal interference graph to verify again whether all necessary causal constraints have been maintained. Key checks are made to see if there is a causal inversion (i.e., a later-occurring operation is mistakenly placed before the operation it depends on). At the same time, some key system invariants (for example, the total amount of money in an account) also need to be verified before and after projection to ensure that they remain unchanged. If any violations are found, the system will attempt to repair them by adjusting the operation order locally until a final execution sequence that passes the verification is obtained. To improve efficiency, the resulting execution sequence is not completely serially executed. The system analyzes the sequence and identifies operation segments that can be executed in parallel. Generally, multiple operations within the same space-time folding region that are independent of each other can be processed in parallel by a multi-threaded executor. Between different folding regions or at key causal dependency points, synchronization points (Synchronization Points) need to be set. At the synchronization point, all parallel threads need to wait and perform state consistency checks to ensure that the merged results up to this point are correct, and then proceed to the next execution phase. During execution, multiple phased execution state snapshots are generated. After all operation segments have been executed, the system performs the final state convergence operation. This includes merging the execution results of each parallel branch and resolving any minor inconsistencies that may exist (for example, using the last writer wins strategy). After convergence is complete, global consistency verification is performed, which includes not only data-level integrity (such as foreign key references), but also business rule-level constraints (such as the correctness of order state transitions), so that the entire space-time folding and merging process does not violate the business semantic correctness of the data. After all the verifications are passed, the system outputs the data state that achieves final consistency.
[0033] As shown in Figure 2 According to one aspect of the present application, a multi-dimensional space-time operation point set is generated, including:
[0034] Step 201, extract the time feature, space feature and semantic feature of each operation from the local and remote incremental operation sequence to form an operation feature vector;
[0035] Step 202, apply a dimension fusion operator composed of a pre-configured neural network to nonlinearly transform the operation feature vector into a space-time coordinate, and generate a multi-dimensional space-time operation point set based on the space-time coordinate.
[0036] Wherein, the training process of the neural network is to minimize the difference between the geometric distance in the space-time coordinate system and the preset semantic distance between operations as the optimization target, so that operations with similar semantics are also adjacent to each other in the multi-dimensional space-time coordinate system.
[0037] Specifically, after extracting the time, space, causality and other feature vectors of each operation, a dimension fusion operator composed of a feedforward neural network is used to generate the final coordinate. The input of the network is the spliced original feature vector, and the interaction feature item (such as the product of the time feature and the space feature) manually constructed to capture the coupling relationship. The network structure can be a multi-layer perceptron containing multiple hidden layers, for example: input layer: the dimension is the total feature dimension after splicing; hidden layer: can contain 1 to 3 hidden layers, each layer is followed by a ReLU activation function and a batch normalization (Batch Norm) layer to speed up convergence and prevent gradient disappearance. To prevent overfitting, a Dropout layer can also be added; output layer: the dimension is the dimension of the target space-time coordinate system (for example, 8 dimensions), and the Tanh activation function is used before output to normalize the coordinate value to the [-1, 1] interval. The training target (i.e. loss function) of this neural network is the core of the embodiment. It is not a simple supervised learning, but a distance-preserving metric learning. Its loss function loss is usually composed of multiple parts: loss = α × L dist + β × L cluster + γ × L reg ; Wherein L dist is the distance-preserving loss, for example, Σ |d semantic (op i , op j )-d spacetime (coord i , coord j )| 2 , which aims to punish the mapping that breaks the consistency of semantic distance and space-time distance; d semantic is a pre-defined function that measures the semantic similarity of two operations, and d spacetime is the geometric distance of the mapped coordinate, op i is the i-th operation instance, and coord i is the output coordinate point corresponding to the i-th operation; L clusteris a clustering loss, e.g. Contrastive Loss, which encourages operations of the same type (e.g. all updates to the same data table) to cluster in the time-space, and operations of different types to be far apart, e.g. L cluster =-∑log(exp(sim(i,j)) / ∑exp(sim(i,k))), where sim(i,j) denotes the similarity between sample i and a positive sample j (e.g. operations of the same type), and the denominator is the sum of the similarities between sample i and all other samples including negative samples. This loss term pulls positive pairs closer and pushes negative pairs apart in the embedding space, so that operations of the same type naturally cluster together. L reg is a regularization term, e.g. -log(det(Cov(coordinates))), where det is the determinant operator, Cov is the covariance matrix, and coordinates is the set of all mapped operation coordinate points, to prevent all coordinate points from collapsing into a low-dimensional subspace, ensuring the effective dimensionality of the coordinates; a, b, g are the weights of each term. The principle of using a neural network for non-linear mapping is that the mutual influence relationship between operations is extremely complex, far beyond the scope that can be expressed by a linear model. The powerful non-linear fitting capability of neural networks enables them to automatically learn this complex, high-order mapping relationship from data, thereby generating a more semantically rich and structurally reasonable set of time-space points.
[0038] The embodiment trains to minimize |d semantic (op i , op j )-d spacetime (coord i , coord j )| 2 The neural network fusion operator aims to realize semantic-preserving mapping from discrete operation sequences to continuous high-dimensional space. The temporal feature f(t), the spatial feature g(s) and the causal feature h(c) are non-linearly transformed by a deep network containing interaction terms, and the generated 8-dimensional time-space coordinates can preserve more than 95% of the semantic relationships between the original operations. In a real distributed storage system, related operations on the same data table are automatically clustered in the time-space neighborhood, reducing the computational complexity of subsequent causal analysis and improving the recall rate of conflict detection compared to the random mapping method.
[0039] Further, the distance metric in the multi-dimensional time-space coordinate system is determined based on a composite metric function customized for the coordinate system, which at least includes: a temporal dimension metric obtained by weightedly fusing the absolute difference of the physical timestamps between operations and the edit distance of the logical clock vector; and a spatial dimension metric obtained by fusing the shortest path length on the partition topology graph and the hash distance of the data key.
[0040] In this embodiment, the distance between any two points in the coordinate system is not a single Euclidean distance, but a composite of customized metric functions in each dimension. The time dimension metric d t (op1, op2) is calculated as follows: d t = w p × |t1 p -t2 p | + w l × edit dist (t1 l , t2 l ); where t1 p , t2 p are the physical timestamps of the two operations; |t1 p -t2 p | is their absolute difference; t1 l , t2 l are the logical clock vectors (e.g., vector clocks) of the two operations; edit dist is the edit distance between the two vectors, which accurately reflects the causal partial order recorded by the vector clocks; w p , w l are weight coefficients that can be dynamically adjusted according to the accuracy of system clock synchronization. The spatial dimension metric d s (op1, op2) is calculated as follows: d s = shortest path (s1, s2) + λ × hash dist (s1, s2); where s1, s2 represent the data objects affected by the two operations; shortest path (s1, s2) is the shortest path length between the partitions where the two data objects reside in the topology graph composed of the adjacency relationships of data partitions, reflecting the logical distance of data in the architecture; hash dist (s1, s2) is some distance between the hash values of the two data keys, such as the Hamming distance, reflecting the similarity of data content; λ is the weight coefficient. Optionally, a causal dimension metric d c (op1, op2) can also be defined: d c= |depth(c1) - depth(c2) | + K x (1 - J(deps(c1), deps(c2))) ; where depth(c) is the depth of operation in the causal dependency chain; J(deps(c1), deps(c2)) is the Jaccard Index of the dependency sets of two operations; K is a weight coefficient. The compound metric function unifies the multiple distance concepts of physical world, business logic, system architecture into one mathematical framework, so that the subsequent geometric analysis (such as nearest neighbor search, region query) has a real business and system significance.
[0041] As shown in FIG. 1, according to one aspect of the present application, a causal interference graph is constructed, including: Figure 3
[0042] Step 301, for each operation point in the set of multi-dimensional spatio-temporal operation points, according to the semantic attributes of the operation point, the influence range of each operation point in the time, space and causal dimensions is calculated, a geometric causal cone with a specific multi-dimensional opening angle is generated, and a set of geometric causal cones is obtained;
[0043] Step 302, the causal interference strength between any two geometric causal cones in the set of geometric causal cones is quantified by estimating the intersection volume of the two geometric causal cones in the high-dimensional space;
[0044] Step 303, based on the causal interference strength, a causal interference graph is constructed, wherein the nodes represent operations, and the weights of the edges correspond to the interference strength.
[0045] In specific implementation, the generation of the geometric causal cone is based on its multi-dimensional opening angle. Taking three-dimensional space-time as an example, the calculation method of the opening angle vector Θ = (θ t , θ s , θ c ) is as follows: the time dimension opening angle θ t = arctan (I t / v t ), wherein I t is the influence strength of the operation in the time dimension (such as the duration of the operation), and v t is the aforementioned dynamically calculated causal propagation speed constant; the space dimension opening angle θ s = 2 x arctan (I s / d avg ), wherein I s is the influence strength of the operation in the space dimension (such as the data coverage range), and d avg is the average data distance in the system; the causal dimension opening angle θ c = π x I c / C max , wherein I c is the influence strength of the operation in the causal dimension (such as the causal dependency strength), and C is the aforementioned dynamically calculated causal propagation speed constant.It is the strength of the operation's influence in the causal dimension (such as the depth of the triggering chain), C max This is the system-defined maximum causal chain depth. These causal cones with specific angles form the basis for subsequent analysis. By estimating any two causal cones (cone... i ,cone j The intersection volume V intersect To quantify the interference strength, since analytical calculation of high-dimensional volumes is very complex, this embodiment preferably uses the Monte Carlo method for estimation. That is, a large number of random sampling points are generated within the minimum bounding box of the two causal cones, and the intersection volume is approximated by statistically analyzing the proportion of points that simultaneously fall into both cones. Using statistical frequency instead of analytical probability reduces computational complexity while meeting accuracy requirements. The weights of the edges in the final constructed causal interferometric graph represent the quantified interference strength, providing richer and more refined decision-making basis for path search than the traditional binary conflict model.
[0046] Optionally, to enrich the semantics of the graph, before constructing the causal interference graph, the following steps are included: defining an internal causal density field for each geometric causal cone, where the gradient of the causal density field characterizes the propagation direction of causal influence; calculating and comparing the gradient directions of the respective causal density fields within the intersection region of any two geometric causal cones; labeling the causal interference represented by the intersection as destructive or constructive interference based on the comparison results of the gradient directions; and further including the labeling as an attribute of the edges in the construction of the causal interference graph.
[0047] Specifically, the influence within each causal cone is not uniformly distributed, but gradually decays outward from the cone apex (operation point). This embodiment defines the causal density field function ρ(P) for this purpose: ρ(P) = ρ0 × exp(-||P - P0|| 2 / σ 2 )×H(P); where P is the coordinate of any point inside the cone; P0 is the spatiotemporal coordinate of the cone apex, i.e., the operation point; ρ0 is the central density of the cone apex; σ is the coefficient controlling the density decay rate; H(P) is an indicator function, which is 1 when point P is inside the cone, and 0 otherwise. The gradient ▽ρ(P) of this density field physically represents the direction of strongest causal influence propagation at that point. When two causal cones intersect, the system calculates the angle Φ(P) = arccos(<▽ρ1,▽ρ2>) between the gradients of the two density fields in the intersection region, where <> is the inner product. The value of cos(Φ(P)) reveals the nature of the interference: if cos(Φ(P)) is close to 1, it indicates that the two influence directions are consistent, which is constructive interference; if it is close to -1, it indicates that the influence directions are opposite, which is destructive interference; if it is close to 0, it is neutral interference. By numerically integrating ρ1(P)×ρ2(P)×cos(Φ(P)) over the intersecting region, a weighted interference intensity value I that simultaneously embodies both interference intensity and properties can be obtained.weighted The system decision goes beyond simple conflict avoidance. For destructive interference, the system will choose to fold around; while for constructive interference, the system can selectively schedule related operations together to possibly gain performance, providing a new dimension for optimization execution.
[0048] The embodiment realizes the breakthrough from traditional binary conflict judgment to continuous quantitative evaluation by modeling the causal impact of operations as geometric causal cones in high-dimensional space and calculating the cone intersection volume to quantify the interference intensity. Specifically, by defining multi-dimensional opening angle and causal density field, the system can accurately calculate the interference degree of any two operations. In the distributed storage fault recovery scenario, it can identify weak conflicts (such as partial data range overlap) missed by traditional methods, improving conflict detection accuracy, while distinguishing between constructive and destructive interference through gradient direction analysis, avoiding unnecessary serialization and improving the proportion of operations that can be executed in parallel.
[0049] As shown in Figure 4 , according to one aspect of the present application, obtaining an optimal space-time folding scheme includes:
[0050] Step 401, defining a space-time state space containing executed operations, to-be-executed operations and current folding configuration according to a multi-dimensional space-time operation point set and a preset folding transformation type;
[0051] Step 402, constructing a cost function containing path length, interference intensity and folding complexity based on a causal interference map;
[0052] Step 403, applying the cost function to perform optimization search in the space-time state space to obtain an optimal space-time folding scheme.
[0053] Specifically, the state space for search needs to be defined. The space-time state space is a mathematical abstraction that describes the progress of the merging problem at any time. In the embodiment, the state S can be defined as a triple: S=(ops executed ,ops pending , fold config ). Where ops executed is a set containing operations that have been scheduled or executed; ops pending is another set containing all operations to be processed; fold config records the current effective space-time folding configuration, for example, which operations apply which type of folding transformation. The transition from one state to another (i.e. state transition) can be achieved by two behaviors: one is to execute the operations in ops pending and move them to ops executed ; two is to apply a folding transformation to ops pendingthe operations in ops config All possible states and their transition relations form a huge state space. To guide the search algorithm to find the optimal path, a refined multi-objective cost function is constructed. This function is used to evaluate the cost of walking from the initial state to the current state. Optionally, the cost function Cost can be defined parametrically as: Cost = a x L path + b x I conflict + g x C fold + d x T delay ; where: L path represents the path length, usually the number of state transitions, which represents the total number of steps to execute and is directly related to the execution efficiency; I conflict represents the cumulative conflict interference intensity of the path passing through the regions, which is obtained from the causal interference map and is a direct measure of the path conflict risk; C fold represents the total computational complexity of all applied folding transformations in the path, which represents the additional computational overhead paid to avoid conflicts; T delay represents the total expected execution delay introduced by applying folding transformations (especially time folding); a, b, g, d are the weight coefficients of each term, which can be set by prior knowledge or dynamically adjusted by Pareto optimization, etc. to balance between different objectives (such as high efficiency, low conflict, low overhead). With the state space and cost function, the system can apply optimization search algorithms such as , Dijkstra, etc. in the state space transition graph to find a path from the initial state (all operations are in ops pending ) to the target state (all operations are in ops executed ) that minimizes the above Cost function value, which is the optimal space-time folding scheme.
[0054] Further, the optimization search is achieved by applying at least one folding transformation selected from the following group, which aims to change the causal relationship between operations: time folding; space folding; causal folding.
[0055] In this embodiment, time folding involves introducing a virtual time dimension dependent on the intensity of a destructive interference identified in the causal interference graph. This logically creates parallel execution timelines, allowing conflicting operations to bypass the interference. In practice, time folding doesn't actually change physical time but employs a mechanism similar to Multi-Version Concurrency Control (MVCC). When two operations (OpA, OpB) conflict in time, the system can create one or more parallel timelines or time layers. For example, OpA continues execution on the main timeline, while OpB is scheduled to a new alternative timeline where it can execute immediately without waiting for OpA. This bypass is achieved by appending a time-folded representation to the operation, which can include: TimeFold(primary) time ,execute time fold layer time slot ), where primary time It is the time when its original logic occurs, execute time The planned execution time takes into account the offset introduced to avoid conflicts. layer It identifies the timeline level to which it belongs, and time slot Within the same layer, time-division multiplexing can be used for further subdivision to avoid new conflicts; TimeFold() is for time folding. Conflicting operations that originally had to be executed sequentially can now be executed in parallel logically, and then merged when their impact no longer overlaps.
[0056] Space folding: This technique dynamically projects the data objects associated with conflicting operations to an isolated shadow data space, where the operations are executed to avoid direct access conflicts to the main data space. Its principle is similar to copy-on-write. When an operation attempts to modify a data object that is being accessed by another conflicting operation, the system does not block the operation but dynamically creates a shadow partition or shadow space. The conflicting operation is then redirected to this shadow space for execution. For example, for the data key `data`... key The modifications will be mapped to the shadow partition. id In order to optimize overhead, data replication can adopt a delayed replication strategy, that is, copying only occurs when the data is actually modified. Simultaneously, the system establishes a mapping relationship fold. mapping Record the original location, shadow location, replication strategy, and conditions for future merges. condition This condition typically occurs when all conflicts related to the data have been resolved, at which point the system merges the modifications in the shadow space back into the main data space.
[0057] Causal folding: In a broken causal dependency chain, a buffer node with expected result and compensation logic is implanted between the interdependent operations to achieve temporary decoupling and flexible connection between operations. When operation OpB strongly depends on the result of OpA, but OpA is delayed due to some reason, causing the causal chain to break, the causal folding mechanism intervenes. Instead of blocking OpB indefinitely, it inserts one or more compensation nodes or placeholder operations between OpA and OpB. This placeholder contains an expected value of the result of OpA (expected result ), as well as a timeout mechanism and a backup fallback value. OpB will temporarily establish a weak dependency with this placeholder and continue execution. This weak dependency contains an availability condition, i.e. is_dependency_available (dep), which represents an availability detection function used to check in the future whether the real result of OpA is ready. When the real result of OpA finally arrives, the system performs result fusion and compensation function (merge_function), which is responsible for merging the real result with the expected result (e.g. weighted according to the confidence of the estimate), and compensating or correcting the execution result of OpB. A soft connection of the causal chain is achieved, improving the fault tolerance and concurrency of the system.
[0058] This embodiment realizes the ability to actively change the causal relationship between operations without changing the final consistency by introducing three transformations: time folding, space folding, and causal folding. Time folding creates parallel timelines, allowing conflicting operations that must be serially waited for to be executed in parallel at different time layers, reducing the average operation waiting time. Space folding dynamically creates shadow partitions to achieve isolated access to conflicting data, avoiding write-write conflict blocking. Causal folding converts strong dependency into fault-tolerant weak dependency by inserting compensation nodes with expected results, so that the system can still maintain operation throughput in extreme failure scenarios such as network partitioning.
[0059] According to an aspect of the present application, before performing the optimization search, further comprising: constructing folding transformation functions for time folding, space folding, and causal folding respectively; applying a preset Lyapunov function to analyze the convergence of the dynamic characteristics of each folding transformation function to verify and correct the stability of the folding transformation function in the state space; based on the results of the analysis and correction, generating a stable folding transformation function library, and the optimization search is realized by calling the stable folding transformation function library.
[0060] In particular, in order to make the folding transformation itself not chaotic or leading to state divergence, its stability needs to be mathematically verified. In this embodiment, the verification process is achieved by Lyapunov's second method. The state of the system (e.g. a vector x consisting of the number of conflicts, the number of pending operations, the current folding depth, etc.) is modeled. A scalar Lyapunov function V(x) is defined, which must be positive definite and V(0) = 0 when the system is in the ideal stable state (e.g. no conflicts). A commonly used form is the quadratic form V(x) = x T Px, where P is a positive definite matrix whose elements reflect the weights of different state components; T is the transpose. The derivative of V(x) along the system state trajectory V dot is calculated. If for any state x, its derivative V dot is negative definite (or at least semi-negative definite), it is proved that the system is asymptotically stable after applying this folding transformation, i.e. the system state will eventually converge to an equilibrium point. If the calculation finds that V dot is greater than a very small negative threshold (-STABILITY_MARGIN) in some state region, it indicates that the transformation may not be stable. At this time, the transformation function needs to be modified, for example, a damping term -ε▽V opposite to the gradient direction of V(x) is added to suppress its divergent trend, where ▽ represents the gradient and ε is the damping coefficient. After this verification and modification, all stable folding transformation functions are collected to form a stable folding transformation function library for safe calling by the search algorithm.
[0061] This embodiment mathematically guarantees that the folding transformation in space-time will not lead to system state divergence by defining a Lyapunov function and verifying the negative definiteness of its derivative. For each folding transformation function, when V dot >-STABILITY_MARGIN is detected, a damping term is automatically added for modification. In large-scale distributed storage fault recovery scenarios involving thousands of concurrent operations, this stability guarantee mechanism makes the folding path eventually converge to a consistent state, avoiding potential chaotic behavior introduced by folding transformations. Compared with heuristic methods that lack theoretical guarantees, the failure rate of fault recovery is reduced, especially in complex cascading conflict scenarios.
[0062] According to an aspect of the present application, the optimization search is performed using an improved algorithm, including: continuously monitoring the effectiveness of the path during the search process to identify whether the search is trapped in a preset deadlock state; when the deadlock state is identified, invoking the time folding transformation to backtrack the current search state to a previous space-time state point; and continuing to explore new path branches from the previous space-time state point to seek a global optimal solution.
[0063] In the embodiment, the standard The heuristic function h(s) of the algorithm is designed to estimate the minimum future cost paid from the current state s to the target state. An effective h(s) can be a heuristic estimation function such as min_fold(remaining_conflicts), that is, the minimum folding cost required to resolve all remaining conflicts. The core improvement of the algorithm is the time-space backtracking mechanism. During the search process, the algorithm maintains the folding history and continuously monitors whether the search is stuck in a deadlock, for example, all pending operations cannot be executed due to destructive interference, and all available folding transformations cannot break the deadlock. Once a deadlock state is identified, the algorithm does not declare failure directly, but triggers time-space backtracking: call the time folding transformation to roll back the current search state to a previous time-space state point on the historical path, which is logically equivalent to going back in time and choosing another path. From this backtracking point, the previously deadlock-causing path branch is added to the taboo list, and other path branches are explored. The ability of the algorithm to find the global optimal solution is enhanced, and the search failure caused by local optimality or traps is avoided.
[0064] The embodiment introduces folding history maintenance and deadlock detection mechanisms into traditional A* search. When it is identified that all pending operations cannot be executed due to destructive interference, the algorithm can call the time folding transformation to backtrack to a previous state point and add the deadlock-causing path to the taboo list. This enables the algorithm to escape from local optimal traps and improves the search success rate in scenarios involving complex circular dependencies. In actual distributed database fault recovery, especially when facing complex dependency networks formed by cascading triggers and foreign key constraints, the number of search backtracks is reduced, and the problem that originally required exponential time to solve is reduced to polynomial time complexity.
[0065] Further, when multiple folding transformations need to be applied to an operation, the following steps are further included: identifying the conflict types involved in the operation from the causal interference map; and dynamically arranging the application order of time folding, space folding and causal folding transformations according to the identified conflict types to generate an optimal composite folding strategy; and optimizing the search, that is, performing the search by applying the composite folding strategy.
[0066] Specifically, in complex conflict scenarios, an operation can involve multiple types of conflicts simultaneously (e.g., both time contention and data object conflict). In this case, simply applying the folding transformations one after another can not be optimal, and can even create new problems. Therefore, a dynamic orchestration mechanism of compound folding is introduced. When a compound folding is needed for an operation, the system first queries the causal interference graph to analyze the main conflict type involved in the operation. For example, if the main conflict is destructive write-write conflict, then spatial folding can be applied first to isolate the data; if the main conflict is causal dependency break, then causal folding should be applied first. The system dynamically decides the application order of these folding transformations according to preset rules or small decision models, forming a compound transformation Φ = T fold ○S fold ○C fold , where ○ is a compound operator, T fold is time folding, S fold is spatial folding, and C fold is causal folding. This order is dynamically adjusted to achieve the best conflict resolution effect and the lowest transformation cost. At the same time, the system also makes the compound transformation reversible, i.e., Φ -1 exists, to ensure that the final result can be correctly merged. The optimization search algorithm directly applies this dynamically generated optimal compound folding strategy when encountering such complex situations, rather than trying single transformations one by one, thereby improving the efficiency and quality of the search.
[0067] To make the shape of the causal cone adaptive to the current running status of the system, preferably, the geometric causal cone with a specific multi-dimensional opening angle is generated by using a dynamic causal propagation velocity constant to assist the calculation, including: continuously monitoring the runtime metrics of the distributed system to obtain system status data including average operation delay and dependency density; based on the system status data, periodically recalculating and adjusting the value of the causal propagation velocity constant, so that the shape of the geometric causal cone is adaptive to the current status of the system.
[0068] Specifically, the causal propagation velocity constant, denoted by symbol v t , measures the diffusion rate of the influence of an operation in the time dimension. The calculation of v t can be based on the function calculate_causal_velocity(system_metrics), which receives a series of system runtime metrics as input. For example: basic speed calculation: v base = 1.0 / avg op_latency ; where avg op_latencyThis is the system's average operating latency. The principle behind this step is that the lower the system latency, the more causal effects can propagate per unit time, and the faster the base speed should be; dependency density adjustment: v adjusted =v base ×(1-0.5×dependency density ); where dependency density This represents the dependency density between operations in the system, with values between [0, 1]. The denser the interdependencies between operations in the system, the more it hinders the free propagation of causality, thus requiring a slower propagation speed. System load also has an impact: v t =v adjusted ×(2-system load ); where system load This represents the current system load, with values between [0, 1]. A higher load indicates more strained system resources, and consequently, a slower actual propagation speed of the impact. The final calculated v... t The value will be limited to a reasonable range, such as [0.1, 10.0], to avoid excessive divergence or convergence of the causal cone shape. This makes the construction of the causal cone no longer static and unchanging, but able to accurately reflect the behavior of the system under different states such as high load, high latency, or high dependency, improving the accuracy of subsequent conflict analysis. Alternatively, in another implementation, v t The calculation can also introduce the operation type as a variable, for example, the v of the read operation. t It can be set to be higher than the write operation's v. t Higher, because the effects of read operations typically spread more quickly.
[0069] This embodiment continuously monitors system runtime metrics and dynamically adjusts the causal propagation speed constant, enabling the shape of the causal cone to reflect the system state in real time. Parameters such as average operation latency, dependency density, and system load are incorporated into the cone construction process. Under high load scenarios (load > 0.8), v t Automatically reduced to 0.3-0.5, generating a steeper causal cone, accurately reflecting the actual situation where the propagation of operational effects slows down; while in low-latency in-memory database scenarios, v t Achievable accuracy of 8-10, generating flat causal cones. Maintains conflict prediction accuracy under different system states, reducing the false positive rate compared to fixed-parameter methods, especially effective during fault recovery when system load fluctuates drastically.
[0070] like Figure 5 As shown, according to one aspect of this application, projecting a high-dimensional path in the optimal spatiotemporal folding scheme into a one-dimensional execution sequence includes:
[0071] Step 501: Perform initial projection on the high-dimensional path to generate a preliminary one-dimensional operation sequence;
[0072] Step 502, compare the preliminary one-dimensional operation sequence with the causal dependency relationship contained in the optimal space-time folding scheme to identify any causal inversion conflicts;
[0073] Step 503, for the identified causal inversion conflicts, reorder the preliminary one-dimensional operation sequence by constructing and solving a constraint satisfaction problem with a hard constraint of maintaining causal order; the reordered causal consistency sequence is used as the one-dimensional execution sequence.
[0074] Specifically, the initial projection can be implemented in various ways. For example, one preferred way is to use principal component analysis (PCA) to analyze all points on the high-dimensional path, find the principal component direction with the largest variance, and use it as the preliminary one-dimensional timeline. All high-dimensional coordinate points are linearly projected onto this principal component axis to obtain a preliminary but possibly causal error-containing sequence. The preliminary sequence is checked and repaired. The core of this process is to construct and solve a constraint satisfaction problem (CSP). The definition of this CSP is as follows: Variables: each operation to be sorted in the set, whose variable is its position in the final one-dimensional sequence (an integer); Domain: the value range of each variable is from 1 to the total number N of operations to be sorted; Hard constraints: for any pair of causal dependency relationships (e.g., operation OpA must be executed before OpB) in the original causal graph, a hard constraint Position(OpA) < Position(OpB) is added in the CSP, which must be satisfied to ensure the causal correctness of the final sequence; Soft constraints: to make the final sequence as close as possible to the structure of the initial projection, a soft constraint can be added for each operation, which aims to minimize the deviation of its final position from the initial projection position, e.g., minimize |Position(Op)-InitialPosition(Op)|, where Position(Op) is the integer position of operation OP in the final repaired sequence, and InitialPosition(Op) is the position of operation OP in the initial linear projection sequence. By solving this CSP (e.g., using a search algorithm with backtracking or a specialized CSP solver), an optimal solution that satisfies all hard constraints and as many soft constraints as possible can be obtained, which is the causal-consistent final one-dimensional execution sequence. The complex sorting problem is converted into a mathematical model with a solid theoretical basis, ensuring the completeness and optimality of the repair process.
[0075] Further, after generating the one-dimensional execution sequence with causal consistency, the method further comprises: comparing the structural complexity of the high-dimensional path and the one-dimensional execution sequence to quantitatively calculate the information loss metric caused by the projection; identifying operations that can be parallel in the high-dimensional path but are serialized in the one-dimensional execution sequence; and attaching the information loss metric and the identified operations as compensation metadata to the corresponding operations in the one-dimensional execution sequence to guide the allocation and scheduling of resources in the final execution stage.
[0076] In the present embodiment, the projection from high-dimensional to one-dimensional inevitably loses information, especially information about parallelism. To compensate for this loss, the information loss is quantitatively calculated and encoded as metadata. The information loss metric can include: entropy loss, obtained by calculating the difference between the information entropy of the high-dimensional path point distribution and the information entropy of the one-dimensional sequence; structural loss, obtained by analyzing the degree of preservation of the topological structure (such as branching, folding) of the high-dimensional path after projection; and parallel opportunity loss, obtained by counting the number of operation pairs that do not have causal dependence and conflict (i.e., can be parallel) in the high-dimensional space, but are forced to be serialized after projection due to one-dimensional linearization. The calculated information loss value and the identified original parallel operation set are packaged into compensation metadata and attached to the record of the corresponding operation in the one-dimensional sequence. For example, the metadata of operation OpA can include {info_loss: 0.35, parallel_candidates: [OpC, OpD]}, where info_loss is the information loss metric of the current operation in the projection process, and parallel_candidates is the set of other operations that can be executed in parallel in the high-dimensional space. The subsequent executor is not only a blind instruction executor, but also an intelligent scheduler that understands the historical context, and can attempt to execute OpA in parallel with OpC and OpD if resources permit, thereby partially recovering the lost parallelism and improving execution efficiency.
[0077] Further, the operations in the one-dimensional execution sequence are also attached with virtual time metadata, and the final execution process is completed by a virtual time-aware scheduler, wherein: the virtual time metadata is intended to encode the scheduling information lost in the projection process from the high-dimensional path to the one-dimensional execution sequence, which at least includes the original logical timing before the space-time folding or the execution delay calculated to deal with conflicts; and the virtual time-aware scheduler is configured to be able to analyze the metadata in real time and adjust the final execution of the operation according to the original logical timing or execution delay encoded therein.
[0078] Specifically, the virtual time metadata is a special form of compensation information. For example, an operation is calculated to have an execute timeThis timestamp may not exactly correspond to its ordering position in the one-dimensional sequence. At this time, execute time The final executor is a virtual time-aware scheduler. When it is ready to execute the next operation in the sequence, it will first check its virtual time metadata. If the metadata indicates that the operation needs to be executed with a delay, the scheduler will pause the execution until the delay condition is met. The carefully calculated timing arrangement in the high-dimensional space to resolve conflicts is passed to the final execution stage in the form of lightweight metadata, enabling the final physical execution to maximize the essence of the high-dimensional optimal path, rather than simply following a simple and incomplete linear order. Optionally, the virtual time metadata can also encode the priority of the operation, the expected execution duration, etc., providing the scheduler with more rich decision-making information.
[0079] This embodiment ensures the causal consistency of the projection from the high-dimensional folding path to the one-dimensional execution sequence by constructing and solving the CSP problem containing causal order hard constraints. The causal inversion conflicts are identified, and the causal correctness is ensured by constraint solving reordering. More importantly, the system calculates and records the information loss in the projection process, including entropy loss, structure loss, and parallel opportunity loss, and attaches these information as compensation metadata to the operation. In the execution stage, the virtual time-aware scheduler can recover the originally parallelizable but serialized operations after projection according to the parallel_candidates information recorded in the metadata, so that the final execution efficiency is close to the theoretical optimal value.
[0080] In a specific embodiment, assume that in a distributed database, there are two operations from different nodes that need to be merged: OpA: a range update operation, UPDATE users SET status=inactive WHERE age BETWEEN 20 AND 30. It is initiated at t=10. OpB: a single-point write operation, INSERT INTO users(id, name, age) VALUES(123, Alice, 25). It is also initiated at t=10. Obviously, OpA and OpB have potential destructive conflicts in space (affecting data with age=25) and time. The initial parameters are set as: the system dynamically calculates the causal propagation speed constant v t =1.0; the system average data spacing d avg =1 (assuming the data key is a continuous integer); the system maximum causal chain depth C max =10. The calculation of operation impact strength I: OpA (range update): I t =2.0; the impact range is wide, I s=log(30-20)≈2.3; causal influence is moderate, I c =2.0. OpB (Single Point Write): Affects instantaneous time, I t =1.0; the scope of influence is extremely small, I s =1.0; the causal effect is relatively small, I c =1.0. Calculate the angle Θ of the causal cone = (θ t θ s θ c OpA: θ t =arctan(2.0 / 1.0)≈63.4°; θ s =2×arctan(2.3 / 1)≈133.0°; θ c =π×2.0 / 10≈36.0°; OpB: θ t =arctan(1.0 / 1.0)=45.0°; θ s =2×arctan(1.0 / 1)=90.0°;θ c =π×1.0 / 10≈18.0°. It can be seen that the causal cone of the range update operation OpA is much wider in the spatiotemporal dimension than that of the single-point write operation OpB. The causal density field ρ(P) is defined as ρ(P) = ρ0×exp(-||P-P0||). 2 / σ 2 ), where P0 is the spatiotemporal coordinate of each at t=10, and ρ0 and σ are preset constants. Estimate the intersection volume V. intersect The Monte Carlo method is employed. Within the smallest bounding box containing two cones, N = 1,000,000 sampling points are randomly generated. Through geometric judgment, the statistical results are obtained as follows: N A = 120,000 points fall within the cone of OpA. N B =50,000 points fall within the cone of OpB. Number of intersection points N intersect =8000 points simultaneously fall inside the two cones. Assume the bounding box volume is V. box Then the intersecting volume V intersect ≈V box ×(N intersect / N)=V box ×0.008. This value represents the unsigned interference intensity between the two. The nature of the interference is determined at N. intersect =Among the 8000 intersection points, for each point P i Calculate the gradient ▽ρ of the two density fields. A (P i ) and ▽ρ B (P iThe gradient direction points in the direction of the fastest density growth, i.e., towards the respective cone apex. Since the cone apex time coordinates of the two operations are the same, and their spatial coordinates (age=25 falls within age=[20, 30]) highly overlap, the directions of the two gradient vectors are almost opposite at most intersection points. The cosine of the gradient angle is calculated as cos(Φ(P)). i Statistical analysis revealed that its mean avg(cos(Φ)) ≈ -0.9. The weighted interference intensity I was calculated. weighted By numerical integration (or approximation using the sample mean) of the intersecting regions, I weighted ≈V intersect ×avg(ρ A ×ρ B ×cos(Φ)). Since avg(cos(Φ)) is a large negative value, the final I is obtained. weighted It is a negative number. The result is interpreted as the calculated weighted interferometry intensity I. weighted A negative value clearly and quantitatively indicates a strong destructive interference between OpA and OpB. The quantified result will serve as the weight and attribute of the edge connecting OpA and OpB in the causal interference graph, providing a clear signal for subsequent spatiotemporal folding path search algorithms: this conflict must be addressed first, for example, by separating the two operations through the application of time folding or spatial folding.
[0081] According to one aspect of this application, the mapping process is further refined, wherein the nonlinear mapping function used for calculating the spatiotemporal coordinates of the operation point consists of a series of specific functions for different dimensions, and is integrated through a dimension fusion operator. Specifically, for the time feature f(t) p , t l The specific mapping function can be defined as: f(t) p , t l )=[t p log(1+t) l ), sin(2π×t) p / T cycle ), cos(2π×t) p / T cycle ), exp(-|t p -t checkpoint | / τ)];where t p The original physical timestamp of the operation is used directly as the basic component; log(1+t) l ) is for logical timestamp t l Logarithmic compression aims to smooth large logical time differences and avoid their disproportionately large impact on the overall coordinate distance; sin(2π×t) p / T cycle ) and cos(2π×tp / T cycle ) is a periodic component designed to capture the periodic behavior of the system if any; T cycle is the characteristic period of the system, e.g., can be the fixed interval at which the database takes checkpoint operations; exp(-|t p -t checkpoint | / τ) is a decaying component that represents the time distance of the operation from the nearest checkpoint operation, τ is the decay constant, t checkpoin is the timestamp of the nearest checkpoint operation taken by the system. The principle of this component is that, generally, the nearer to the checkpoint, the operation's state uncertainty or impact on the subsequent operations can have different characteristics. The function finally outputs a 5-dimensional time feature vector.
[0082] For the spatial feature g(key, partition id , node id ), its specific mapping function can be defined as: g(key, partition id , node id ) = [hash1(key) / MAX HASH , hash2(key) / MAX HASH , partition id / MAX PARTITION , node id / MAX NODE , bloom filter (key)]; where hash1(key) and hash2(key) are two different hash functions that map the data key key to a numerical value, normalized by the maximum hash value MAX HASH . Using multiple hash functions aims to reduce the collision probability and more accurately express the position of the data key in space. partition id / MAX PARTITION and node id / MAX NODE are the normalized partition ID and node ID, respectively, directly reflecting the physical and logical topology location of the operation, partition id is the partition ID, node id is the node ID, MAX PARTITION is the maximum partition value, and MAX NODE is the maximum node value. bloom filter(key) is a k-bit vector computed by passing the data key key through a Bloom filter. This component can compactly represent the existence information of data keys and can efficiently determine the similarity of keys. The function finally outputs a (4+k)-dimensional spatial feature vector.
[0083] For the causal feature h(deps, op type ), its specific mapping function can be defined as: h(deps, op type ) = [len(deps) / MAX DEPS , max depth (deps) / MAX DEPTH , avg depth (deps), one hot (op type ), dependency matrix_eigenvalues [:3]]; where: len(deps) / MAX DEPS is the normalized operation dependency number, reflecting the breadth of its causal relationship; max depth (deps) and avg depth (deps) are the maximum depth and average depth of the operation in its dependency chain, respectively, reflecting the depth of its causal relationship; one hot (op type ) is the one-hot encoding of the operation type (such as INSERT, UPDATE, DELETE), generating an m-dimensional vector; dependency matrix_eigenvalues [:3] is the first 3 eigenvalues of the dependency relationship matrix of the local area where the operation is located, which can capture more complex local causal structure features; deps is the direct dependency object set of the current operation, op type is the type of the current operation, and MAX DEPS is the maximum number of dependencies that a single operation can have in the global or window range, and MAX DEPTH is the maximum depth threshold of the dependency chain in the global or window range. The function finally outputs a (6+m)-dimensional causal feature vector.
[0084] After generating the final coordinates, in order to ensure the quality of the coordinates and the effectiveness of subsequent calculations, a coordinate normalization and verification step needs to be performed. Specifically, through the affine transformation p norm = (p-p min ) / (p max -p min ), all operation coordinate vectors p are mapped to the unit hypercube [0, 1] dThe dimensional differences between different dimensions are eliminated, so that all dimensions have the same weight for distance calculation. The preservation of distance is verified, that is, whether the mapped spatio-temporal geometric distance dist(p1, p2) and the pre-defined semantic distance dist(op1, op2) between operations satisfy |dist(p1, p2)-dist(op1, op2)|<ε. Where ε is a very small tolerance threshold. If the mapping of some points violates this constraint, the system can fine-tune the parameters of the mapping function or the coordinates of the points through optimization algorithms such as gradient descent, until the preservation of distance requirement is met. Where p is the original operation point coordinate vector, p min is the minimum value of all operation points in each dimension, p max is the maximum value of all operation points in each dimension, p norm is the normalized coordinate vector.
[0085] Preferably, the construction process of the causal graph is as follows: in the stage of generating a single causal cone, the process is defined more finely. The explicit operation influence vector I=(I t , I s , I c ) is calculated; wherein the time dimension influence intensity I t is based on the persistence of the operation (1 for instantaneous operation, and the life cycle for persistent operation); the spatial dimension influence intensity I s is based on the data coverage range (the range operation is the logarithmic value of the number of covered keys); the causal dimension influence intensity I c is based on the propagation depth of the operation (the trigger operation is the maximum trigger chain length). On this basis, the accurate cone geometry parameter set is generated, including defining the cone axis direction vector D=(1, δ s , δ c ), wherein δ is the direction correction factor fine-tuned according to the operation type, and defining the cone generatrix equation L(λ)=P0+λ(cos(θ i )D+sin(θ i )R i ), wherein R i is the radial unit vector of each dimension, λ is the scale factor, and θ iis the deflection angle. For ease of computer processing, the continuous causal cones are discretized into a grid representation, and the grid resolution can be adaptively adjusted according to the complexity of the operation to balance the calculation accuracy and overhead. In the process of detecting the intersection of the causal cones, in order to solve the performance bottleneck of the calculation caused by the massive operation, an efficient indexing and storage mechanism is introduced. Specifically, before the two-by-two intersection calculation is performed, a high-dimensional grid intersection index is constructed. Preferably, a variant of the R-tree can be used to index the bounding boxes of all discretized causal cones, and objects that are adjacent in space are organized in the same child node of the tree. When querying, only those cone pairs whose bounding boxes overlap need to be checked, without checking all N x (N-1) / 2 combinations, thereby reducing the calculation complexity, where N is the total number of all operations to be processed in the system. After calculating the interference intensity of all intersecting cone pairs, a causal cone intersection matrix is constructed. Considering that most of the operation pairs in the system do not interfere with each other, the system uses a sparse matrix storage format (such as CSR or COO) to store the matrix, and can set an interference intensity threshold I min to filter out edges with very weak interference, further reducing the storage and subsequent graph calculation overhead.
[0086] In classifying the interference mode, a more intelligent classification method based on machine learning is used. Specifically, for each pair of intersecting causal cones, an interference feature vector is extracted. The vector can include the ratio of the intersection volume to the volume of the two cones r v , the density gradient angle θ grad , the encoding of the combination of the two operation types type code , and the timing relationship t rel , and other features in multiple dimensions. An unsupervised density clustering algorithm (such as DBSCAN) is applied to cluster all interference feature vectors, automatically discovering typical interference patterns. Only a one-time labeling of the center point of each cluster (such as typical write-write conflict, read-after-write enhancement) is required, which can be used as a basis to train a supervised learning classifier (such as support vector machine SVM). Thereafter, for new interference instances, the classifier can quickly and automatically qualify (constructive / destructive / neutral). It can learn more complex and implicit interference patterns from data than a single gradient angle, thereby achieving more accurate classification, especially in systems with diverse operation types and complex interaction relationships.
[0087] In a further embodiment, the detailed process of implementing the spatiotemporal folding mechanism is as follows: Before initiating path search, to improve search efficiency, a folding candidate point identification mechanism is preferably adopted. Specifically, the system pre-traverses all operation points to be processed and calculates a folding potential score based on their attributes in the causal interferogram. The calculation of this score can comprehensively consider the following factors: whether the operation is on the edge of one or more destructive interferences; whether the causal cone angle of the operation is small (meaning the folding influence range is controllable); and whether the operation has symmetry in certain spatiotemporal dimensions (facilitating transformation). Operations with higher scores are selected to form a set of folding candidate operations. In subsequent... During the search, the algorithm is guided to prioritize applying folding transformations to these candidate operations, thereby avoiding wasting computational resources on operations that are not suitable for folding and narrowing the search space.
[0088] For time folding, its algorithmic definition of time is... fold_transform (t original conflict level The core idea of (operation) is to create multiple timelines. It does not change the original time t. primary Instead, it is based on the degree of conflict. level Calculate the fold level layer and execution offset t offset To avoid new conflicts within the same layer, a hash function can be used to allocate a dedicated time slot (time) for each operation. slot The planned execution time of the operation is calculated as t. execute =t primary +t offset +(time slot ×SLOT DURATION The returned result is a composite time representation, TimeFold, containing the original logical time, planned execution time, folding level, and time slot. The executor can use this information for fine-grained scheduling. Where t... original The original logical time of the operation is SLOT, where SLOT is the current operation instance to be scheduled. DURATION The standard duration for each time slot.
[0089] For spatial folding, its algorithmic definition is space. fold_transform (data key conflict info The core idea is to create a shadow space. When data is detected... key In the event of a related conflict, the system will assign a new partition to the original partition containing the data. partition Create a temporary shadow partition.id At the same time, a data copy policy copy strategy is defined, preferably LAZY, and a merge condition merge condition is set, e.g. a Boolean function that checks whether all related conflicts have been resolved. These information are encapsulated in a SpaceFold object, which guides the operation to be safely executed in an isolated shadow space, and the result is written back to the main space when the merge condition is satisfied. Wherein data key is the unique identifier of the data object involved in the current operation, and conflict info is the conflict information structure.
[0090] For causal folding, the algorithmic definition causal fold_transform (operation, broken dependencies ) is to insert compensation nodes. For each broken dependency, a placeholder operation is created. The placeholder contains an expected result value of the dependent operation, a timeout, and a fallback value. The original operation and the placeholder establish a Weak Dependency, whose strength can be quantified, and contains a condition to check whether the real dependency is available. These components are encapsulated in a Compensation object, which also defines a merge_function to merge the real result with the expected result when the real result arrives. Through this mechanism, strong dependencies are temporarily decoupled into fault-tolerant weak dependencies. Wherein broken dependencies is the list of operations that the current operation depends on but has not yet been satisfied.
[0091] After the search algorithm finds the preliminary optimal path, there are post-processing steps for the path, i.e. feasibility verification and smoothing optimization. Feasibility verification aims to ensure the correctness of the path, e.g. by simulation execution to check whether the folded sequence satisfies the most basic consistency constraints, and whether new causal paradoxes are introduced. Optionally, Monte Carlo simulation can be used to impose random perturbations on the path, to evaluate its stability and robustness. Path smoothing aims to improve the elegance and efficiency of the scheme. The system checks whether there are zigzag patterns in the path, i.e. unnecessary and frequent folding and unfolding of an operation. Redundant transformations are locally refactored and eliminated. Further, mathematical tools (such as Bezier curves) can be used to smooth the motion trajectory of the operation in space-time, so that the final execution plan is more concise and efficient.
[0092] Further, the high-dimensional path projection and execution process is as follows: when projecting the high-dimensional path to a one-dimensional execution sequence, the preferred solution is piecewise linear projection mapping. This solution is not a simple global linear projection, but rather the entire high-dimensional path is divided into several segments according to the type of folding transformation (for example, one segment is time folding and one segment is space folding). Within each segment, since the transformation type is single, a simple linear projection p 1d = <p hd , v base > can be used to map it to a one-dimensional timeline, where p hd is the high-dimensional coordinate, v base is the optimal projection basis vector corresponding to this segment, and p 1d is the one-dimensional projection coordinate. At the connection of different segments, in order to ensure the continuity and smoothness of the entire one-dimensional sequence, spline interpolation can be used for transition, which can better preserve the local structure characteristics of the original high-dimensional path. In addition, for two operations that overlap in the one-dimensional timeline after projection, the system will separate them by applying a small random disturbance ε x rand(), to ensure the strict linear order of the sequence. Where ε is the disturbance amplitude factor and rand() is a pseudo-random number generation function.
[0093] After obtaining the one-dimensional execution sequence, the actual execution process is a segmented parallel, synchronization point controlled precise process. Specifically, the executor will analyze the sequence, identify the continuous operation set that does not exist causal dependence, and identify these sets as parallel execution segments. One or more worker threads are started for each parallel segment to process it. At the end of each parallel segment, a global synchronization point is set. When all worker threads processing the segment have completed their tasks, the system is paused at this synchronization point. At this time, the system triggers a state consistency check, for example, by comparing the data snapshots processed by each thread, to ensure that the merged result up to this point is correct and there are no new conflicts. Only after the check passes, the executor will start processing the next operation or parallel segment. Under the premise of ensuring the correctness of the execution, the utilization rate of system resources is maximized.
[0094] After all the operation segments are executed, a final state convergence and validation is performed. This includes merging the state snapshots generated by each parallel branch during execution. During the merging process, some new minor inconsistencies can be found (e.g. both parallel operations modify the same non-core metadata field), for which a pre-set resolution strategy is needed. Optionally, the strategy can be Last Writer Wins (LWW), i.e. the operation with the latest timestamp is used. After all the data is merged, a global consistency validation is performed. This validation is more extensive than the checkpoint validation, and includes not only the data-level reference integrity, but also the constraints of the upper-level business rules, e.g. checking whether the state transition of an order follows the correct order of pending payment -> paid -> shipped. Only after passing this most stringent, business-semantic-included global validation, the entire fault recovery and data merging process is considered successfully completed, and the system outputs the data state that is consistent and can be trusted by the business system.
[0095] In an embodiment of the present application, in order to guarantee the reversibility of the folding transformation, a guarantee mechanism based on procedural inverse transformation is proposed: for each applied folding transformation Φ, the system must synchronously generate and store a metadata object Φ meta that can safely reverse the effect of Φ. This reversibility is not always a strict mathematical function inversion. Specifically: for time folding: when an operation is bypassed to a parallel alternative timeline, its inverse transformation is to merge or discard the alternative timeline and the state generated on it. Its metadata Φ meta needs to record the unique identifier of the alternative timeline, the operation sequence occurring on it, and the merging point information with the main timeline. When merging occurs, the inverse transformation process is triggered and executed. For space folding: its reversibility is guaranteed by the copy-on-write mechanism and the merging condition itself. Its metadata Φ meta is a fold mapping object, which completely records the original data location, shadow data location, and merging logic back to the main space (merge condition ). When the merging condition is met, executing this logic completes the inverse transformation, and the shadow space is recycled, guaranteeing the reversibility of the transformation. For causal folding: its reversibility is realized through the merge_function of the compensation node. Its metadata Φ meta is a Compensation object, which contains the estimate of the real result, placeholder operations, and the key merging function. When the real dependent operation result arrives, the system calls this merging function to replace or correct the subsequent calculations based on the estimated result with the real result, thus completing the logical inverse transformation. In this embodiment, when any folding transformation is applied, the above Φ metaMetadata. In the subsequent path projection and execution phase, the system will use these metadata to make sure each folding operation can be correctly reversed or merged, thus ensuring the macro reversibility of the whole folding process in program logic.
[0096] Further, specific conflict resolution strategies are implemented when multiple timelines are merged. Specifically, when time folding produces multiple parallel execution timelines and needs to be merged at a merge point, the system calls the select_merge_strategy function to select a specific conflict resolution method. A preferred, hierarchical strategy library is provided: Strategy 1: Commutative Semantic Merge, which is applicable when the conflicting operations act on data types that support the commutative law, such as counters (Counter) and sets (Set) in CRDTs. Instead of selecting, the semantic fusion of the two operations is performed. For example, if both the main and branch lines perform an increase operation on the same counter, the merge result is the sum of the two increase amounts; if both perform an add element operation on the same set, the merge result is the union of the two sets. No information is lost. Strategy 2: Domain-Specific Merge based on pre-defined rules, which is applicable to scenarios where key data with complex business logic can register user-defined merge processors (User-Defined Resolver, UDR) in advance. For example, for the scenario of concurrent modification of the same user's permissions, select_merge_strategy calls the permission merge processor. This processor may contain hard-coded business rules such as taking the highest level of both permissions, only allowing modifications by specific roles, etc. Strategy 3: Last Writer Wins (LWW) based on timestamps, which is applicable when neither of the above two strategies is applicable, and a simple, deterministic automatic merge rule is needed. Compare the original physical timestamps t p, the operation with the latest timestamp is selected as the final valid version, and the other operation is discarded. This guarantees the determinism and automation of the merging process. Strategy four: Conflict Logging and Deferred Resolution, is applicable to scenarios where automatic safe merging is not possible, and the data value is extremely high and cannot be lost. The system will select a version (e.g., the version of the main timeline) as a temporary effective version to ensure the continuation of the main process, but will record the other conflicting version and its context information in a special conflict log, and notify the system administrator or trigger an exception handling process, waiting for subsequent manual arbitration. The select_merge_strategy function will try to apply the above strategies in sequence according to the metadata of the operated data object (e.g., whether it is a CRDT type, whether it is registered with a UDR), thereby achieving fine and differentiated processing of different types of conflicts.
[0097] In further embodiments, the causal cone computation of multiple nodes can be synchronized in a distributed environment using two alternative distributed coordination models: Centralized Coordinator Model: In a distributed cluster, elect a node (e.g. using Paxos or Raft protocol) or pre-designate a node as temporary central coordinator. All other nodes send their respective incremental operation sequences to the coordinator after failure recovery. The coordinator node independently and completely executes the entire smart merge algorithm of the present application, including building the global spatiotemporal point cloud, computing the causal cone, searching the folding path, etc. After computation, the coordinator broadcasts the final one-dimensional execution sequence or the final data state to all other nodes to complete synchronization. The implementation is simple and the logic is clear, without the need to handle complex distributed computing consistency issues. Decentralized Model with Async Communication and Final Consensus: This is the preferred implementation. Nodes asynchronously exchange their respective incremental operation sequences through Gossip or other protocols. Each node locally maintains a view of the global operation set and independently and asynchronously updates its local causal interference graph when receiving new operations. This means that at a certain moment, the graphs of different nodes may be temporarily inconsistent. However, the core of the merge computation is the determination of the optimal spatiotemporal folding scheme. Therefore, when a node believes it has collected enough information and computed a candidate folding scheme, it can submit this scheme itself (rather than the entire computation process) to a lightweight consensus group, and the consensus group reaches a consensus on the final execution scheme. The heavy and parallelizable computation (such as graph construction) is distributed to each node for asynchronous execution, while the lightweight and globally consistent decision (determination of the final execution scheme) is left to the consensus algorithm to ensure. This avoids the bottleneck of the central coordinator, has better scalability, and improves the overall throughput and robustness of the system.
[0098] In optional embodiments, the performance impact of dynamically adjusting v t in real-time systems, the following mitigation and optimization strategies are proposed: Asynchronous and low-priority processing: The task responsible for monitoring system runtime metrics (such as average latency, load, etc.) and recalculating v t values runs in a separate background thread with lower priority. This ensures that the monitoring and adjustment process does not block or preempt the foreground thread resources that handle core data read-write requests, thereby minimizing its direct impact on real-time performance. Hysteresis and damping mechanism: To avoid frequent adjustments of v tvalues, thus triggering unnecessary, cascading re-computations, introducing a hysteresis mechanism. That is, only when the newly computed v t value is stably above a preset threshold (e.g., a change rate above 10%) for a sustained period of time, the system will truly apply this new v t value. Similar to a low-pass filter, high-frequency noise is filtered out, ensuring that the adjustment of v t values is smooth and robust. Incremental re-computation: when v t values do change significantly and are applied, the system does not need to re-compute all the causal cones from scratch. Instead, the system can identify the causal cones that will be significantly affected by this v t adjustment, and update them incrementally. The main impact is on the time dimension, the angular width θ t . Thus, the system can identify only those causal cones whose θ t will be significantly affected by this v t adjustment, and update them incrementally. For the parts of the graph that have already been computed and are not affected, their results can be reused. This reduces the computational overhead of dynamic adjustment.
[0099] In a preferred embodiment, the dimension fusion operator can be implemented by a neural network, specifically: the dimension fusion operator is implemented as a three-layer feedforward neural network. The structure of the neural network is defined as: the input layer dimension input_dim: its dimension is the sum of the dimensions of each feature vector, plus the dimension of the interaction feature. Assuming that the Bloom filter bit vector in the spatial feature is k-dimensional, and the one-hot encoding in the causal feature is m-dimensional, then the base feature dimension is 15+k+m. The hidden layer dimension hidden_dim: can be exemplarily set to 64 or 128, which is used to provide sufficient model capacity to learn complex nonlinear relationships. The output layer dimension output_dim: its dimension is the dimension of the target spatiotemporal coordinate system, for example, it can be set to 8-dimensional. The specific hierarchical structure of the network can be defined using a sequence module, which successively includes: the first layer (feature interaction layer): a linear transformation layer (nn.Linear) from input_dim to hidden_dim, followed by a rectified linear unit activation function (nn.ReLU) to introduce nonlinearity. To accelerate training and improve stability, a batch normalization layer (nn.BatchNorm1d) can also be connected. The second layer (dimension fusion layer): a linear transformation layer from hidden_dim to hidden_dim, also followed by a ReLU activation function. To prevent overfitting, a dropout layer (nn.Dropout) can be added after this layer, for example, with a dropout rate of 0.2. The third layer (coordinate generation layer): a linear transformation layer from hidden_dim to output_dim, followed by a hyperbolic tangent activation function (nn.Tanh). Using Tanh can smoothly normalize the final output coordinate value to the interval [-1, 1], which is convenient for subsequent processing.
[0100] The forward propagation (forward) process of the neural network is designed to include direct concatenation of features and construction of interaction features. Specifically, when inputting the feature vectors f t (time), g s (space), and h c (causal), the original feature vectors are concatenated to form the base input tensor x = torch.cat([f t , g s , h c ], dim=-1), where torch.cat is a tensor concatenation function and dim is the specified dimension for concatenation. To enable the network to more directly learn the coupling relationship between different dimensions, interaction feature items are manually constructed. For example, the first two components of the time and spatial features can be extracted for element-wise multiplication f t [:,:2]×g s[:,:2] to capture the spatio-temporal interaction; similarly, the space-causal interaction term and the time-causal interaction term can be constructed. The basic input tensor x is spliced with all the constructed interaction feature terms to form an enhanced input tensor x interact and is sent into the network structure defined above for calculation to obtain the final output_dim dimensional spatio-temporal coordinates.
[0101] The preferred embodiments of the present application are described in detail above, but the present application is not limited to the specific details of the above-described embodiments. Within the technical concept of the present application, various equivalent transformations of the technical solutions of the present application can be made, and these equivalent transformations all belong to the protection scope of the present application.
Claims
1. A bidirectional incremental intelligent merging method for distributed storage fault recovery, characterized in that, include: Receive local and remote incremental operation sequences, map the operation sequences to a multi-dimensional spatiotemporal coordinate system, and generate a multi-dimensional spatiotemporal operation point set; The local incremental operation sequence includes the database operation type, target object, operation parameters, and local physical timestamp; the remote incremental operation sequence includes the logical clock; the database operation types include INSERT, DELETE, and UPDATE. The target object includes the logical address of the data object affected by the operation, the physical partition information where the data is located, and the node identifier that performs the operation; the operation parameters include the data range affected by the operation, i.e. the data range defined by the WHERE condition; the local physical timestamp includes the physical time when the operation occurred; the logical clock includes the logical timestamp used to trace the causal order. Based on a multidimensional spatiotemporal operation point set, a geometric causal cone is constructed for each operation point, and a causal interference spectrum is constructed by analyzing the interference between the geometric causal cones. Based on the causal interference spectrum and the multidimensional spatiotemporal operation point set, a spatiotemporal folding path is searched to avoid or minimize causal conflicts and obtain the optimal spatiotemporal folding scheme. Project the high-dimensional path in the optimal spatiotemporal folding scheme into a one-dimensional execution sequence, and execute to achieve a consistent data state; Constructing a causal interference map includes: For each operation point in the multidimensional spatiotemporal operation point set, its influence range in the time, space, and causal dimensions is calculated based on semantic attributes, generating a geometric causal cone with a specific multidimensional subtended angle, thus obtaining a set of geometric causal cones; where the time dimension subtended angle in the geometric causal cone is based on the causal propagation speed constant v. t The calculated causal propagation speed constant v t The calculation process is as follows: v base =1.0 / avg op_latency ;avg op_latency It is the system's average operating delay, v base Based on the base velocity; v adjusted =v base ×(1-0.5×dependency density dependency density It is the dependency density between operations in the system, v adjusted This is the adjusted dependency density; v t =v adjusted ×(2-system load ); system load This is the current system load; The intensity of causal interference is quantified by estimating the intersection volume of any two geometric causal cones in a high-dimensional space. Based on the causal interference strength, a causal interference graph is constructed, where the nodes of the causal interference graph represent operations, and the weights of the edges of the causal interference graph correspond to the interference strength.
2. The method according to claim 1, characterized in that, Generate a multidimensional spatiotemporal operation point set, including: From the local and remote incremental operation sequences, extract temporal features, spatial features, and semantic features for each operation to form an operation feature vector; the spatial features include node ID and partition ID; the temporal features include physical timestamp and vector clock. A dimension fusion operator composed of pre-configured neural networks is applied to nonlinearly transform the operational feature vectors into spatiotemporal coordinates to generate a multidimensional spatiotemporal operational point set.
3. The method according to claim 1, characterized in that, Before constructing the causal interference map, the following is also included: Define an internal causal density field for each geometric causal cone, where the gradient of the causal density field characterizes the propagation direction of causal influence; Within the intersection region of any two geometric causal cones, calculate and compare the gradient directions of their respective causal density fields; Based on the comparison results of gradient directions, the causal interference represented by the intersection is labeled as destructive interference or constructive interference; The construction of causal interference graphs includes the property of treating labels as edges.
4. The method according to claim 1, characterized in that, To obtain the optimal spacetime folding scheme, the following are included: Based on the multidimensional spatiotemporal operation point set and the preset folding transformation type, a spatiotemporal state space is defined, which includes executed operations, operations to be executed, and the current folding configuration. Based on causal interferometric graphs, a cost function is constructed that includes path length, interferometry strength, and folding complexity. Within the spatiotemporal state space, an optimization search is performed using a cost function to obtain the optimal spatiotemporal folding scheme.
5. The method according to claim 4, characterized in that, Optimized search is achieved by applying at least one of the following folding transformations: Time folding introduces a virtual time dimension that depends on the intensity of the interference for the destructive interference identified in the causal interference graph, creating parallel execution timelines that allow conflicting operations to be bypassed. This is achieved through the Multi-Version Concurrency Control (MVCC) mechanism. Space folding dynamically projects the data objects associated with conflicting operations to an isolated shadow data space, where the operations are executed to avoid direct access conflicts to the main data space; this is achieved through the copy-on-write mechanism, where conflicting operations are executed in the shadow partition. Causal folding involves implanting buffer nodes with predictive results and compensation logic between interdependent operations in a broken causal dependency chain, in order to achieve temporary decoupling and flexible connection between operations.
6. The method according to claim 5, characterized in that, Before performing the optimized search, the following is also included: Construct folding transformation functions for time folding, spatial folding, and causal folding respectively; By applying the pre-defined Lyapunov function, the dynamic characteristics of each folding transformation function are analyzed for convergence in order to verify and correct its stability in the state space. Based on the analysis and correction results, a stable folding transformation function library is generated, and the optimization search is achieved by calling the stable folding transformation function library.
7. The method according to claim 4, characterized in that, Optimize search through improvements Algorithm execution, wherein the execution process includes: The effectiveness of the path is continuously monitored during the search process to identify whether the search has fallen into a preset deadlock state; When a deadlock state is identified, the time folding transformation is invoked to backtrack the current search state to a previous spatiotemporal state point. Starting from the previous spatiotemporal state point, continue to explore new path branches in order to seek the global optimal solution.
8. The method according to claim 1, characterized in that, Projecting the high-dimensional path in the optimal spatiotemporal folding scheme into a one-dimensional execution sequence includes: Perform an initial projection on the high-dimensional path to generate a preliminary one-dimensional operation sequence; By comparing the preliminary one-dimensional operation sequence with the causal dependencies implied in the optimal spatiotemporal folding scheme, causal inversion conflicts are identified. For the identified causal inversion conflicts, a constraint satisfaction problem with maintaining causal order as a hard constraint is constructed and solved to reorder the initial one-dimensional operation sequence, resulting in a causal consistency sequence, which is then used as a one-dimensional execution sequence.
9. The method according to claim 8, characterized in that, After obtaining the causal consistency sequence, it also includes: By comparing the structural complexity of high-dimensional paths and one-dimensional execution sequences, the information loss metric caused by projection is quantitatively calculated. Identify operations that can be parallelized in high-dimensional paths but are serialized in one-dimensional execution sequences; The information loss metric and the identified operations are used as compensating metadata and appended to the corresponding operations in the one-dimensional execution sequence.
Citation Information
Patent Citations
A cause and effect concurrent detection method for large-scale cooperative environment
CN101127644A
Atlas embedding system and device
CN116848535A