A lightweight fast response virtual simulation training method and system

CN122530463BActive Publication Date: 2026-10-30CHENGDU POLYTECHNIC +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611023831.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-10
Publication Date
2026-10-30
Estimated Expiration
2046-07-10

AI Technical Summary

Technical Problem

以发电运维仿真场景为例,一个包含调速器、励磁系统、110KV主变及SF6断路器的完整变电站场景中,可变状态变量总数通常在数百至逾千个量级,如果每帧均对上述变量执行完整的读取、比较与条件渲染指令生成,在复杂场景下会引发不可忽视的无效计算开销,导致移动端性能劣化,造成操作响应迟钝,影响实训效果

Benefits of technology

[0006]本发明的有益效果体现在,本发明提供的轻量化快速响应的虚拟仿真实训方法和系统,通过将依赖图配置与计算脚本优先打包为第一级资源包,使平台在第一级资源包加载完成后即可开放交互界面,缩短了首次可用等待时间。通过第一线程与第二线程的异步分工,使状态传播计算不再阻塞UI线程的渲染提交,从机制上消除了因计算耗时不确定导致的帧率抖动。通过沿依赖图按拓扑顺序精确传播变化节点的值,使状态更新量仅与操作的真实影响范围相关,而非与场景总节点数相关,实现了计算量与场景复杂度的解耦。基于此,本发明可以降低处理器的无效计算开销与热积累,提升帧率稳定性与操作响应速度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122530463B_ABST
    Figure CN122530463B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of simulation training, in particular to a light-weighted fast-response virtual simulation training method and system, wherein the method comprises the following steps: declaring all state variables of variable attributes in a virtual simulation scene as nodes and constructing a dependency graph to generate a dependency relationship description file; performing topological sorting on the nodes; storing the node topological sequence, the dependency relationship description file and a calculation function script into a first-level resource package; constructing a local directed dependency graph according to a simulation running instruction and the first-level resource package; receiving simulation operation instructions in sequence through a first thread, determining a target physical state node, reassigning values and adding the target physical state node to an asynchronous propagation queue; traversing successor nodes in topological order of the local directed dependency graph through a second thread and reassigning values; and executing corresponding local rendering instructions on all nodes with changed values. The application can reduce invalid calculation overhead and heat accumulation of a processor, and improve frame rate stability and operation response speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of simulation training technology, and in particular to a lightweight and fast-response virtual simulation training method and system. Background Technology

[0002] Current mainstream virtual simulation training platforms (represented by industrial-grade mobile 3D simulation systems) generally adopt a full-state polling and whole-frame redrawing mechanism. At the beginning of each rendering frame (typically 16.7ms / frame, corresponding to a 60fps target), the platform's main thread traverses all variable state variables in the scene (including device switch positions, instrument readings, indicator light colors, device animation frame indices, etc.). Regardless of whether a variable has been affected by any operation between the previous and current frames, it is included in the state evaluation and UI update pipeline. Taking a power generation operation and maintenance simulation scenario as an example, in a complete substation scenario including a speed governor, excitation system, 110kV main transformer, and SF6 circuit breaker, the total number of variable state variables is usually in the hundreds to over a thousand. If a complete read, comparison, and conditional rendering instruction is executed for the above variables every frame, it will cause a significant amount of invalid computational overhead in complex scenarios, leading to mobile device performance degradation, sluggish operation response, and affecting the training effect. Therefore, there is an urgent need to provide a virtual simulation training method with fast response. Summary of the Invention

[0003] To address one of the aforementioned problems in the prior art, this invention provides a lightweight and fast-response virtual simulation training method and system.

[0004] To achieve the above objectives, the present invention provides a lightweight and fast-response virtual simulation training method, comprising: Step S101: Receive course production instructions and declare the state variables of all variable attributes in the virtual simulation scene as nodes according to the course production instructions. The nodes include: physical state nodes for representing the physical state of the equipment, electrical calculation nodes for representing the derivation results based on physical quantities, and presentation nodes for representing visual or auditory feedback. Step S102: Connect directed dependency edges according to the actual causal relationship between the nodes, construct a dependency graph according to the nodes and the directed dependency edges, and generate a dependency relationship description file describing the nodes and the directed dependency edges. Step S103: Perform topological sorting on the nodes according to the dependency graph to determine the legal computation order of all the nodes and form a node topological sequence; Step S104: Obtain the corresponding computation function script according to the node, and store at least the node topology sequence, the dependency description file and the computation function script into the first-level resource package; Step S105: Receive simulation run instruction, obtain the first level resource package according to the simulation run instruction, construct a local directed dependency graph according to the node topology sequence and the dependency description file, bind the corresponding calculation function to each node according to the calculation function script, and set the initial value of each node according to the dependency description file; Step S106: The simulation operation instructions are received sequentially through the first thread, and the following processing is performed on each simulation operation instruction: the target physical state node is determined according to the simulation operation instruction; if the simulation operation instruction generates a new value for the target physical state node, the new value generated by the simulation operation instruction is reassigned to the target physical state node through atomic writing, and the target physical state node is added to the asynchronous propagation queue. Step S107: Obtain all target physical state nodes from the asynchronous propagation queue through the second thread, traverse the successor node of each target physical state node according to the topological order of the local directed dependency graph, call the corresponding calculation function to calculate the corresponding new value for each successor node and reassign the value to the successor node. Step S108: Add all nodes whose values ​​have changed to the update queue, and generate and execute corresponding local rendering instructions based on the nodes in the update queue.

[0005] Another aspect of the present invention provides a lightweight and fast-response virtual simulation training system, the virtual simulation training system comprising: a training platform and a first client connected to the training platform; The training platform includes: The node declaration module is used to receive course production instructions and declare the state variables of all variable attributes in the virtual simulation scene as nodes according to the course production instructions. The nodes include: physical state nodes for representing the physical state of the equipment, electrical calculation nodes for representing the derivation results based on physical quantities, and presentation nodes for representing visual or auditory feedback. The dependency graph construction module is used to connect directed dependency edges according to the actual causal relationship between the nodes, construct a dependency graph according to the nodes and the directed dependency edges, and generate a dependency relationship description file describing the nodes and the directed dependency edges. The topology sorting module is used to sort the nodes according to the dependency graph and determine the legal computation order of all the nodes to form a node topology sequence. The resource package generation module is used to obtain the corresponding calculation function script based on the node, and to store at least the node topology sequence, the dependency description file, and the calculation function script into the first-level resource package; The first client includes: The running module is used to receive simulation running instructions, obtain the first-level resource package according to the simulation running instructions, construct a local directed dependency graph according to the node topology sequence and the dependency description file, bind the corresponding calculation function to each node according to the calculation function script, and set the initial value of each node according to the dependency description file. The interaction module is used to receive simulation operation instructions sequentially through the first thread, and perform the following processing on each simulation operation instruction: determine the target physical state node according to the simulation operation instruction; if the simulation operation instruction generates a new value for the target physical state node, reassign the new value generated by the simulation operation instruction to the target physical state node through atomic writing, and add the target physical state node to the asynchronous propagation queue. The calculation module is used to obtain all the target physical state nodes from the asynchronous propagation queue through the second thread, traverse the successor node of each target physical state node according to the topological order of the local directed dependency graph, call the corresponding calculation function to calculate the corresponding new value for each successor node and reassign the value to the successor node. The rendering module is used to add all nodes whose values ​​have changed to the update queue, and to generate and execute corresponding local rendering instructions for the nodes in the update queue.

