Method for bidirectional synchronization between BOM task tree and simulation application process canvas

The method synchronizes BOM task trees with simulation application flowcharts by using incremental updates on shared directed graphs, reducing time complexity and preventing deadlocks in complex simulations.

CN119862724BActive Publication Date: 2025-07-15CHINA SHIPBUILDING ORLANDO WUXI SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510352282.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-15
Estimated Expiration
2045-03-25

AI Technical Summary

Technical Problem

In the prior art, the bidirectional synchronization of the BOM task tree and the simulation application process canvas has problems of deadlock and high time complexity. Especially in complex simulation application processes, the dual loop comparison method leads to performance impact and deadlock risk.

Method used

By constructing a directed loop graph data structure shared by the BOM task tree and the simulation application process canvas, monitoring the data structure addition, deleting and modifying operations of the data structure, obtaining a set of directed loop graph data structures with incremental changes, and performing asynchronous updates based on incremental changes, avoiding full-quantity double loop comparison, and using the incremental directed loop graph method for synchronization.

Benefits of technology

It effectively avoids deadlock problems and reduces the time complexity from O(V2) to O(4*V), significantly improving the synchronization efficiency and performance of complex simulation processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862724B_ABST
    Figure CN119862724B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of simulation computing technology, and specifically discloses a method for two-way synchronization between a BOM task tree and a simulation application process canvas, including: constructing a directed cyclic graph data structure shared by the BOM task tree and the simulation application process canvas; initializing the data structure of the BOM task tree and the data structure of the simulation application process canvas; respectively performing data structure addition, deletion, and modification operation monitoring on the BOM task tree and the simulation application process canvas to obtain a set of directed cyclic graph data structures with incremental changes; respectively performing asynchronous update from the data structure of the BOM task tree to the data structure of the simulation application process canvas or asynchronous update from the data structure of the simulation application process canvas to the data structure of the BOM task tree according to the set of directed cyclic graph data structures with incremental changes. The method for two-way synchronization between the BOM task tree and the simulation application process canvas provided by the present invention can avoid deadlocks and reduce the time complexity at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of simulation computing, and particularly to a method for two-way synchronization between a BOM task tree and a simulation application process canvas. Background Art

[0002] In the process of simulation design in the field of overall ship performance, multiple simulation computing software (referred to as APP for short) need to be combined and connected to form an APP simulation application process to solve problems such as cross-professional simulation collaboration, solidification of simulation processes and knowledge among APPs. To facilitate the design of the APP simulation application process by simulation designers, improve the design efficiency, enhance the design intuitiveness, and also to meet the requirements of visual design and complex business logic, a visual canvas is designed. On this canvas, multiple APPs are logically combined in a drag-and-drop manner to form an application process design. At the same time, a simulation design hierarchical task tree (referred to as BOM task tree) consistent with the main structure of the APP simulation application process is designed to mount simulation computing task plans, which is convenient for simulation personnel to compare simulation computing tasks after multiple simulation computations to form an optimal plan.

[0003] In the prior art, to achieve two-way synchronization between the APP simulation application process on the canvas and the BOM task tree, it is necessary to construct the data structures of both and compare them. For example, when synchronizing from the APP simulation application process to the BOM task tree, according to the simulation task node information of the APP simulation application process on the canvas, a simulation task node json string JsonFlow_New needs to be constructed. At the same time, the original BOM task tree information is retrieved from the database, and a Json string JsonBom_Old is also constructed. Using a double-loop comparison method, a full comparison is made between the JsonFlow_New string and the JsonBom_Old information. JsonBom_Old is set as the outer loop, and JsonFlow_New is set as the inner loop to determine which BOM task tree nodes are newly added, deleted, or modified, and a new BOM task tree JsonBom_New string is formed. After storing the JsonBom_New string in the database, the BOM task tree is reloaded and displayed on the canvas.

[0004] When the APP simulation application process is relatively simple, the full - scale comparison using the double - loop comparison method can achieve two - way synchronization between the BOM task tree and the APP simulation application process. However, when the APP simulation application process is relatively complex, especially when there is a back - tracking situation in the business - flow connection of the simulation task nodes in the APP simulation application process design, that is, from subsequent task nodes pointing to multiple previous task nodes, there is a loop in the directed cyclic graph. In this case, the full - scale double - loop comparison method has a high time complexity and affects the program performance. At the same time, during this full - scale comparison process with double - loop nesting, if both directed cyclic graphs have loops and the process continuously requests and releases resources in the loop, it may form a circular - wait condition, resulting in deadlocks and being unable to complete the comparison between the two.

[0005] Although there are some measures to prevent deadlocks in the prior art. For example, a process can be allowed to allocate all the required resources at once when requesting resources, or the resource - ordered allocation method can be adopted to ensure that each process requests resources in the same order. At the same time, the banker's algorithm can be used to check whether deadlocks will occur before the system allocates resources, and resources are only allocated when it is confirmed that no deadlocks will occur. Deadlocks can also be detected and resolved by regularly checking whether there are deadlocks. Once a deadlock is found, measures are taken to resolve it. This usually involves interrupting and revoking the resource occupancy of some processes until a safe resource - allocation sequence is found.

[0006] However, these methods for avoiding deadlocks cannot solve the time - complexity problem, and at the same time, the implementation of the program is complex and the maintenance cost is relatively high. Therefore, how to provide a comparison method that can avoid deadlocks and reduce the time complexity has become a technical problem that needs to be urgently solved by those skilled in the art. Summary of the Invention

[0007] The present invention provides a method for two - way synchronization between the BOM task tree and the simulation application process canvas, which solves the problems of deadlocks and high time complexity existing in the two - way synchronization between the APP simulation application process on the canvas and the BOM task tree in the related art.

