Method and system for multi-operation path deduction and optimization based on digital twin runtime

CN122653752APending Publication Date: 2026-08-28CHENGDU BOWEI DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610826318.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-09
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

[0005]本发明的目的在于提供基于数字孪生运行时的多操作路径推演与寻优方法及系统,以解决现有技术中推演副本复制成本高、主从一致性差导致结果不可执行、动态环境下重算慢的技术问题

Benefits of technology

[0037] This invention freezes the main runtime snapshot, copying only the minimum necessary data set of semantic context and resource occupancy status, eliminating the need to copy rendering resources. This significantly reduces the memory consumption and startup time of shadow instances, enabling rapid recalculation after state changes and supporting high-frequency parallel inference. Multiple shadow instances are created using a copy-on-write mechanism, sharing immutable rule objects while independently copying only mutable state data. This achieves rapid copying of shadow instances and maintains consistency with the main runtime environment, allowing the optimal inference path to be directly mapped to the execution environment, avoiding the generation of "pseudo-optimal paths." Furthermore, copying shadow instances based on the current snapshot reduces memory consumption and startup time, expanding the scale of multi-operation path inference under the same computing resource conditions. Parallel computation allows for the inference of more operation paths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122653752A_ABST
    Figure CN122653752A_ABST
Patent Text Reader

Abstract

The application discloses a multi-operation path deduction and optimization method and system based on a digital twin runtime, and relates to the technical field of digital twin and intelligent decision-making.The method comprises the following steps: when there is a decision-making demand, freezing the current state of the main runtime instance to obtain a current snapshot of a minimum necessary data set; creating multiple shadow instances based on the current snapshot by using a write-once-copy mechanism, assigning a candidate operation path to each shadow instance, and respectively deducing the candidate operation path; scoring each deduction result, selecting an optimal operation path, and outputting a guide package.The application greatly reduces the creation cost of the shadow instance, guarantees the consistency between the master and the slave, and enables the deduction result to be directly mapped to on-site execution, thereby solving the problems of high replication cost, unexecutable result, and slow dynamic recalculation in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of digital twin and intelligent decision-making technology, specifically to a method and system for multi-operation path deduction and optimization based on digital twin runtime. Background Technology

[0002] In high-risk or high-value scenarios such as complex industrial operation and maintenance, emergency command, power dispatch, and chemical disposal, operators often face the choice of multiple legal operation paths (such as different valve combinations, different switching sequences, and different resource allocation strategies). Traditional decision-making often relies on the operator's personal experience or to verify the accessibility and optimality of each path one by one.

[0003] With the development of digital twin technology, some existing solutions utilize digital twin simulation for multi-path generation, deduction, and optimization. However, these solutions often use a complete simulation copy as the deduction carrier, resulting in high memory consumption and slow instance startup. When the on-site state changes, a new solution needs to be quickly provided. Existing solutions require a full recalculation after a state change, making it difficult to support high-frequency, parallel analysis. Furthermore, if the simulation copy is inconsistent with the main runtime environment, the deduced "optimal path" may be unexecutable in reality due to resource conflicts, insufficient permissions, or other reasons, resulting in a "pseudo-optimal path."

[0004] In summary, in the field of industrial-grade digital twin and intelligent decision-making technology, there are problems such as high cost of replicating the simulation, poor master-slave consistency leading to unexecutable results, and slow recalculation in dynamic environments. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for multi-operation path deduction and optimization based on digital twin runtime, so as to solve the technical problems of high cost of deduction copy replication, poor master-slave consistency leading to unexecutable results, and slow recalculation in dynamic environment in the prior art.

[0006] This invention is achieved through the following technical solution:

[0007] In a first aspect, the present invention provides a method for multi-operation path deduction and optimization based on digital twin runtime, including:

[0008] In response to the optimization request, the current state of the main runtime is frozen to obtain the current snapshot; the current snapshot contains the minimum necessary data set of the semantic context and resource occupancy status of the main runtime;

[0009] Based on the current snapshot, multiple shadow instances are created using a copy-on-write mechanism; each shadow instance shares the immutable rule object in the semantic context and independently copies the mutable state data.

[0010] A candidate operation path is assigned to each shadow instance, and each shadow instance performs its own deduction on its candidate operation path to obtain the deduction result;

[0011] Each simulation result is scored, the optimal operation path is selected, and the guiding package of the optimal operation path is output.

[0012] In one implementation, before creating multiple shadow instances using a copy-on-write mechanism based on the current snapshot, the method further includes:

[0013] Perform state key integrity verification and lock resource consistency verification on the current snapshot; wherein, the state key integrity verification is used to check the timeliness of key sensor data and mark the risk when the data is missing or expires; the lock resource consistency verification is used to verify whether the lock state is consistent with the distributed lock service.

[0014] In one implementation, the candidate operation path is generated by at least one of the following methods:

[0015] Perform the K-shortest path algorithm on the device connectivity graph to generate topology operation paths as candidate operation paths;

[0016] Based on the finite state machine reachability graph of the operation process, enumerate the legal operation sequences as candidate operation paths;

[0017] Based on the topology operation path or legal operation sequence, a security confirmation step is inserted into the key nodes to generate a hybrid strategy path as a candidate operation path.

[0018] In one implementation, during the deduction of each candidate operation path, each action in the candidate operation path is verified by an abstract syntax tree or finite state machine to update the state tree and record the violation risk and bypass count.

[0019] In one implementation, the step of deducing candidate operation paths for each shadow instance includes:

[0020] Each shadow instance is configured with an independent virtual clock, speedup factor, and random seed; wherein the random seed is used to generate a random perturbation sequence during the simulation to simulate uncertainty factors.

[0021] Each shadow instance utilizes its own virtual clock and acceleration factor to perform accelerated simulations in parallel.

[0022] In one implementation, the scoring method for each deduction result is as follows:

[0023] Each simulation result is scored using a multi-objective cost function, which is a weighted sum based on risk value, execution time, energy consumption, and violation penalty.

[0024] The risk value is calculated based on the minimum safety margin, the execution time is estimated based on a three-dimensional spatial distance and personnel movement speed model, and the violation penalty is the penalty for the number of times the path is bypassed or the number of times forced authorization is granted.

[0025] In one implementation, the guidance package includes a target node identifier, a camera guidance path, a 3D highlighting style, and a cost decomposition field; wherein the cost decomposition field is used to explain the advantages of the optimal path over other paths in terms of risk, time consumption, energy consumption, or violation penalties.

[0026] In one embodiment, the method further includes: pushing the bootstrap package to a 3D terminal via the WebSocket protocol to overlay and render the ghost action and path of the optimal operation path in the 3D scene for guiding the operation.

[0027] In one embodiment, the method further includes:

[0028] During the execution of the optimal operation path in the main runtime, the key states and lock resource changes of the main runtime are continuously monitored;

[0029] When a state change or lock conflict occurs, determine the set of target candidate operation paths affected by the state change;

[0030] Incremental recalculation is performed on the target candidate operation path set and its associated shadow instances, and the scoring results are updated.

[0031] Secondly, this invention provides a multi-operation path deduction and optimization system based on digital twin runtime, including:

[0032] The snapshot generation module is used to freeze the current state of the main runtime in response to the optimization request and obtain the current snapshot; the current snapshot contains the minimum necessary data set of the semantic context and resource occupancy status of the main runtime.

[0033] The shadow management module is used to create multiple shadow instances based on the current snapshot using a copy-on-write mechanism; wherein each shadow instance shares the immutable rule object in the semantic context and independently copies the mutable state data;

[0034] The inference engine is used to assign a candidate operation path to each shadow instance, and each shadow instance infers its candidate operation path to obtain the inference result.

[0035] The scoring and output module is used to score each simulation result, select the optimal operation path, and output the guidance package of the optimal operation path.

[0036] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0037] This invention freezes the main runtime snapshot, copying only the minimum necessary data set of semantic context and resource occupancy status, eliminating the need to copy rendering resources. This significantly reduces the memory consumption and startup time of shadow instances, enabling rapid recalculation after state changes and supporting high-frequency parallel inference. Multiple shadow instances are created using a copy-on-write mechanism, sharing immutable rule objects while independently copying only mutable state data. This achieves rapid copying of shadow instances and maintains consistency with the main runtime environment, allowing the optimal inference path to be directly mapped to the execution environment, avoiding the generation of "pseudo-optimal paths." Furthermore, copying shadow instances based on the current snapshot reduces memory consumption and startup time, expanding the scale of multi-operation path inference under the same computing resource conditions. Parallel computation allows for the inference of more operation paths. Attached Figure Description

[0038] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:

[0039] Figure 1 This is a flowchart of a multi-operation path deduction and optimization method based on digital twin runtime according to an embodiment of the present invention;

[0040] Figure 2 This is a flowchart illustrating a closed-loop deduction process for multiple operation paths according to an embodiment of the present invention.

[0041] Figure 3 This is a block diagram of a multi-operation path deduction and optimization system based on digital twin runtime according to an embodiment of the present invention;

[0042] Figure 4 This is a schematic diagram of the workflow of a multi-operation path deduction and optimization system according to an embodiment of the present invention; Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.

[0044] To address the shortcomings of existing digital twin-based multi-path deduction and optimization schemes, such as high replication costs, poor master-slave consistency, and slow dynamic recalculation, this invention provides a multi-operation path deduction and optimization method based on digital twin runtime, solving at least one of the aforementioned problems. The core idea of ​​this invention is to freeze a snapshot of the "minimum necessary data set" of the master runtime, create lightweight shadow instances through a copy-on-write mechanism, assign candidate paths to each shadow instance and independently accelerate the deduction, score and rank the deduction results, and output a guidance package to guide operations. This method can be widely applied to high-risk operation scenarios such as power plant control rooms, chemical plant DCS operations, flight simulators, and emergency command systems.

[0045] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0046] The multi-operation path deduction and optimization method based on digital twin runtime provided in this invention is executed by a digital twin system. This digital twin system can be deployed on a control center server or edge computing node in an industrial field. It communicates in real-time with the underlying control system (such as DCS, PLC, SCADA) via industrial Ethernet, OPCUA, or MQTT protocols to acquire real-time data from field sensors, equipment status, lock resource information, and operation logs. Simultaneously, the digital twin system provides decision service interfaces to upper-level systems (such as production scheduling systems and emergency command platforms) and interacts with human-machine interaction terminals (such as 3D visualization screens, AR glasses, and tablets) via WebSocket or HTTP protocols. The main runtime is the core component of the digital twin system. It continuously synchronizes the state of the real physical world, maintains the twin mirror at the current moment, and provides status query, rule verification, and deduction services. The shadow instance is a lightweight copy of the main runtime, used for offline deduction, and does not interfere with the normal state updates of the main runtime. When a field operator initiates an optimization request through a terminal, or when the upper-level system automatically triggers it (such as detecting abnormal operating conditions), the digital twin system initiates the process of this method.

