Bidirectional synchronization method for BOM task tree and simulation application process canvas

By building a directed loop graph data structure and using incremental changes to update the data structure for asynchronously, the problems of deadlock and high time complexity in bidirectional synchronization of the BOM task tree and simulation application process canvas are solved, and a more efficient synchronization process is achieved.

CN119862724AActive Publication Date: 2025-04-22CHINA SHIPBUILDING ORLANDO WUXI SOFTWARE TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510352282.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-04-22
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 when complex business flow lines are backtracked.

Method used

By constructing a directed loop graph data structure shared by the BOM task tree and the simulation application process canvas, and using an incrementally changing directed loop graph data structure set for asynchronous update, avoiding the full-quantity double loop comparison method.

Benefits of technology

It effectively avoids deadlock problems and reduces time complexity, from O(V2) to O(4*V), significantly improving program performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862724A_ABST
    Figure CN119862724A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of simulation calculation, and particularly discloses a BOM task tree and simulation application process canvas bidirectional synchronization method, which comprises the following steps: constructing a directed loop graph data structure shared by a BOM task tree and a simulation application process canvas; initializing a data structure of a BOM task tree and a data structure of a simulation application process canvas; respectively carrying out data structure addition, deletion and modification operation monitoring on the BOM task tree and the simulation application process canvas to obtain a directed loop graph data structure set with increment change; asynchronous updating from the data structure of the BOM task tree to the data structure of the simulation application process canvas or asynchronous updating from the data structure of the simulation application process canvas to the data structure of the BOM task tree is carried out according to the directed loop graph data structure set with the incremental change. According to the bidirectional synchronization method for the BOM task tree and the simulation application process canvas, deadlock can be avoided, and meanwhile the time complexity can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of simulation computing technology, and in particular to a method for bidirectional synchronization between a BOM task tree and a simulation application process canvas. Background Art