[0008] As an aspect of the present invention, a method for two-way synchronization between a BOM task tree and a simulation application process canvas is provided, which includes: constructing a directed acyclic graph data structure shared by the BOM task tree and the simulation application process canvas; initializing the data structure of the BOM task tree and the data structure of the simulation application process canvas; respectively monitoring the data structure addition, deletion, and modification operations of the BOM task tree and the simulation application process canvas to obtain a set of directed acyclic graph data structures with incremental changes; according to the set of directed acyclic graph data structures with incremental changes and in combination with the hierarchical relationship of the BOM task tree, performing asynchronous update of the data structure of the BOM task tree to the data structure of the simulation application process canvas, and / or, according to the set of directed acyclic graph data structures with incremental changes and in combination with the task grouping boxes of the simulation application process canvas, performing asynchronous update of the data structure of the simulation application process canvas to the data structure of the BOM task tree, so as to complete the two-way synchronization between the BOM task tree and the simulation application process canvas.

[0009] Further, constructing a directed acyclic graph data structure shared by the BOM task tree and the simulation application process canvas includes: determining the structure type of the directed acyclic graph, where the structure type of the directed acyclic graph includes task grouping, task nodes, business flow directed edges, and data flow directed edges; respectively constructing corresponding data structures for the structure types of the directed acyclic graph; and forming the data structures corresponding to the structure types of the directed acyclic graph into a directed acyclic graph data structure.

[0010] Further, initializing the data structure of the BOM task tree and the data structure of the simulation application process canvas includes: determining whether the data structure of the BOM task tree and the data structure of the simulation application process canvas are newly created; if they are newly created, the initialization results of the data structure of the BOM task tree and the data structure of the simulation application process canvas are both empty; if they are not newly created, reading the simulation application process canvas string and the BOM task tree string from the database for initialization.

[0011] Further, respectively monitoring the data structure addition, deletion, and modification operations of the BOM task tree and the simulation application process canvas to obtain a set of directed acyclic graph data structures with incremental changes includes: respectively monitoring the data structure addition, deletion, and modification operations of the BOM task tree and the simulation application process canvas according to the monitoring log; obtaining the data structures that have changed in the monitoring results; and constructing the data structures that have changed into a set of directed acyclic graph data structures with incremental changes.

[0012] Further, an asynchronous update of the data structure of the BOM task tree to the data structure of the simulation application process canvas is performed according to the set of directed cyclic graph data structures with incremental changes and in combination with the hierarchical relationship of the BOM task tree, and / or, an asynchronous update of the data structure of the simulation application process canvas to the data structure of the BOM task tree is performed according to the set of directed cyclic graph data structures with incremental changes and in combination with the task grouping box of the simulation application process canvas, including: determining an incremental change target according to the set of directed cyclic graph data structures with incremental changes; if the incremental change target is the BOM task tree, asynchronously updating the data structure of the simulation application process canvas according to the data structure of the BOM task tree; if the incremental change target is the simulation application process canvas, asynchronously updating the data structure of the BOM task tree according to the data structure of the simulation application process canvas.

[0013] Further, it also includes the following steps performed after the two-way synchronization between the BOM task tree and the simulation application process canvas is completed: comparing the data structures of the BOM task tree and the simulation application process canvas respectively; if the information of the two is consistent, it is determined that the consistency verification is passed; if the information of the two is inconsistent, it is determined that the consistency verification fails.

[0014] Further, an asynchronous update of the data structure of the BOM task tree to the data structure of the simulation application process canvas is performed according to the set of directed cyclic graph data structures with incremental changes and in combination with the hierarchical relationship of the BOM task tree, including: determining the target task grouping box of the incremental task nodes in the set of directed cyclic graph data structures with incremental changes in the simulation application process canvas according to the hierarchical relationship in the data structure of the BOM task tree; determining the coordinate position information of the incremental task nodes in the simulation application process canvas according to the vertex coordinates of the target task grouping box; determining the business flow connection lines of the incremental task nodes in the simulation application process canvas according to the hierarchical relationship in the data structure of the BOM task tree and the target task grouping box.

[0015] Further, determine the business flow connection line of the incremental task node in the simulation application process canvas according to the hierarchical relationship in the data structure of the BOM task tree and the target task grouping box, including: determining the target task node and the connection direction in the simulation application process canvas that have a connection relationship with the incremental task node according to the superior-subordinate relationship of different-level task nodes and the front-back sequence relationship of same-level task nodes in the BOM task tree; determining the shortest distance between the incremental task node to be connected and the target task node in the simulation application process canvas according to the A* algorithm for obstacle avoidance of the task grouping box; realizing the business flow connection line of the incremental task node in the simulation application process canvas according to the shortest distance and the connection direction between the incremental task node to be connected and the target task node in the simulation application process canvas.

[0016] Further, determine the shortest distance between the incremental task node to be connected and the target task node in the simulation application process canvas according to the A* algorithm for obstacle avoidance of the task grouping box, including: selecting any task node in the simulation application process canvas as the current task node; respectively determining the actual distance from the target task node to the current task node and the estimated distance from the current task node to the incremental task node; setting all other task grouping boxes in the simulation application process canvas except the target task node and the incremental task node as obstacles; finding the shortest path that can avoid all obstacles between the target task node and the incremental task node.