[0047] Please see Figure 1 , Figure 1 A flowchart of a multi-operation path deduction and optimization method based on digital twin runtime, according to an embodiment of the present invention, is shown. The method includes the following steps:

[0048] Step S101: In response to the optimization request, freeze the current state of the main runtime and obtain the current snapshot.

[0049] Specifically, when on-site operators or upper-level systems issue an "optimization request" (such as emergency response, task switching, multi-solution decision-making, etc.), the digital twin system receives and responds to the optimization request, pauses the change of the main runtime state, and freezes its current complete runtime context into a read-only snapshot (current snapshot). This snapshot does not completely copy the entire twin environment, but only copies the minimum necessary data set for decision optimization, that is, including the semantic context and resource occupancy status of the main runtime.

[0050] In this implementation, the semantic context of the main runtime includes at least: semantic rule version (such as the version number of the AST or FSM rule file), current state tree (state nodes of each device and process), lock resource view (holders and waiting queues of each mutually exclusive resource), constraint levels (operation permissions, security constraint parameters), and deterministic clock baseline (current simulation time base). This data is sufficient to support subsequent path deduction and feasibility verification without copying resources unrelated to logical deduction, such as meshes, textures, animations, and rendering caches.

[0051] In one specific implementation, the current snapshot is stored in the form of structured data blocks, such as JSON or binary serialization format, specifically including the following fields:

[0052] snapshot_id: A unique identifier for a snapshot, generated from a timestamp and a random number.

[0053] rule_version: Semantic rule version number, used to load the corresponding AST / FSM rule file.

[0054] state_tree: Key-value pairs representing the status of all devices / processes, such as {"valve_01":"open","pump_02":"running","pressure_reactor":9.5MPa}.

[0055] lock_view: Records the current holder and waiting queue of each mutex resource, for example {"device_A":"process_123","device_B":null}.

[0056] constraint_profile: Constraint level, including role and permission mapping, security thresholds, and maximum number of bypass attempts.

[0057] clock_baseline: The current virtual timestamp of the simulation, used as the starting point for subsequent accelerated simulations.

[0058] missing_tags: An initially empty list of missing test tags, which is populated during validation.

[0059] Once the snapshot is generated, it is frozen, and no shadow instance can modify its original content; it can only be used to create a private copy.

[0060] The resource utilization status of the main runtime includes the current utilization rate of each computing resource (CPU, memory, network bandwidth), the number of handles of critical processes, and the lock holding status recorded in the distributed lock service. This information is collected in real time through the operating system interface and distributed coordination components and saved along with snapshots to ensure that the shadow instance can simulate a real resource contention environment during simulation.

[0061] Step S102: Based on the current snapshot, multiple shadow instances are created using a copy-on-write mechanism.

[0062] After obtaining the snapshot, the digital twin system uses the operating system's copy-on-write mechanism or similar structure-sharing techniques to quickly create multiple shadow instances. Each shadow instance shares the immutable rule objects from the snapshot (e.g., semantic rule versions, constraint levels, rule AST structures, etc.), while independently copying a copy of the mutable state data (e.g., differential copies of the state tree, lock view copies, risk caches, etc.) for each shadow instance. When a shadow instance needs to modify its state data during the simulation, the copy-on-write mechanism automatically copies that data to the instance's private area without affecting other instances. This ensures isolation between shadow instances while significantly reducing the initial memory and time overhead of creation.

[0063] In one specific implementation, shadow instances are created by copying the minimum necessary data set at runtime through a structure-sharing and differential write mechanism. That is, immutable rule objects (such as rule ASTs and constraint levels) are reused among all shadow instances via pointer sharing, without generating any copies. For mutable state data (state trees, lock views, risk caches), no actual copying is performed initially; instead, a blank "differential layer" record table is created for each shadow instance. When a shadow instance first attempts to modify a state key or lock key, the system copies the current value of that key from the shared snapshot to the instance's private differential layer, and then performs the modification. Subsequent read and write operations prioritize accessing the differential layer. This mechanism makes the initial creation time of N shadow instances approximately O(1), and memory usage only increases linearly with the actual amount of modification.

[0064] In a preferred embodiment, before creating multiple shadow instances based on the current snapshot using a copy-on-write mechanism, a consistency check is performed on the current snapshot, specifically including: performing a state key integrity check and a lock resource consistency check on the current snapshot.

[0065] The status key integrity check is used to verify the timeliness of critical sensor data and flag risks when data is missing or expires. For example, for each critical physical quantity (such as pressure, temperature, and liquid level), it checks whether its last update timestamp is within a preset validity period (usually 3-10 seconds). If a sensor's data is missing or expires, the system marks the corresponding status key as "missing" in that snapshot, requests the data to be reacquired, or adds a corresponding risk penalty when scoring subsequent simulation results. This avoids invalid simulations based on outdated or erroneous data.

[0066] Lock resource consistency verification is used to verify whether the lock state is consistent with the distributed lock service. Specifically, the system compares the lock resource view in the snapshot with the current lock state of the distributed lock service (such as Redis, ZooKeeper, etc.). If an inconsistency is found (for example, the snapshot shows that a device is not locked, but in the actual distributed lock service, the device has been locked by another process), the system rejects the snapshot or triggers the reconstruction of the lock view to ensure that the lock resource assumptions of the shadow instance are consistent with reality.