[0002] In the simulation design process of the overall performance of ships, multiple simulation software (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 between APPs, solidification of simulation processes and knowledge, etc. In order to facilitate simulation designers to design APP simulation application processes, improve design efficiency, enhance design intuitiveness, and meet the requirements of visual design and complex business logic, a visual canvas is designed, and multiple APPs are logically combined by dragging and dropping to form an application process design. At the same time, a simulation design hierarchical task tree (BOM task tree for short) consistent with the main structure of the APP simulation application process is designed to mount simulation calculation task solutions, so that simulation personnel can compare simulation calculation tasks after multiple simulation calculations to form the optimal solution.

[0003] In the prior art, in order to achieve two-way synchronization between the APP simulation application process and the BOM task tree on the canvas, it is necessary to construct the data structures of the two and compare them. For example, when synchronizing from the APP simulation application process to the BOM task tree, it is necessary to construct a simulation task node json string JsonFlow_New based on the simulation task node information of the APP simulation application process on the canvas. At the same time, the original BOM task tree information is taken out from the database, and a Json string JsonBom_Old is also constructed. A double-loop comparison method is used to compare the JsonFlow_New string and the JsonBom_Old information in full, and 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, and modified, and form a new BOM task tree JsonBom_New string. After storing the JsonBom_New string in the database, the BOM task tree is reloaded in the canvas for display.

[0004] When the APP simulation application process is relatively simple, the double loop comparison method can achieve bidirectional synchronization between the BOM task tree and the APP simulation application process when the full comparison is performed. However, when the APP simulation application process is relatively complex, especially when the business flow connection of the simulation task node in the APP simulation application process design is backtracked, that is, from the subsequent task node to multiple previous task nodes, there is a loop in the directed cycle graph. In this case, the full double loop comparison method has high time complexity and affects the program performance; at the same time, in this double loop nested full comparison process, if there are loops in both directed cycle graphs, and the process continuously requests and releases resources in the loop, a loop waiting condition may be formed, resulting in a deadlock and the inability to complete the comparison between the two.

[0005] There are some measures to prevent deadlock in the prior art, such as allowing a process to allocate all required resources at once when requesting resources, or using an ordered resource allocation method 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 deadlock will occur before the system allocates resources, and resources are allocated only when it is confirmed that deadlock will not occur. Deadlocks can also be detected and resolved, and deadlocks can be checked regularly to determine whether they exist. Once a deadlock is found, measures can be taken to resolve it. This usually involves interrupting and revoking the resource occupation of some processes until a safe resource allocation sequence is found.

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

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

[0008] As one aspect of the present invention, a method for bidirectional synchronization between a BOM task tree and a simulation application process canvas is provided, which includes: 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; monitoring the addition, deletion and modification operations of the BOM task tree and the simulation application process canvas respectively to obtain a set of directed cyclic graph data structures with incremental changes; asynchronously updating the data structure of the BOM task tree to the data structure of the simulation application process canvas 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 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 cyclic 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 bidirectional synchronization between the BOM task tree and the simulation application process canvas.

[0009] Furthermore, a directed cycle graph data structure shared by the BOM task tree and the simulation application process canvas is constructed, including: determining a structure type of the directed cycle graph, the structure type of the directed cycle graph including task groups, task nodes, business flow directed edges, and data flow directed edges; constructing corresponding data structures for the structure types of the directed cycle graph; and combining the data structures corresponding to the structure types of the directed cycle graph into a directed cycle graph data structure.

[0010] Furthermore, the data structure of the BOM task tree and the data structure of the simulation application process canvas are initialized, including: 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, the simulation application process canvas string and the BOM task tree string are read from the database for initialization.

[0011] Furthermore, the data structure addition, deletion and modification operations are monitored on the BOM task tree and the simulation application process canvas respectively to obtain a directed cyclic graph data structure set of incremental changes, including: monitoring 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; obtaining the changed data structure in the monitoring result; and constructing the changed data structure into a directed cyclic graph data structure set of incremental changes.

[0012] Furthermore, according to the directed cyclic graph data structure set of incremental changes and in combination with the hierarchical relationship of the BOM task tree, an asynchronous update is performed from the data structure of the BOM task tree to the data structure of the simulation application process canvas, and / or, according to the directed cyclic graph data structure set of incremental changes and in combination with the task grouping box of the simulation application process canvas, an asynchronous update is performed from the data structure of the simulation application process canvas to the data structure of the BOM task tree, including: determining the incremental change target according to the directed cyclic graph data structure set of 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] Furthermore, it also includes the following steps after completing the step of bidirectional synchronization of the BOM task tree and the simulation application process canvas: comparing the data structure of the BOM task tree with the data structure of the simulation application process canvas respectively; if the information of the two is consistent, it is determined that the consistency verification has passed; if the information of the two is inconsistent, it is determined that the consistency verification has failed.

[0014] Furthermore, an asynchronous update of the data structure of the BOM task tree to the data structure of the simulation application process canvas is performed based on the directed cyclic graph data structure set of incremental changes and in combination with the hierarchical relationship of the BOM task tree, including: determining the target task grouping box in the simulation application process canvas of the incremental task node in the directed cyclic graph data structure set of incremental changes according to the hierarchical relationship in the data structure of the BOM task tree; determining 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; and determining the business flow connection 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.

[0015] Furthermore, the business flow connection of the incremental task node in the simulation application process canvas is determined 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 that are connected to the incremental task node in the simulation application process canvas according to the superior-subordinate relationship of different-level task nodes and the front-to-back order relationship of the 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; and realizing 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 to be connected and the target task node in the simulation application process canvas.

[0016] Furthermore, the shortest distance between the incremental task node to be connected and the target task node in the simulation application process canvas is determined according to the A* algorithm for obstacle avoidance of the task grouping frame, 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 frames in the simulation application process canvas except the target task node and the incremental task node as obstacles; and finding the shortest path between the target task node and the incremental task node that can avoid all obstacles.