[0017] Further, determine the target task node and the connection direction in the simulation application process canvas that have a connection relationship with the incremental task node according to the superior-subordinate relationship of different-level task nodes and the front-back sequence relationship of same-level task nodes in the BOM task tree, including: determining the task grouping box to which the incremental task node belongs in the simulation application process canvas according to the task grouping where the incremental task node is located in the data structure of the BOM task tree; determining the target task node and the connection direction of the incremental task node in the simulation application process canvas according to the upper and lower level task node relationship of the incremental task node in the data structure of the BOM task tree.

[0018] The method for bidirectional synchronization between the BOM task tree and the simulation application process canvas provided by the present invention obtains the data structures that change in the BOM task tree and the simulation application process through monitoring, and constructs a directed cyclic graph data structure with incremental changes based on this. Therefore, only the changed parts in the simulation application process canvas and the BOM task tree are compared, avoiding the full-scale internal and external nested double-loop comparison of two directed cyclic graphs using the full-scale double-loop comparison method, thus avoiding the deadlock problem that may occur during the double-loop comparison; at the same time, after adopting the bidirectional synchronization method between the BOM task tree and the simulation application process canvas based on the incremental directed cyclic graph, the original time complexity O(V 2 ) is reduced to O(4*V), where V = max (the number of task nodes V1 in the BOM tree directed graph, the number of task nodes V2 in the APP simulation application process). Therefore, when the number of task nodes is greater than 4, the time complexity will decrease significantly. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present invention, but do not constitute a limitation to the present invention.

[0020] Figure 1 It is a flowchart of the method for bidirectional synchronization between the BOM task tree and the simulation application process canvas provided by the present invention.

[0021] Figure 2 It is a flowchart of constructing a directed cyclic graph data structure provided by the present invention.

[0022] Figure 3 It is a flowchart of initializing the data structure provided by the present invention.

[0023] Figure 4 It is a flowchart of obtaining a set of directed cyclic graph data structures with incremental changes provided by the present invention.

[0024] Figure 5 It is a flowchart of asynchronous update provided by the present invention.

[0025] Figure 6 It is a schematic diagram of the BOM task tree and the simulation application process canvas taking the overall design process of a certain type of ship as an example provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0026] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the drawings and in combination with the embodiments.

[0027] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data used in appropriate cases can be interchanged so as to implement the embodiments of the present invention described herein. In addition, 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 necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0029] In this embodiment, a method for two-way synchronization between a BOM task tree and a simulation application process canvas is provided. Figure 1 It is a flowchart of the method for two-way synchronization between a BOM task tree and a simulation application process canvas provided according to an embodiment of the present invention, as Figure 1 shown, including: S100, constructing a directed acyclic graph data structure common to the BOM task tree and the simulation application process canvas.

[0030] In the embodiments of the present invention, the directed acyclic graph data structure includes task groups, task nodes, business flow directed edges, and data flow directed edges. Therefore, a directed acyclic graph data structure common to both is constructed for the BOM task tree and the simulation application process canvas respectively, so as to subsequently determine the incremental directed acyclic graph data structure that has changed based on this.

[0031] S200, initializing the data structure of the BOM task tree and the data structure of the simulation application process canvas.

[0032] The data structure of the BOM task tree and the data structure of the simulation application process canvas are both initialized to facilitate determining the state of the data structure of the current BOM task tree and the state of the data structure of the current simulation application process canvas.

[0033] S300, respectively performing data structure addition, deletion, and modification operation monitoring on the BOM task tree and the simulation application process canvas to obtain a set of incremental directed acyclic graph data structures that have changed.

[0034] In an embodiment of the present invention, data structures that have changed (added, deleted, or modified) in the BOM task tree and the simulation application process canvas are obtained in real time by listening, and a set of directed cyclic graph data structures with incremental changes is constructed based on the changed data structures.

[0035] S400. According to the set of directed cyclic graph data structures with incremental changes and in combination with the hierarchical relationship of the BOM task tree, perform asynchronous update of the data structure of the BOM task tree to the data structure of the simulation application process canvas, and / or according to the set of directed cyclic graph data structures with incremental changes and in combination with the task grouping boxes of the simulation application process canvas, perform asynchronous update of the data structure of the simulation application process canvas to the data structure of the BOM task tree, so as to complete the two-way synchronization between the BOM task tree and the simulation application process canvas.

[0036] In an embodiment of the present invention, it is determined whether the data structure of the BOM task tree has changed or the data structure of the simulation application process canvas has changed based on the set of directed cyclic graph data structures with incremental changes, and asynchronous update is performed on the other party according to the changed party to realize the synchronization process between the two parties.

[0037] The method for two-way synchronization between the BOM task tree and the simulation application process canvas provided by the embodiments of the present invention obtains the data structures that have changed in the BOM task tree and the simulation application process by listening, and constructs a directed cyclic graph data structure with incremental changes based on this. Therefore, only the changed parts in the simulation application process canvas and the BOM task tree are compared, avoiding the full-scale inner and outer nested double-loop comparison of two directed cyclic graphs using the full-scale double-loop comparison method, thereby avoiding the deadlock problem that may occur during the double-loop comparison process; at the same time, since the two-way synchronization method between the BOM task tree and the simulation application process canvas based on the incremental directed cyclic graph is adopted, the original time complexity O(V 2 ) is reduced to O(4*V), where V = max (the number of task nodes V1 in the BOM tree directed graph, the number of task nodes V2 in the APP simulation application process). Therefore, when the number of task nodes is greater than 4, the time complexity will decrease significantly.

[0038] In an embodiment of the present invention, a directed cyclic graph data structure common to the BOM task tree and the simulation application process canvas is constructed, as Figure 2 shown, including: S110. Determine the structure type of the directed cyclic graph, and the structure type of the directed cyclic graph includes task grouping, task nodes, business flow directed edges, and data flow directed edges; S120. Respectively construct corresponding data structures for the structure type of the directed cyclic graph.