[0067] The system only allows the creation of a shadow instance based on the snapshot when both checks pass (or are deemed acceptable after being flagged as risky). This implementation further ensures strong consistency between the simulation environment and the actual execution environment, eliminating the possibility of "pseudo-optimal paths" from the outset.

[0068] Step S103: Assign a candidate operation path to each shadow instance, and have each shadow instance perform deduction on its candidate operation path to obtain the deduction result.

[0069] This step first assumes that a set of candidate operation paths (e.g., K paths) has been obtained. The system assigns these paths one by one to the shadow instances that have already been created (usually in a 1:1 mapping). Each shadow instance, in its independent inference environment, executes each operation action in the assigned candidate operation path in the order of action orchestration, simulating the entire process of the path from the current snapshot state to the end.

[0070] During the simulation, the system records process data such as state changes, violation events, and safety margin evolution at each step, ultimately forming the simulation result (trace) of the path.

[0071] State changes refer to any change in key values ​​in the state tree of the shadow instance (such as device switching on / off, parameter value updates). Each change records a timestamp, the values ​​before and after the change, and the triggered action. Violations include: violations of rule guard conditions (such as actions being rejected by AST / FSM), insufficient role permissions, mutex lock conflicts, etc. Safety margin is defined as the minimum percentage difference between the current physical quantity (pressure, temperature, liquid level, etc.) and its preset redline envelope (upper or lower limit). For example, if the pressure safety upper limit is 10.0 MPa and the current value is 9.5 MPa, then the safety margin is 5%.

[0072] The system updates each physical quantity after each iteration using a built-in physical evolution model (simplified ODE or external FMU) or conservative boundary estimation, and calculates the safety margin in real time. When the safety margin drops to 0% or below (touching the red line), an alarm is triggered and the risk is recorded.

[0073] In one specific implementation, a candidate operation path generation strategy is preset in the twin simulation system, and candidate operation paths can be generated using at least one of the following three methods:

[0074] Method 1: Generate topological paths by applying the K-Shortest Path (KSP) algorithm to the equipment connectivity graph. A connectivity graph of equipment / valves / nodes is pre-constructed (nodes represent equipment or workstations, edges represent directly operable relationships) and stored in the operating system or twin simulation system. Given a starting node and a target node, the system executes the Yen algorithm or Eppstein algorithm to find K shortest paths (the recommended value for K is 8–128). Each path represents an operation sequence, such as "close valve A → open valve B → adjust pump C speed". These topological paths can be directly used as candidate operation paths.

[0075] Method 2: Based on the reachability graph of the finite state machine for the operation process, enumerate legal operation sequences as candidate operation paths. For scenarios with strict procedural constraints (such as chemical start-up and shutdown processes), the system pre-establishes a finite state machine (FSM) model of the operation process. Each state represents a work stage, and each legal operation corresponds to a state transition edge. Starting from the current state, the system enumerates all legal operation sequences with a length not exceeding a set upper limit (e.g., ≤50 steps) through breadth-first search or depth-first search as candidate operation paths.

[0076] Method 3: Generate a hybrid strategy path. Based on the paths generated by the first two methods, the system identifies critical safety nodes in the path (such as nodes requiring mandatory safety steps like pressure relief, power cut-off, and confirmation). If these steps are not included in the original path, they are automatically inserted. For example, a "confirm pressure has dropped to a safe value" step is inserted before closing the high-pressure valve. The path after this insertion correction is called a hybrid strategy path and serves as a candidate operation path.

[0077] The three methods described above can be used individually or in combination (for example, first generating topology paths using KSP, and then performing safety step completion on each topology path). This embodiment ensures the coverage and executability of the candidate path set through multiple strategies.

[0078] Step S104: Score each simulation result, select the optimal operation path, and output the guidance package of the optimal operation path.

[0079] The system calculates the comprehensive cost for each simulation result according to preset scoring rules, and selects the path with the lowest (or optimal) cost as the optimal operation path. Then, the system converts the optimal path into a "ghost guide package" that can be rendered by the front-end 3D terminal. This package can contain a sequence of steps, highlighted nodes, camera movement paths, and explanatory fields to guide on-site operators to perform operations according to the path.

[0080] The explanation field is a readable text or structured data field used to explain to operators why the optimal path was selected. For example: "The optimal path has a total cost of 120, which is 15% lower than the second-best path, with a 30% lower risk (avoiding high-pressure areas) and a 10% lower time consumption." This field enhances the interpretability of the decision, enabling operators to understand and trust the system's recommendations.

[0081] Through the above steps, this embodiment realizes multi-path parallel deduction and optimization in the digital twin runtime environment with extremely low replication cost and completely consistent master-slave context, solving the problems of high replication cost and non-executable results in the prior art.

[0082] In one implementation, during the deduction of each candidate operation path, each action in the candidate operation path is verified by an abstract syntax tree or finite state machine to update the state tree and record the violation risk and bypass count.

[0083] Specifically, based on the rule version in the current shadow instance, the corresponding Abstract Syntax Tree (AST) or Finite State Machine (FSM) rule is loaded. Each action must pass the rule's guards, such as checking whether the current state allows the action, whether the operator role has the necessary permissions, and whether the target device is locked. If the verification passes, the corresponding state variable in the state tree is updated; if the verification fails, a "violation" is recorded, and the path derivation can be terminated or continued but the violation count is incremented, depending on the configuration.

[0084] When an action should be denied by the rules, but is forcibly executed by the operator through override or bypass, the system records a "bypass" behavior and accumulates the number of bypasses. This number can be added to the overall score as a penalty item in subsequent evaluations.