[0017] Furthermore, the target task node and the connection direction that are connected to the incremental task node in the simulation application process canvas are determined according to the hierarchical relationship between different-level task nodes and the front-to-back order relationship between the same-level task nodes in the BOM task tree, including: determining the task group box to which the incremental task node belongs in the simulation application process canvas according to the task group to which the incremental task node is located in the data structure of the BOM task tree; and 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 structure of changes in the BOM task tree and the simulation application process by monitoring, and constructs an incrementally changed directed cycle graph data structure based on the data structure. Therefore, only the changed parts in the simulation application process canvas and the BOM task tree are compared, avoiding the use of a full double cycle comparison method to perform a full inner and outer nested double cycle comparison on two directed cycle graphs, thereby avoiding the deadlock problem that may occur in the double cycle comparison process; at the same time, due to the use of the bidirectional synchronization method between the BOM task tree and the simulation application process canvas based on the incremental directed cycle graph, the time complexity of the original full double cycle comparison method is reduced to O(V 2 ), reduced to O(4*V), where V = max (the number of task nodes in the BOM tree directed graph V1, the number of task nodes in the APP simulation application process V2), so when the number of task nodes is greater than 4, the time complexity will be greatly reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to provide 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 of the present invention.

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

[0021] Figure 2 A flow chart of constructing a directed cyclic graph data structure provided by the present invention.

[0022] Figure 3 A flowchart of the initialization data structure provided by the present invention.

[0023] Figure 4 A flow chart of a directed cyclic graph data structure set for obtaining incremental changes provided by the present invention.

[0024] Figure 5 A flowchart of the asynchronous update provided by the present invention.

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

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

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection 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 are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] In this embodiment, a method for bidirectional synchronization between a BOM task tree and a simulation application process canvas is provided. Figure 1 is a flowchart of a method for bidirectional synchronization between a BOM task tree and a simulation application process canvas provided according to an embodiment of the present invention, such as Figure 1 As shown, it includes: S100, constructing a directed cyclic graph data structure shared by the BOM task tree and the simulation application process canvas.

[0030] In an embodiment of the present invention, the directed cyclic graph data structure includes task groups, task nodes, business flow directed edges and data flow directed edges. Therefore, a directed cyclic graph data structure common to the BOM task tree and the simulation application process canvas is constructed respectively, so that the incremental directed cyclic graph data structure that has changed can be determined based on this subsequently.

[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 initialized to facilitate determining the status of the data structure of the current BOM task tree and the data structure of the current simulation application process canvas.

[0033] S300, respectively monitoring the data structure addition, deletion and modification operations on the BOM task tree and the simulation application process canvas to obtain a directed cyclic graph data structure set with incremental changes.

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

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

[0036] In an embodiment of the present invention, a directed cyclic graph data structure set based on incremental changes determines whether the data structure of the BOM task tree has changed or the data structure of the simulation application process canvas has changed, and asynchronously updates the other party based on the changed party to achieve a synchronization process between the two parties.

[0037] The method for bidirectional synchronization between the BOM task tree and the simulation application process canvas provided by the embodiment of the present invention obtains the data structure of changes in the BOM task tree and the simulation application process by monitoring, and constructs an incrementally changed directed cycle graph data structure based on the data structure. Therefore, only the changed parts in the simulation application process canvas and the BOM task tree are compared, avoiding the use of a full double loop comparison method to perform a full inner and outer nested double loop comparison on two directed cycle graphs, thereby avoiding the deadlock problem that may occur in the double loop comparison process; at the same time, due to the use of the bidirectional synchronization method between the BOM task tree and the simulation application process canvas based on the incremental directed cycle graph, the time complexity of the original full double loop comparison method is reduced to O(V 2 ), reduced to O(4*V), where V = max (the number of task nodes in the BOM tree directed graph V1, the number of task nodes in the APP simulation application process V2), so when the number of task nodes is greater than 4, the time complexity will be greatly reduced.

[0038] In the embodiment of the present invention, a directed cyclic graph data structure shared by the BOM task tree and the simulation application process canvas is constructed, such as Figure 2 As shown, it includes: S110, determining the structure type of the directed cyclic graph, the structure type of the directed cyclic graph includes task grouping, task nodes, business flow directed edges and data flow directed edges; S120, constructing corresponding data structures for the structure types of the directed cyclic graph.

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

[0040] Specifically, the data structure C = (Cid, CName, T, X) of the directed cyclic graph task grouping is constructed. s , Y s , X e , Y e ); It is represented as a first-level tree node on the BOM tree and as the outermost task grouping 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 status of the task group addition, deletion, and modification, which is generally represented by a timestamp; X s and Y s Indicates the coordinate position of the upper left corner of the task group box in the canvas; X e and Y e Indicates the coordinate position of the lower right corner of the task group box in the canvas.