[0039] In the embodiments of the present invention, data structures corresponding to task groups, task nodes, business flow directed edges, and data flow directed edges of a directed cyclic graph are respectively constructed.

[0040] Specifically, the data structure C of the task group of the directed cyclic graph is constructed as C = (Cid, CName, T, X s , Y s , X e , Y e ); it appears as a first-level tree node in the BOM tree and as the outermost task group in the APP simulation application process design.

[0041] Among them, Cid is the unique identifier of the task group; CName is the name of the task group; T is the add / delete / modify status of the task group, generally represented by a timestamp; X s and Y s represent the coordinate positions of the upper left corner endpoint of the task group box on the canvas; X e and Y e represent the coordinate positions of the lower right corner endpoint of the task group box on the canvas.

[0042] The data structure V of the task nodes of the directed cyclic graph is constructed as V = (Vid, TaskName, APPName, APPphoto, C, T, X, Y); it appears as tree nodes and leaf nodes below the second level in the BOM tree and as task nodes within the task group in the APP simulation application process design. It is not allowed to add task nodes outside the task group.

[0043] Among them: Vid is the unique identifier of the task node; TaskName is the name of the task node; APPName is the name of the mounted APP; APPphoto is the icon of the mounted APP; C represents the task group to which the current task node belongs; T is the add / delete / modify status of the task node, generally represented by a timestamp; X and Y represent the coordinate positions of the center point of the task node on the canvas.

[0044] The data structure EB of the business flow directed edges of the directed cyclic graph is constructed as EB = <EBid, V S , V e , T>; it appears as the superior-subordinate relationship between different-level task nodes and the front-back order relationship between same-level task nodes in the BOM tree and as the business flow connection line between task nodes in the APP simulation application process design. Since the role of the BOM tree is more for structured display and solution mounting, it cannot and does not need to fully reflect the business flow information on the APP simulation application process design canvas. Therefore, the two are in a subset relationship: EB b ⊆EB f .

[0045] Among them, EBid is the unique identifier of the business flow directed edge; V SRepresents the starting task node; V e Represents the ending task node; T is the status of adding, deleting, or modifying the directed edge of the business process flow, usually represented by a timestamp.

[0046] Construct the data structure of the directed edge of the data flow in the directed acyclic graph ED = <EDid, V S , V e , T>; In the design of the APP simulation application process, it is manifested as the data flow connection line between task nodes. Due to the different focuses of the two, the data flow information on the APP simulation application process design canvas cannot and does not need to be reflected on the BOM tree, so ED b = <0>.

[0047] Among them, EDid is the unique identifier of the directed edge of the data flow; V S Represents the starting task node; V e Represents the ending task node; T is the status of adding, deleting, or modifying the directed edge of the data flow, usually represented by a timestamp.

[0048] S130. Compose the data structures corresponding to the structure types of the directed acyclic graph into the data structure of the directed acyclic graph.

[0049] It should be understood that the entire directed acyclic graph is composed of data structures such as task groups, task nodes, directed edges of business flows, and directed edges of data flows. The obtained data structure of the directed acyclic graph G = {C, V, EB, ED}.

[0050] In the embodiment of the present invention, initialize the data structure of the BOM task tree and the data structure of the simulation application process canvas, as Figure 3 shown, including: S210. Determine whether the data structure of the BOM task tree and the data structure of the simulation application process canvas are newly created; S220. If they are newly created, the initialization results of the data structure of the BOM task tree and the data structure of the simulation application process canvas are both empty; S230. If they are not newly created, read the simulation application process canvas string and the BOM task tree string from the database for initialization.

[0051] It should be understood that when the user starts the simulation application process design, take out the APP simulation application process and the BOM task tree json strings from the database for initialization. Form G b0 and G f0 . If it is a new situation, it is empty.

[0052] G b0 = {C b0 , V b0 , EB b0 , ED b0}; ED b0 = ⇀0.

[0053] G f0 ={C f0 ,V f0 ,EB f0 ,ED f0}。

[0054] In the embodiment of the present invention, the BOM task tree and the simulation application process canvas are respectively monitored for data structure addition, deletion, and modification operations, and a set of directed cyclic graph data structures with incremental changes is obtained. As Figure 4 shown, it includes: S310. Monitoring the data structure addition, deletion, and modification operations of the BOM task tree and the simulation application process canvas respectively according to the monitoring log; S320. Obtaining the data structures that have changed in the monitoring result; S330. Constructing the data structures that have changed into a set of directed cyclic graph data structures with incremental changes.

[0055] Specifically, when the user designs the simulation application process, through the log monitoring method, according to the addition, deletion, and modification operations of the task nodes of the APP simulation application process and the BOM task tree on the canvas, the changed ∆C, ∆V, ∆EB, and ∆ED are obtained respectively.

[0056] ∆G b ={∆C b ,∆V b ,∆EB b ,∆ED b}; ∆ED b =⇀0。

[0057] ∆G f ={∆C f ,∆V f ,∆EB f ,∆ED f}。

[0058] In the embodiment of the present invention, according to the set of directed cyclic graph data structures with incremental changes and in combination with the hierarchical relationship of the BOM task tree, the asynchronous update of the data structure of the BOM task tree to the data structure of the simulation application process canvas is performed, and / or, according to the set of directed cyclic graph data structures with incremental changes and in combination with the task grouping box of the simulation application process canvas, the asynchronous update of the data structure of the simulation application process canvas to the data structure of the BOM task tree is performed. As Figure 5 shown, it includes: S410. Determining the target to be updated according to the set of directed cyclic graph data structures with incremental changes.