[0006] The beneficial effects of this invention are reflected in the fact that the lightweight and fast-response virtual simulation training method and system provided by this invention, by prioritizing the packaging of dependency graph configuration and calculation scripts into a first-level resource package, allows the platform to open the interactive interface immediately after the first-level resource package is loaded, shortening the initial usability waiting time. Through the asynchronous division of labor between the first and second threads, state propagation calculations no longer block the UI thread's rendering submission, fundamentally eliminating frame rate jitter caused by uncertain computation time. By accurately propagating the values ​​of changed nodes along the dependency graph in topological order, the state update amount is only related to the actual impact range of the operation, rather than the total number of nodes in the scene, achieving decoupling between computational load and scene complexity. Based on this, this invention can reduce the processor's ineffective computational overhead and heat accumulation, improving frame rate stability and operation response speed. Attached Figure Description

[0007] Figure 1 This is a flowchart of the lightweight and fast-response virtual simulation training method provided in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the lightweight and fast-response virtual simulation training system provided in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the multi-terminal collaborative virtual simulation teaching application scenario provided in Embodiment 1 of the present invention. Detailed Implementation

[0008] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0009] Example 1 Existing training platforms typically employ a full state polling architecture. Under this architecture, each rendering frame must traverse all state variables within the scene. However, in typical training operations, there is a clear silent interval between two adjacent user operations (such as reading operation instructions or observing device action results). During this period, the values ​​of most state variables within the scene remain unchanged. Nevertheless, existing platforms still perform complete read and comparison operations on these unchanged variables and incorporate their corresponding UI components into the conditional rendering judgment process. Taking a mobile device equipped with a Snapdragon 870 processor (3.2GHz clock speed, Adreno 650 GPU) as an example, in a complex substation simulation scenario with over 800 variable nodes, the main thread CPU utilization rate in silent frames remains at 35%~50% due to full polling, significantly exacerbating device heat accumulation, triggering the processor's thermal throttling mechanism, and consequently causing the frame rate to drop from the target 60fps to 25~30fps, resulting in sluggish operation response and affecting the training effect.

[0010] Based on this, the core idea of ​​this invention is to abandon the indiscriminate periodic traversal of all state variables of the scene, and instead, during the course production stage, abstract all variable attributes in the scene, including the physical state of the equipment (switch position, circuit breaker on / off), electrical calculation quantities (bus voltage, line power), and visual presentation attributes (indicator color, meter pointer angle), into directed dependency graph nodes with clear causal semantics. The dependency relationships between nodes are delivered along with the resource package in the form of static configuration files. At runtime, calculation is only asynchronously propagated downwards along the dependency graph when the user operation actually changes the value of a node. The dependency edges between the physical calculation layer and the visual rendering layer decouple the two at the thread level. The calculation thread independently completes the re-derivation of electrical quantities and only pushes the results of the presentation nodes whose values ​​have actually changed to the UI thread. The UI thread executes precise local rendering instructions accordingly, and all other nodes in the frame that are not marked as changed completely skip the rendering update process.

[0011] Specifically, this embodiment provides a lightweight and fast-response virtual simulation training method, such as... Figure 1 As shown, it includes: Step S101: Receive course production instructions. According to the course production instructions, declare all variable attribute state variables in the virtual simulation scene as nodes. Nodes include: physical state nodes for representing the physical state of the equipment, electrical calculation nodes for representing the results of physical quantity derivation, and presentation nodes for representing visual or auditory feedback. Specifically, in the course production toolchain, a visual editor can be used to declare the state variables in the scene as nodes. The physical equipment state nodes (first layer), the electrical calculation nodes based on physical quantity derivation (second layer), and the visual presentation and sound feedback nodes (third layer) are organized in layers. Directed dependency edges are connected between nodes in and between layers according to the actual causal relationship, and finally a configuration file describing the complete dependency relationship is generated.

[0012] Step S102: Connect directed dependency edges based on the actual causal relationships between nodes, construct a dependency graph based on nodes and directed dependency edges, and generate a dependency relationship description file describing the nodes and directed dependency edges. Through the static modeling mechanism of dependency graph, all linkage rules are described in the form of directed dependency edges in the course configuration file, completely separated from the platform program code. After designers add or modify dependency edges in the editor, they can regenerate the resource package to make it effective at runtime without modifying any program code. The direct result of this decoupling is that the workload of customizing linkage logic for different power plant models and different operating procedures is transferred from software developers to designers, and the resource iteration cycle is shortened from depending on the software release rhythm (usually measured in weeks) to only depending on the time of repackaging the course package (usually measured in hours), significantly improving the platform's response speed to updates to power industry regulations.

[0013] Here's a concrete implementation example: During the course production phase, all mutable properties within the scene are declared as nodes. Each node is represented by a four-tuple. It means that among them A unique string identifier for a node. The semantic type to which the node belongs (one of three categories: physical state node, electrical computing node, or visual presentation node). The identifier for the computation function of this node (the physical state node is directly assigned a value by the user operation, at this time). (Can be left empty) This is the set of predecessor node identifiers that this node explicitly depends on. Taking the circuit breaker closing triggering the establishment of bus voltage and then driving the voltmeter pointer deflection as an example, the circuit breaker on / off state node belongs to the physical state node, and the bus voltage amplitude node belongs to the electrical calculation node. Pointing to a predefined node voltage calculation function, the voltmeter pointer angle node belongs to the visual representation node and This is a linear mapping function, forming two directed dependency edges between the three nodes. All node declarations and dependency edges together constitute the original description of the dependency graph, which is persisted as a course configuration file in JSON format.

[0014] Step S103 involves performing a topological sort on the nodes according to the dependency graph to determine the legal computation order of all nodes, forming a node topological sequence. After completing the node declaration, a topological sort can be performed on the dependency graph to determine the legal computation order of each node at runtime. In a specific example, the Kahn algorithm can be used. Specifically, an in-degree table is first constructed. Represents a node The number of predecessor nodes is used to add all nodes with an in-degree of zero (i.e., physical state nodes) to the initial queue. Loop through the head node of the queue ,Will Add to node topology sequence and to Each successor node implement ,like If it drops to zero, it will join in until Empty. If the final node topology sequence length is less than the total number of nodes, it indicates the presence of a directed cycle in the dependency graph. The toolchain will report an error and prevent the course from being published, requiring the course designer to check and eliminate the cycle. This step is performed offline in the course creation toolchain, generating the node topology sequence. It is written into the resource package along with the dependency graph configuration file, and can be used directly at runtime without repeated calculations.

