Tree node transaction replication method and system based on replication semantics dispatching
Patent Information
- Application Number
- CN202611312368.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-08-27
AI Technical Summary
[0002]目前,传统方法通常对所有正文和附件执行全量物理克隆,缺乏基于复用评分的数据价值判定;使得高频通用的正文模板或大体积附件在每个目标节点下都生成独立物理副本,导致存储空间急剧冗余,尤其在频繁复制的业务场景下,会迅速消耗存储资源并增加备份成本
本发明通过在节点创建前对目标父节点加锁,并结合闭包重建与无环校验操作,将节点创建记录和闭包写入记录捆绑为原子事务;使得即使在并发操作或系统异常中断时,也不会产生悬挂节点或断裂的父子路径,同时从物理层面杜绝循环引用的产生,从而完整维护了树形存储底层的拓扑逻辑正确性;
Smart Images

Figure CN122837991B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of product data management technology, specifically to a tree node transaction replication method and system based on replication semantic dispatch. Background Technology
[0002] Currently, traditional methods typically perform full physical cloning of all text and attachments, lacking data value assessment based on reuse scoring. This results in high-frequency, commonly used text templates or large attachments generating independent physical copies on each target node, leading to a sharp redundancy in storage space. Especially in business scenarios with frequent copying, this can quickly consume storage resources and increase backup costs.
[0003] Furthermore, traditional methods do not differentiate between attachments and main text based on their ownership paths. When the general main text or common attachments of the source node are updated, all previously copied physical copies cannot be automatically synchronized, which can easily lead to data splitting and version inconsistency issues. At the same time, due to the lack of clear ownership determination for attachments, deleting the source node often results in dangling references or accidental deletion of valid data due to chaotic reference counting. This forces administrators to rely on complex manual scripts to maintain the relationships, significantly reducing the maintainability and data reliability of the system. Summary of the Invention
[0004] To achieve the above objectives, the present invention provides the following technical solution: a tree node transaction replication method based on replication semantic dispatch, comprising: Obtain the target replication request, perform semantic parsing on the target replication request to obtain the source node information, target parent node and replication target range corresponding to the target replication request; based on the source node information, query the complete subtree data corresponding to the source node information from the preset tree node storage structure, perform node deduplication and hierarchical sorting operations on the complete subtree data to obtain the current subtree to be replicated; Perform ancestor-descendant relationship analysis on the current subtree to be copied to obtain the node hierarchy mapping relationship, and determine the semantic copying type of all nodes to be copied based on the node hierarchy mapping relationship; Based on the semantic replication type and the preset multidimensional scoring rules, a reuse dimension score is calculated for each node to be replicated. The reuse score of each node to be replicated is obtained based on all reuse dimension scores. Based on the comparison between the reuse score of each node to be replicated and the preset reuse score threshold, each node to be replicated is classified to obtain the replication strategy of each node to be replicated. If the replication strategy of the node to be replicated is direct reuse, the node to be replicated is semantically assigned based on the node identifier of the target parent node, the reuse score of the node to be replicated, and the node hierarchy mapping relationship, so as to obtain the target assigned node of the node to be replicated under the target parent node. If the replication strategy of the node to be replicated is to create a new node, a merge judgment operation is performed on the node to be replicated based on the complete subtree data corresponding to the source node information, the reuse score of the node to be replicated, and the reuse scores of other nodes to be replicated that have a dependency relationship with the node to be replicated, to obtain the target transaction unit. Based on the target assignment node and the target parent node, node creation and closure reconstruction operations are performed on the nodes in the target transaction unit to obtain the transaction write result; based on the transaction write result, the node hierarchy mapping relationship and the preset replication semantic assignment rules, replication assignment operations are performed on the text data and attachment data in the current subtree to be replicated to obtain the text replication result and attachment cloning result; based on the node creation record, closure write record, text replication result and attachment cloning result, the final transaction replication result is determined.
[0005] Preferably, the target replication request carries the source node identifier and the target parent node identifier; Semantic parsing of the target replication request yields the source node information, target parent node, and replication target range corresponding to the target replication request, including: The source node identifier and the target parent node identifier are input into the pre-trained semantic dispatch model, which then extracts the hierarchical position information of the source node information in the tree structure through hierarchical relationship recognition, and calculates the hierarchical depth value of the source node information based on the hierarchical position information. Calculate the structural matching degree between the source node information and the target parent node, and count the number of direct child nodes of the source node information to calculate the branch complexity. Perform connectivity analysis on the source node information and the target parent node to obtain the path connectivity score; Based on the level depth value, structure matching degree, branch complexity and path connectivity score, the source node information, target parent node and copy target range are determined. The copy target range includes one of the following: full subtree copy range, partial subtree copy range and single node copy range.
[0006] Preferably, an ancestor-descendant relationship analysis operation is performed on the current subtree to be copied to obtain the node hierarchy mapping relationship, including: Based on the ancestor-descendant relationship stored in the preset tree node storage structure, obtain all descendant node data corresponding to the source node information to obtain a complete set of descendant nodes; The source node information is merged with the complete set of descendant nodes. The merged result is then subjected to node deduplication and hierarchical sorting operations to obtain the current subtree to be copied. For each node in the current subtree to be copied, determine all its ancestor nodes and all its descendant nodes according to the hierarchical relationship in the complete descendant node set, and obtain the node hierarchy mapping relationship. Among them, the node hierarchy mapping relationship is used for the calculation of reuse score, the calculation of semantic dispatch conflict score and closure path calculation operation.
[0007] Preferably, based on the semantic replication type and preset multi-dimensional scoring rules, a reuse dimension score is calculated for each node to be replicated, and a reuse score for each node to be replicated is obtained based on all reuse dimension scores, including: Based on the semantic replication type, determine the hierarchical dimension score, semantic dimension score, and historical operation dimension score corresponding to each node to be replicated, and use them as the reuse dimension score; Based on all reuse dimension scores and multi-dimensional scoring rules, calculate the comprehensive reuse score for each node to be replicated, and use the comprehensive reuse score as the reuse score for the node to be replicated. The semantic copying type is determined based on the ancestor-descendant association path between the node to be copied and the source node information in the node hierarchy mapping relationship.
[0008] Preferred copying strategies are direct reuse or creation: Based on the comparison between the reuse score of each node to be replicated and the preset reuse score threshold, each node to be replicated is classified, and a replication strategy for each node to be replicated is obtained, including: For each node to be replicated, determine whether the reuse score of the node to be replicated is greater than or equal to the preset reuse score threshold; If the reuse score of the node to be replicated is greater than or equal to the preset reuse score threshold, the replication strategy of the node to be replicated is determined to be direct reuse; If the reuse score of the node to be replicated is less than the preset reuse score threshold, the replication strategy for the node to be replicated is determined to be to create a new node.
[0009] Preferably, based on the node identifier of the target parent node, the reuse score of the node to be replicated, and the node hierarchy mapping relationship, semantic assignment is performed on the node to be replicated to obtain the target assigned node of the node to be replicated under the target parent node, including: Based on the node identifier of the target parent node, select the target mapping template that matches the node to be copied from the pre-set parent node mapping templates; The assignment priority of the node to be replicated is determined based on the target mapping template and the reuse score of the node to be replicated. The node to be replicated is initially assigned according to the assignment priority and the preset anchor point rule, and at least one assignment candidate relationship is obtained, wherein the assignment candidate relationship includes at least one candidate parent node. If the candidate assignment relationship includes a candidate parent node, the candidate parent node will be determined as the target assignment node; If the assignment candidate relationship includes multiple candidate parent nodes, obtain the subtree information related to each candidate parent node from the tree node storage structure, and calculate the conflict score of each candidate parent node based on the subtree information of each candidate parent node. Based on the conflict scores of each candidate parent node, the target assignment node is selected from the candidate parent nodes. The node hierarchy mapping relationship is also used to verify the hierarchical compatibility between candidate parent nodes and nodes to be replicated when selecting target assignment nodes.
[0010] Preferably, based on the complete subtree data corresponding to the source node information, the reuse score of the node to be replicated, and the reuse scores of other nodes to be replicated that have dependencies on the node to be replicated, a merge determination operation is performed on the node to be replicated to obtain the target transaction unit, including: Identify at least one target node to be replicated from other nodes that have dependency relationships with the node to be replicated, where the replication strategy is direct reuse; Based on the ancestor-descendant relationship path in the complete subtree data corresponding to the source node information, determine whether there are at least one other target node to be copied that satisfies the merging condition with the node to be copied. If there are other target nodes to be replicated that meet the merging conditions, the node to be replicated and the other target nodes to be replicated that meet the merging conditions will be merged and replicated to obtain a target transaction unit; If there are no other target nodes to be replicated that meet the merge conditions, the node to be replicated will be replicated as an independent transaction unit. The merging criteria are determined by the reuse score of the node to be replicated, the reuse score of other target nodes to be replicated, and the dependencies in the complete subtree data.
[0011] Preferably, the transaction write result includes node creation records and closure write records; all replicated nodes directly point to the original source node; Based on the target assignment node and target parent node, node creation and closure reconstruction operations are performed on the nodes in the target transaction unit to obtain the transaction write result. Based on the transaction write result, node hierarchy mapping relationship, and preset replication semantic assignment rules, replication assignment operations are performed on the text data and attachment data in the current subtree to be replicated to obtain the text replication result and attachment cloning result, including: Based on the target assignment node, perform child node creation operations on the nodes in the target transaction unit under the target parent node to obtain node creation records; based on the node hierarchy mapping relationship, perform closure path calculation operations on each node in the current subtree to be copied to obtain closure path results; Based on the closure path result, perform the closure data write operation to obtain the closure write record; determine the transaction write result based on the node creation record and the closure write record; before performing the child node creation operation, lock the target parent node to ensure the transaction consistency between the node creation record and the closure write record. Based on the node hierarchy mapping relationship, determine the main text data and attachment data corresponding to each node in the current subtree to be copied; based on the copy semantic dispatch rules and transaction write results, determine whether each piece of main text data needs to be copied in full or referenced. When it is determined that the main text data needs to be fully copied, the main text data is copied to the target node corresponding to the transaction write result to obtain the main text copy result. When it is determined that the text data needs to be referenced, the reference address of the text data is pointed to the corresponding text data storage location in the original source node, so that all nodes directly point to the original source node. Based on the attachment data and the attribution path in the node hierarchy mapping relationship, perform the attachment attribution determination operation to obtain the attachment attribution result. Based on the attachment attribution result, perform the attachment cloning operation to obtain the attachment cloning result.
[0012] Preferably, the final transaction replication result is determined based on the node creation record, closure write record, text copy result, and attachment cloning result, including: Generate a list of nodes that have completed replication based on the node creation record; Based on the closure write records and node hierarchy mapping relationship, perform a loop-free verification operation to obtain the consistency verification result; Determine the transaction completion status based on the results of copying the main text and cloning the attachments; The final transaction replication result is obtained by integrating the list of replication completed nodes, consistency verification results, and transaction completion status. Among them, the acyclic verification operation verifies that there are no circular references in the current subtree to be copied based on the closure path result in the closure write record.
[0013] A tree node transaction replication system based on replication semantic dispatch, applicable to the aforementioned tree node transaction replication method based on replication semantic dispatch, including: The information acquisition module is used to acquire the target copy request, perform semantic parsing on the target copy request to obtain the source node information, target parent node and copy target range corresponding to the target copy request; based on the source node information, it queries the complete subtree data corresponding to the source node information from the preset tree node storage structure, performs node deduplication and hierarchical sorting operations on the complete subtree data to obtain the current subtree to be copied; The relation analysis module is used to perform ancestor-descendant relation analysis on the current subtree to be copied, obtain the node-level mapping relationship, and determine the semantic copying type of all nodes to be copied based on the node-level mapping relationship; The reuse scoring module is used to calculate the reuse dimension score for each node to be replicated based on the semantic replication type and the preset multi-dimensional scoring rules. The reuse score of each node to be replicated is obtained based on all reuse dimension scores. Based on the comparison result of the reuse score of each node to be replicated with the preset reuse score threshold, each node to be replicated is classified to obtain the replication strategy of each node to be replicated. The first judgment module is used to perform semantic assignment on the node to be copied if the copying strategy of the node to be copied is direct reuse, based on the node identifier of the target parent node, the reuse score of the node to be copied, and the node hierarchy mapping relationship, so as to obtain the target assigned node of the node to be copied under the target parent node. The second judgment module is used to perform a merge judgment operation on the node to be replicated if the replication strategy of the node to be replicated is newly created, based on the complete subtree data corresponding to the source node information, the reuse score of the node to be replicated, and the reuse scores of other nodes to be replicated that have a dependency relationship with the node to be replicated, to obtain the target transaction unit. The replication result module is used to perform node creation and closure reconstruction operations on nodes in the target transaction unit according to the target assignment node and the target parent node to obtain the transaction write result; according to the transaction write result, node hierarchy mapping relationship and preset replication semantic assignment rules, it performs replication assignment operations on the text data and attachment data in the current subtree to be replicated to obtain the text replication result and attachment cloning result; and determines the final transaction replication result based on the node creation record, closure write record, text replication result and attachment cloning result.
[0014] Compared with the prior art, the beneficial effects of the present invention are: This invention locks the target parent node before node creation and combines closure reconstruction and acyclic verification operations to bind the node creation record and closure writing record into an atomic transaction. This ensures that even during concurrent operations or abnormal system interruptions, there will be no hanging nodes or broken parent-child paths, and at the same time, it eliminates the generation of circular references from the physical level, thereby fully maintaining the correctness of the topological logic of the underlying tree storage. This invention dynamically distinguishes between full copying and reference pointing to text data through reuse scoring, while performing differentiated cloning or sharing of attachments based on their ownership path. This strategy allows frequently used text data to be shared by multiple nodes simply through address mapping, significantly reducing storage space usage. Meanwhile, attachments belonging to specific nodes are cloned independently to ensure data isolation, thus achieving the best balance between saving resources and ensuring data independence. Attached Figure Description
[0015] Figure 1 This is a schematic flowchart of the overall method in one embodiment of the present invention; Figure 2This is a schematic diagram of the steps for parsing a copy request in one embodiment of the present invention; Figure 3 This is a schematic diagram of the overall system architecture in one embodiment of the present invention.
[0016] In the diagram: 1. Information acquisition module; 2. Relationship analysis module; 3. Reuse scoring module; 4. First judgment module; 5. Second judgment module; 6. Copy result module. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Example 1, please refer to Figure 1 - Figure 2 This invention provides a technical solution: a tree node transaction replication method based on replication semantic dispatch, comprising: S1. Obtain the target replication request, perform semantic parsing on the target replication request to obtain the source node information, target parent node and replication target range corresponding to the target replication request; based on the source node information, query the complete subtree data corresponding to the source node information from the preset tree node storage structure, perform node deduplication and hierarchical sorting operations on the complete subtree data to obtain the current subtree to be replicated; S2. Perform ancestor-descendant relationship analysis on the current subtree to be copied to obtain the node level mapping relationship, and determine the semantic copying type of all nodes to be copied based on the node level mapping relationship; S3. Calculate the reuse dimension score for each node to be replicated based on the semantic replication type and the preset multidimensional scoring rules. Obtain the reuse score of each node to be replicated based on all reuse dimension scores. Classify each node to be replicated based on the comparison result between the reuse score of each node to be replicated and the preset reuse score threshold to obtain the replication strategy of each node to be replicated. S4. If the replication strategy of the node to be replicated is direct reuse, the node to be replicated is semantically assigned according to the node identifier of the target parent node, the reuse score of the node to be replicated, and the node hierarchy mapping relationship, so as to obtain the target assigned node of the node to be replicated under the target parent node. S5. If the replication strategy of the node to be replicated is to create a new node, perform a merge judgment operation on the node to be replicated based on the complete subtree data corresponding to the source node information, the reuse score of the node to be replicated, and the reuse scores of other nodes to be replicated that have a dependency relationship with the node to be replicated, to obtain the target transaction unit. S6. Based on the target assignment node and the target parent node, perform node creation and closure reconstruction operations on the nodes in the target transaction unit to obtain the transaction write result; based on the transaction write result, the node hierarchy mapping relationship and the preset replication semantic assignment rules, perform replication assignment operations on the text data and attachment data in the current subtree to be replicated to obtain the text replication result and attachment cloning result; based on the node creation record, closure write record, text replication result and attachment cloning result, determine the final transaction replication result.
[0019] It should be noted that, assuming there is a product category tree in the system, the source node is category A, the target parent node is category B, and the scope of copying the target is limited to copying only the subcategories under category A and their associated data, excluding category A itself; Upon receiving the copy request, the source node identifier is parsed as A, the target parent node is B, and the copy range is the child level. Then, the complete subtree under category A is retrieved from the tree node storage structure, including subcategories A1, A2 and grandchild category A2a under A2. At the same time, nodes that may appear repeatedly due to multiple parent relationships are filtered out, and sorted according to the level depth to obtain the list of subtrees to be copied: A1, A2, A2a. Ancestor-descendant relationship analysis is performed on these three nodes, and it is found that A1 and A2 are sibling child nodes, and A2a is a descendant of A2. Based on this mapping, the semantic copying type of A1 and A2 is determined to be independent entity copying, and A2a is dependent entity copying. Calculate a reuse dimension score for each node. The dimensions include the frequency of node content changes, the number of associated attachments, and the number of downstream dependencies. Assuming A1 scores 85 points, A2 scores 70 points, and A2a scores 90 points, with a preset threshold of 75 points, A1 and A2a are classified as direct reuse, while A2 is classified as newly created. For A1, which is directly reused, its semantics are assigned to B based on the identifier, score 85, and hierarchical relationship of the target parent node B, generating the target assignment node B-A1, while retaining all attributes and substructures of the original node; for A2a, since it belongs to A2, it is not assigned independently for the time being. For the newly created A2, a merge decision is made: check the nodes that have dependencies on A2, and find that A2a depends on A2, and A2a's score of 90 is higher than the threshold. Therefore, A2 and A2a are merged into a target transaction unit. It is decided to create a new node B-A2 under the target parent node B, and at the same time rebuild A2a as its child node. Based on the target assignment node B-A1 and the target parent node B, node creation and closure reconstruction are performed, generating transaction write records that record the creation information of B-A1 and B-A2 and their parent-child closure relationships. According to the replication semantics assignment rules, the main text data under the source node A1 is copied to B-A1, and the attachment files under A1 are cloned to the new location. For A2 in the transaction unit, the main text is copied and the attachments are cloned in the same way. The node creation records, closure write records, main text copy results, and attachment cloning results are summarized to form a complete transaction replication result, returning a success status and recording the identifiers and path mappings of all new nodes to ensure the correctness of subsequent queries and operations. The entire replication process does not change the source tree structure; two independent branches, B-A1 and B-A2, are added to the target tree, and B-A2 contains cloned A2a child nodes. Both the main text and attachments are completely migrated.
[0020] In an optional embodiment, the target replication request carries a source node identifier and a target parent node identifier; Semantic parsing of the target replication request yields the source node information, target parent node, and replication target range corresponding to the target replication request, including: S101. Input the source node identifier and the target parent node identifier into the pre-trained semantic dispatch model, so that the semantic dispatch model can identify and extract the hierarchical position information of the source node information in the tree structure through hierarchical relationship, and calculate the hierarchical depth value of the source node information based on the hierarchical position information. S102. Calculate the structural matching degree between the source node information and the target parent node, count the number of direct child nodes of the source node information to calculate the branch complexity; perform connectivity analysis on the source node information and the target parent node to obtain the path connectivity score. S103. Based on the level depth value, structure matching degree, branch complexity and path connectivity score, determine the source node information, target parent node and copy target range, where the copy target range includes one of the following: full subtree copy range, partial subtree copy range and single node copy range.
[0021] It should be noted that, assuming the system is preparing to copy the source node C to the target parent node D; the source node identifier C and the target parent node identifier D are input into the pre-trained semantic dispatch model; the model first identifies the hierarchical position of C in the current tree structure, finds that C is located at the third level, and its ancestor path is root node R - first-level node X - second-level node YC, so the hierarchical depth value is calculated to be 3; The model calculates the structural matching degree between C and the target parent node D. D is located at the fourth level and has a similar child node pattern to C. For example, D already has two direct child nodes, which is close to the number of direct child nodes under C. Therefore, the structural matching degree is high, with a score of 0.85. At the same time, the number of direct child nodes of C is counted as 5, and the branch complexity is evaluated as medium. The model also performed connectivity analysis on C and D, and found that C and D do not have a direct ancestor or descendant relationship in the original tree, but they can be reached through the root node with a path length of 4 and a low path connectivity score of 0.4, indicating that the two are not strongly related. Considering the overall hierarchical depth of 3, structural matching degree of 0.85, moderate branch complexity, and path connectivity score of 0.4, the model determines that the current replication scenario is not suitable for full subtree replication because of its depth and poor connectivity, nor is it suitable for single-node replication because of its high structural matching degree. The final output replication target range is the replication range of a portion of the subtree, specifically limited to replicating only the first two levels of child nodes and their data under C, excluding deeper descendants, in order to achieve optimal semantic consistency.
[0022] In an optional embodiment, an ancestor-descendant relationship analysis operation is performed on the current subtree to be copied to obtain the node hierarchy mapping relationship, including: Based on the ancestor-descendant relationship stored in the preset tree node storage structure, obtain all descendant node data corresponding to the source node information to obtain a complete set of descendant nodes; The source node information is merged with the complete set of descendant nodes. The merged result is then subjected to node deduplication and hierarchical sorting operations to obtain the current subtree to be copied. For each node in the current subtree to be copied, determine all its ancestor nodes and all its descendant nodes according to the hierarchical relationship in the complete descendant node set, and obtain the node hierarchy mapping relationship. Among them, the node hierarchy mapping relationship is used for the calculation of reuse score, the calculation of semantic dispatch conflict score and closure path calculation operation.
[0023] It should be noted that, using the aforementioned product classification tree, the source node is category A; querying all descendant nodes of A from the tree node storage structure yields a set containing A1, A2, and A2a, where A2a is a descendant of A2; the source node A is merged with this set, deduplicated, and sorted by level depth, resulting in a list of subtrees to be copied: A, A1, A2, and A2a, with levels 0, 1, 1, and 2 respectively; Construct a hierarchical mapping relationship for each node: record that A has no ancestors and its descendants are A1, A2, and A2a; A1's ancestor is A and it has no descendants; A2's ancestor is A and its descendant is A2a; A2a's ancestors are A and A2 and it has no descendants; this mapping relationship is stored in a temporary structure. This mapping relationship is subsequently used in three places: when calculating reuse scores, the scope of influence is assessed based on the number of descendants a node has; for example, A2 has descendants, so its score is lowered. When performing conflict scoring for semantic assignment, the existing nodes under the target parent node are compared with the current node to avoid duplicate creation; for example, if B2a already exists under the target, a conflict score is deducted. When calculating closure paths, the parent-child connections between new nodes are directly determined based on the mapping; for example, after creating A2, the closure edge of A2a needs to be automatically reconstructed.
[0024] In an optional embodiment, a reuse dimension score is calculated for each node to be replicated based on the semantic replication type and a preset multidimensional scoring rule. The reuse score for each node to be replicated is obtained based on all reuse dimension scores, including: Based on the semantic replication type, determine the hierarchical dimension score, semantic dimension score, and historical operation dimension score corresponding to each node to be replicated, and use them as the reuse dimension score; Based on all reuse dimension scores and multi-dimensional scoring rules, calculate the comprehensive reuse score for each node to be replicated, and use the comprehensive reuse score as the reuse score for the node to be replicated. The semantic copying type is determined based on the ancestor-descendant association path between the node to be copied and the source node information in the node hierarchy mapping relationship.
[0025] It should be noted that, assuming the source node S has direct child nodes S1 and S2, where S2 contains child node S2a; based on the ancestor-descendant relationship between each node and S in the node hierarchy mapping, the semantic replication type is determined as follows: S1 and S2 have a parent-child relationship with S, with a path length of 1, and are considered independent entity replication types; S2a has a grandparent-grandchild relationship with S, with a path length of 2, and must be attached to S2, and is considered a subordinate entity replication type. For each node to be replicated, a three-dimensional score is assigned based on its semantic replication type: For node S1, which is an independent entity, the hierarchical dimension score is high because it is directly attached to the source node and has high structural importance, so it is given 90 points; the semantic dimension score is based on the similarity between the node name and content and S, and S1's name is related to S, so it is given 85 points; the historical operation dimension score is based on the number of recent modifications and access frequency, and S1 is relatively active, so it is given 80 points; after weighting the three dimensions according to the preset weights, the comprehensive reuse score is 86 points. For node S2, it is also an independent entity type, but its branch complexity is higher. The hierarchical dimension score is 80 points, the semantic similarity score is 75 points, the historical operation score is 70 points, and the overall score is 76 points. For node S2a, which is a subordinate entity type, its hierarchical dimension score is relatively low because it must follow the parent node S2, and it is given 70 points; the semantic dimension score is given 90 points because its name and content are strongly related to S2; the historical operation score is given 60 points because it has changed little recently, and the overall score is 73 points. Based on the comparison of the comprehensive reuse score of each node with the preset threshold of 75: S1 scored 86, which is higher than the threshold and is classified as direct reuse; S2 scored 76, which is slightly higher than the threshold and is also classified as direct reuse; S2a scored 73, which is lower than the threshold and is classified as newly created. Therefore, in subsequent processing, S1 and S2 are semantically assigned according to the direct reuse strategy, while S2a is merged with the newly created S2 into a transaction unit to avoid reusing its deep associations separately. The entire scoring process depends on the ancestor path length and dependency relationship between the node and the source node to ensure the rationality of the scoring and replication strategy.
[0026] In an alternative embodiment, the replication strategy is either direct reuse or new creation: Based on the comparison between the reuse score of each node to be replicated and the preset reuse score threshold, each node to be replicated is classified, and a replication strategy for each node to be replicated is obtained, including: For each node to be replicated, determine whether the reuse score of the node to be replicated is greater than or equal to the preset reuse score threshold; If the reuse score of the node to be replicated is greater than or equal to the preset reuse score threshold, the replication strategy of the node to be replicated is determined to be direct reuse; If the reuse score of the node to be replicated is less than the preset reuse score threshold, the replication strategy for the node to be replicated is determined to be to create a new node.
[0027] It should be noted that, taking the nodes S1, S2, and S2a to be replicated under the source node S as an example, the preset reuse score threshold is 75 points; the comprehensive reuse score of each node is judged in turn: Node S1 has a score of 86, which is greater than or equal to 75. Therefore, the replication strategy is determined to be direct reuse, and it will be directly assigned to the target parent node. Node S2 scored 76 points, which is also greater than or equal to 75, and is therefore classified as directly reused. Node S2a has a score of 73, which is less than 75. Therefore, the replication strategy is to create it as a new node and not reuse it separately. Instead, it will be included in a new transaction unit and wait to be merged with the parent node S2 for processing. If a node scores exactly 75 points, it is considered to be greater than or equal to the threshold and is still classified as directly reused.
[0028] In an optional embodiment, based on the node identifier of the target parent node, the reuse score of the node to be replicated, and the node hierarchy mapping relationship, semantic assignment is performed on the node to be replicated to obtain the target assigned node of the node to be replicated under the target parent node, including: Based on the node identifier of the target parent node, select the target mapping template that matches the node to be copied from the pre-set parent node mapping templates; The assignment priority of the node to be replicated is determined based on the target mapping template and the reuse score of the node to be replicated. The node to be replicated is initially assigned according to the assignment priority and the preset anchor point rule, and at least one assignment candidate relationship is obtained, wherein the assignment candidate relationship includes at least one candidate parent node. If the candidate assignment relationship includes a candidate parent node, the candidate parent node will be determined as the target assignment node; If the assignment candidate relationship includes multiple candidate parent nodes, obtain the subtree information related to each candidate parent node from the tree node storage structure, and calculate the conflict score of each candidate parent node based on the subtree information of each candidate parent node. Based on the conflict scores of each candidate parent node, the target assignment node is selected from the candidate parent nodes. The node hierarchy mapping relationship is also used to verify the hierarchical compatibility between candidate parent nodes and nodes to be replicated when selecting target assignment nodes.
[0029] It should be noted that, assuming the node to be replicated is a subcategory X under the source node, and the target parent node is T; based on the node identifier of T, a template matching the name and type of X is selected from the pre-set parent node mapping template library. This template defines the recommended mounting position and assignment rules of X in the target environment; combined with X's reuse score of 85 points, the default weight in the template is medium, and the overall calculation shows that the assignment priority is high; according to the preset anchor point rule, that is, to preferentially mount it to a sibling node with a similar structure to the source node, X is initially assigned, resulting in two candidate parent nodes: child nodes T1 and T2 under T, because T1 and T2 are structurally similar to X's original parent node; At this point, the candidate assignment relationship contains two candidate parent nodes. The subtree information of T1 and T2 is retrieved from the tree node storage structure. It is found that T1 already has child nodes of the same type as X, while T2 has no child nodes of the same type. According to the conflict scoring rules, T1's conflict score is calculated to be 20 points, as the existence of child nodes of the same type may lead to naming or semantic conflicts. T2's conflict score is 5 points, indicating a lower conflict rate. Simultaneously, the node hierarchy mapping relationship is used to verify compatibility: X's original hierarchy depth is 3, and both T1 and T2 are at level 3, indicating that hierarchy compatibility is passed. Finally, T2, with the lower conflict score, is selected as the target assignment node, and X is attached to T2 to avoid conflicts with existing nodes under T1.
[0030] In an optional embodiment, based on the complete subtree data corresponding to the source node information, the reuse score of the node to be replicated, and the reuse scores of other nodes to be replicated that have a dependency relationship with the node to be replicated, a merge determination operation is performed on the node to be replicated to obtain the target transaction unit, including: Identify at least one target node to be replicated from other nodes that have dependency relationships with the node to be replicated, where the replication strategy is direct reuse; Based on the ancestor-descendant relationship path in the complete subtree data corresponding to the source node information, determine whether there are at least one other target node to be copied that satisfies the merging condition with the node to be copied. If there are other target nodes to be replicated that meet the merging conditions, the node to be replicated and the other target nodes to be replicated that meet the merging conditions will be merged and replicated to obtain a target transaction unit; If there are no other target nodes to be replicated that meet the merge conditions, the node to be replicated will be replicated as an independent transaction unit. The merging criteria are determined by the reuse score of the node to be replicated, the reuse score of other target nodes to be replicated, and the dependencies in the complete subtree data.
[0031] It should be noted that, assuming the node to be replicated is a grandchild node S2a under the source node S, its reuse score is 73, which is below the threshold, and the replication strategy is to create a new node; other nodes to be replicated that have a dependency relationship with S2a are found, including its direct parent node S2 and its sibling node S2b; S2 has a reuse score of 76, and the strategy is direct reuse; S2b has a reuse score of 80, and the strategy is also direct reuse. Based on the ancestor-descendant paths in the source subtree data, it is determined that there is a parent-child dependency between S2a and S2, and S2 is the only ancestor of S2a; while S2b and S2a are only siblings and have no direct dependency. The merging conditions require that the node to be copied must be a subordinate entity, and at least one of its dependent ancestor nodes must be determined as directly reused. At the same time, the difference in scores between the two must not exceed a certain range to avoid forcibly merging high-scoring nodes with low-scoring nodes, which would lead to resource waste. Here, the difference between S2a's score of 73 and S2's score of 76 is only 3, and S2a depends on S2, so the merging conditions are met. S2a and S2 are merged into a single target transaction unit. During replication, S2 is created first, and then S2a is created under it, treating the whole process as an atomic operation. If S2a's score is only 50 while S2's score is 90, the difference is too large, and the merging condition is not met. S2a is copied as an independent transaction unit. Although the dependency exists, the score difference indicates that the merging reuse value is low. If the dependent ancestor node, such as S2 itself, is also a newly created node, the merging condition is usually not met either, because the two newly created nodes can be processed independently.
[0032] In an optional embodiment, the transaction write result includes node creation records and closure write records; all replicated nodes directly point to the original source node; Based on the target assignment node and target parent node, node creation and closure reconstruction operations are performed on the nodes in the target transaction unit to obtain the transaction write result. Based on the transaction write result, node hierarchy mapping relationship, and preset replication semantic assignment rules, replication assignment operations are performed on the text data and attachment data in the current subtree to be replicated to obtain the text replication result and attachment cloning result, including: Based on the target assignment node, perform child node creation operations on the nodes in the target transaction unit under the target parent node to obtain node creation records; based on the node hierarchy mapping relationship, perform closure path calculation operations on each node in the current subtree to be copied to obtain closure path results; Based on the closure path result, perform the closure data write operation to obtain the closure write record; determine the transaction write result based on the node creation record and the closure write record; before performing the child node creation operation, lock the target parent node to ensure the transaction consistency between the node creation record and the closure write record. Based on the node hierarchy mapping relationship, determine the main text data and attachment data corresponding to each node in the current subtree to be copied; based on the copy semantic dispatch rules and transaction write results, determine whether each piece of main text data needs to be copied in full or referenced. When it is determined that the main text data needs to be fully copied, the main text data is copied to the target node corresponding to the transaction write result to obtain the main text copy result. When it is determined that the text data needs to be referenced, the reference address of the text data is pointed to the corresponding text data storage location in the original source node, so that all nodes directly point to the original source node. Based on the attachment data and the attribution path in the node hierarchy mapping relationship, perform the attachment attribution determination operation to obtain the attachment attribution result. Based on the attachment attribution result, perform the attachment cloning operation to obtain the attachment cloning result.
[0033] It should be noted that, continuing from the previous scenario, the target assignment node is B-A1, the target parent node is B, and the transaction unit includes the newly created node B-A2 and its child node B-A2a; a write lock is acquired on the target parent node B to prevent concurrent modifications; then, the child node creation operation is performed under B, generating node creation records: creating B-A1, B-A2, and B-A2a; at the same time, according to the node hierarchy mapping relationship, the closure path is calculated for these three nodes, for example, the closure path of B-A2a is B to B-A2 to B-A2a, the closure data is written, and a closure write record is generated; the node creation record and the closure write record are atomically committed under lock protection, the transaction write result is obtained, the new node and its parent-child relationship are confirmed to be persisted, and then the lock is released; Based on the node hierarchy mapping, the associated text data for each node is determined; for example, B-A1 corresponds to the text document of source node A1, and B-A2 corresponds to the text configuration of source node A2. According to the copy semantic dispatch rules, the text copying method is determined: if the text content is strongly related to the target environment, a full copy operation is performed, copying the entire text of A1 to B-A1, resulting in the text copying result; if the text content is a general template and there is no need to modify it, a reference pointing operation is performed, pointing the text reference address of A2 directly to the original text data storage location of source node A2, so that B-A2 accesses the same text, saving storage. For attachment data, the attribution relationship is determined based on the attribution path. For example, if there is an image attachment under A1, and the attribution path is clearly dedicated to A1, then an attachment cloning operation is performed, generating an independent copy under B-A1, resulting in the attachment cloning result. However, if there is a shared document attachment under A2a, and its attribution path points to the public attachment area of the source node S, it is determined that no cloning is needed, and only the reference address is pointed to the public attachment. Finally, the node creation record, closure write record, text copy result, text reference result, attachment cloning result, and attachment reference result are summarized to form a complete transaction replication result, ensuring that all data operations are consistent and traceable.
[0034] In an optional embodiment, the final transaction replication result is determined based on the node creation record, closure write record, text replication result, and attachment cloning result, including: Generate a list of nodes that have completed replication based on the node creation record; Based on the closure write records and node hierarchy mapping relationship, perform a loop-free verification operation to obtain the consistency verification result; Determine the transaction completion status based on the results of copying the main text and cloning the attachments; The final transaction replication result is obtained by integrating the list of replication completed nodes, consistency verification results, and transaction completion status. Among them, the acyclic verification operation verifies that there are no circular references in the current subtree to be copied based on the closure path result in the closure write record.
[0035] It should be noted that after the copy operation is completed, a list of copied nodes is generated based on the node creation record, which includes the identifiers of the newly created nodes, for example, the list is B-A1, B-A2, B-A2a and their respective attributes; Read the closure write record, combine it with the node hierarchy mapping relationship, and perform acyclic verification. The verification process traverses each closure path, such as the path B-A2 to B-A2a, and checks in reverse to see if there is a path from B-A2a to B-A2, and ensures that no node appears in its ancestor chain. At the same time, it checks the path across transaction units to confirm that no circular dependencies are formed. If all paths are directed acyclic, the verification passes and the consistency verification result is successful. The summary of the text copying results includes successful full copying of B-A1 and successful referencing of the original text in B-A2; the attachment cloning results include successful cloning of attachments under B-A1 and successful referencing of attachments under B-A2a; all data operations have been completed without any anomalies, and the transaction completion status is marked as committed; Finally, the list of replicated nodes, the consistency verification result (passed), and the transaction completion status (committed) are integrated into the final transaction replication result. This result includes a complete new node mapping, verification report, and operation log, which can be delivered to the caller for subsequent querying or rollback auditing. If the verification fails, the entire transaction is rolled back and marked as failed.
[0036] Example 2, please refer to Figure 3 This invention provides a technical solution: a tree node transaction replication system based on replication semantic dispatch, applicable to the aforementioned tree node transaction replication method based on replication semantic dispatch, comprising: Information acquisition module 1 is used to acquire the target copy request, perform semantic parsing on the target copy request to obtain the source node information, target parent node and copy target range corresponding to the target copy request; based on the source node information, query the complete subtree data corresponding to the source node information from the preset tree node storage structure, perform node deduplication and hierarchical sorting operations on the complete subtree data to obtain the current subtree to be copied; Relationship analysis module 2 is used to perform ancestor-descendant relationship analysis on the current subtree to be copied, obtain the node level mapping relationship, and determine the semantic copying type of all nodes to be copied based on the node level mapping relationship; The reuse scoring module 3 is used to calculate the reuse dimension score for each node to be replicated according to the semantic replication type and the preset multi-dimensional scoring rules, and obtain the reuse score of each node to be replicated based on all reuse dimension scores; based on the comparison result of the reuse score of each node to be replicated with the preset reuse score threshold, each node to be replicated is classified to obtain the replication strategy of each node to be replicated. The first judgment module 4 is used to perform semantic assignment on the node to be copied based on the node identifier of the target parent node, the reuse score of the node to be copied, and the node hierarchy mapping relationship if the copying strategy of the node to be copied is direct reuse, so as to obtain the target assignment node of the node to be copied under the target parent node. The second judgment module 5 is used to perform a merge judgment operation on the node to be replicated if the replication strategy of the node to be replicated is newly created, based on the complete subtree data corresponding to the source node information, the reuse score of the node to be replicated, and the reuse scores of other nodes to be replicated that have a dependency relationship with the node to be replicated, to obtain the target transaction unit. The replication result module 6 is used to perform node creation and closure reconstruction operations on the nodes in the target transaction unit according to the target assignment node and the target parent node to obtain the transaction write result; according to the transaction write result, the node hierarchy mapping relationship and the preset replication semantic assignment rules, it performs replication assignment operations on the text data and attachment data in the current subtree to be replicated to obtain the text replication result and attachment cloning result; and determines the final transaction replication result according to the node creation record, closure write record, text replication result and attachment cloning result.
[0037] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited thereto. Various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention.
Claims
1. A tree node transaction replication method based on replication semantic dispatch, characterized in that, include: Obtain the target replication request, perform semantic parsing on the target replication request, and obtain the source node information, target parent node, and replication target range corresponding to the target replication request; Based on the source node information, query the complete subtree data corresponding to the source node information from the preset tree node storage structure, perform node deduplication and hierarchical sorting operations on the complete subtree data, and obtain the current subtree to be copied; Perform ancestor-descendant relationship analysis on the current subtree to be copied to obtain the node hierarchy mapping relationship, and determine the semantic copying type of all nodes to be copied based on the node hierarchy mapping relationship; Based on the semantic replication type and the preset multidimensional scoring rules, a reuse dimension score is calculated for each node to be replicated, and the reuse score of each node to be replicated is obtained based on all reuse dimension scores. Based on the comparison between the reuse score of each node to be replicated and the preset reuse score threshold, each node to be replicated is classified to obtain the replication strategy for each node to be replicated. If the replication strategy of the node to be replicated is direct reuse, the node to be replicated is semantically assigned based on the node identifier of the target parent node, the reuse score of the node to be replicated, and the node hierarchy mapping relationship, so as to obtain the target assigned node of the node to be replicated under the target parent node. If the replication strategy of the node to be replicated is to create a new node, a merge judgment operation is performed on the node to be replicated based on the complete subtree data corresponding to the source node information, the reuse score of the node to be replicated, and the reuse scores of other nodes to be replicated that have a dependency relationship with the node to be replicated, to obtain the target transaction unit. Based on the target assignment node and the target parent node, node creation and closure reconstruction operations are performed on the nodes in the target transaction unit to obtain the transaction write result; based on the transaction write result, the node hierarchy mapping relationship and the preset replication semantic assignment rules, replication assignment operations are performed on the text data and attachment data in the current subtree to be replicated to obtain the text replication result and attachment cloning result; based on the node creation record, closure write record, text replication result and attachment cloning result, the final transaction replication result is determined.
2. The tree node transaction replication method based on replication semantic dispatch according to claim 1, characterized in that, The target replication request carries the source node identifier and the target parent node identifier; Semantic parsing of the target replication request yields the source node information, target parent node, and replication target range corresponding to the target replication request, including: The source node identifier and the target parent node identifier are input into the pre-trained semantic dispatch model, which then extracts the hierarchical position information of the source node information in the tree structure through hierarchical relationship recognition, and calculates the hierarchical depth value of the source node information based on the hierarchical position information. Calculate the structural matching degree between the source node information and the target parent node, and count the number of direct child nodes of the source node information to calculate the branch complexity. Perform connectivity analysis on the source node information and the target parent node to obtain the path connectivity score; Based on the level depth value, structure matching degree, branch complexity and path connectivity score, the source node information, target parent node and copy target range are determined. The copy target range includes one of the following: full subtree copy range, partial subtree copy range and single node copy range.
3. The tree node transaction replication method based on replication semantic dispatch according to claim 2, characterized in that, Perform ancestor-descendant relationship analysis on the current subtree to be copied to obtain the node hierarchy mapping relationship, including: Based on the ancestor-descendant relationship stored in the preset tree node storage structure, obtain all descendant node data corresponding to the source node information to obtain a complete set of descendant nodes; The source node information is merged with the complete set of descendant nodes. The merged result is then subjected to node deduplication and hierarchical sorting operations to obtain the current subtree to be copied. For each node in the current subtree to be copied, determine all its ancestor nodes and all its descendant nodes according to the hierarchical relationship in the complete descendant node set, and obtain the node hierarchy mapping relationship. Among them, the node hierarchy mapping relationship is used for the calculation of reuse score, the calculation of semantic dispatch conflict score and closure path calculation operation.
4. The tree node transaction replication method based on replication semantic dispatch according to claim 3, characterized in that, Based on the semantic replication type and the preset multi-dimensional scoring rules, a reuse dimension score is calculated for each node to be replicated. The reuse score for each node to be replicated is obtained based on all reuse dimension scores, including: Based on the semantic replication type, determine the hierarchical dimension score, semantic dimension score, and historical operation dimension score corresponding to each node to be replicated, and use them as the reuse dimension score; Based on all reuse dimension scores and multi-dimensional scoring rules, calculate the comprehensive reuse score for each node to be replicated, and use the comprehensive reuse score as the reuse score for the node to be replicated. The semantic copying type is determined based on the ancestor-descendant association path between the node to be copied and the source node information in the node hierarchy mapping relationship.
5. The tree node transaction replication method based on replication semantic dispatch according to claim 4, characterized in that, The copying strategy is either to reuse directly or create a new copy: Based on the comparison between the reuse score of each node to be replicated and the preset reuse score threshold, each node to be replicated is classified, and a replication strategy for each node to be replicated is obtained, including: For each node to be replicated, determine whether the reuse score of the node to be replicated is greater than or equal to the preset reuse score threshold; If the reuse score of the node to be replicated is greater than or equal to the preset reuse score threshold, the replication strategy of the node to be replicated is determined to be direct reuse; If the reuse score of the node to be replicated is less than the preset reuse score threshold, the replication strategy for the node to be replicated is determined to be to create a new node.
6. The tree node transaction replication method based on replication semantic dispatch according to claim 5, characterized in that, Based on the node identifier of the target parent node, the reuse score of the node to be replicated, and the node hierarchy mapping relationship, semantic assignment is performed on the node to be replicated to obtain the target assigned node of the node to be replicated under the target parent node, including: Based on the node identifier of the target parent node, select the target mapping template that matches the node to be copied from the pre-set parent node mapping templates; The assignment priority of the node to be replicated is determined based on the target mapping template and the reuse score of the node to be replicated. The node to be replicated is initially assigned according to the assignment priority and the preset anchor point rule, and at least one assignment candidate relationship is obtained, wherein the assignment candidate relationship includes at least one candidate parent node. If the candidate assignment relationship includes a candidate parent node, the candidate parent node will be determined as the target assignment node; If the assignment candidate relationship includes multiple candidate parent nodes, obtain the subtree information related to each candidate parent node from the tree node storage structure, and calculate the conflict score of each candidate parent node based on the subtree information of each candidate parent node. Based on the conflict scores of each candidate parent node, the target assignment node is selected from the candidate parent nodes. The node hierarchy mapping relationship is also used to verify the hierarchical compatibility between candidate parent nodes and nodes to be replicated when selecting target assignment nodes.
7. The tree node transaction replication method based on replication semantic dispatch according to claim 6, characterized in that, Based on the complete subtree data corresponding to the source node information, the reuse score of the node to be replicated, and the reuse scores of other nodes to be replicated that have dependencies on the node to be replicated, a merge determination operation is performed on the node to be replicated to obtain the target transaction unit, including: Identify at least one target node to be replicated from other nodes that have dependency relationships with the node to be replicated, where the replication strategy is direct reuse; Based on the ancestor-descendant relationship path in the complete subtree data corresponding to the source node information, determine whether there is at least one other target node to be copied that satisfies the merging condition with the node to be copied. If there are other target nodes to be replicated that meet the merging conditions, the node to be replicated and the other target nodes to be replicated that meet the merging conditions will be merged and replicated to obtain a target transaction unit; If there are no other target nodes to be replicated that meet the merge conditions, the node to be replicated will be replicated as an independent transaction unit. The merging criteria are determined by the reuse score of the node to be replicated, the reuse score of other target nodes to be replicated, and the dependencies in the complete subtree data.
8. The tree node transaction replication method based on replication semantic dispatch according to claim 7, characterized in that, The transaction write results include node creation records and closure write records; all replicated nodes point directly to the original source node; Based on the target assignment node and target parent node, node creation and closure reconstruction operations are performed on the nodes in the target transaction unit to obtain the transaction write result. Based on the transaction write result, node hierarchy mapping relationship, and preset replication semantic assignment rules, replication assignment operations are performed on the text data and attachment data in the current subtree to be replicated to obtain the text replication result and attachment cloning result, including: Based on the target assignment node, perform child node creation operations on the nodes in the target transaction unit under the target parent node to obtain node creation records; based on the node hierarchy mapping relationship, perform closure path calculation operations on each node in the current subtree to be copied to obtain closure path results; Based on the closure path result, perform the closure data write operation to obtain the closure write record; determine the transaction write result based on the node creation record and the closure write record; before performing the child node creation operation, lock the target parent node to ensure the transaction consistency between the node creation record and the closure write record. Based on the node hierarchy mapping relationship, determine the main text data and attachment data corresponding to each node in the current subtree to be copied; based on the copy semantic dispatch rules and transaction write results, determine whether each piece of main text data needs to be copied in full or referenced. When it is determined that the main text data needs to be fully copied, the main text data is copied to the target node corresponding to the transaction write result to obtain the main text copy result. When it is determined that the text data needs to be referenced, the reference address of the text data is pointed to the corresponding text data storage location in the original source node, so that all nodes directly point to the original source node. Based on the attachment data and the attribution path in the node hierarchy mapping relationship, perform the attachment attribution determination operation to obtain the attachment attribution result. Based on the attachment attribution result, perform the attachment cloning operation to obtain the attachment cloning result.
9. The tree node transaction replication method based on replication semantic dispatch according to claim 8, characterized in that, Based on the node creation record, closure write record, text copy result, and attachment clone result, determine the final transaction replication result, including: Generate a list of nodes that have completed replication based on the node creation record; Based on the closure write records and node hierarchy mapping relationship, perform a loop-free verification operation to obtain the consistency verification result; Determine the transaction completion status based on the results of copying the main text and cloning the attachments; The final transaction replication result is obtained by integrating the list of replication completed nodes, consistency verification results, and transaction completion status. Among them, the acyclic verification operation verifies that there are no circular references in the current subtree to be copied based on the closure path result in the closure write record.
10. A tree node transaction replication system based on replication semantic dispatch, applicable to the tree node transaction replication method based on replication semantic dispatch as described in any one of claims 1-9, characterized in that, include: The information acquisition module is used to acquire target replication requests, perform semantic parsing on target replication requests, and obtain the source node information, target parent node, and replication target range corresponding to the target replication request. Based on the source node information, query the complete subtree data corresponding to the source node information from the preset tree node storage structure, perform node deduplication and hierarchical sorting operations on the complete subtree data, and obtain the current subtree to be copied; The relation analysis module is used to perform ancestor-descendant relation analysis on the current subtree to be copied, obtain the node-level mapping relationship, and determine the semantic copying type of all nodes to be copied based on the node-level mapping relationship; The reuse scoring module is used to calculate the reuse dimension score for each node to be replicated based on the semantic replication type and the preset multi-dimensional scoring rules, and to obtain the reuse score of each node to be replicated based on all reuse dimension scores. Based on the comparison between the reuse score of each node to be replicated and the preset reuse score threshold, each node to be replicated is classified to obtain the replication strategy for each node to be replicated. The first judgment module is used to perform semantic assignment on the node to be copied if the copying strategy of the node to be copied is direct reuse, based on the node identifier of the target parent node, the reuse score of the node to be copied, and the node hierarchy mapping relationship, so as to obtain the target assigned node of the node to be copied under the target parent node. The second judgment module is used to perform a merge judgment operation on the node to be replicated if the replication strategy of the node to be replicated is newly created, based on the complete subtree data corresponding to the source node information, the reuse score of the node to be replicated, and the reuse scores of other nodes to be replicated that have a dependency relationship with the node to be replicated, to obtain the target transaction unit. The replication result module is used to perform node creation and closure reconstruction operations on nodes in the target transaction unit according to the target assignment node and the target parent node to obtain the transaction write result; according to the transaction write result, node hierarchy mapping relationship and preset replication semantic assignment rules, it performs replication assignment operations on the text data and attachment data in the current subtree to be replicated to obtain the text replication result and attachment cloning result; and determines the final transaction replication result based on the node creation record, closure write record, text replication result and attachment cloning result.
Citation Information
Patent Citations
Storage and query method and system for tree structure data and medium
CN121958269A
Data processing method and apparatus, readable storage medium, and electronic device
US20240256613A1