[0059] In the embodiment of the present invention, it is possible to determine whether the BOM task tree has undergone addition, deletion, or modification changes or whether the simulation application process canvas has undergone addition, deletion, or modification changes according to the set of directed cyclic graph data structures with incremental changes.

[0060] It should be understood that since the BOM task tree and the simulation application process canvas are in different string forms, the target to be updated can be determined based on the expression form of the data structure set.

[0061] S420. If the incremental change target is the BOM task tree, asynchronously update the data structure of the simulation application process canvas according to the data structure of the BOM task tree.

[0062] Specifically, after the APP simulation application process on the canvas obtains the change of the BOM task tree, a new APP simulation application process is generated: G fn =G fn-1 +∆G b +∆G f .

[0063] It should be understood that if it is determined that the current BOM task tree has changed due to addition, deletion, or modification operations, the data structure of the simulation application process canvas is asynchronously updated according to the data structure of the BOM task tree. It should be noted that when performing asynchronous update, only the changed part of the BOM task tree is used to update the simulation application process canvas.

[0064] S430. If the incremental change target is the simulation application process canvas, asynchronously update the data structure of the BOM task tree according to the data structure of the simulation application process canvas.

[0065] Specifically, after the BOM task tree obtains the change of the APP simulation application process on the canvas, a new BOM task tree is generated: G bn =G bn-1 +∆G b +∆G f .

[0066] It should be understood that if it is determined that the current simulation application process canvas has changed due to addition, deletion, or modification operations, the data structure of the BOM task tree is asynchronously updated according to the data structure of the simulation application process canvas. It should be noted that when performing asynchronous update, only the changed part of the simulation application process canvas is used to update the BOM task tree.

[0067] In the embodiment of the present invention, the method for two-way synchronization of the BOM task tree and the simulation application process canvas further includes: after completing the two-way synchronization step of the BOM task tree and the simulation application process canvas, comparing the data structures of the BOM task tree and the simulation application process canvas respectively; if the information of the two is consistent, it is determined that the consistency verification is passed; if the information of the two is inconsistent, it is determined that the consistency verification fails.

[0068] It should be understood that when the user completes the simulation application process design, it is necessary to verify the consistency of the main structures of the APP simulation application process and the BOM task tree. This can be achieved by comparing the task groups, task nodes, business flow directed edges, and data flow directed edge information respectively. If there are no differences between the two, the verification is passed.

[0069] F(G fn -G bn ) = F(C f -C b , V f -V b , EB f -EB b , ED f -ED b ) = (F(C f -C b ), F(V f -V b ), F(EB f -EB b ), F(ED f -ED b )); If F(C f -C b ) = ⇀0; F(V f -V b ) = ⇀0; EB b ⊆ EB f ; It means that the two are consistent, otherwise it means that the two are inconsistent.

[0070] Since the amount of information that can be expressed by the APP simulation application process design and the BOM task tree on the canvas is different, the APP simulation application process design needs to record the coordinate positions of the upper left endpoint and the lower right endpoint of the task grouping box on the canvas, as well as the coordinate positions of the task nodes, but these information are not available on the BOM task tree. Therefore, when adding a task grouping box and task nodes to the BOM task tree, it needs to be automatically added after finding a default position on the APP simulation application process design canvas.

[0071] Therefore, in the embodiment of the present invention, according to the set of directed cyclic graph data structures with incremental changes and in combination with the hierarchical relationship of the BOM task tree, the asynchronous update of the data structure of the BOM task tree to the data structure of the simulation application process canvas is performed, including: (1) determining the target task grouping box of the incremental task nodes in the set of directed cyclic graph data structures with incremental changes in the simulation application process canvas according to the hierarchical relationship in the data structure of the BOM task tree.

[0072] In the embodiments of the present invention, since the hierarchical relationship in the data structure of the BOM task tree is task grouping and task nodes under the task grouping, therefore, the relationships of the task nodes include task nodes under the same task grouping and task nodes under different task groupings. In the simulation application process canvas, it includes task grouping boxes and task nodes under the task grouping boxes. Therefore, the relationships of the task nodes in the simulation application process canvas include task nodes under the same task grouping box and task nodes under different task grouping boxes.

[0073] According to the task grouping where the incremental task node is located in the data structure of the BOM task tree, the target task grouping box corresponding to the task grouping of the BOM task tree in the simulation application process canvas can be determined.

[0074] (2)Determine the coordinate position information of the incremental task node in the simulation application process canvas according to the vertex coordinates of the target task grouping box.

[0075] In the embodiments of the present invention, the APP simulation application process design canvas is divided into a regular grid structure. According to the hierarchical relationship of the BOM task tree, determine which grid cell the task grouping box or task node to be drawn falls into, and obtain its relative position coordinates on the canvas, so as to realize the positioning of the grouped task box.

[0076] Specifically, (21) The data structure definition includes the Canvas structure, Grid structure, Box structure, and Point structure of the task node.

[0077] (22)Determine the default length and width of the task grouping box (Box) and task node (Point).

[0078] (23)Initialize the canvas and the grid, and determine according to the design interface.

[0079] (24)Determine the grid cell where the task grouping box is located according to the BOM tree hierarchy: When adding a task grouping to the left BOM task tree, determine the position of the current task grouping box in the canvas according to the task grouping hierarchy relationship and order of the BOM tree, and check and calculate whether the row index and column index are within the legal range according to the 4 vertex coordinates.