[0015] It is worth noting that although there is an overall hierarchical relationship between the three types of semantic nodes (physical state nodes are usually located at the beginning of the topology sequence, and visual presentation nodes are usually located at the end), there may be horizontal dependencies between nodes within the same semantic type (for example, the line current calculation node and the power factor calculation node are both electrical calculation nodes, but the latter is preceded by the former). Therefore, topology sorting must be performed independently on the complete dependency graph. The semantic layer type is only used for resource hierarchical packaging and cannot replace the topology sequence number.

[0016] Step S104: Obtain the corresponding computation function script based on the node, and store at least the node topology sequence, dependency description file, and computation function script into the first-level resource package. Existing training platforms often require a complete download of the course resource package before interactive access, making the platform's actual usability highly dependent on network conditions. On a mobile 4G network (average download speed of approximately 20-30 Mbps), downloading a resource package of several hundred MB typically takes 1-3 minutes, during which time users cannot perform any pre-study or functional operations. For application scenarios such as power generation and maintenance that require on-site learning near equipment, the long waiting time directly reduces the practical value of mobile training, contradicting the platform's core positioning of "conducting skills training anytime, anywhere" for frontline maintenance personnel. Therefore, this invention can divide the resource package downloaded by the client into multiple levels. For example, configuration files and interactive logic scripts can together constitute the smallest first-level resource package, low-precision device models can constitute the second-level resource package, and high-precision textures and animation resources can constitute subsequent resource packages at each level. Each package is independently compressed and stored according to topology depth for sequential streaming download during runtime.

[0017] In a specific example, during the resource hierarchical packaging process, course resources can be divided into two levels based on the relative position of nodes in the topology sequence. The first level includes dependency graph configuration files, topology sequence files, all computation function scripts and interaction logic scripts, as well as minimally sized geometric proxies for interactive devices within the scene (retaining only colliders and operation trigger areas, stripping away all visual details). This level is extremely small and prioritizes transmission. The second level contains complete 3D models, high-precision textures, and skeletal animation resources for each device. After the first level resources are loaded and interactive, they are continuously downloaded in the background. Downloaded resources replace the minimally sized proxies of the corresponding nodes, gradually refining the visual presentation. This hierarchical strategy allows the platform to initialize the dependency graph and respond to user actions as soon as the first level resources are ready, laying the data foundation for runtime propagation in subsequent steps.

[0018] Step S105: Receive the simulation run command, acquire the first-level resource package according to the command, construct a local directed dependency graph based on the node topology sequence and dependency description file, bind the corresponding computation function to each node according to the computation function script, and set the initial value of each node according to the dependency description file. Specifically, after the client downloads the first-level resource package, it immediately parses the configuration file into a directed dependency graph data structure in local memory, performs topological sorting on all nodes, and pre-calculates the predecessor set of each node, completing the initialization of the graph structure. After this step is completed, the platform can enter an interactive state and respond to basic user operations without waiting for subsequent levels of resource packages to finish downloading. After the first-level resource package is downloaded, the platform immediately enters the runtime construction process of the dependency graph. This step must be completed before the first frame is rendered to ensure that any subsequent user operations can find a legitimate propagation path.

[0019] During the dependency graph construction process, the consistency check is first performed between the topology sequence file in the resource package and the dependency graph configuration file. In a specific example, let the set of nodes declared in the configuration file be... The set of directed dependent edges is The ordered list of nodes recorded in the topology sequence file is The verification condition is and Each element belongs to If the verification fails, the platform will terminate loading and display a resource package corruption message to the user, refusing to enter the interactive state to prevent subsequent initial value injection order errors due to inconsistencies between the sequence and the graph structure.