[0042] Construct the data structure V=(Vid,TaskName,APPName,APPphoto,C,T,X,Y) of the task node of the directed cyclic graph; it is represented as tree nodes and leaf nodes below the second level on 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 mounted APP icon; C indicates the task group to which the current task node belongs; T is the addition, deletion, and modification status of the task node, generally represented by a timestamp; X and Y indicate the coordinate position of the center point of the task node in the canvas.

[0044] Construct the data structure EB of the directed edge of the business flow of the directed cycle graph <EBid,V S , V e , T>; It is shown as the superior-subordinate relationship of different-level task nodes and the sequential relationship of the same-level task nodes on the BOM tree, and as the business flow connection between task nodes in the APP simulation application process design. Since the role of the BOM tree is 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, so the two are subset relationships: EB b ⊆EB f .

[0045] Among them, EBid is the unique identifier of the directed edge of the business flow; V SIndicates the starting task node; V e Indicates the end task node; T is the addition, deletion, and modification status of the directed edge of the business flow, generally represented by a timestamp.

[0046] Construct the data structure of the directed edge of the data flow of the directed cycle graph ED= <EDid,V S , V e , T>; in the APP simulation application process design, it is represented by the data flow connection 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 Indicates the starting task node; V e Indicates the end task node; T is the addition, deletion, and modification status of the directed edge of the data flow, generally represented by a timestamp.

[0048] S130. Combining the data structures corresponding to the structural types of the directed cyclic graph into a directed cyclic graph data structure.

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

[0050] In an embodiment of the present invention, the data structure of the BOM task tree and the data structure of the simulation application process canvas are initialized, such as Figure 3 As shown, it includes: S210, judging 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, reading 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, the APP simulation application process and BOM task tree json string are taken out from the database for initialization. b0 and G f0 If it is a new creation, it will be empty.

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

