Test method and device for distributed autonomous operation system
Patent Information
- Application Number
- CN202610187096.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-10
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2046-02-10
AI Technical Summary
[0007]本发明的目的在于解决现有技术中时间维度验证效率低且空间维度虚实耦合失真的问题,提供一种面向分布式自主运行系统的测试方法及装置
通过将被测对象作为函数库嵌入仿真环境中,将测试系统的系统基准时钟设置为超实时时钟基准,通过屏蔽底层I/O通信耗时的方式,利用预设数量的随机生成数据以高于物理时间的速度对被测对象进行仿真测试,以得到经算法逻辑验证后的控制算法源码。通过虚拟总线直接交换随机生成数据,剔除物理耗时,在时间折叠模式下进行控制算法源码的测试,可以实现在短时间内完成海量工况的遍历,进而捕捉长时序下的累积误差或策略发散问题。
Smart Images

Figure CN121979182B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial control system technology, and in particular to a testing method and apparatus for distributed autonomous operating systems. Background Technology
[0002] Large-scale distributed autonomous systems, such as those used in water conservancy projects, are characterized by wide-area physical coupling and long-term evolution (e.g., 72-hour floods). Existing testing technologies face two major bottlenecks:
[0003] First, the time dimension verification efficiency is low. Hardware-in-the-loop (HIL) is limited by the "hard real-time" clock, which makes it impossible to complete the traversal of a large number of long-cycle operating conditions within a limited time, making it difficult to capture cumulative policy defects.
[0004] Second, the spatial dimension suffers from distortion due to the coupling between the virtual and real worlds. Traditional hybrid testing only transmits data through the physical medium, which cannot reproduce the time of flight and energy attenuation caused by the transmission of physical media, resulting in the failure of verification of wide-area collaborative response.
[0005] Furthermore, the process from algorithm verification to hardware deployment often requires rewriting code, resulting in severe asset fragmentation. Therefore, these problems urgently need to be addressed.
[0006] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0007] The purpose of this invention is to solve the problems of low efficiency in time dimension verification and distortion of virtual-real coupling in spatial dimension in the prior art, and to provide a testing method and device for distributed autonomous operating systems.
[0008] The first aspect of this invention provides a testing method for a distributed autonomous operating system, applied to the testing system. The method includes: embedding the object under test (AUT) as a function library into a simulation environment; setting the system reference clock of the testing system as a super real-time clock reference; using a preset amount of randomly generated data to simulate and test the AUT at a speed higher than physical time by shielding the low-level I / O communication time, to obtain the source code of the control algorithm after algorithm logic verification; encapsulating the source code of the control algorithm into a virtual container; injecting virtual drive stubs into the virtual container and performing communication tests to obtain a software image; deploying the software image to an entity controller and verifying the electrical characteristics and physical I / O response of the entity controller in a hard real-time closed-loop mode; constructing a wide-area collaborative simulation scenario, simultaneously connecting multiple AUT nodes to the same polymorphic physical simulation kernel; calculating the coupling effect of the actions of the multiple AUT nodes on the shared physical environment in real time through the polymorphic physical simulation kernel, and feeding back to each AUT node to form a closed-loop control; wherein the multiple AUT nodes exist in a heterogeneous manner, including at least one virtual container node corresponding to the virtual container and one entity controller node corresponding to the entity controller.
[0009] In one embodiment of the present invention, the coupling effect of the actions of the multiple tested nodes on the shared physical environment is calculated in real time through the polymorphic physical simulation kernel, including: when the virtual container node triggers an action and excites a physical wave in the polymorphic physical simulation kernel, the spatiotemporal lag and energy attenuation value required for the physical wave to propagate to the location of the entity controller node are calculated in real time based on the physical model; when the simulation time reaches the spatiotemporal lag, the calculated physical wave value is reconstructed into a simulated physical signal through the virtual-real mapping interface layer of the test system and injected into the entity controller to trigger the physical response of the entity controller.
[0010] In one embodiment of the present invention, the construction of a wide-area collaborative simulation scenario includes: using the crystal oscillator time of the physical controller or the hard real-time step size of the multi-state physical simulation kernel as a global reference; and dynamically calibrating the server system clock running the virtual container node based on a precise time protocol.
[0011] In one embodiment of the present invention, the ultra-real-time clock reference is set to 10 to 100 times the physical time; wherein, the simulation test of the object under test is performed using a preset amount of randomly generated data at a speed higher than the physical time, including: automatically generating random boundary conditions using the Monte Carlo method, traversing the working conditions within a preset period to obtain the randomly generated data.
[0012] In one embodiment of the present invention, the process of calculating the spatiotemporal lag required for the physical wave to propagate to the location of the physical controller node in real time includes: obtaining the propagation speed of the transient pressure wave or fluid wave caused by the action of the virtual container node in the pipeline network; obtaining the physical transmission path length between the virtual container node and the physical controller node in the topology network corresponding to the multiple measured nodes; and determining the spatiotemporal lag based on the physical transmission path length and the propagation speed.
[0013] In one embodiment of the present invention, during the migration from encapsulating the control algorithm source code into a virtual container to deploying the software image to the physical controller, the object under test remains the same virtual container image version; when injecting virtual driver stubs into the virtual container and performing communication tests, the virtual driver stubs are used to redirect read and write operations on hardware registers to network data packets; when verifying the electrical characteristics and physical I / O response of the physical controller, the underlying driver mapping is configured to allow the virtual container image to directly access the physical I / O ports of the physical controller.
[0014] In one embodiment of the present invention, the step of reconstructing the calculated physical wave values into analog physical signals and injecting them into the physical controller through the virtual-real mapping interface layer of the test system includes: receiving digital waveform data from the multi-state physical simulation kernel through the physical signal adapter of the virtual-real mapping interface layer; converting the digital waveform data into industrial standard analog quantities; and loading the industrial standard analog quantities into the sensor input terminals of the physical controller in real time through the hardwiring of the virtual-real mapping interface layer to simulate physical impact.
[0015] A second aspect of this invention provides a testing device for a distributed autonomous operating system, applied in a testing system. The device includes: a first testing module, configured to embed the object under test as a function library into a simulation environment, set the system reference clock of the testing system as a super real-time clock reference, and simulate the object under test using a preset amount of randomly generated data at a speed exceeding physical time by shielding the low-level I / O communication time, to obtain the control algorithm source code verified by the algorithm logic; and a second testing module, configured to encapsulate the control algorithm source code into a virtual container, inject virtual driver stubs into the virtual container and perform communication tests to obtain a software mirror. The system includes: a third test module for deploying the software image to the physical controller and verifying the electrical characteristics and physical I / O response of the physical controller in hard real-time closed-loop mode; and a fourth test module for constructing a wide-area collaborative simulation scenario, connecting multiple nodes under test to the same polymorphic physical simulation kernel, calculating the coupling effect of the actions of the multiple nodes under test on the shared physical environment in real time through the polymorphic physical simulation kernel, and feeding back to each node under test to form a closed-loop control; wherein the multiple nodes under test exist in a heterogeneous manner, including at least one virtual container node corresponding to the virtual container and one physical controller node corresponding to the physical controller.
[0016] In one embodiment of the present invention, the fourth test module includes: a first processing submodule, used to calculate in real time the spatiotemporal lag and energy attenuation value required for the physical wave to propagate to the location of the entity controller node based on the physical model when the virtual container node triggers an action and excites a physical wave in the polymorphic physical simulation kernel; and a second processing submodule, used to reconstruct the calculated physical wave value into a simulated physical signal through the virtual-real mapping interface layer of the test system and inject it into the entity controller when the simulation time reaches the spatiotemporal lag, so as to trigger the physical response of the entity controller.
[0017] A third aspect of the present invention provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a test method for a distributed autonomous operating system as described in the first aspect.
[0018] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, it implements the testing method for a distributed autonomous operating system as described in the first aspect.
[0019] Compared with the prior art, the technical effects achieved by the present invention are as follows: By embedding the object under test (DUT) as a function library into the simulation environment and setting the system reference clock of the test system as an ultra-real-time clock reference, and by shielding the low-level I / O communication time, the DUT is simulated and tested using a preset amount of randomly generated data at a speed exceeding physical time. This yields the control algorithm source code, which has been verified by the algorithm logic. By directly exchanging randomly generated data via a virtual bus, eliminating physical time consumption, and testing the control algorithm source code in a time-folding mode, it is possible to complete the traversal of massive operating conditions in a short time, thereby capturing accumulated errors or strategy divergence problems over long time series.
[0020] The control algorithm source code is encapsulated into a virtual container, and virtual drive stubs are injected into the virtual container for communication testing to obtain a software image. The software image is then deployed to the physical controller, and the electrical characteristics and physical I / O response of the physical controller are verified in hard real-time closed-loop mode. A wide-area collaborative simulation scenario is constructed, and multiple nodes under test are simultaneously connected to the same polymorphic physical simulation kernel. The polymorphic physical simulation kernel calculates the coupling effect of the actions of multiple nodes under test on the shared physical environment in real time and feeds it back to each node under test to form a closed-loop control. This achieves accurate simulation of the propagation of physical waves between virtual and physical nodes, avoids the asset separation problem from algorithm model to physical deployment, and solves the problems of low verification efficiency in the time dimension and distortion of virtual-real coupling in the spatial dimension in existing technologies. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the framework of a testing system according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a testing method for a distributed autonomous operating system according to an embodiment of the present invention. Figure 3 This is an implementation topology diagram of a distributed heterogeneous system in the loop testing phase according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the framework of a test device for a distributed autonomous operating system according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the frame of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0022] Unless otherwise expressly stated, throughout the specification and claims, the term "comprising" or its variations such as "including" or "comprises" shall be understood to include the stated elements or components without excluding other elements or other components.
[0023] The technical solution of the present invention is illustrated below through specific embodiments. It should be understood that the one or more steps mentioned in the present invention do not preclude the existence of other methods and steps before or after the combined steps, or that other methods and steps may be inserted between these explicitly mentioned steps. It should also be understood that these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Unless otherwise stated, the numbering of each method step is only for the purpose of identifying each method step, and not for limiting the order of each method or limiting the scope of the present invention. Changes or adjustments to their relative relationships, without substantial changes to the technical content, can also be considered as within the scope of the present invention.
[0024] Before introducing the embodiments of the present invention, the testing system in the embodiments of the present invention will first be described, such as... Figure 1 As shown, the test system 10 includes: a unified test management layer 100, used to configure a multimodal clock scheduler and support switching between ultra-real-time mode and hard real-time mode; a multimodal physical simulation kernel layer 200, which has a built-in global physical coupling solver, used to calculate the spatiotemporal lag required for the physical waves generated by virtual nodes to propagate to physical nodes in a heterogeneous network state; and a virtual-physical mapping interface layer 300, which integrates a physical signal adapter. The physical signal adapter is configured to convert digital simulation signals into analog physical signals and output them to physical nodes at precise simulation moments based on the spatiotemporal lag.
[0025] In this embodiment, the multi-state physics simulation kernel layer 200 supports dynamic loading and switching of models with various precision levels. It has a built-in solution engine supporting multiple precision levels, capable of loading reduced-order model ROMs to accommodate long-cycle, fast calculations, and also capable of loading high-fidelity 3D models CFD / FEM to accommodate refined verification, thus providing a suitable digital physical environment for different testing stages.
[0026] The physical signal adapter is also configured to simulate physical layer faults, including sensor disconnection, signal noise superposition, and power fluctuations, to verify the electrical resilience of the physical controller.
[0027] This invention provides a testing method for a distributed autonomous operating system, which is applied to a testing system 10, such as... Figure 2 As shown, the method may specifically include the following steps: S201 embeds the object under test as a function library into the simulation environment, sets the system reference clock of the test system as an ultra-real-time clock reference, and uses a preset amount of randomly generated data to simulate and test the object under test at a speed higher than physical time by shielding the time consumption of the underlying I / O communication, so as to obtain the source code of the control algorithm after the algorithm logic is verified. S202, the control algorithm source code is encapsulated into a virtual container, virtual driver stubs are injected into the virtual container and communication tests are performed to obtain the software image; S203 deploys the software image to the physical controller and verifies the electrical characteristics and physical I / O response of the physical controller in hard real-time closed-loop mode; S204 constructs a wide-area collaborative simulation scenario, connecting multiple test nodes to the same multi-state physical simulation kernel simultaneously. The multi-state physical simulation kernel calculates in real time the coupling effect of the actions of multiple test nodes on the shared physical environment and feeds it back to each test node to form a closed-loop control. Among them, multiple tested nodes exist in a heterogeneous manner, including at least one virtual container node corresponding to a virtual container and one entity controller node corresponding to an entity controller.
[0028] In this embodiment, the object under test includes, but is not limited to, algorithm source code, such as scripts in programming languages like Python and C++.
[0029] In practical applications, the algorithm's source code, i.e., the object under test, is directly embedded into the simulation environment as a function block. Time acceleration technology is used to shield the low-level I / O communication time, generating a preset number of randomly generated data points within a short time. This allows for simulation testing of the pure control algorithm at a speed exceeding physical time. In this embodiment, the preset number is determined based on the system's operational complexity. For example, in a cross-basin water transfer project, to cover extreme low-probability conditions over a long period, the preset number can be set to 5000 different rainfall and inflow boundary conditions.
[0030] In one example, a smart water network is a system composed of a massive number of heterogeneous nodes (such as pumping stations, sluice gates, and monitoring stations), whose macroscopic scheduling behavior exhibits highly nonlinear and complex emergent characteristics. The source code of the pure control algorithm for the smart water network is directly embedded as a function block into the simulation environment. Time acceleration technology is used to shield the low-level I / O communication time, automatically generating massive amounts of random rainfall or sudden operating conditions in a short time. This allows for rapid verification of the algorithm's policy convergence and parameter sensitivity over long periods (such as a 72-hour flood event), thus enabling low-cost verification of the algorithm's policy.
[0031] Next, step S202 corresponds to the Software Engineering Verification (SIL) stage. In step S202, the object under test is encapsulated into a virtual container with a standardized interface. Containerization technology (such as Docker) is used to package the algorithm source code verified in step S201, along with its dependent operating system environment (OS) and communication middleware, into an independent image file. This stage mainly utilizes I / O driver virtualization technology to inject virtual driver stubs inside the container, redirecting read and write operations that originally pointed to hardware registers to network data packet transmission. Simultaneously, fault injection tests are performed at the virtual network layer, artificially introducing network faults such as packet loss, latency, and out-of-order delivery to verify the robustness of the software's exception handling mechanism, watchdog reset mechanism, and reconnection capability.
[0032] Step S203 corresponds to the single-node physical performance verification stage HIL. In step S203, the object under test is migrated to real edge computing controller hardware (such as a PLC or embedded industrial computer). The container image generated in step S202 is deployed to the target hardware losslessly via OTA or flashing. The hardware is connected to the physical adapter of the test system through physical wiring. In this stage, the simulation kernel is switched to hard real-time closed-loop mode to ensure that the simulation step size is aligned with the physical controller clock. While verifying the control logic, the electrical and physical characteristics of the controller under full load computing are evaluated, including heat dissipation, anti-interference capability in long-distance signal transmission, and I / O response jitter.
[0033] Step S204 corresponds to the Hybrid-SITL (System-in-the-Loop) testing phase of a distributed heterogeneous system. In step S204, a wide-area collaborative simulation scenario is constructed. This scenario includes multiple nodes under test, which exist in a heterogeneous manner, including at least one virtual container node corresponding to a virtual container and one entity controller node corresponding to an entity controller. Multiple nodes under test simultaneously connect to the same polymorphic physical simulation kernel. The polymorphic physical simulation kernel resides in the polymorphic physical simulation kernel layer 200.
[0034] In one example, taking a smart water network as an example, a heterogeneous distributed system wide-area water network simulation scenario is constructed, consisting of multiple virtual nodes and multiple physical nodes. Non-critical or numerous nodes (such as ordinary monitoring stations) run in the form of SIL virtual containers in a server cluster, while critical nodes (such as the main control of a hub pumping station) are connected in the form of HIL physical hardware. In this stage, a hybrid clock synchronization mechanism (Hybrid-Sync) based on the PTP (IEEE 1588) protocol is adopted to coordinate the system time of virtual nodes with the crystal oscillator time of physical hardware, eliminating timing drift caused by the coexistence of virtual and physical nodes. The simulation kernel collects the control commands of all virtual and physical nodes in real time, performs global physical coupling decomposition, uniformly calculates the superimposed impact on the shared physical environment (such as river water level and pipeline pressure), and feeds back to form a closed loop. In addition, the system verifies the overall resilience of the heterogeneous system and the effectiveness of the collaborative strategy by simulating cascading failure scenarios (such as virtual node data anomalies causing physical node malfunctions).
[0035] In one scenario of this embodiment, the wide-area collaborative simulation scenario also includes accessing a real human-computer interaction interface; under simulated emergency situations, the operator's manual intervention instructions are recorded, and the permission priority arbitration logic between the manual intervention instructions and the automatic control algorithm is verified.
[0036] Through this embodiment of the invention, by embedding the object under test as a function library into a simulation environment, setting the system reference clock of the test system as an ultra-real-time clock reference, and by shielding the low-level I / O communication time, the object under test is simulated and tested using a preset amount of randomly generated data at a speed higher than physical time, thereby obtaining the control algorithm source code after algorithm logic verification. By directly exchanging randomly generated data through a virtual bus, eliminating physical time consumption, and testing the control algorithm source code in a time-folding mode, it is possible to complete the traversal of massive operating conditions in a short time, thereby capturing accumulated errors or strategy divergence problems under long time series.
[0037] The control algorithm source code is encapsulated into a virtual container, and virtual drive stubs are injected into the virtual container for communication testing to obtain a software image. The software image is then deployed to the physical controller, and the electrical characteristics and physical I / O response of the physical controller are verified in hard real-time closed-loop mode. A wide-area collaborative simulation scenario is constructed, and multiple nodes under test are simultaneously connected to the same polymorphic physical simulation kernel. The polymorphic physical simulation kernel calculates the coupling effect of the actions of multiple nodes under test on the shared physical environment in real time and feeds it back to each node under test to form a closed-loop control. This achieves accurate simulation of the propagation of physical waves between virtual and physical nodes, avoids the asset separation problem from algorithm model to physical deployment, and solves the problems of low verification efficiency in the time dimension and distortion of virtual-real coupling in the spatial dimension in existing technologies.
[0038] Optionally, in this embodiment, the coupling effect of the actions of multiple tested nodes on the shared physical environment is calculated in real time through the polymorphic physical simulation kernel, including but not limited to: when the virtual container node triggers an action and excites a physical wave in the polymorphic physical simulation kernel, the spatiotemporal lag and energy attenuation value required for the physical wave to propagate to the location of the entity controller node are calculated in real time based on the physical model; when the simulation time reaches the spatiotemporal lag, the calculated physical wave value is reconstructed into a simulated physical signal through the virtual-real mapping interface layer of the test system and injected into the entity controller to trigger the physical response of the entity controller.
[0039] In this embodiment, the physical model includes, but is not limited to, a one-dimensional unsteady hydrodynamic model along the entire line, a high-fidelity three-dimensional fluid dynamics model (CFD), etc.
[0040] In one example, the polymorphic simulation kernel is based on the method of characteristics (MOC) to calculate in real time the transient physical waves (such as water hammer pressure waves) generated by the action in the virtual pipe network. The polymorphic simulation kernel accurately calculates the speed and attenuation of the pressure wave propagating upstream and downstream based on the physical parameters of the pipe network (such as the elastic modulus of the pipe material, the pipe wall thickness, and the fluid density).
[0041] Taking the application scenario of smart water networks as an example, such as Figure 3 As shown, based on the importance and geographical distribution characteristics of the measured objects, the distributed system corresponding to the smart water network is divided into two types of nodes: a large number of non-critical nodes that play a local auxiliary role (such as intermediate pumping stations and ordinary monitoring stations) are run as virtual container (SIL) nodes in a server cluster; and key control nodes (such as headwater intake hubs and tailwater storage hubs) are connected to the network as physical controllers (HIL). All nodes are connected to the same communication network through industrial switches or virtual bridges and are uniformly driven by the same polymorphic physical simulation kernel.
[0042] Optionally, in this embodiment, a wide-area collaborative simulation scenario is constructed, including but not limited to: using the crystal oscillator time of the physical controller or the hard real-time step size of the multi-state physical simulation kernel as a global benchmark; and dynamically calibrating the server system clock running the virtual container node based on a precise time protocol.
[0043] Taking the application scenario of smart water networks as an example, to address the "timing drift" problem caused by the inconsistency between the virtual operating system time and the physical crystal oscillator time, in this embodiment, the test system 10 enables a hybrid clock synchronization mechanism based on the IEEE 1588 protocol (PTP). This hybrid clock synchronization mechanism uses the hard real-time step size of the physical simulation kernel as a global benchmark to dynamically calibrate the system clock of the virtual container nodes, ensuring that the operation cycle of the virtual logic is strictly aligned with the physical clock of the physical controller (e.g., 1ms), thereby guaranteeing the timing accuracy of cross-node collaborative actions.
[0044] The test system runs cascading failure scenarios, such as virtual node malfunctions causing physical node misoperations. A global physical coupling solver is used to achieve a complete closed loop from virtual actions to physical perception. This can specifically include the following steps: S41, Source Trigger (Virtual Action); Specifically, the third-level pump station (virtual container node) located in the middle of the topology performs a "fault-induced valve closure" action. The polymorphic physics simulation kernel captures this action as a Dirichlet distribution of the boundary conditions.
[0045] S42, Wave propagation (digital tsunami); Specifically, the multimorphic physics simulation kernel, based on a high-fidelity hydraulic model (such as the method of characteristics MOC), calculates in real time the transient physical waves (such as water hammer pressure waves) generated in the virtual pipeline network by the "fault-induced valve closure" action. Based on the physical parameters of the pipeline network, the multimorphic physics simulation kernel accurately calculates the propagation speed, attenuation, and time-of-flight delay required for the pressure wave to reach the first-level hub (physical controller node) of the upstream and downstream propagation of the pressure wave.
[0046] S43, Signal Reconstruction (Physical Impact); Specifically, when the calculated virtual pressure wave arrives at the virtual location of the Level 1 hub, the physical signal adapter of the virtual-real mapping interface layer is immediately activated. It maps and converts the high-voltage value output by the polymorphic physical simulation kernel into an industrial standard analog electrical signal (e.g., a current signal that abruptly changes from 4mA to 18mA).
[0047] S44, Entity Response (Closed-Loop Verification).
[0048] Specifically, the physical current signal is directly applied to the input terminal of the first-level hub entity controller via hardware circuitry. The entity controller physically senses this "real physical impact" caused by the "virtual fault" hundreds of kilometers away and triggers local protection logic (such as emergency shutdown) accordingly.
[0049] Through the above steps, this embodiment successfully verified the collaborative response capability between heterogeneous nodes to complex physical coupling fluctuations.
[0050] Optionally, in this embodiment, the ultra-real-time clock reference is set to 10 to 100 times the physical time; wherein, the simulation test on the object under test is performed at a speed higher than the physical time using a preset amount of randomly generated data, including: generating random boundary conditions using the Monte Carlo method, traversing the working conditions within a preset period to obtain randomly generated data.
[0051] Taking the smart water network application scenario as an example, the system reference clock is set to a 10-100 times acceleration mode of physical time using a multimodal clock scheduler in the unified test management layer. At this time, the object under test does not depend on the real physical controller, but is directly embedded into the simulation kernel as a pure logic function block.
[0052] Leveraging the aforementioned time acceleration capabilities, the testing system can apply the Monte Carlo method to address the challenge of low coverage in long-cycle system testing. The system automatically generates massive amounts of random boundary conditions (such as different rainfall intensities, upstream water combinations, and sudden failures), completing traversal testing of thousands of long-cycle operating conditions in an extremely short time.
[0053] In one example, taking a cross-basin water transfer project as an example, the system rapidly ran 5000 sets of different rainfall and inflow boundary conditions using accelerated mode. Capturing long-term "butterfly effects" and policy correction: This step aims to discover hidden policy flaws that only manifest over long-term accumulation. Test results showed that under the 2345th extreme rainfall scenario (simulating a 72-hour flood evolution process), the original algorithm caused water level overflow in the forebay of the third-stage pumping station due to accumulated errors. Based on this feedback, engineers corrected the algorithm's constraint parameters and re-ran the target test. The entire process, without hardware cost, utilized "time acceleration" capabilities to comprehensively verify policy convergence and parameter sensitivity, effectively avoiding the risk that traditional real-time testing, due to its excessive time consumption, could not cover extreme, low-probability scenarios.
[0054] Optionally, in this embodiment, the real-time calculation of the spatiotemporal lag required for the physical wave to propagate to the location of the physical controller node includes, but is not limited to: obtaining the propagation speed of transient pressure waves or fluid waves caused by the actions of the virtual container node in the pipeline network; obtaining the physical transmission path length between the virtual container node and the physical controller node in the topology network corresponding to multiple measured nodes; and determining the spatiotemporal lag based on the physical transmission path length and the propagation speed. In the example of the smart water network, the physical transmission path length is the physical pipeline length (i.e., the actual length of the physical transmission medium).
[0055] Specifically, taking the smart water network as an example, when a virtual pumping station (virtual container node) located upstream suddenly closes its valve, a severe water hammer effect will occur in the pipe network. The multi-state physical simulation kernel loads a high-fidelity pipe network hydraulic model of this water network, which pre-sets physical parameters such as the elastic modulus of the pipe material, the pipe wall thickness, and the fluid density.
[0056] First, the simulation kernel uses a method of characteristics (MOC) solver to calculate the propagation velocity 'a' of the transient water hammer pressure wave in the pipeline in real time (e.g., for steel pipe media, the wave velocity is approximately 1000 m / s). Second, the system reads the topology network data to obtain the physical pipeline length L (e.g., 50 km) between the virtual pump station and the downstream physical pressure regulating valve (physical controller node). Finally, the spatiotemporal lag T (i.e., 50 seconds) is calculated using the formula T=L / a. This means that although the virtual pump station has closed the valve at $t=0$, the simulation kernel determines that the pressure wave will not physically reach the physical pressure regulating valve until $t=50s$, thus ensuring the realistic reproduction of the physical transmission characteristics during long-distance water transport.
[0057] Optionally, in this embodiment, during the migration from encapsulating the control algorithm source code into a virtual container to deploying the software image to the physical controller, the object under test remains the same virtual container image version; when injecting virtual driver stubs into the virtual container and performing communication tests, the virtual driver stubs are used to redirect read and write operations on hardware registers to network data packets; when verifying the electrical characteristics and physical I / O response of the physical controller, the underlying driver mapping is configured to allow the virtual container image to directly access the physical I / O ports of the physical controller.
[0058] Specifically, taking the smart water network as an example, the tested object is the intelligent control program of a gate station (running in a Docker container under Linux). During the SIL software verification phase, this container runs on a cloud server. When the control program attempts to call the underlying API to open the gate, the virtual stub within the container intercepts the call, converts it into an MQTT or TCP network packet, and sends it to the simulation kernel, indicating that "the gate has been opened," thus verifying the logic's correctness in a pure software environment. During the HIL physical verification phase, the same Docker image file is downloaded and deployed to the embedded edge controller in the field via OTA technology. At this point, only the underlying driver mode needs to be switched via the configuration file; the aforementioned `write_gpio` instruction is no longer intercepted as a network packet but is directly mapped to the actual GPIO physical pin of the industrial control computer, outputting a high-level signal to drive the relay.
[0059] In this way, "zero code modification" is achieved from cloud algorithm verification to edge hardware deployment, avoiding human errors introduced in traditional development by rewriting Python / C++ algorithms into PLC ladder diagrams.
[0060] Optionally, in this embodiment, the calculated physical wave values are reconstructed into analog physical signals and injected into the physical controller through the virtual-real mapping interface layer of the test system, including but not limited to: receiving digital waveform data from the multi-state physical simulation kernel through the physical signal adapter of the virtual-real mapping interface layer; converting the digital waveform data into industrial standard analog quantities; and loading the industrial standard analog quantities into the sensor input terminals of the physical controller in real time through the hardwiring of the virtual-real mapping interface layer to simulate physical impact.
[0061] Specifically, taking the smart water network as an example, in the aforementioned water hammer propagation scenario, when the simulation time reaches the calculated spatiotemporal lag T (i.e., the 50th second), the simulation kernel calculates that the instantaneous pressure value at the physical node suddenly increases from 0.5MPa to 2.0MPa. At this time, the physical signal adapter of the virtual-real mapping interface layer receives this digital quantity (2.0MPa). The high-precision D / A conversion module inside the adapter converts this digital quantity into a 16.8mA current signal in real time according to the preset range (e.g., 0-2.5MPa corresponds to 4-20mA). This current signal is directly input to the "pressure sensor input terminal" of the physical controller through physical hardwiring. The physical controller (such as a field PLC) cannot distinguish whether this is pressure from a real water pipe or a signal from the test system, and therefore, upon detecting a surge in current, it immediately triggers its internal "overpressure protection logic" and executes an emergency pressure relief action.
[0062] This embodiment successfully reproduces the electrical impact of a physical shock caused by a fault hundreds of kilometers away in a real water network on local equipment using limited hardware resources, verifying the physical robustness of the system.
[0063] According to a second aspect of the present invention, a testing apparatus for a distributed autonomous operating system is provided, which can be integrated into a testing system 10 for operation, such as... Figure 4 As shown, the device includes: The first test module 40 is used to embed the object under test as a function library into the simulation environment, set the system reference clock of the test system as an ultra-real-time clock reference, and use a preset number of randomly generated data to perform simulation tests on the object under test at a speed higher than physical time by shielding the time consumption of the underlying I / O communication, so as to obtain the control algorithm source code after algorithm logic verification. The second test module 42 is used to encapsulate the control algorithm source code into a virtual container, inject virtual drive stubs into the virtual container and perform communication tests to obtain a software image; The third test module 44 is used to deploy the software image to the physical controller and verify the electrical characteristics and physical I / O response of the physical controller in hard real-time closed-loop mode. The fourth test module 46 is used to construct a wide-area collaborative simulation scenario, which connects multiple test nodes to the same polymorphic physical simulation kernel at the same time. The polymorphic physical simulation kernel calculates the coupling effect of the actions of the multiple test nodes on the shared physical environment in real time and feeds it back to each test node to form a closed-loop control. The plurality of tested nodes exist in a heterogeneous manner, including at least one virtual container node corresponding to the virtual container and one entity controller node corresponding to the entity controller.
[0064] In actual operation, the source code of the control algorithm generated by the first test module 40 and verified by the algorithm logic is transferred to the second test module 42; the second test module 42 encapsulates it to obtain a software image and transfers the image to the third test module 44 for deployment; the fourth test module 46 connects the entity controller node in the third test module 44 and the virtual container node in the second test module 42 in the same simulation scenario through the polymorphic physical simulation kernel, and calculates the coupling effect between the two in real time, thereby realizing the closed-loop flow of data.
[0065] Optionally, in this embodiment, the fourth test module 46 includes: The first processing submodule is used to calculate in real time, based on the physical model, the spatiotemporal lag and energy attenuation required for the physical wave to propagate to the location of the entity controller node when the virtual container node triggers an action and excites a physical wave in the polymorphic physical simulation kernel. The second processing submodule is used to reconstruct the calculated physical wave values into simulated physical signals and inject them into the entity controller through the virtual-real mapping interface layer of the test system when the simulation time reaches the spatiotemporal lag amount, so as to trigger the physical response of the entity controller.
[0066] Optionally, in this embodiment, the fourth test module 46 further includes: The third processing submodule is used to take the crystal oscillator time of the physical controller or the hard real-time step size of the polymorphic physical simulation kernel as a global reference. The fourth processing submodule is used to dynamically calibrate the server system clock running the virtual container node based on a precise time protocol.
[0067] Optionally, in this embodiment, the ultra-real-time clock reference is set to 10 to 100 times the physical time; wherein, the first test module 40 includes: The fifth processing submodule is used to automatically generate random boundary conditions using the Monte Carlo method, and traverse the working conditions within a preset period to obtain the randomly generated data.
[0068] Optionally, in this embodiment, the first processing submodule includes: The first acquisition unit is used to acquire the propagation speed of transient pressure waves or fluid waves caused by the action of the virtual container node in the pipeline network. The second acquisition unit is used to acquire the physical transmission path length between the virtual container node and the entity controller node in the topology network corresponding to the multiple tested nodes; The first determining unit is used to determine the spatiotemporal lag based on the physical transmission path length and the propagation speed.
[0069] Optionally, in this embodiment, during the migration from encapsulating the control algorithm source code into a virtual container to deploying the software image to the physical controller, the object under test remains the same virtual container image version; When injecting virtual driver stubs into the virtual container and performing communication tests, the virtual driver stubs are used to redirect read and write operations on hardware registers into network data packets. When verifying the electrical characteristics and physical I / O response of the physical controller, the virtual container image can directly access the physical I / O ports of the physical controller by configuring the underlying driver mapping.
[0070] Optionally, in this embodiment, the second processing submodule includes: The first receiving unit is used to receive digital waveform data from the polymorphic physical simulation kernel through the physical signal adapter of the virtual-real mapping interface layer. The first processing unit is used to convert the digital waveform data into industrial standard analog quantities; The first test unit is used to load the industrial standard analog quantity into the sensor input terminal of the physical controller in real time through the hard wiring of the virtual-real mapping interface layer to simulate physical impact.
[0071] The third aspect of this invention discloses an electronic device, such as... Figure 5 As shown, it includes: at least one processor 501; and a memory 502 communicatively connected to the at least one processor 501; wherein the memory 502 stores instructions executable by the at least one processor 501, the instructions being executed by the at least one processor 501 to enable the at least one processor 501 to execute the test methods for distributed autonomous operating systems in the above embodiments.
[0072] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0073] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0074] Another embodiment of this application relates to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the above-described embodiment of the testing method for a distributed autonomous operating system.
[0075] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0076] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0077] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0078] The foregoing description of specific exemplary embodiments of this application is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.
Claims
1. A testing method for distributed autonomous operating systems, characterized in that, When applied to a testing system, the method includes: The test object is embedded as a function library in the simulation environment. The system reference clock of the test system is set as an ultra-real-time clock reference. By shielding the time consumption of the underlying I / O communication, a preset amount of randomly generated data is used to simulate and test the test object at a speed higher than physical time, so as to obtain the control algorithm source code after algorithm logic verification. The source code of the control algorithm is encapsulated into a virtual container, and a virtual driver stub is injected into the virtual container and a communication test is performed to obtain a software image. The software image is deployed to the physical controller, and the electrical characteristics and physical I / O response of the physical controller are verified in hard real-time closed-loop mode. A wide-area collaborative simulation scenario is constructed, in which multiple nodes under test are simultaneously connected to the same polymorphic physical simulation kernel. The polymorphic physical simulation kernel calculates in real time the coupling effect of the actions of the multiple nodes under test on the shared physical environment and feeds it back to each node under test to form a closed-loop control. The plurality of tested nodes exist in a heterogeneous manner, including at least one virtual container node corresponding to the virtual container and one entity controller node corresponding to the entity controller; The multi-state physics simulation kernel calculates in real time the coupling effect of the actions of the multiple tested nodes on the shared physical environment, including: When the virtual container node triggers an action and generates a physical wave in the polymorphic physical simulation kernel, the spatiotemporal lag and energy attenuation required for the physical wave to propagate to the location of the entity controller node are calculated in real time based on the physical model. When the simulation time reaches the specified spatiotemporal lag, the calculated physical wave values are reconstructed into simulated physical signals through the virtual-real mapping interface layer of the test system and injected into the entity controller to trigger the physical response of the entity controller.
2. The method according to claim 1, characterized in that, The construction of the wide-area collaborative simulation scenario includes: The crystal oscillator time of the physical controller or the hard real-time step size of the polymorphic physical simulation kernel is used as the global benchmark; The server system clock running the virtual container node is dynamically calibrated based on a precise time protocol.
3. The method according to claim 1, characterized in that, The ultra-real-time clock reference is set to 10 to 100 times physical time; wherein... Simulation testing of the object under test is performed using a preset amount of randomly generated data at a rate exceeding physical time, including: Random boundary conditions are generated using the Monte Carlo method, and the operating conditions within a preset period are traversed to obtain the randomly generated data.
4. The method according to claim 1, characterized in that, The real-time calculation of the spatiotemporal lag required for the physical wave to propagate to the location of the entity controller node includes: The propagation speed of transient pressure waves or fluid waves caused by the actions of the virtual container nodes in the pipeline network is obtained. Obtain the physical transmission path length between the virtual container node and the entity controller node in the topology network corresponding to the multiple tested nodes; The spatiotemporal lag is determined based on the physical transmission path length and the propagation speed.
5. The method according to claim 1, characterized in that, The process of reconstructing the calculated physical wave values into simulated physical signals and injecting them into the physical controller through the virtual-real mapping interface layer of the test system includes: Digital waveform data from the polymorphic physical simulation kernel is received through the physical signal adapter of the virtual-real mapping interface layer; Convert the digital waveform data into industry-standard analog quantities; Through hardwiring in the virtual-real mapping interface layer, the industrial standard analog quantity is loaded into the sensor input terminal of the physical controller in real time to simulate physical impact.
6. A testing device for a distributed autonomous operating system, characterized in that, The device, used in a testing system, includes: The first test module is used to embed the object under test as a function library into the simulation environment, set the system reference clock of the test system as an ultra-real-time clock reference, and use a preset number of randomly generated data to perform simulation tests on the object under test at a speed higher than physical time by shielding the time consumption of the underlying I / O communication, so as to obtain the control algorithm source code after algorithm logic verification. The second testing module is used to encapsulate the control algorithm source code into a virtual container, inject virtual driver stubs into the virtual container and perform communication tests to obtain a software image; The third test module is used to deploy the software image to the physical controller and verify the electrical characteristics and physical I / O response of the physical controller in hard real-time closed-loop mode. The fourth test module is used to construct a wide-area collaborative simulation scenario, which connects multiple test nodes to the same polymorphic physical simulation kernel at the same time. The polymorphic physical simulation kernel calculates the coupling effect of the actions of the multiple test nodes on the shared physical environment in real time and feeds it back to each test node to form a closed-loop control. The plurality of tested nodes exist in a heterogeneous manner, including at least one virtual container node corresponding to the virtual container and one entity controller node corresponding to the entity controller; The fourth test module includes: The first processing submodule is used to calculate in real time, based on the physical model, the spatiotemporal lag and energy attenuation required for the physical wave to propagate to the location of the entity controller node when the virtual container node triggers an action and excites a physical wave in the polymorphic physical simulation kernel. The second processing submodule is used to reconstruct the calculated physical wave values into simulated physical signals and inject them into the entity controller through the virtual-real mapping interface layer of the test system when the simulation time reaches the spatiotemporal lag amount, so as to trigger the physical response of the entity controller.
7. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed, enables the at least one processor to perform a test method for a distributed autonomous operating system as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the testing method for a distributed autonomous operating system as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Hardware-in-the-loop test platform, variable-pitch in-the-loop test system and test system
CN114647200A
Intelligent ship multi-channel interactive simulation system and method for virtual-real hybrid integrated simulation
CN114882759A