[0020] After successful verification, the platform uses a hash table. Build an in-memory adjacency table for the underlying container, where With node identifier string Using the node object reference as the key and the node object reference as the value, the expected lookup complexity is O(n log n). For each directed edge in the configuration file ( and (for two nodes), execute Node Add node Operations on the set of successor nodes are executed simultaneously. Node Add node Operations on the set of predecessor nodes, where Represents a node The set of successor nodes, Represents a node The set of predecessor nodes. After all edges have been processed, the adjacency list is completed, and the total time complexity of graph construction is O(n log n). .

[0021] Once the adjacency list is ready, the platform performs computed function binding. The platform pre-registers all valid computed functions to the global function registry using string identifiers as keys during program startup. .right Each computation function identifier Non-empty nodes ,implement This binds the function object reference to the node's execution slot. If Does not exist If the string is not explicitly defined, it is considered an illegal function identifier, and the platform will terminate the loading process. This design transforms runtime function calls from string parsing into direct function reference calls, eliminating the overhead of string lookups during each propagation computation.

[0022] After function binding is complete, proceed by topological sequence. from to Inject initial values ​​into each node sequentially. For physical state nodes ( (If empty), its initial value is directly assigned by the default state declared in the course configuration file, representing the initial physical conditions of the scene (such as all circuit breakers being in the open position and all disconnect switches being in the open state). For electrical calculation nodes and presentation nodes, the initial value is determined by their bound functions. The ready initial value of the predecessor node is used as input for calculation, that is: in, Represents a node The current value, for The set of predecessor nodes, due to For a valid topological sequence, for any edge All exist China first It appears, therefore calculation At this point, the initial values ​​of all predecessor nodes are guaranteed to be ready, eliminating the risk of reading undefined values. After all nodes have completed their initial value injection in sequence, the dependency graph enters the ready state, and the change flags (dirty flags) of all nodes are simultaneously set. Initialize to This indicates that there are currently no changes to be disseminated.

[0023] In an optional implementation, the first-level resource package may further include: a simplified geometric proxy of an interactive device within the virtual simulation scene; after step S105, the method further includes: opening a primary interactive interface based on the simplified geometric proxy of the interactive device, and continuously acquiring the second-level resource package. Through the simplified geometric proxy, colliders and operation trigger areas can be preserved, while all other visual details are stripped away, allowing the user to receive initial interactive feedback. Resources are packaged hierarchically according to the topological depth of the dependency graph, with the first-level resource package (containing the dependency graph structure definition) loaded first, enabling the platform to respond to basic user operations before the high-precision visual resource transmission is complete.

[0024] At this point, the platform can open its interactive interface to users and respond to operation events without waiting for the second-level high-precision visual resources to complete download. Subsequent user simulation operation command capture logic will use the hash adjacency table constructed in this step. With topological sequence Perform propagation computation on shared data structures.

[0025] In an optional implementation, after obtaining the second-level resource package, the method further includes: rendering an advanced interactive interface based on the second-level resource package, wherein the second-level resource package includes at least: a 3D model, high-precision textures, and skeletal animation resources. By using a minimalist geometric proxy to provide basic interaction after the first-level resource package is loaded, and then replacing it with a complete 3D model, high-precision textures, and skeletal animation resources upon the arrival of the second-level resource package, the platform can complete the streaming loading of visual resources in the background without the user's awareness. The interactive interface smoothly transitions from basic visuals to advanced visuals, avoiding the time wasted waiting for all resources to download in traditional solutions.

[0026] Step S106: The first thread sequentially receives simulation operation instructions and performs the following processing on each instruction: The target physical state node is determined based on the simulation operation instruction. If the simulation operation instruction generates a new value for the target physical state node, the new value is atomically written to the target physical state node, and the target physical state node is added to the asynchronous propagation queue. The first thread can be the UI thread, to distinguish it from the computation thread used in subsequent steps. Specifically, after a user operation (clicking an interactive device, dragging a control, etc.) is captured in the UI thread, an atomic assignment is performed on the target physical state node. Simultaneously, the change flag of the node is set, and it is added to the asynchronous propagation queue. Control is then returned to the UI thread to ensure the immediate responsiveness of the operation capture. The UI thread can receive multiple simulation operation instructions in batches, adding them sequentially to the asynchronous propagation queue, accumulating several instructions before initiating subsequent steps; alternatively, it can update the asynchronous propagation queue after processing each simulation operation instruction and immediately initiate subsequent steps. Nodes added to the asynchronous propagation queue can serve as source nodes for subsequent operations.

[0027] Here is a specific example: After the local dependency graph enters the ready state, the platform pre-establishes an event binding table for each interactive device object in the scene. Each record uses the device object's scene identifier as the key and the corresponding physical state node identifier and set of valid values ​​as the value. The event binding table can also be completed synchronously with the dependency graph construction during the initialization phase, without consuming additional runtime initialization time. When a user performs a click or swipe operation on a device on the touchscreen interface, the UI thread's event handler queries... Locating the target physical state node And determine the new value corresponding to this operation from the set of legal values. .

[0028] In an optional implementation, before assigning the new value generated by the simulation operation command to the target physical state node via atomic writing, the method further includes: determining whether the time interval between the current simulation operation command and the previous simulation operation command for the same physical state node is less than a preset threshold; if so, the current simulation operation command is discarded. Specifically, before submitting the change to the propagation queue, the platform performs time window filtering on consecutive operation events of the same node. By comparing the times of adjacent operation commands for the same physical state node, duplicate commands with times less than the threshold are discarded, thereby reducing invalid wake-ups and redundancy overhead caused by duplicate events due to accidental touches or other operations.

[0029] Here is a specific example: Suppose the last time the node was targeted... The event arrival time is The current event arrival time is The filtering threshold is (In the context of power generation operation and maintenance) (The shortest reasonable interval for a single physical toggle switch operation by the operator). If If the current event is considered a duplicate trigger of the same physical operation, the event is discarded and the current event is updated. ;like If the operation fails, it is considered an independent operation and proceeds to the subsequent write process. This filter is executed synchronously within the UI thread without introducing additional thread switching.

[0030] The following write sequence is triggered by filtered operation events. First, the UI thread processes nodes in `release` (release semantics) memory order. Atomic write to value fields The `release` method guarantees that the write operation has priority in memory visibility over any subsequent reads performed using `acquire` (acquire semantics). This operation ensures that the computing thread always reads the latest value when consuming the propagated message, preventing data races where old values ​​are read. Then, (Dirty marker) set to .

[0031] In an optional implementation, the target physical state node is added to the asynchronous propagation queue by adding its node identifier and new value as a message to be processed to the asynchronous propagation queue. Specifically, after completing the atomic write, the UI thread constructs the propagation message. ,in This is the source node identifier. For the new value to be written, Use the event timestamp and attempt to... Push into a thread-safe propagation queue .

[0032] In an optional implementation, before adding the target physical state node to the asynchronous propagation queue, the method further includes: checking whether the same target physical state node already exists in the asynchronous propagation queue; if so, updating the target physical state node to the new value for this operation. By merging consecutive operation messages of the same node, multiple repetitive operations are compressed into a single propagation task, avoiding redundant computation and queue accumulation. A specific example is given below, where... Before pushing, the platform checks Does it already exist in China? Pending messages for node identifiers If it exists, then... The value field is updated in place. And update its timestamp without adding new queue entries, i.e. ; This message merging operation compresses multiple consecutive operations performed by the user on the same node during the processing intervals of the computation threads into a single propagation task, avoiding multiple rounds of repetitive downstream propagation computations on the same source node. There is no targeting in China The pending messages will be directly processed. Add to the queue. The above queue operations are protected by a mutex lock. The critical section only covers the queue search and insertion operations. The lock holding time is extremely short and does not cause any perceptible blocking to the UI thread.

[0033] Once the message is enqueued, the UI thread returns immediately without waiting for any response from the computation thread, thus ensuring that the entire event handling process does not block the frame rendering pipeline. The computation thread for subsequent steps will continue to listen. Incremental propagation is then performed along the dependency graph, starting from the propagation message written in this step.

[0034] Step S107: The second thread retrieves all target physical state nodes from the asynchronous propagation queue, traverses the successor nodes of each target physical state node according to the topological order of the local directed dependency graph, calls the corresponding calculation function to calculate the corresponding new value for each successor node, and reassigns the value to the successor node. Specifically, the second thread can be a calculation thread independent of the aforementioned UI thread. The calculation thread retrieves the set source node from the asynchronous propagation queue, traverses downwards along the dependency edges in breadth-first order, and re-derives the node value for each reachable downstream node according to its predefined calculation function (physical formula, state machine transition function, or simple mapping relationship). For calculation nodes with multiple predecessor nodes, the calculation can only be executed after all its predecessor nodes have completed the current round of calculation.

[0035] After calculation, the new node value can be compared with the cached old value. Only nodes whose values ​​have actually changed and their new values ​​are pushed to the UI update queue; nodes whose values ​​have not changed do not enter any subsequent processing flow. Therefore, in an optional implementation, step S107 may specifically include: the second thread retrieves all currently existing nodes in the asynchronous propagation queue as the starting node set for this round of processing and clears the asynchronous propagation queue; it scans sequentially according to the topological order of the local directed dependency graph, marking the successor nodes of each node in the starting node set as nodes to be calculated, and calculating the new values ​​of all nodes to be calculated in sequence; it compares the new value of the node to be calculated with the corresponding cached value. If they are not equal, the cached value of the node to be calculated is reassigned to the new value of the node to be calculated, and all successor nodes of the node to be calculated are marked as nodes to be calculated, so that iterative processing can continue in the subsequent scans of this round. By emptying the queue at once and iteratively propagating only nodes whose values ​​have actually changed along the topological order, the propagation scope is precisely limited to the subgraph of the actual impact caused by this operation on the dependency graph, which greatly reduces the amount of computation compared with the full polling scheme.

[0036] The following is a specific implementation example: after completing the initialization of the local dependency graph, the computation thread enters a continuous running state and waits for the propagation queue by blocking with a condition variable. A non-empty signal. When the UI thread sends... After the propagation message is pushed in, the condition variable is activated, and the computation thread enters the current processing cycle. At the start of the processing cycle, the computation thread... A one-time empty operation is performed, retrieving all messages currently in the queue and clearing the queue. New messages pushed in by the UI thread will then accumulate until the next processing cycle. This design ensures that the input set for a single processing cycle is fixed, preventing the processing cycle from being extended indefinitely due to continuously arriving new messages. Let the set of messages retrieved in this cycle be... ,in This is the source node identifier. The new value written in the preceding steps, This represents the number of source nodes in this period. All source nodes are added to the starting node set (initial dirty set). and for each confirm (Consistent with the aforementioned atomic writing results).

[0037] Subsequently, the computation threads are arranged in a topological sequence. Scan from beginning to end, for each node Perform the following judgments and calculations: If Belongs to the initial dirty set (That is, the source node of this cycle), then its value has been atomically written and does not need to be called again to calculate the function, but it needs to enter the subsequent value change detection. Let... The old cache value is The new value is If the two are not equal, then Add all successor nodes to the extended dirty set That is, for each implement If the two are equal (indicating that the write did not substantially change the node value), then the dirty mark will not be propagated to subsequent nodes, and the subsequent nodes will remain in a non-dirty state for this period. Not belonging to But it belongs to the extended dirty set. (i.e., infected by upstream dirty nodes), then its binding function is called to recalculate the node value: ; in, For the bound computation function, for The set of predecessor nodes, Predecessor node The current value (due to the topological order guarantee) exist China first Appear, The value at this point has necessarily already been processed in the current cycle, and the latest result is being read. After the calculation is complete, and In comparison, if Then execute ,Will Add all successor nodes And will update the records. Push into UI update queue ;like If the node value does not change substantially, the cache is not updated, dirty marks are not propagated, and no writes are performed. The successor node will not be triggered within this cycle. If Neither belong to It does not belong to If the condition is met, then skip that node and do not perform any operation.

[0038] After the above scan is completed, clear the dirty collection. and Reset the dirty flag of all processed nodes to Once the processing cycle ends, the computation thread re-enters the condition variable waiting state. The accumulated update records will be consumed by the UI thread during the rendering preparation phase of the next frame.

[0039] Through the above mechanism, the propagation of dirty marking is strictly based on the actual change of node values, rather than on the node being visited. This precisely limits the propagation scope to the subgraph of the actual impact of the operation on the dependency graph. Compared with the full polling scheme, the computational cost is reduced from... Down to ,in This represents the total number of nodes whose values ​​actually changed during this period, in typical operations of power generation operation and maintenance simulation. Significant performance gains.

[0040] Furthermore, through the separation of the computation thread and the UI thread in the above steps, the computation thread executes asynchronous propagation independently, while the UI thread only processes the calculated results during the frame rendering preparation phase. The only interface between the two is a queue. Therefore, even if the execution time of the computation thread exceeds the single-frame budget within a certain propagation cycle, the UI thread can still submit rendering instructions normally in the current frame (using the rendering state of the previous frame) without blocking or waiting. This mechanism eliminates the root cause of frame rate jitter caused by the uncertainty of computation time.

[0041] Step S108: All nodes whose values ​​have changed are added to the update queue. Local rendering instructions are generated and executed based on the nodes in the update queue. The UI thread processes the UI update queue during the rendering preparation phase of each frame, executing only the corresponding rendering instructions (e.g., updating material parameters, driving skeletal animation, refreshing numerical display components) for the nodes in the queue. The rendering state of other nodes remains unchanged from the cached result of the previous frame, completely skipping the evaluation and redrawing logic of the current frame. After the rendering instructions are submitted, the change flags of the relevant nodes are cleared. The calculation thread adds data to the UI update queue at the end of each processing cycle. Update the node records where the written value (i.e., the assignment) has actually changed. The UI thread updates these records during the rendering preparation phase of each frame (i.e., before submitting the draw call to the GPU). The process involves converting the incremental calculation results into specific rendering instructions.

[0042] In an optional implementation, before generating and executing corresponding local rendering instructions based on the nodes in the update queue, the method further includes: calculating the difference between the new value of the node in the update queue and the value used when the rendering instruction was successfully submitted last time; and generating and executing the corresponding local rendering instruction for the node in the update queue when the absolute value of the difference is greater than a preset rendering update threshold. Before generating the rendering instruction, calculating the difference between the new value of the node and the value used when the rendering instruction was successfully submitted last time, and executing the rendering instruction only when the absolute value of the difference is greater than the preset rendering update threshold, thereby avoiding invalid redrawing due to small numerical fluctuations and reducing rendering overhead.

[0043] In one optional implementation, the rendering nodes include material parameter nodes, animation state nodes, and numerical display nodes. The step of generating and executing corresponding local rendering instructions based on the nodes in the update queue specifically includes: filtering the update queue, retaining the records of the rendering nodes, calculating rendering parameters according to the mapping functions bound to the rendering nodes, and executing the corresponding local rendering instructions according to the rendering parameters. Specifically, material parameter nodes are bound to color mapping functions, and the local rendering instruction updates the material shader parameters of the corresponding mesh object; animation state nodes are bound to state mapping functions, and the local rendering instruction triggers the state transition of the target skeletal animation; numerical display nodes are bound to formatting functions, and the local rendering instruction updates the displayed content. By subdividing the rendering nodes in the update queue into three categories—material parameters, animation states, and numerical displays—and using their respective bound mapping functions (color mapping, state mapping, and formatting functions) to generate different rendering instructions, the decoupling of visual feedback and electrical calculation logic is achieved. This ensures that only the nodes ultimately used for rendering drive the rendering pipeline, avoiding the unnecessary occupation of intermediate calculations for visual updates.

[0044] The following is a specific example of the process: When processing begins, the UI thread first processes... Perform frame deduplication on all existing records in the queue. Assume there are records in the queue with the same node identifier. If there are multiple records (occurring when the computation thread completes multiple processing cycles between two frames), only the record with the latest timestamp is retained, and the rest are discarded. After deduplication, the set of records to be processed in this frame is obtained. Each record is in the form of .

[0045] Subsequently Filter by node type, retain records of visual representation nodes, and discard records of electrical calculation nodes (the new values ​​of electrical calculation nodes have been written to the adjacency list). This is for use by subsequent dependent nodes, and no rendering instructions need to be generated. For each filtered record... Perform floating-point threshold judgment: Set the value used when the node last successfully submitted a rendering command to 1. (Same as the initial value of the node during initialization), the judgment condition is: ; in, To update the rendering threshold, angle-type parameters (such as the rotation angle of the instrument pointer) are taken as follows: For normalized brightness parameters (such as indicator light brightness coefficient, the value range) )Pick For discrete state parameters (such as the on / off state of a circuit breaker, which takes integer enumeration values), take... (Strict equality check). If the above conditions are not met, skip generating rendering instructions for this node in this frame and maintain the current rendering state; if the conditions are met, use the mapping function bound to the node. Will Convert to target rendering parameters ,Right now ; in, The specific meaning is determined by the type of rendering instruction for the node: for material parameter type nodes (such as indicator light color). For RGB color vectors, the rendering instruction is to update the material shader parameters of the corresponding mesh object; for animation state nodes (such as circuit breaker opening and closing animation). This is the target state identifier for the animation state machine, and the rendering instruction is to trigger the state transition of the corresponding skeletal animation; for numerical display nodes (such as voltmeter reading text). The formatted string is used as the rendering instruction to update the display content of the UI text component. Once the rendering instruction is generated, it will... Update the rendering baseline value of this node for use in threshold determination in the next frame.

[0046] After all filtered records have been processed, the corresponding rendering instructions are submitted in batches to the rendering pipeline for execution by the GPU within the current frame. Rendering objects corresponding to other nodes in the scene that have not changed completely skip the state evaluation and redraw process in this frame; their rendering state is carried over from the previous frame by the GPU's frame buffer, requiring no CPU intervention. The data is then cleared after processing. Once the records have been processed, the UI thread enters the normal rendering and submission process.

[0047] Steps S106, S107, and S108 together constitute a complete incremental update chain from user operation to screen display: Step S106 completes the atomic write and enqueue on the UI thread, Step S107 completes the asynchronous propagation on the calculation thread, and Step S108 writes the changed result. And process at the frame boundaries of the UI thread. It accurately projects into rendering instructions, and the three steps communicate with each other only through a queue. The UI thread and the computing thread are completely decoupled at the data level, and there are no direct function calls or shared lock dependencies.

[0048] The lightweight and fast-response virtual simulation training method provided in this implementation packages dependency graph configuration and calculation scripts into a first-level resource package, allowing the platform to open the interactive interface immediately after the first-level resource package is loaded, thus shortening the initial usability wait time. Through asynchronous division of labor between the first and second threads, state propagation calculations no longer block UI thread rendering submissions, fundamentally eliminating frame rate fluctuations caused by uncertain computation time. By accurately propagating the values ​​of changed nodes along the dependency graph in topological order, the state update amount is only related to the actual impact range of the operation, rather than the total number of nodes in the scene, achieving decoupling between computational load and scene complexity. Based on this, this invention can reduce the processor's ineffective computational overhead and heat accumulation, improving frame rate stability and operation response speed.

[0049] This embodiment also provides a lightweight, fast-response virtual simulation training system for implementing the aforementioned method. The content already described in the method section will not be repeated here; only the system architecture will be described, such as... Figure 2 As shown, the virtual simulation training system includes: a training platform 21 and a first client 22 connected to the training platform; Training platform 21 includes: The node declaration module 211 is used to receive course production instructions and declare the state variables of all variable attributes in the virtual simulation scene as nodes according to the course production instructions. The nodes include: physical state nodes for representing the physical state of the equipment, electrical calculation nodes for representing the derivation results based on physical quantities, and presentation nodes for representing visual or auditory feedback.

[0050] The dependency graph construction module 212 is used to connect directed dependency edges based on the actual causal relationship between nodes, construct a dependency graph based on nodes and directed dependency edges, and generate a dependency relationship description file describing the nodes and directed dependency edges.

[0051] The topology sorting module 213 is used to sort the nodes topologically according to the dependency graph and determine the legal computation order of all nodes to form a node topology sequence.

[0052] The resource package generation module 214 is used to obtain the corresponding computation function script based on the node, and to store at least the node topology sequence, dependency description file and computation function script into the first-level resource package.

[0053] The first client 22 includes: The running module 221 is used to receive simulation running instructions, obtain the first-level resource package according to the simulation running instructions, construct a local directed dependency graph according to the node topology sequence and dependency description file, bind the corresponding calculation function to each node according to the calculation function script, and set the initial value of each node according to the dependency description file.

[0054] The interaction module 222 is used to receive simulation operation instructions sequentially through the first thread, and perform the following processing on each simulation operation instruction: determine the target physical state node according to the simulation operation instruction; if the simulation operation instruction generates a new value for the target physical state node, reassign the new value generated by the simulation operation instruction to the target physical state node through atomic writing, and add the target physical state node to the asynchronous propagation queue.

[0055] The calculation module 223 is used to obtain all target physical state nodes from the asynchronous propagation queue through the second thread, traverse the successor nodes of each target physical state node according to the topological order of the local directed dependency graph, call the corresponding calculation function to calculate the corresponding new value for each successor node and reassign the value to the successor node.

[0056] The rendering module 224 is used to add all nodes whose assignments have changed to the update queue, and to generate and execute corresponding local rendering instructions for the nodes in the update queue.

[0057] The lightweight and fast-response virtual simulation training system provided in this implementation packages dependency graph configuration and calculation scripts into a first-level resource package, allowing the platform to open the interactive interface immediately after the first-level resource package is loaded, thus shortening the initial usability wait time. Through asynchronous division of labor between the first and second threads, state propagation calculations no longer block UI thread rendering submissions, fundamentally eliminating frame rate fluctuations caused by uncertain computation time. By accurately propagating the values ​​of changed nodes along the dependency graph in topological order, the state update quantity is only related to the actual impact range of the operation, rather than the total number of nodes in the scene, achieving decoupling between computational load and scene complexity. Based on this, the present invention can reduce the processor's ineffective computational overhead and heat accumulation, improving frame rate stability and operation response speed.

[0058] In practical applications, multi-terminal collaborative teaching is a common requirement. In multi-user collaborative teaching and assessment scenarios, existing platforms maintain a complete scene state object on the server side. When any client performs an operation, the server serializes the current full state object and broadcasts it to all online clients in the room. Upon receiving the broadcast, the receiving end performs a full overwrite of its local state object and triggers a complete state refresh process for the local scene. The size of the state object increases linearly with the complexity of the scene. In complex industrial scenarios containing hundreds of interactive nodes, the size of a single broadcast state snapshot can reach several KB to tens of KB. Furthermore, when multiple trainees operate simultaneously (such as multiple people concurrently controlling the same virtual power distribution system), the server must process multiple concurrent status broadcast requests within a very short time window. The product of the size of a single broadcast packet (several KB to tens of KB) and the concurrency frequency can cause the instantaneous peak downlink bandwidth to exceed the available bandwidth limit of common 4G private networks or enterprise Wi-Fi networks in industrial sites (such as hydropower station control rooms) (usually 1~5Mbps / user), which in turn causes status packets to be lost or out of order, resulting in inconsistent device statuses presented by different clients, which in severe cases affects the objectivity and accuracy of the assessment.

[0059] Therefore, in an optional implementation, the present invention also provides a multi-terminal collaborative virtual simulation teaching application scenario based on differential synchronization. For example... Figure 3 As shown, the virtual simulation training system of this embodiment further includes: at least one other client 23; the first client 22, which, after receiving the simulation operation instruction, sends the target physical state node determined by the simulation operation instruction and the corresponding new value as an operation message to the training platform; the training platform 21, which is further used to perform propagation calculation on the dependency graph according to the operation message, obtain a list of changed node differences, and broadcast the list of changed node differences to other clients; and the other clients 23, which are used to update their local asynchronous propagation queue according to the list of changed node differences. Specifically, in order to meet the requirements of multi-person collaborative teaching, a training platform can connect to multiple clients simultaneously, and multiple clients can operate collaboratively. The internal structure of each other client is similar to that of the first client, and will not be described again here. In multi-person collaborative teaching or virtual simulation assessment scenarios, the first client, as the initiator, reports only the source node identifier and new value changed by this operation to the server. The server performs the same propagation calculation as the first client on its maintained authority dependency graph to obtain the set of all changed nodes caused by this operation. It then broadcasts the difference list composed of the changed node identifiers and new values ​​to other clients in the room. Each receiving client directly injects the nodes in the difference list into its local propagation queue, triggering local incremental updates and achieving state convergence consistent with the initiator, without needing to receive or process a complete state snapshot.

[0060] The following is a specific example of a multi-terminal collaborative virtual simulation teaching application: In the scenario of a collaborative teaching room and a virtual simulation assessment room, the server (i.e., the training platform) maintains an authority dependency graph for each active room that has the same resource package structure as the first client. And maintain a monotonically increasing state version number. The initial value is When a room is created, the server broadcasts a snapshot of the current full state to the first client to join (at this time...). The snapshot (which is the set of initial values ​​for each node) is in the default initial state of the course and includes the current version number. The client uses this method to align the state of its local dependency graph. Subsequent clients joining the room also first receive a full state snapshot and perform initial alignment with the current version number, then switch to differential synchronization mode. When a room is created, the server also verifies the resource package hash value reported by the client. If it differs from the resource package hash value held by the server, the client is rejected from joining, preventing synchronization errors caused by differences in dependency graph structures due to resource package version differences.

[0061] After initial alignment is complete, when a client user performs an operation, the client, after completing a local atomic write, simultaneously reports the operation message to the server. ,in This is the source node identifier. For the new value, This is the most recently received server version number recorded locally by the client, used by the server to detect whether the client's state is lagging behind.

[0062] The server received After that, first check Is it equal to the current server version number? .like This indicates that the client had not yet received several differential packets when issuing this operation, and its local state was lagging behind the authoritative dependency graph. The server temporarily stores the operation message in the pending queue, and processes it after the acknowledgment receipt of the corresponding differential packet arrives, or forcibly overwrites it based on the current state of the authoritative dependency graph after a timeout, ensuring the uniqueness of the authoritative dependency graph. If so, the conflict detection process will begin.

[0063] For the set of other operation messages currently being processed or pending, the server estimates the impact of each operation. (That is, the client initiating the operation can propagate the set of changed nodes involved in the computation, through...) (Obtained by performing a single read-only simulated propagation). Let the estimated impact set of this operation be... If for all current concurrent operations All If a conflict exists, it is considered non-conflictible, and this operation can be executed concurrently with other operations; if a conflict exists... Make If a conflict occurs, the operation is added to the serialization queue and executed only after the conflict has been resolved. In power generation operation and maintenance simulation scenarios, the dependent subgraphs of the speed control system, excitation system, and high-voltage distribution system usually have no common successor nodes, so the probability of concurrent conflicts is extremely low, and the serialization queue is empty in most cases.

[0064] After conflict detection, the server... Perform the same topological order scan propagation calculation as the client that initiated the operation, and obtain the set of changed nodes caused by this operation. Each element is a tuple of the changed node identifier and the new value. The version number is then incremented. Construct differential messages ,in This is the client identifier that initiates the operation, used by the receiver to distinguish between locally processed operations and those arriving from a remote location. The server will... The broadcast is sent to all online clients in the room except the initiator; for the initiator's client, only the new version number is sent. As a confirmation receipt, the differential content will not be sent repeatedly.

[0065] The receiving client received Next, first verify the version number it carries. Is it equal to the local version number plus one? If yes, then... Each record The local state is atomically written in `release` memory order, and the corresponding node is added to the local propagation queue. The computation thread then performs subsequent incremental propagation and rendering updates. The local state converges to the authority dependency within one processing cycle. Figure 1 The result is that the local version number will be updated to [the desired value]. If the received version number is greater than the local version number plus one, it indicates that differential packets have been lost. The receiving client sends a full status request to the server, and the server updates the status to reflect the current version. The receiving client receives a full snapshot response and then re-performs full alignment before continuing to receive subsequent differential packets.

[0066] In the description of the embodiments of the present invention, it should be understood that the terms "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "center," "top," "bottom," "top," "bottom," "inner," "outer," "inner side," and "outer side," etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the accompanying drawings and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. "Inner side" refers to the interior or enclosed area or space. "Outer perimeter" refers to the area surrounding a specific component or specific area.

[0067] In the description of embodiments of the present invention, the terms "first," "second," "third," and "fourth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first," "second," "third," or "fourth" may explicitly or implicitly include one or more of that feature. In the description of the present invention, unless otherwise stated, "a plurality of" means two or more.

[0068] In the description of the embodiments of the present invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," "joining," and "assembly" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0069] In the description of embodiments of the present invention, specific features, structures, materials or characteristics may be combined in any suitable manner in one or more embodiments or examples.

[0070] In the description of the embodiments of the present invention, it should be understood that "-" and "~" represent a range between two numerical values, and this range includes the endpoints. For example, "AB" represents a range greater than or equal to A and less than or equal to B. "A~B" represents a range greater than or equal to A and less than or equal to B.

[0071] In the description of embodiments of the present invention, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0072] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A lightweight and fast-response virtual simulation training method, characterized in that, include: Step S101: Receive course production instructions and declare the state variables of all variable attributes in the virtual simulation scene as nodes according to the course production instructions. The nodes include: physical state nodes for representing the physical state of the equipment, electrical calculation nodes for representing the derivation results based on physical quantities, and presentation nodes for representing visual or auditory feedback. Step S102: Connect directed dependency edges according to the actual causal relationship between the nodes, construct a dependency graph according to the nodes and the directed dependency edges, and generate a dependency relationship description file describing the nodes and the directed dependency edges. Step S103: Perform topological sorting on the nodes according to the dependency graph to determine the legal computation order of all the nodes and form a node topological sequence; Step S104: Obtain the corresponding computation function script according to the node, and store at least the node topology sequence, the dependency description file and the computation function script into the first-level resource package, wherein the first-level resource package further includes: a minimalist geometric proxy of the interactive device in the virtual simulation scene; Step S105: Receive simulation run instruction, obtain the first-level resource package according to the simulation run instruction, construct a local directed dependency graph according to the node topology sequence and the dependency description file, bind the corresponding calculation function to each node according to the calculation function script, set the initial value of each node according to the dependency description file, and open the primary interactive interface according to the minimalist geometric proxy of the interactive device after the first-level resource package is loaded, and continuously obtain the second-level resource package. After obtaining the second-level resource package, render according to the second-level resource package to form an advanced interactive interface. The second-level resource package includes at least: 3D model, high-precision texture and skeletal animation resources. Step S106: The simulation operation instructions are received sequentially through the first thread, and the following processing is performed on each simulation operation instruction: the target physical state node is determined according to the simulation operation instruction; if the simulation operation instruction generates a new value for the target physical state node, the new value generated by the simulation operation instruction is reassigned to the target physical state node through atomic writing, and the target physical state node is added to the asynchronous propagation queue. Step S107 involves retrieving all target physical state nodes from the asynchronous propagation queue using a second thread, traversing the successor nodes of each target physical state node according to the topological order of the local directed dependency graph, calling the corresponding calculation function to calculate the corresponding new value for each successor node, and reassigning the value to the successor node. Specifically, step S107 includes: retrieving all currently existing nodes in the asynchronous propagation queue at once as the starting node set for this round of processing using the second thread, and clearing the asynchronous propagation queue; scanning sequentially according to the topological order of the local directed dependency graph, marking the successor nodes of each node in the starting node set as nodes to be calculated, and sequentially calculating the new values ​​of all nodes to be calculated; comparing the new value of the node to be calculated with the corresponding cached value; if they are not equal, reassigning the cached value of the node to be calculated to the new value of the node to be calculated, and marking all successor nodes of the node to be calculated as nodes to be calculated, so as to continue iterative processing in subsequent scans of this round; if they are equal, the successor node is not triggered in this cycle. Step S108: Add all nodes whose values ​​have changed to the update queue, and generate and execute corresponding local rendering instructions based on the nodes in the update queue.