[0080] (25) Determine the grid cell where the task node is located according to the BOM tree level and the belonging task grouping box: When adding a task node to the left BOM task tree, determine the task grouping box to which the current task node belongs in the canvas and the positions of the previous and subsequent task nodes in the task grouping box according to the task grouping and the relationship between the upper and lower level task nodes of the task node in the BOM tree. And check and calculate whether the row index and column index are within the legal range according to the four vertex coordinates. At the same time, for the case where the task grouping box is not large enough to hold the current task node, according to the coordinate calculation result, it is necessary to appropriately adjust the width and height values of the task grouping box where the current task node is located.

[0081] (26) Process levels and conflicts in the order of creation: For the situation where two task grouping boxes or task nodes compete for the same position, strategies such as recalculating the positions of the task grouping boxes or task nodes, moving the new box to the next available position, or adjusting the positions of the existing boxes to make room, or deciding which box remains in place according to the creation order rule can be adopted for adjustment.

[0082] (3) Determine the business flow connection line of the incremental task node in the simulation application process canvas according to the hierarchical relationship in the data structure of the BOM task tree and the target task grouping box.

[0083] In the embodiment of the present invention, according to the superior-subordinate relationship of different-level task nodes and the front-back order relationship of same-level task nodes shown on the BOM tree, determine which task nodes on the canvas need to be connected and the connection direction. Construct an A* algorithm based on obstacle avoidance of task grouping boxes to determine the shortest distance between two task nodes that need to be connected on the canvas, and it is necessary to avoid other task grouping boxes except the two task nodes.

[0084] Specifically, determining the business flow connection line of the incremental task node in the simulation application process canvas according to the hierarchical relationship in the data structure of the BOM task tree and the target task grouping box includes: (31) Determine the target task node and the connection direction that have a connection relationship with the incremental task node in the simulation application process canvas according to the superior-subordinate relationship of different-level task nodes and the front-back order relationship of same-level task nodes in the BOM task tree.

[0085] In an embodiment of the present invention, specifically, determining the target task nodes and connection directions in the simulation application process canvas that are connected to the incremental task nodes according to the superior-inferior relationship of different-level task nodes and the front-back order relationship of same-level task nodes in the BOM task tree includes: (311) determining the task grouping box in the simulation application process canvas to which the incremental task node belongs according to the task grouping where the incremental task node is located in the data structure of the BOM task tree; (312) determining the target task node and connection direction of the incremental task node in the simulation application process canvas according to the superior-inferior task node relationship of the incremental task node in the data structure of the BOM task tree.

[0086] (32) Determine the shortest distance between the incremental task node to be connected and the target task node in the simulation application process canvas according to the A* algorithm for obstacle avoidance of task grouping boxes.

[0087] The A* algorithm for obstacle avoidance of task grouping boxes is a heuristic search algorithm that evaluates the actual distance from the starting task node to the current point and the estimated distance from the current point to the final task node at each step. Other task grouping boxes except the two task nodes are set as obstacles, and the algorithm will automatically bypass these obstacles when searching for a path.

[0088] Specifically, determining the shortest distance between the incremental task node to be connected and the target task node in the simulation application process canvas according to the A* algorithm for obstacle avoidance of task grouping boxes includes: (321) selecting any task node in the simulation application process canvas as the current task node; (322) respectively determining the actual distance from the target task node to the current task node and the estimated distance from the current task node to the incremental task node; (323) setting all other task grouping boxes in the simulation application process canvas except the target task node and the incremental task node as obstacles; (324) searching for the shortest path between the target task node and the incremental task node that can avoid all obstacles.

[0089] In an embodiment of the present invention, the A* algorithm logic for obstacle avoidance of task grouping boxes is as follows.

[0090] Step 1, initialization: Set the open list and the closed list. The open list is used to store the task grouping box nodes to be checked, and the closed list is used to store the task grouping box nodes that have been checked.

[0091] Step 2, select the task grouping box node: Select the node with the lowest f value (f = g + h) from the open list, where g is the cost from the starting point to the current node, and h is the heuristic estimated value obtained through the Manhattan distance algorithm.

[0092] Step 3, check the end point of the task grouping box: If the selected node is the end point, the path has been found, and the path can be reconstructed by backtracking the parent nodes of each node.

[0093] Step 4, task grouping box neighbor check: For each neighbor of the current node, if it is not in the closed list, calculate its g value and f value. If the g value is lower or the neighbor is not in the open list, add it to the open list and set the current node as its parent node.

[0094] Step 5, update and repeat: Add the current node to the closed list, and then repeat steps 2 - 4 until the end point is found or the open list is empty.

[0095] (33) Implement the business flow connection of the incremental task node in the simulation application process canvas according to the shortest distance and connection direction between the incremental task node and the target task node to be connected in the simulation application process canvas.

[0096] The following is combined with Figure 6 As shown in the following, taking the overall design process of a certain type of ship as an example, it is necessary to conduct simulation analyses on four major disciplines: hydrodynamics, structure, heat, and vibration and noise. At the same time, it is also necessary to conduct multi - physical - field coupling analysis of the combination of various specialties. Each discipline involves a series of specific professional simulations, and there is a sequential analysis order among specialties. At the same time, there are data streams and business flows among professional simulation analyses. The execution order and data reference relationships of simulation disciplines and simulation specialties are shown in the following table.

[0097] Table 1 Overall design simulation analysis design process table of a certain type of ship

[0098]

[0099] Construct the simulation task BOM tree and design the APP simulation application process through the canvas, then select the appropriate simulation analysis APP on the task node, calculate and generate the simulation task plan through the simulation APP, and mount it on the simulation task BOM tree.

[0100] Since the simulation disciplines and simulation specialties in Table 1 will not be directly designed all at once, but need to be gradually explored and improved through visual drag - and - drop operations on the canvas. And the design process in Table 1 is not completely fixed and will be gradually optimized according to the APP calculation results.