[0053] G f0 ={C f0 , V f0 , E.B. f0 , E.D. 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 to obtain a directed cyclic graph data structure set with incremental changes, such as Figure 4 As 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 changed data structure in the monitoring result; S330, constructing the changed data structure into a directed cyclic graph data structure set of incremental changes.

[0055] Specifically, when the user designs a simulation application process, the log monitoring method is used to obtain the changed ∆C, ∆V, ∆EB, and ∆ED respectively 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.

[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 an embodiment of the present invention, the data structure of the BOM task tree is asynchronously updated to the data structure of the simulation application process canvas according to the directed cyclic graph data structure set of incremental changes and in combination with the hierarchical relationship of the BOM task tree, and / or, the data structure of the simulation application process canvas is asynchronously updated to the data structure of the BOM task tree according to the directed cyclic graph data structure set of incremental changes and in combination with the task grouping box of the simulation application process canvas, such as Figure 5 As shown, it includes: S410, determining the target to be updated according to the directed cyclic graph data structure set of the incremental change.

[0059] In an embodiment of the present invention, it can be determined 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 based on the directed cyclic graph data structure set of incremental changes.

[0060] It should be understood that, since the string formats of the BOM task tree and the simulation application process canvas are different, the target to be updated can be determined based on the expression format 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 changes in 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 undergone changes in 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 updates, the simulation application process canvas is updated only for the changed parts of the BOM task tree.

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

[0065] Specifically, after the BOM task tree obtains the changes in 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 undergone changes in addition, deletion, and 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 updates, the BOM task tree is updated only for the changed parts of the simulation application process canvas.

[0067] In an embodiment of the present invention, the method for bidirectional synchronization of the BOM task tree and the simulation application process canvas also includes, after completing the step of bidirectional synchronization of the BOM task tree and the simulation application process canvas: comparing the data structure of the BOM task tree with the data structure of the simulation application process canvas respectively; if the information of the two is consistent, it is determined that the consistency verification has passed; if the information of the two is inconsistent, it is determined that the consistency verification has failed.

[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 structure of the APP simulation application process and the BOM task tree. This can be done by comparing the task grouping, task nodes, business flow directed edges, and data flow directed edge information respectively. If there is no difference between the two, the verification is passed.

[0069] F(G fn -G bn )=F(C f -C b , V f -V b , E.B. f -EB b , E.D. 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 ; indicates that the two are consistent, otherwise it indicates that the two are inconsistent.

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

[0071] Therefore, in an embodiment of the present invention, an asynchronous update is performed from the data structure of the BOM task tree to the data structure of the simulation application process canvas based on the directed cyclic graph data structure set of incremental changes and in combination with the hierarchical relationship of the BOM task tree, including: (1) determining the target task grouping box of the incremental task node in the directed cyclic graph data structure set of 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 embodiment 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, the relationship of the task nodes includes the task nodes under the same task grouping and the task nodes under different task groupings. In the simulation application process canvas, it includes the task grouping frame and the task nodes under the task grouping frame, so the relationship of the task nodes in the simulation application process canvas includes the task nodes under the same task grouping frame and the task nodes under different task grouping frames.

[0073] According to the task grouping of the incremental task node in the data structure of the BOM task tree, a 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 an embodiment 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, it is determined in which grid unit the task grouping box or task node to be drawn falls, and its relative position coordinates on the canvas are obtained, so as to realize the positioning of the grouped task box.

[0076] Specifically, (21) data structure definition includes canvas (Canvas) structure, grid (Grid) structure, task group box (Box) structure, and task node (Point) structure.

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

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

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

[0080] (25) Determine the grid unit where the task node is located according to the BOM tree level and the task group box to which it belongs: When adding a task node to the BOM task tree on the left, determine the task group box to which the current task node belongs in the canvas and the position of the previous and subsequent task nodes in the task group box according to the task group to which the task node belongs in the BOM tree and the relationship between the upper and lower hierarchical task nodes. And check and calculate the row index and column index based on the coordinates of the four vertices to see if they are within the legal range. At the same time, if the task group box is not large enough to accommodate the current task node, the width and height of the task group box where the current task node is located need to be appropriately adjusted according to the coordinate calculation results.

[0081] (26) Handling hierarchies and conflicts according to the creation order: In the case where two task group boxes or task nodes compete for the same position, strategies such as recalculating the task group box or task node position, moving the new box to the next available position, or adjusting the position of the existing box to make room, or deciding which box to keep in place according to the creation order rules can be used for adjustment.

[0082] (3) Determine the business flow connection 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 hierarchical relationship of different-level task nodes and the front-to-back order relationship of the same-level task nodes on the BOM tree, it is determined which task nodes on the canvas need to be connected and the direction of the connection. An A* algorithm based on task grouping box obstacle avoidance is constructed to determine the shortest distance between two task nodes that need to be connected on the canvas, and other task grouping boxes other than the two task nodes need to be avoided.

[0084] Specifically, the business flow connection of the incremental task node in the simulation application process canvas is determined according to the hierarchical relationship in the data structure of the BOM task tree and the target task grouping box, including: (31) determining the target task node and connection direction that has 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-to-back order relationship of the same-level task nodes in the BOM task tree.

[0085] In an embodiment of the present invention, specifically, the target task node and the connection direction that are connected to the incremental task node in the simulation application process canvas are determined according to the hierarchical relationship of different-level task nodes and the front-to-back order relationship of the same-level task nodes in the BOM task tree, including: (311) determining the task group box to which the incremental task node belongs in the simulation application process canvas according to the task group to which the incremental task node is located in the data structure of the BOM task tree; (312) 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.

[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 of the task grouping frame obstacle avoidance.

[0087] The A* algorithm based on task grouping box obstacle avoidance 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. The task grouping boxes other than the two task nodes are set as obstacles, and the algorithm automatically bypasses these obstacles when searching for a path.

[0088] Specifically, the shortest distance between the incremental task node to be connected and the target task node in the simulation application process canvas is determined according to the A* algorithm for obstacle avoidance of the task grouping box, including: (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) finding 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 based on task grouping frame obstacle avoidance is as follows.

[0090] Step 1, initialization: set the open list (Open List) and the closed list (Closed List). The open list is used to store the task group box nodes to be checked, and the closed list is used to store the task group box nodes that have been checked.

[0091] Step 2, select the task group 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 estimate obtained by the Manhattan distance algorithm.

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

[0093] Step 4, Task Group 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.

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

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

[0096] Combine the following Figure 6 As shown in the figure, taking the overall design process of a certain type of ship as an example, it is necessary to simulate and analyze the four major disciplines of fluid dynamics, structure, heat, and vibration and noise. At the same time, it is also necessary to conduct multi-physics field coupling analysis on the combination of various disciplines. Each discipline involves a series of specific professional simulations, and there is a sequence of analysis between the disciplines. At the same time, there are data flows and business flows between the simulation analyses of various disciplines. The execution order and data reference relationship of simulation disciplines and simulation disciplines are shown in the following table.

[0097] Table 1. Design flow chart of simulation analysis of overall design of a certain type of ship

[0098] Use the canvas to build the simulation task BOM tree and design the APP simulation application process, then select the appropriate simulation analysis APP on the task node, generate the simulation task plan through the simulation APP calculation, and mount it on the simulation task BOM tree.

[0099] Since the simulation disciplines and simulation majors in Table 1 cannot be designed directly at one time, but need to be dragged and dropped on the canvas visually, there is a gradual exploration and improvement process. In addition, the design process in Table 1 is not completely fixed and will be gradually optimized according to the calculation results of the APP.

[0100] First, add five first-level task grouping nodes, "Fluid Dynamics Simulation Analysis", "Structural Simulation Analysis", "Thermal Simulation Analysis", "Vibration and Noise Simulation Analysis", and "Multi-physics Field Coupling Analysis" from top to bottom on the BOM task on the left. Simultaneously, automatically generate five task grouping boxes at appropriate locations on the application process canvas and arrange them from top to bottom. The two correspond one to one.

[0101] Then, on the application process canvas on the right, drag the "Hydrodynamic Performance Analysis Simulation APP" and "Wave Simulation APP" into the "Fluid Dynamics Simulation Analysis" task grouping node in order. Since the "Wave Simulation APP" needs to reference the result data of the "Hydrodynamic Performance Analysis Simulation APP", it is necessary to pull a business flow line and a data flow line from the "Hydrodynamic Performance Analysis Simulation APP" to the "Wave Simulation APP". Simultaneously, in the "Fluid Dynamics Simulation Analysis" first-level task grouping node on the BOM task tree, create two second-level task nodes, "Hydrodynamic Performance Analysis Simulation APP" and "Wave Simulation APP", in order.

[0102] Similarly, in the simulation task BOM tree or APP simulation application process design canvas, create the simulation analysis APP listed in Table 1, and you can see that in the "Structural Simulation Analysis" task group, the task nodes "Strength Stiffness Analysis" and "Explosion Resistance Analysis" have backtracking. The two can be updated in real time and keep in sync.

[0103] After the design is completed, the canvas is saved, and the simulation task BOM tree or APP simulation application process design canvas is stored in the database. When modifications are required later, they can be read from the database for modification, such as adding the task group "electromagnetic analysis" or adding the "propeller performance analysis" task node under the "fluid dynamics simulation analysis" task group.

[0104] In summary, the method for bidirectional synchronization of the BOM task tree and the simulation application process canvas provided by the present invention, through the bidirectional synchronization method of the BOM task tree and the simulation application process canvas based on the incremental directed loop graph, only compares the changed parts in the APP simulation application process and the BOM task tree, avoiding the use of a full double loop comparison method to perform a full inner and outer nested double loop comparison of two directed loop graphs, thereby avoiding the deadlock problem that may occur during the double loop comparison process.

[0105] At the same time, the bidirectional synchronization method between the BOM task tree and the simulation application process canvas based on the incremental directed cycle graph is adopted, which reduces the time complexity of the original full double cycle comparison method to O(V 2 ), reduced to O(4*V), where V = max (the number of task nodes in the BOM tree directed graph V1, the number of task nodes in the APP simulation application process V2). When the number of task nodes is greater than 4, the time complexity will be greatly reduced. The task node tree of complex simulation process design will be greater than 20, and this method can significantly reduce the time complexity.

[0106] At the same time, the method of bidirectional synchronization between the BOM task tree and the simulation application process canvas of the embodiment of the present invention can switch operations 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 and calculation, and can be synchronized to the other side for rendering in a timely manner. In addition, the resource usage is also relatively small through the incremental method. The grid positioning and connection method based on the hierarchical relationship is adopted to solve the problem of creating task groups and task nodes from the BOM task tree, and then generating corresponding task groups and task nodes at the appropriate position on the APP simulation application process design canvas instead of manual operation, and automatically completing the business flow connection. The A* algorithm based on the task group box obstacle avoidance is adopted to solve the problems of irregular business flow connection, threading from other task group boxes, etc., effectively avoiding other task group boxes, so that the connection is clear, visible and beautiful.

[0107] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but 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 considered to be within the scope of protection of the present invention.

Claims

1. A method for bidirectional synchronization of a BOM task tree and a simulation application process canvas, characterized in that: include: Construct a directed cyclic graph data structure shared by 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; Performing data structure addition, deletion and modification monitoring on the BOM task tree and the simulation application process canvas respectively to obtain a directed cyclic graph data structure set of incremental changes; According to the directed cyclic graph data structure set with incremental changes and in combination with the hierarchical relationship of the BOM task tree, an asynchronous update is performed from the data structure of the BOM task tree to the data structure of the simulation application process canvas, and / or, according to the directed cyclic graph data structure set with incremental changes and in combination with the task grouping box of the simulation application process canvas, an asynchronous update is performed from 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 of the BOM task tree and the simulation application process canvas.

2. The method for bidirectional synchronization of a BOM task tree and a simulation application process canvas according to claim 1, characterized in that: Construct the directed cyclic graph data structure shared by the BOM task tree and the simulation application process canvas, including: Determine a structure type of a directed cyclic graph, wherein the structure type of the directed cyclic graph includes task groups, task nodes, business flow directed edges, and data flow directed edges; Constructing corresponding data structures for the structural types of the directed cyclic graphs respectively; The data structures corresponding to the structural types of the directed cyclic graph are combined into a directed cyclic graph data structure.

3. The method for bidirectional synchronization of a BOM task tree and a 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, including: Determine whether the data structure of the BOM task tree and the data structure of the simulation application process canvas are newly created; If it is a new creation, 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 it is not newly created, the simulation application process canvas string and the BOM task tree string are read from the database for initialization.

4. The method for bidirectional synchronization between a BOM task tree and a simulation application process canvas according to any one of claims 1 to 3, characterized in that: The BOM task tree and the simulation application process canvas are respectively monitored for data structure addition, deletion, and modification operations to obtain a directed cyclic graph data structure set of incremental changes, including: According to the monitoring log, the BOM task tree and the simulation application process canvas are monitored for data structure addition, deletion and modification operations; Get the data structure that has changed in the monitoring result; The changed data structures are constructed into a directed cyclic graph data structure set with incremental changes.

5. The method for bidirectional synchronization between a BOM task tree and a simulation application process canvas according to any one of claims 1 to 3, characterized in that: According to the incrementally changed directed cyclic graph data structure set and in combination with the hierarchical relationship of the BOM task tree, an asynchronous update is performed from the data structure of the BOM task tree to the data structure of the simulation application process canvas, and / or, according to the incrementally changed directed cyclic graph data structure set and in combination with the task grouping box of the simulation application process canvas, an asynchronous update is performed from the data structure of the simulation application process canvas to the data structure of the BOM task tree, including: Determining an incremental change target according to the directed cyclic graph data structure set of the incremental changes; If the incremental change target is the BOM task tree, then 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, the data structure of the BOM task tree is asynchronously updated according to the data structure of the simulation application process canvas.

6. The method for bidirectional synchronization between a BOM task tree and a simulation application process canvas according to any one of claims 1 to 3, characterized in that: It also includes the following steps after completing the bidirectional synchronization between the BOM task tree and the simulation application process canvas: Compare the data structure of the BOM task tree with the data structure of the simulation application process canvas; If the information of the two is consistent, it is determined that the consistency verification has passed; If the two pieces of information are inconsistent, it is determined that the consistency verification fails.

7. The method for bidirectional synchronization between a BOM task tree and a simulation application process canvas according to any one of claims 1 to 3, characterized in that: According to the directed cyclic graph data structure set of the incremental changes and in combination with the hierarchical relationship of the BOM task tree, an asynchronous update is performed from the data structure of the BOM task tree to the data structure of the simulation application process canvas, including: Determine the target task grouping box of the incremental task node in the directed cyclic graph data structure set of the incremental change in the simulation application process canvas according to the hierarchical relationship in the data structure of the BOM task tree; 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 frame; The business flow connection of the incremental task node in the simulation application process canvas is determined according to the hierarchical relationship in the data structure of the BOM task tree and the target task grouping box.

8. The method for bidirectional synchronization of a BOM task tree and a simulation application process canvas according to claim 7, characterized in that: Determining the business flow connection 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: Determine the target task node and the connection direction that are connected to the incremental task node in the simulation application process canvas according to the superior-subordinate relationship of the different-level task nodes and the front-to-back order relationship of the same-level task nodes in the BOM task tree; 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 of the task grouping frame obstacle avoidance; The business flow connection of the incremental task node in the simulation application process canvas is realized according to the shortest distance between the incremental task node to be connected and the target task node in the simulation application process canvas and the connection direction.

9. The method for bidirectional synchronization of a BOM task tree and a simulation application process canvas according to claim 8, characterized in that: 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 of the task grouping frame obstacle avoidance includes: Select any task node in the simulation application process canvas as the current task node; Determine respectively 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 except the target task node and the incremental task node in the simulation application process canvas as obstacles; Find the shortest path between the target task node and the incremental task node that can avoid all obstacles.

10. The method for bidirectional synchronization of BOM task tree and simulation application process canvas according to claim 8, characterized in that: Determining the target task node and the connection direction that are connected to the incremental task node in the simulation application process canvas according to the superior-subordinate relationship of the different-level task nodes and the front-to-back order relationship of the same-level task nodes in the BOM task tree includes: Determine the task group box to which the incremental task node belongs in the simulation application process canvas according to the task group to which the incremental task node is located in the data structure of the BOM task tree; The target task node and connection direction of the incremental task node in the simulation application process canvas are determined according to the upper and lower level 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

  • A method for organize and displaying multiple view of product BOM

    CN109471991A

  • Real-time chart display method and device for electromagnetic simulation result data file

    CN116090151A

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

    CN116245051A

  • Complex product design verification knowledge graph construction and application method

    CN117609508A