2. The virtual simulation training method according to claim 1, characterized in that, Before the step of assigning the new value generated by the simulation operation command to the target physical state node via atomic writing, the method further includes: Determine whether the time interval between the current simulation operation command and the previous simulation operation command for the same physical state node is less than a preset threshold. If so, the current simulation operation instruction is discarded.

3. The virtual simulation training method according to claim 1, characterized in that, Before adding the target physical state node to the asynchronous propagation queue, the method further includes: Check if the same target physical state node already exists in the asynchronous propagation queue. If it does, update the target physical state node with the new value for this operation.

4. The virtual simulation training method according to claim 1, characterized in that, The presentation nodes include material parameter nodes, animation status nodes, and numerical display nodes; The step of generating and executing corresponding local rendering instructions based on the nodes in the update queue specifically includes: filtering the update queue, retaining the records of the rendering nodes, calculating rendering parameters based on the mapping function bound to the rendering nodes, and executing corresponding local rendering instructions based on the rendering parameters. The material parameter class node is bound to a color mapping function, and the local rendering instruction is to update the material shader parameters of the corresponding mesh object. The animation state class node is bound to a state mapping function, and the local rendering instruction is a state transition that triggers the target skeletal animation. The numerical display class node is bound to a formatting function, and the local rendering instruction is used to update the displayed content.