[0085] Through the step-by-step verification in this embodiment, each shadow instance can accurately simulate the rule conflicts and violation risks that may be encountered in the real operating environment, making the simulation results closer to reality.

[0086] In one implementation, the method for scoring each simulation result is as follows: a multi-objective cost function is used to score each simulation result.

[0087] Typically, scoring requires a comprehensive evaluation of the merits of an operational path from multiple dimensions. A predefined set of evaluation indicators (such as security, timeliness, economy, and compliance) is used, a quantification function is designed for each indicator, and a comprehensive score is obtained through weighted summation, the Analytic Hierarchy Process (AHP), or multi-objective Pareto ranking. This invention does not limit the specific method of determining weights, allowing for flexible configuration based on the scenario.

[0088] In one specific implementation, the multi-objective cost function is a weighted sum based on risk value, execution time, energy consumption, and violation penalty. The risk value is calculated based on the minimum safety margin, the execution time is estimated based on a three-dimensional spatial distance and personnel movement speed model, and the violation penalty is the penalty for the number of times the path is bypassed or forcibly authorized.

[0089] The multi-objective cost function can be expressed as follows:

[0090] ;

[0091] Among them, risk value ( The risk value is calculated based on the minimum safety margin of each physical quantity during the simulation. The safety margin is defined as the percentage distance between the current value and the safety red line boundary (for example, if the pressure upper limit is 10MPa and the closest value in the simulation is 9.5MPa, then the margin is 5%). The risk value is taken as the inverse function of the minimum safety margin; the smaller the margin, the higher the risk. If the red line is touched, the risk value is set to infinity (or a maximum penalty is imposed).

[0092] Execution time ( The time taken is calculated by summing the action time and personnel movement time recorded in the simulation. Personnel movement time is estimated based on Euclidean distance in three-dimensional space and a preset movement speed model; waiting time (such as waiting for lock release or authorization) is also included in the time taken.

[0093] Energy consumption ( (Optional dimension, estimated based on device start / stop count, pump power integral, etc.) If energy consumption is not a concern in this scenario, its weight can be set to 0.

[0094] Violation penalties ( ): equals the sum of the number of bypasses or forced authorizations recorded in the path, multiplied by the penalty coefficient.

[0095] Weighting coefficient , , , It can be adaptively configured according to the application scenario, with the sum of weights being 1, allowing the optimization target to be flexibly adjusted according to the actual business scenario (e.g., increasing the risk weight in emergency scenarios). and time consumption weight Scenarios where energy consumption is not a concern ).

[0096] Finally, the total cost is calculated by weighting the multi-objective cost function, and the Costs of all candidate paths are sorted in ascending order. The path with the smallest Cost is the optimal operation path, and the guidance packet of the optimal operation path is output and sent to the operation terminal in a three-dimensional ghost guidance mode, so as to realize interpretable and verifiable decision optimization.

[0097] In one specific implementation, the boot packet is stored as a structured data object, including at least the following fields:

[0098] Target node identifier (node_uuid): A unique identifier for the device or location corresponding to each operation step in the sequence.

[0099] Camera path: A sequence of three-dimensional spatial coordinate points used to automatically move the observation camera on the terminal and focus on each target in turn.

[0100] 3D highlight style: such as color, flashing frequency, halo effect, etc., used to prominently identify the device to be operated in the twin scene.

[0101] Cost breakdown field: A readable text or structured data field that explains the advantages of the optimal path over other paths in terms of risk, time, energy consumption, or penalty for violations.

[0102] The bootstrap package is encapsulated in JSON or Protobuf format, making it easy for the front-end to parse and render.

[0103] Furthermore, the encapsulated guidance package is pushed to a 3D terminal (such as a VR headset, mobile tablet, or control room screen) via the WebSocket protocol. After receiving the guidance package, the terminal overlays and renders ghost actions and ghost paths onto the existing digital twin 3D scene. Operators can directly follow the ghost guidance to perform operations without consulting paper manuals or waiting for instructions.

[0104] Meanwhile, the terminal interface can also provide a "switch to suboptimal solution" button. After clicking, the system will automatically load the guide package of the next highest-rated path, enabling flexible decision-making.

[0105] In one implementation, the method of having each shadow instance deduce its candidate operation path includes:

[0106] Each shadow instance is given an independent virtual clock, speedup factor, and random seed; the random seed is used to generate a random perturbation sequence during the simulation to simulate uncertainty factors.

[0107] Each shadow instance utilizes its own virtual clock and acceleration factor to perform accelerated simulations in parallel.

[0108] Specifically, the system obtains a deterministic clock baseline T_base from the current snapshot, and then assigns each shadow instance i its virtual clock T_i (the initial value of T_i is aligned with T_base, and then increments independently by a speedup factor s_i), a speedup factor s_i (representing the ratio of virtual time to real time), and a random seed seed_i. The speedup factor can be dynamically adjusted based on the number of instances and CPU load, or it can be configured by the user.

[0109] The random seed `seed_i` is generated through deterministic hashing using a global seed and the shadow instance ID. During the simulation, all events requiring randomness (such as equipment failure time and personnel response time fluctuations) are generated using a pseudo-random number generator (such as the Mason tween algorithm) driven by this seed. Because the seed is fixed, multiple simulations using the same snapshot, the same path, and the same seed will produce identical random sequences, ensuring the reproducibility of the simulation. Using different seeds for different shadow instances simulates the uncertainty distribution of the real world.

[0110] During simulation, each shadow instance runs in an independent thread or lightweight process, and the operating system scheduler allocates them to multiple CPU cores for parallel execution. Within each simulation step, the shadow instance calculates the amount of virtual time that should be advanced from the last simulation to the current real time based on the current value of its virtual clock. Then, it performs all actions and physical evolution calculations within that time window in batches, and finally updates its state. This implementation is based on a hybrid simulation mode of time-driven and event-driven simulation, which enables a continuous sequence of operations that originally required several minutes to complete to be simulated within hundreds of milliseconds.

[0111] In a preferred embodiment, to address sudden changes in the field state, the system provides a method for incremental recalculation during execution. This method includes:

[0112] S201, during the execution of the optimal operation path in the main runtime, continuously monitor the key states and lock resource changes of the main runtime;

[0113] S202, when a state change or lock conflict is detected, determine the set of target candidate operation paths affected by the state change;

[0114] S203, perform incremental recalculation on the target candidate operation path set and its associated shadow instances, and update the scoring results.

[0115] The system initiates a background monitoring thread to collect sensor data and lock status events in real time. When a sudden state change is detected (e.g., a device suddenly fails, a critical sensor is missing data, or a new congestion occurs) or a lock conflict is detected (e.g., a device is locked by an unexpected process), the system identifies the device or resource involved in the state change. Then, from the candidate path set evaluated in the previous round, it filters out those paths that contain the affected device or resource and marks them as "affected paths." For paths that do not involve changed resources, their inference results remain valid and can be reused.

[0116] The system utilizes the latest state (rather than refreezing the entire snapshot) and only needs to recreate or update the affected shadow instances, performing incremental extrapolation on these instances (e.g., recalculating from the point in time when the state change occurred). After the extrapolation is complete, the cost scores of these paths are recalculated and merged with the scores of unaffected paths, reordering them to select a new optimal path. If the new optimal path differs from the original optimal path, the system can issue an alert or automatically switch the bootstrap package.

[0117] This implementation significantly reduces the computational overhead of recalculation in dynamic environments, enabling the system to respond quickly to changes in the field.

[0118] In one specific implementation, a closed-loop method for multi-operation path deduction and optimization based on digital twin runtime is provided, such as... Figure 2 As shown, it includes the following steps:

[0119] Step S1: Main runtime snapshot freeze and consistency check (triggering phase)

[0120] S1-1, upon receiving an "optimization request" (emergency response / switch task), freezes the main runtime snapshot StateSnapshot, including: semantic rule version, state tree, lock resource status, role set and constraint level.

[0121] S1-2, Perform consistency verification on the snapshot:

[0122] (1) Status key integrity: The timeliness of key sensor data is within the preset validity period; if the data is missing, the risk is marked as increased.

[0123] (2) Lock resource consistency: The lock state must be consistent with the distributed lock service; otherwise, the lock view will be rejected or rebuilt.

[0124] Step S2: Generate candidate paths (policy space construction stage)

[0125] S2-1, enumerate the candidate path set `candidate_paths` from the flowchart / state machine, including:

[0126] Topology-based paths: Perform k-shortest paths (k = 128) on the device / valve connectivity graph.

[0127] Procedure-based path: Enumerate the legal operation sequence for the FSM reachability graph (limit the length to ≤50 steps to avoid explosion).

[0128] Hybrid strategy: Force the inclusion of a "safety confirmation step" (pressure relief / power failure node) in critical nodes and insert it into the path.

[0129] S2-2, perform fast pruning on candidate paths: remove paths that contain obviously unreachable actions (insufficient roles, mutually exclusive resources will inevitably conflict).

[0130] Step S3: Parallel replication of shadow instances (resource preparation phase)

[0131] S3-1 generates N shadow instances (N is 256), each instance only copies "semantic rules + state tree + lock view + constraint position + deterministic random seed", and does not copy rendering resources.

[0132] S3-2 assigns an independent virtual clock and random seed to each shadow instance and sets the acceleration multiplier. .

[0133] S3-3, Enables structure sharing and differential writing for shadow instances: Immutable rule objects are shared, and differential layers are only established for changing state keys, lock keys, and risk caches.

[0134] Step S4: Accelerate the simulation and reachability verification (parallel simulation phase)

[0135] S4-1, for each candidate path, execute in the corresponding shadow instance: each action triggers AST / FSM verification (guards), updates the state tree, and records the violation risk and bypass count.

[0136] S4-2, Physical Approximation: Simplified evolutionary models or interface predictions are used for key physical variables to calculate the change of safety margin over time; if there is no physical model, conservative boundary estimation is used.

[0137] S4-3, the output trace includes each step's decision, state changes, lock holding, estimated time, and risk curve.

[0138] Step S5: Multi-objective cost scoring and ranking (optimization stage)

[0139] S5-1, calculate for each trace:

[0140] Risk: Calculates the inverse function of the minimum safety margin (the smaller the margin, the higher the risk), and imposes an infinite penalty on paths that trigger the red line.

[0141] Execution Time: Action duration + Personnel movement time.

[0142] Estimated values ​​for energy consumption, such as the number of equipment start-ups and shutdowns, and the integral of pump power.

[0143] OverridePenalty penalties include the number of times forced authorization is applied, the number of times bypass is applied, and the number of times the account is frozen.

[0144] S5-2, based on configuration weight ~ Calculate the total cost (Cost) and sort them to select the optimal path.

[0145] Step S6: Explanatory Output and Guided Generation of 3D Ghosts (Deployment Phase)

[0146] S6-1, Generate the ghost boot package: including the step sequence, target node_uuid, camera path, and highlight style; and output an explanatory explanation, including:

[0147] (1) Why it is optimal: based on the cost decomposition of each item (Risk / Time / Energy / OverridePenalty);

[0148] (2) Key constraints: statistically triggered mutexes, key thresholds, and minimum risk margins.

[0149] S6-2, distributed to 3D terminals / mobile devices: push guide packages via WebSocket; the terminal overlays ghost actions and paths in the 3D scene and provides an entry for "switch to suboptimal solution" (a more conventional setting).

[0150] Step S7: Execution phase recalculation and closed-loop verification (running phase).

[0151] S7-1 continuously monitors key states and lock resource changes during execution; if there is a sudden change in state (device failure, missing test, congestion) or lock conflict, it triggers a fast recalculation (reusing the previous round of candidate sets and incrementally updating), only recalculating the affected paths and their associated shadow instances.

[0152] S7-2, Compare and evaluate the actual execution results: Record the deviation between the recommended path and the actual path as data for subsequent weight and model correction.

[0153] like Figure 3 As shown, embodiments of the present invention also provide a multi-operation path deduction and optimization system based on digital twin runtime, used to execute the method of any of the above embodiments of the present invention. The system includes:

[0154] The snapshot generation module is used to freeze the current state of the main runtime in response to the optimization request and obtain the current snapshot; the current snapshot contains the minimum necessary data set of the semantic context and resource occupancy status of the main runtime.

[0155] The shadow management module is used to create multiple shadow instances based on the current snapshot using a copy-on-write mechanism; wherein each shadow instance shares the immutable rule object in the semantic context and independently copies the mutable state data;

[0156] The inference engine is used to assign a candidate operation path to each shadow instance, and each shadow instance infers its candidate operation path to obtain the inference result.

[0157] The scoring and output module is used to score each simulation result, select the optimal operation path, and output the guidance package of the optimal operation path.

[0158] In one implementation, a consistency verification module is further included, which performs state key integrity verification and lock resource consistency verification on the current snapshot before creating multiple shadow instances; wherein, the state key integrity verification is used to check the timeliness of key sensor data and mark risks when data is missing or timed out; the lock resource consistency verification is used to verify whether the lock state is consistent with the distributed lock service.

[0159] In one embodiment, the system further includes a candidate path generation module, configured to generate the candidate operation path by at least one of the following methods: performing the K-shortest path algorithm on the device connectivity graph to generate a topology operation path; enumerating a legal operation sequence based on a finite state machine reachability graph of the operation process; and generating a hybrid strategy path by inserting a safety confirmation step into the key nodes of the topology operation path or legal operation sequence.

[0160] In one implementation, the inference engine is further configured to: set an independent virtual clock, acceleration factor, and random seed for each shadow instance; wherein the random seed is used to generate a random perturbation sequence during the inference process to simulate uncertainty factors; and each shadow instance uses its own virtual clock and acceleration factor to perform accelerated inference in parallel.

[0161] In one implementation, the inference engine is further used to: perform abstract syntax tree or finite state machine verification on each action in the candidate operation path during the inference process of each candidate operation path, so as to update the state tree and record the violation risk and bypass count.

[0162] In one implementation, the scoring and output module is further configured to: generate a guidance package containing a target node identifier, a camera guidance path, a 3D highlighting style, and a cost decomposition field; wherein the cost decomposition field is used to explain the advantages of the optimal path over other paths in terms of risk, time consumption, energy consumption, or violation penalties.

[0163] In one embodiment, a WebSocket protocol communication module is also included, which is used to push the guidance package to the 3D terminal to overlay and render the ghost action and path of the optimal operation path in the 3D scene for guiding the operation.

[0164] In one implementation, an incremental recalculation module is also included, which is used for:

[0165] During the execution of the optimal operation path in the main runtime, the key states and lock resource changes of the main runtime are continuously monitored;

[0166] When a state change or lock conflict occurs, determine the set of target candidate operation paths affected by the state change;

[0167] Incremental recalculation is performed on the target candidate operation path set and its associated shadow instances, and the scoring results are updated.

[0168] like Figure 4 The diagram shown illustrates the system workflow, which is as follows:

[0169] The snapshot generation module first freezes the current state from the main runtime, extracts the semantic rule version, state tree, lock resource view, constraint level and deterministic clock baseline, encapsulates it into the current snapshot, and passes the snapshot to the shadow management module;

[0170] After receiving a snapshot, the shadow management module uses a copy-on-write mechanism to create a preset number of shadow instances (e.g., 8 to 256). Each shadow instance reuses immutable rule objects through structure sharing and independently copies mutable state data.

[0171] The inference engine obtains a set of candidate operation paths from the candidate path generation module, assigns a path to each shadow instance, and then starts the accelerated inference of each shadow instance in parallel. During the inference process, the engine calls the missing test flags and lock states recorded by the consistency verification module to judge violations.

[0172] After the simulation is completed, the scoring and output module collects the simulation results of each shadow instance, calculates the multi-objective cost function score, selects the optimal path and generates the guidance package;

[0173] The WebSocket protocol communication module pushes the boot packet to the 3D terminal;

[0174] During execution, the incremental recalculation module continuously monitors changes in the field status and triggers local recalculation as needed; if the operator requests to switch to the suboptimal solution through the terminal, the system reselects the next path from the scoring and sorting results and issues a new guidance package.

[0175] Embodiments of the present invention also provide an electronic device, which includes a processor and a memory, wherein the number of processors may be one or more. The memory, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules. The processor executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory, thereby realizing the multi-operation path deduction and optimization method based on digital twin runtime of any of the above embodiments of the present invention.

[0176] The memory may primarily comprise a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory may include high-speed random access memory (RAM) and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, the memory may further include memory remotely located relative to the processor, which can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks (LANs), mobile communication networks, and combinations thereof.

[0177] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the multi-operation path deduction and optimization method based on digital twin runtime of any embodiment of the present invention.

[0178] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0179] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0180] Embodiments of the present invention also provide a computer program product that, when run on a computer, causes the computer to execute the multi-operation path deduction and optimization method based on digital twin runtime of any of the above embodiments of the present invention.