[0101] First, add five first-level task grouping nodes of "Hydrodynamic Simulation Analysis", "Structural Simulation Analysis", "Thermal Simulation Analysis", "Vibration and Noise Simulation Analysis", and "Multi-Physical Field Coupling Analysis" in sequence from top to bottom on the left BOM task. Synchronously, five task grouping boxes are automatically generated at appropriate positions on the application process canvas and arranged from top to bottom. The two correspond one by one.

[0102] Then, on the right application process canvas, drag the "Hydrodynamic Performance Analysis Simulation APP" and "Wave Simulation APP" into the "Hydrodynamic Simulation Analysis" task grouping node in sequence. Since the "Wave Simulation APP" needs to reference the result data of the "Hydrodynamic Performance Analysis Simulation APP", a business flow line and a data flow line need to be drawn from the "Hydrodynamic Performance Analysis Simulation APP" to the "Wave Simulation APP". Synchronously, two second-level task nodes of "Hydrodynamic Performance Analysis Simulation APP" and "Wave Simulation APP" are created in sequence in the "Hydrodynamic Simulation Analysis" first-level task grouping node on the BOM task tree.

[0103] Similarly, on the simulation task BOM tree or the APP simulation application process design canvas, create the simulation analysis APPs listed in Table 1 respectively. It can be seen that in the "Structural Simulation Analysis" task grouping, there are backtracking situations in the task nodes of "Strength and Stiffness Analysis" and "Explosion Resistance Analysis". The two can be updated in real-time and remain synchronized.

[0104] After the design is completed, save the canvas, and the simulation task BOM tree or the APP simulation application process design canvas is stored in the database respectively. When subsequent modifications are required, they can be read from the database for modification respectively, such as adding a task grouping of "Electromagnetic Analysis", or adding a task node of "Propeller Performance Analysis" under the "Hydrodynamic Simulation Analysis" task grouping.

[0105] In summary, the method for two-way synchronization of the BOM task tree and the simulation application process canvas provided by the present invention, through the two-way synchronization method of the BOM task tree and the simulation application process canvas based on the incremental directed cyclic graph, only compares the changed parts in the APP simulation application process and the BOM task tree, avoiding the full-scale internal and external nested double-loop comparison of the two directed cyclic graphs using the full-scale double-loop comparison method, thereby avoiding the deadlock problem that may occur during the double-loop comparison process.

[0106] At the same time, after adopting the two-way synchronization method of the BOM task tree and the simulation application process canvas based on the incremental directed cyclic graph, the time complexity of the original full-scale double-loop comparison method O(V 2) is reduced to O(4*V), where V = max (the number of task nodes V1 in the BOM tree directed graph, the number of task nodes V2 in the APP simulation application process). When the number of task nodes is greater than 4, the time complexity will decrease significantly. The complex simulation process design task node tree will be greater than 20, and the time complexity can be significantly reduced by this method.

[0107] Meanwhile, in the method for two-way synchronization between the BOM task tree and the simulation application process canvas in the embodiments of the present invention, operations can be switched frequently and arbitrarily on the APP simulation application process design and the BOM task tree. The incremental information of the operations on both sides does not require complex background comparison calculations, can be synchronized to the other side in time for rendering, and in an incremental manner, the resource occupancy is also less. By adopting the grid positioning and connection method based on the hierarchical relationship, after creating task groups and task nodes from the BOM task tree, at the appropriate positions on the APP simulation application process design canvas, manual operations are replaced to generate the corresponding task groups and task nodes, and the business flow connections are automatically completed. By adopting the A* algorithm based on obstacle avoidance of the task group box, the problems of irregular business flow connections and threading through other task group boxes are solved, effectively avoiding other task group boxes and facilitating clear and beautiful connections.

[0108] It can be understood that the above embodiments are only exemplary embodiments adopted to illustrate the principle of the present invention, and the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also regarded as the protection scope of the present invention.

Claims

1. A method for bidirectional synchronization between a BOM task tree and a simulation application process canvas, characterized in that Including: Construct a directed acyclic graph data structure common to the BOM task tree and the simulation application process canvas; Initialize the data structure of the BOM task tree and the data structure of the simulation application process canvas; Monitor the data structure addition, deletion, and modification operations on the BOM task tree and the simulation application process canvas respectively, and obtain a set of directed acyclic graph data structures with incremental changes; Asynchronously update the data structure of the BOM task tree to the data structure of the simulation application process canvas according to the set of directed acyclic graph data structures with incremental changes and in combination with the hierarchical relationship of the BOM task tree, and / or, asynchronously update the data structure of the simulation application process canvas to the data structure of the BOM task tree according to the set of directed acyclic graph data structures with incremental changes and in combination with the task grouping box of the simulation application process canvas, so as to complete the two-way synchronization between the BOM task tree and the simulation application process canvas; Among them, asynchronously updating the data structure of the simulation application process canvas to the data structure of the BOM task tree according to the set of directed acyclic graph data structures with incremental changes and in combination with the task grouping box of the simulation application process canvas includes: if it is determined that there are changes in the addition, deletion, and modification operations of the current simulation application process canvas, then asynchronously update the data structure of the BOM task tree according to the data structure of the simulation application process canvas, and the BOM task tree generates a new BOM task tree after obtaining the changes in the APP simulation application process on the canvas.

2. The method for bidirectional synchronization between the BOM task tree and the simulation application process canvas according to claim 1, wherein, Constructing a directed acyclic graph data structure common to the BOM task tree and the simulation application process canvas includes: Determine the structure type of the directed acyclic graph, and the structure type of the directed acyclic graph includes task grouping, task nodes, business flow directed edges, and data flow directed edges; Construct corresponding data structures for the structure types of the directed acyclic graph respectively; Form the data structures corresponding to the structure types of the directed acyclic graph into a directed acyclic graph data structure.