5. The virtual simulation training method according to claim 1, characterized in that, Before the step of generating and executing corresponding local rendering instructions based on the nodes in the update queue, the method further includes: Calculate the difference between the new value of the node in the update queue and the value used when the rendering command was successfully submitted last time; When the absolute value of the difference is greater than the preset rendering update threshold, a corresponding local rendering instruction is generated and executed for the nodes in the update queue.

6. A lightweight, fast-response virtual simulation training system, characterized in that, The virtual simulation training system includes: a training platform, and a first client connected to the training platform; The training platform includes: The node declaration module is used to receive course production instructions and declare the state variables of all variable attributes in the virtual simulation scene as nodes according to the course production instructions. The nodes include: physical state nodes for representing the physical state of the equipment, electrical calculation nodes for representing the derivation results based on physical quantities, and presentation nodes for representing visual or auditory feedback. The dependency graph construction module is used to connect directed dependency edges according to the actual causal relationship between the nodes, construct a dependency graph according to the nodes and the directed dependency edges, and generate a dependency relationship description file describing the nodes and the directed dependency edges. The topology sorting module is used to sort the nodes according to the dependency graph and determine the legal computation order of all the nodes to form a node topology sequence. The resource package generation module is used to obtain the corresponding calculation function script according to the node, and store at least the node topology sequence, the dependency description file and the calculation function script into the first-level resource package, wherein the first-level resource package further includes: a minimalist geometric proxy of the interactive device in the virtual simulation scene; The first client includes: The running module is used to receive simulation run instructions, obtain the first-level resource package according to the simulation run instructions, construct a local directed dependency graph according to the node topology sequence and the dependency description file, bind the corresponding calculation function to each node according to the calculation function script, set the initial value of each node according to the dependency description file, and open the primary interactive interface according to the minimalist geometric proxy of the interactive device after the first-level resource package is loaded, and continuously obtain the second-level resource package. After obtaining the second-level resource package, the module renders the second-level resource package to form an advanced interactive interface. The second-level resource package includes at least: 3D model, high-precision texture and skeletal animation resources. The interaction module is used to receive simulation operation instructions sequentially through the first thread, and perform the following processing on each simulation operation instruction: determine the target physical state node according to the simulation operation instruction; if the simulation operation instruction generates a new value for the target physical state node, reassign the new value generated by the simulation operation instruction to the target physical state node through atomic writing, and add the target physical state node to the asynchronous propagation queue. The calculation module is used to retrieve all target physical state nodes from the asynchronous propagation queue through a second thread, traverse the successor nodes of each target physical state node according to the topological order of the local directed dependency graph, call the corresponding calculation function to calculate the corresponding new value for each successor node and reassign the value to the successor node. Specifically, the calculation module is used to retrieve all currently existing nodes in the asynchronous propagation queue at once through the second thread as the starting node set for this round of processing, and clear the asynchronous propagation queue; scan sequentially according to the topological order of the local directed dependency graph, mark the successor nodes of each node in the starting node set as nodes to be calculated, and calculate the new value of all nodes to be calculated in turn; compare the new value of the node to be calculated with the corresponding cached value. If they are not equal, the cached value of the node to be calculated is reassigned to the new value of the node to be calculated, and all successor nodes of the node to be calculated are marked as nodes to be calculated, so as to continue iterative processing in the subsequent scans of this round; if they are equal, the successor node is not triggered in this cycle. The rendering module is used to add all nodes whose values ​​have changed to the update queue, and to generate and execute corresponding local rendering instructions for the nodes in the update queue.

7. The virtual simulation training system according to claim 6, characterized in that, The virtual simulation training system also includes: at least one other client; The first client is further configured to, after receiving the simulation operation instruction, send the target physical state node determined by the simulation operation instruction and the corresponding new value as an operation message to the training platform; The training platform is also used to perform propagation calculations on the dependency graph according to the operation message, obtain a list of changed node differences, and broadcast the list of changed node differences to the other clients. The other clients are used to update their local asynchronous propagation queues based on the changed node difference list.

Citation Information

Patent Citations

  • Systems, methods, kits, and apparatuses for digital product network systems and biology-based value chain networks

    CA3177585A1

  • Temporal dependencies in dependency graphs

    CN104520902A