[0181] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for multi-operation path deduction and optimization based on digital twin runtime, characterized in that, include: In response to the optimization request, freeze the current state of the main runtime and obtain the current snapshot; The current snapshot contains the minimum necessary set of data regarding the semantic context and resource occupancy status of the main runtime. Based on the current snapshot, multiple shadow instances are created using a copy-on-write mechanism; each shadow instance shares the immutable rule object in the semantic context and independently copies the mutable state data. A candidate operation path is assigned to each shadow instance, and each shadow instance performs its own deduction on its candidate operation path to obtain the deduction result; Each simulation result is scored, the optimal operation path is selected, and the guiding package of the optimal operation path is output.

2. The multi-operation path deduction and optimization method based on digital twin runtime as described in claim 1, characterized in that, Before creating multiple shadow instances based on the current snapshot using a copy-on-write mechanism, the method further includes: Perform state key integrity verification and lock resource consistency verification on the current snapshot; wherein, the state key integrity verification is used to check the timeliness of key sensor data and mark the risk when the data is missing or timed out; the lock resource consistency verification is used to verify whether the lock state is consistent with the distributed lock service.

3. The multi-operation path deduction and optimization method based on digital twin runtime as described in claim 1, characterized in that, The candidate operation path is generated by at least one of the following methods: Perform the K-shortest path algorithm on the device connectivity graph to generate topology operation paths as candidate operation paths; Based on the finite state machine reachability graph of the operation process, enumerate the legal operation sequences as candidate operation paths; Based on the topology operation path or legal operation sequence, a security confirmation step is inserted into the key nodes to generate a hybrid strategy path as a candidate operation path.