3. The method for two-way synchronization between the BOM task tree and the simulation application process canvas according to claim 1, characterized in that, Initializing the data structure of the BOM task tree and the data structure of the simulation application process canvas includes: Judge whether the data structures of the BOM task tree and the simulation application process canvas are newly created; If it is newly created, the initialization results of the data structures of the BOM task tree and the simulation application process canvas are both empty; If it is not newly created, read the simulation application process canvas string and the BOM task tree string from the database for initialization.

4. The method for bidirectional synchronization between the BOM task tree and the simulation application process canvas according to any one of claims 1 to 3, characterized in that Monitoring the data structure addition, deletion, and modification operations on the BOM task tree and the simulation application process canvas respectively, and obtaining a set of directed acyclic graph data structures with incremental changes includes: Monitor the data structure addition, deletion, and modification operations on the BOM task tree and the simulation application process canvas respectively according to the monitoring log; Obtain the data structures that have changed in the monitoring results; Construct the data structures that have changed into a set of directed acyclic graph data structures with incremental changes.

5. The method for bidirectional synchronization between the BOM task tree and the simulation application process canvas according to any one of claims 1 to 3, characterized in that Asynchronously update the data structure of the BOM task tree to the data structure of the simulation application process canvas based on the set of incrementally changing directed cyclic graph data structures and in combination with the hierarchical relationship of the BOM task tree, and / or, asynchronously update the data structure of the simulation application process canvas to the data structure of the BOM task tree based on the set of incrementally changing directed cyclic graph data structures and in combination with the task grouping boxes of the simulation application process canvas, including: Determine the increment change target according to the set of incrementally changing directed cyclic graph data structures; If the increment change target is the BOM task tree, asynchronously update the data structure of the simulation application process canvas according to the data structure of the BOM task tree; If the increment change target is the simulation application process canvas, asynchronously update the data structure of the BOM task tree according to the data structure of the simulation application process canvas.

6. The method for bidirectional synchronization between the BOM task tree and the simulation application process canvas according to any one of claims 1 to 3, characterized in that, It also includes the following steps performed after completing the two-way synchronization of the BOM task tree and the simulation application process canvas: Compare the data structures of the BOM task tree and the simulation application process canvas respectively; If the information of the two is consistent, it is determined that the consistency verification passes; If the information of the two is inconsistent, it is determined that the consistency verification fails.

7. The method for bidirectional synchronization of the BOM task tree and the simulation application process canvas according to any one of claims 1 to 3, characterized in that, Asynchronously update the data structure of the BOM task tree to the data structure of the simulation application process canvas based on the set of incrementally changing directed cyclic graph data structures and in combination with the hierarchical relationship of the BOM task tree, including: Determine the target task grouping box in the simulation application process canvas for the incremental task nodes in the set of incrementally changing directed cyclic graph data structures according to the hierarchical relationship in the data structure of the BOM task tree; Determine the coordinate position information of the incremental task nodes in the simulation application process canvas according to the vertex coordinates of the target task grouping box; Determine the business flow connection lines of the incremental task nodes in the simulation application process canvas according to the hierarchical relationship in the data structure of the BOM task tree and the target task grouping box.

8. The method for two-way synchronization between the BOM task tree and the simulation application process canvas according to claim 7, characterized in that, Determine the business flow connection lines of the incremental task nodes in the simulation application process canvas according to the hierarchical relationship in the data structure of the BOM task tree and the target task grouping box, including: Determine the target task nodes and connection directions in the simulation application process canvas that have connection relationships with the incremental task nodes according to the superior-subordinate relationship between different-level task nodes and the front-back order relationship between same-level task nodes in the BOM task tree; Determine the shortest distance between the incremental task nodes to be connected and the target task nodes in the simulation application process canvas according to the A* algorithm for obstacle avoidance of task grouping boxes; Realize the business flow connection lines of the incremental task nodes in the simulation application process canvas according to the shortest distance and connection direction between the incremental task nodes to be connected and the target task nodes in the simulation application process canvas.

9. The method for bidirectional synchronization between the BOM task tree and the simulation application process canvas according to claim 8, characterized in that, Determine the shortest distance between the incremental task nodes to be connected and the target task nodes in the simulation application process canvas according to the A* algorithm for obstacle avoidance of task grouping boxes, including: Select any task node in the simulation application process canvas as the current task node; Determine the actual distance from the target task node to the current task node and the estimated distance from the current task node to the incremental task node respectively; Set all other task grouping boxes in the simulation application process canvas except the target task node and the incremental task node as obstacles; Find the shortest path that can avoid all obstacles between the target task node and the incremental task node.

10. The method for bidirectional synchronization between the BOM task tree and the simulation application process canvas according to claim 8, wherein Determine the target task node and the connection direction with the incremental task node in the simulation application process canvas according to the superior-subordinate relationship of different-level task nodes and the front-back order relationship of same-level task nodes in the BOM task tree, including: Determine the task grouping box to which the incremental task node belongs in the simulation application process canvas according to the task grouping where the incremental task node is located in the data structure of the BOM task tree; Determine the target task node and the connection direction of the incremental task node in the simulation application process canvas according to the superior-subordinate task node relationship of the incremental task node in the data structure of the BOM task tree.

Citation Information

Patent Citations

  • Emulated procedure information modeling and maintenance method based on product structural tree

    CN101169716A

  • Simulation software rendering method and device, storage medium and electronic equipment

    CN116245051A