4. The multi-operation path deduction and optimization method based on digital twin runtime as described in claim 1, characterized in that, During the deduction of each candidate operation path, an abstract syntax tree or finite state machine is used to verify each action in the candidate operation path in order to update the state tree and record the violation risk and bypass count.

5. The multi-operation path deduction and optimization method based on digital twin runtime according to claim 1, characterized in that, The step of deducing candidate operation paths for each shadow instance includes: Each shadow instance is configured with an independent virtual clock, speedup factor, and random seed; wherein the random seed is used to generate a random perturbation sequence during the simulation to simulate uncertainty factors. Each shadow instance utilizes its own virtual clock and acceleration factor to perform accelerated simulations in parallel.

6. The multi-operation path deduction and optimization method based on digital twin runtime according to claim 1, characterized in that, The scoring method for each deduction result is as follows: A multi-objective cost function is used to score each simulation result. The multi-objective cost function is a weighted sum based on risk value, execution time, energy consumption, and violation penalty. The risk value is calculated based on the minimum safety margin, the execution time is estimated based on a three-dimensional spatial distance and personnel movement speed model, and the violation penalty is the penalty for the number of times the path is bypassed or the number of times forced authorization is granted.

7. The multi-operation path deduction and optimization method based on digital twin runtime according to claim 5, characterized in that, The guidance package includes a target node identifier, a camera guidance path, a 3D highlighting style, and a cost decomposition field; wherein, the cost decomposition field is used to explain the advantages of the optimal path compared to other paths in terms of risk, time consumption, energy consumption, or violation penalties.

8. The multi-operation path deduction and optimization method based on digital twin runtime according to any one of claims 1 to 7, characterized in that, The method further includes: pushing the guidance package to a 3D terminal via the WebSocket protocol to overlay and render the ghost action and path of the optimal operation path in the 3D scene for guiding the operation.

9. The multi-operation path deduction and optimization method based on digital twin runtime according to claim 7, characterized in that, The method further includes: During the execution of the optimal operation path in the main runtime, the key states and lock resource changes of the main runtime are continuously monitored; When a state change or lock conflict occurs, determine the set of target candidate operation paths affected by the state change; Incremental recalculation is performed on the target candidate operation path set and its associated shadow instances, and the scoring results are updated.

10. A multi-operation path deduction and optimization system based on digital twin runtime, characterized in that, include: The snapshot generation module is used to freeze the current state of the main runtime in response to optimization requests and obtain the current snapshot; The current snapshot contains the minimum necessary set of data regarding the semantic context and resource occupancy status of the main runtime. The shadow management module is used to create multiple shadow instances based on the current snapshot using a copy-on-write mechanism; wherein each shadow instance shares the immutable rule object in the semantic context and independently copies the mutable state data; The inference engine is used to assign a candidate operation path to each shadow instance, and each shadow instance infers its candidate operation path to obtain the inference result. The scoring and output module is used to score each simulation result, select the optimal operation path, and output the guidance package of the optimal operation path.