Data interaction method of simulation software and related product
By building a control server and constructing standardized interaction ports in the simulation software, the problems of inconsistent interfaces, closed process control, and insufficient real-time performance between external devices and GCAir simulation software in data interaction are solved, achieving efficient and reliable data transmission and flexible simulation control, and improving the system's adaptability and automation level.
Patent Information
- Application Number
- CN202511702513.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-02-27
AI Technical Summary
The lack of standardized interfaces between external devices and GCAir simulation software leads to closed simulation process control, insufficient real-time data transmission capabilities, and unconfigurable interaction parameters, resulting in high integration and maintenance costs, low efficiency of automated testing, and unreliable and non-real-time data transmission.
A control server is built in the simulation software, a standardized interaction port is constructed, which supports remote simulation process control and data transmission, flexible parameter configuration, and realizes a unified interface and efficient data interaction.
It reduces system integration complexity and maintenance costs, improves the flexibility and efficiency of automated testing and remote collaborative simulation, ensures the real-time performance and reliability of data transmission, and meets personalized simulation needs.
Smart Images

Figure CN121585658A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to a data interaction method of simulation software and related products. BACKGROUND
[0002] Currently, there are many problems in data interaction between external devices and simulation software, for example, the following problems exist in data interaction and process control between external devices and GCAir simulation software:
[0003] Firstly, there is a lack of standardized interaction interface, which makes it difficult for external clients to conveniently and uniformly obtain the variable tree structure information of the GCAir simulation system, and different devices need to develop customized docking logic, which significantly increases the integration and maintenance cost.
[0004] Secondly, the simulation process control mode is scattered and closed, and external devices cannot perform initialization, start, pause, stop and simulation speed adjustment operations on GCAir simulation through unified and remote instructions, but still rely on local manual intervention, which seriously restricts the flexibility and efficiency of automated testing and remote collaborative simulation.
[0005] Thirdly, the real-time data transmission capability is insufficient, and external devices cannot accurately bind the required simulation variables and efficiently receive their dynamic values; at the same time, the data transmission format is not unified, and there is a lack of standardized serialization protocol, which leads to complex analysis, high delay and poor reliability.
[0006] Finally, the interaction parameters lack configurability, such as communication ports, sampling periods, data types, etc., which are fixed in the code or configuration file and cannot be flexibly adjusted according to specific simulation scenarios. For example, different external devices may need to use different network ports, or the same variable may need to be output in different precision (such as float / double) or units in different application scenarios, and the existing mechanism cannot meet such individualized needs. SUMMARY
[0007] Based on the above problems, the present application provides a data interaction method of simulation software and related products, aiming to reduce the data interaction cost of simulation software and improve the remote controllability and data sharing capability of simulation software.
[0008] The embodiments of the present application disclose the following technical solutions:
[0009] The first aspect of the present application provides a data interaction method of simulation software, which is applied to simulation software, and the method comprises:
[0010] building a control terminal server;
[0011] The control end server is configured with parameters, and an interaction channel of the control end server and the data server is constructed based on an interaction port;
[0012] After receiving the simulation instruction, the interaction port of the control end server and the data server is opened;
[0013] Real-time simulation data is collected based on the control end server; the simulation data is running data of an external device;
[0014] The simulation data is sent to the data server based on the interaction port.
[0015] Optionally, the control end server is built, specifically including:
[0016] In response to receiving a first drag operation, a blank subsystem template in a template library is dragged to a canvas;
[0017] In response to receiving a double-click operation, a configuration interface of the blank subsystem template is entered;
[0018] In response to receiving a second drag operation, a control end server in the template library is dragged to the configuration interface to obtain a setting interface of the control end server;
[0019] In response to receiving setting data, the setting data is added to the setting interface to complete the building of the control end server.
[0020] Optionally, the control end server is configured with parameters, and an interaction channel of the control end server and the data server is constructed based on an interaction port, specifically including:
[0021] In response to receiving configuration data, the control end server is configured with parameters; the configuration data at least includes a template name, an address, an interaction port, a sampling step number, an input / output port name, an initial value, a variable type and a data type;
[0022] The interaction channel of the control end server and the data server is constructed based on the interaction port, so that the data server accesses the control end server through the interaction port.
[0023] Optionally, before the interaction port of the control end server and the data server is opened after receiving the simulation instruction, the method further includes:
[0024] A first server is built in the simulation software;
[0025] An interaction channel of the first server and the control end server is constructed.
[0026] The second aspect of the application provides a data interaction method of simulation software, the method is applied to a data server, and the method comprises the following steps:
[0027] sending simulation instructions to a control terminal server through an interaction channel; the control terminal server is built in simulation software; the interaction channel between the control terminal server and the data server is built based on an interaction port;
[0028] receiving simulation data; the simulation data is collected in real time by the control terminal server after receiving the simulation instructions; the simulation data is sent to the data server by the control terminal server through the interaction port; and the simulation data is operation data of an external device;
[0029] displaying the simulation data.
[0030] Optionally, the method further comprises the following steps.
[0031] judging whether the external device has a fault based on the simulation data; if the judging result indicates that the external device has a fault, performing correction processing on parameters of the external device.
[0032] The third aspect of the application provides a data interaction device of simulation software, the data interaction device of simulation software is applied to simulation software, and the device comprises the following steps:
[0033] a building module, configured to build a control terminal server;
[0034] a configuration module, configured to perform parameter configuration on the control terminal server and build an interaction channel of the control terminal server and a data server based on an interaction port;
[0035] a first receiving module, configured to open an interaction port of the control terminal server and the data server after receiving simulation instructions;
[0036] a collection module, configured to collect simulation data in real time based on the control terminal server; the simulation data is operation data of an external device;
[0037] an interaction module, configured to send the simulation data to a data server based on the interaction port.
[0038] The fourth aspect of the application provides a data interaction device of simulation software, the data interaction device of simulation software is applied to a data server, and the device comprises the following steps:
[0039] a sending module, configured to send simulation instructions to a control terminal server through an interaction channel; the control terminal server is built in simulation software; the interaction channel between the control terminal server and the data server is built based on an interaction port;
[0040] a second receiving module, configured to receive simulation data; the simulation data is collected by the control end server in real time after receiving a simulation instruction; the simulation data is sent by the control end server to the data server through the interaction port; and the simulation data is running data of an external device;
[0041] a display module, configured to display the simulation data.
[0042] The fifth aspect of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the data interaction method of the simulation software provided in the first aspect or the second aspect.
[0043] The sixth aspect of the present application provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to realize the data interaction method of the simulation software provided in the first aspect or the second aspect.
[0044] Compared with the prior art, the present application has the following beneficial effects:
[0045] The present application comprises building a control end server in the simulation software; the control end server is configured with parameters, and an interaction port of the control end server and a data server is constructed; after receiving a simulation instruction, the interaction port of the control end server and the data server is opened; simulation data is collected by the control end server in real time; the simulation data is running data of an external device; and the simulation data is sent to the data server based on the interaction port. The present application provides a standardized and normalized access interface for external devices by building a control end server and opening a unified interaction port. External clients do not need to repeatedly develop customized docking logic for different devices, but only need to follow the interaction port protocol to obtain a simulation variable tree structure, subscribe to required data, or issue a control instruction, thereby greatly reducing the system integration complexity and later maintenance cost. The control end server supports receiving and analyzing simulation instructions (such as initialization, start, pause, stop, speed adjustment, etc.) sent by the outside, and dynamically opens an interaction channel with the data server after receiving the instructions, thereby realizing remote, centralized and automatic control of the simulation process. This eliminates the dependence on local manual operation, and significantly improves the flexibility and execution efficiency in the scenarios of automatic testing, remote collaborative simulation and unattended operation.
[0046] The control end server can collect simulation data corresponding to the external device in real time based on configuration, and efficiently push the simulation data to the data server in a unified format through an interaction port. Since the data transmission path is clear and the protocol is specified, the problems of parsing error and high delay caused by format confusion and inconsistent serialization in the traditional mode are avoided, and the real-time, accuracy and reliability of data transmission are ensured. The control end server in the application supports flexible configuration of parameters. These parameters are no longer hard-coded in the program, but can be dynamically adjusted according to the specific simulation task or external device requirements, greatly enhancing the adaptability and scalability of the system, and meeting the diversified and personalized simulation interaction requirements. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0048] Figure 1 A flowchart of a data interaction method of a simulation software provided by an embodiment of the present application;
[0049] Figure 2 A first schematic diagram of building a control end server provided by an embodiment of the present application;
[0050] Figure 3 A second schematic diagram of building a control end server provided by an embodiment of the present application;
[0051] Figure 4 A third schematic diagram of building a control end server provided by an embodiment of the present application;
[0052] Figure 5 A configuration interface schematic diagram of a control end server provided by an embodiment of the present application;
[0053] Figure 6 A schematic diagram of a control end server provided by an embodiment of the present application;
[0054] Figure 7 A schematic diagram of requesting variable tree information provided by an embodiment of the present application;
[0055] Figure 8 A schematic diagram of simulation initialization information provided by an embodiment of the present application;
[0056] Figure 9 A schematic diagram of simulation speed information provided by an embodiment of the present application;
[0057] Figure 10A schematic diagram of a simulation start command provided for an embodiment of the present application;
[0058] Figure 11 A schematic diagram of binding variable information provided for an embodiment of the present application;
[0059] Figure 12 A schematic diagram of a simulation pause command provided for an embodiment of the present application;
[0060] Figure 13 A schematic diagram of a simulation reset command provided for an embodiment of the present application;
[0061] Figure 14 A schematic diagram of a simulation project provided for an embodiment of the present application;
[0062] Figure 15 A schematic diagram of a simulation process provided for an embodiment of the present application;
[0063] Figure 16 A structural diagram of a data interaction device for simulation software according to an embodiment of the present application;
[0064] Figure 17 A schematic diagram of a data interaction method for simulation software according to an embodiment of the present application;
[0065] Figure 18 A structural diagram of a data interaction device for simulation software applied to a data server according to an embodiment of the present application. DETAILED DESCRIPTION
[0066] As described above, at present, the data interaction between external devices and GCAir simulation software faces multiple challenges: the lack of standardized interfaces makes it difficult to uniformly obtain variable tree structures, forcing each device to develop customized interface logic, significantly increasing integration and maintenance costs; simulation process control is closed and dispersed, and cannot be uniformly executed through remote instructions to initialize, start and stop, speed adjustment, and other operations, relying heavily on manual intervention, which restricts automation and collaboration efficiency; real-time data transmission capability is weak, making it difficult to accurately bind target variables, and causing complex analysis, high delay, and poor reliability due to non-uniform formats and non-standardized protocols; at the same time, key parameters such as communication ports, sampling periods, data precision, and units are fixed in the code or configuration files, and cannot be dynamically adjusted as needed, making it difficult to meet the needs of flexibility and individualization of different devices or scenarios.
[0067] In view of the above problems, this application provides a data interaction generation method and related products for simulation software. The method includes: building a control server in the simulation software; configuring parameters of the control server and constructing an interaction port between the control server and the data server; opening the interaction port between the control server and the data server after receiving a simulation command; collecting simulation data in real time based on the control server; and sending the simulation data to the data server based on the interaction port. This application establishes a standardized and regulated external interaction mechanism by building a control server within the simulation software and opening a unified interaction port. This eliminates the need for external clients to repeatedly develop customized interface logic for different devices; they only need to follow a unified protocol to obtain variable tree structures, subscribe to data, or issue control commands, significantly reducing integration and maintenance costs. The control server supports receiving and parsing remote simulation commands such as initialization, start, pause, stop, and speed adjustment, dynamically opening interaction channels with the data server to achieve centralized and automated control of the simulation process. This eliminates reliance on local manual intervention and greatly improves efficiency and flexibility in automated testing, remote collaboration, and unattended scenarios. Simultaneously, the server can collect simulation data in real time according to configuration and efficiently push it to the data server in a unified format, ensuring a clear transmission path and standardized protocol. This effectively avoids delays and errors caused by format chaos or inconsistent serialization in traditional methods, guaranteeing the real-time performance, accuracy, and reliability of the data. Furthermore, parameters such as communication ports, sampling periods, and data precision all support dynamic configuration, no longer hard-coded into the code. They can be flexibly adjusted according to specific tasks or equipment requirements, greatly enhancing the system's adaptability, scalability, and personalized service capabilities.
[0068] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0069] Explanation of relevant professional terms:
[0070] GCAir is a graphical modeling and simulation environment that supports the Modelica language. Based on the FMI / FMU (Functional Mock-up Interface / Unit) standard, it enables the integration and collaborative simulation of multi-source heterogeneous models, aiming to build a digital engineering system covering the entire lifecycle of "design-simulation-testing-operation and maintenance".
[0071] Figure 1A flowchart illustrating a data interaction method for simulation software provided in this application embodiment is shown below. Figure 1 As shown, a data interaction method for simulation software includes:
[0072] S101: Simulation software is used to build the control server.
[0073] This application does not limit the specific construction method of the control server in the simulation software, and has a high degree of implementation flexibility and adaptability. For example, the control server can be automatically initialized and deployed by directly calling and executing pre-written program code (such as scripts, plugins, or modules) during the startup or operation of the simulation software; alternatively, it can be designed to respond to external or internal trigger commands (such as user operation commands, configuration file loading events, API calls, or changes in simulation process status, etc.) to dynamically create and configure the control server on demand in the simulation environment. This open construction mechanism is not only compatible with various development modes and integration scenarios, but also allows for flexible selection of automated deployment or condition-triggered activation strategies according to actual application needs, thereby improving the system's maintainability, scalability, and compatibility with different simulation environments.
[0074] S102: The simulation software configures the parameters of the control server and builds an interaction channel between the control server and the data server based on the interaction port.
[0075] This application maintains a high degree of openness in the parameter configuration methods of the control server, and is not limited to any specific implementation method. Specifically, relevant parameters (such as communication protocol type, IP address, sampling frequency, data type, buffer size, etc.) can be dynamically set in the code through programming (e.g., calling configuration interfaces, loading structured configuration files such as JSON / YAML, or injecting through environment variables), or can be configured or hot-updated in real time through external commands (such as command-line parameters, remote API requests, graphical user interface operations, or simulation script commands), thereby adapting to different deployment environments and runtime requirements.
[0076] Similarly, the method for determining the interaction port is not limited. The user can explicitly specify the port number based on the actual network topology, security policy, or system integration requirements; alternatively, a preset default port (such as standard HTTP port 80, or a custom service port such as 12000) can be automatically used as the communication entry point between the control server and the data server when no explicit configuration is required. This port supports multiple transport protocols such as TCP, UDP, WebSocket, and gRPC, and can also be combined with service discovery mechanisms (such as DNS-SD, Consul, and ZooKeeper) to achieve dynamic port allocation and registration.
[0077] Because the interaction port itself is flexible, the interaction channel between the control server and the data server is not limited to a specific communication architecture. This channel can be implemented in a point-to-point direct connection mode, or based on mechanisms such as message middleware (e.g., MQTT, Kafka, RabbitMQ), shared memory, named pipes, or distributed service buses; it supports both synchronous request-response modes and asynchronous event-driven or streaming data push modes. This unrestricted design significantly enhances the system's compatibility in heterogeneous environments, deployment flexibility, and scalability for future technological evolution, providing a solid technical foundation for highly reliable, low-latency, and large-scale simulated collaborative interaction.
[0078] S103: After receiving the simulation command, the simulation software opens the interaction port between the control server and the data server.
[0079] Upon receiving the simulation command, indicating that the simulation task is ready to start, the interaction port between the control server and the data server is activated, establishing a stable and efficient communication channel to ensure that relevant data can be transmitted in real time and reliably during the simulation. This mechanism achieves coordinated operation between simulation execution and data interaction, avoiding resource consumption or security risks caused by premature port opening, while ensuring that the data server can obtain the necessary dynamic simulation data in a timely manner during simulation operation.
[0080] S104: The simulation software collects simulation data in real time based on the control server.
[0081] This application does not limit the specific method by which the control server collects simulation data, offering excellent flexibility and compatibility. For example, after the simulation starts, standard communication protocols such as XCP (Universal Measurement and Calibration Protocol) can be used to collect dynamic data from external devices in real time as simulation data; alternatively, custom protocols such as CAN, Modbus, TCP / UDP, or other industrial communication interfaces can be selected for data acquisition according to actual needs. This non-limiting design allows the system to adapt to various hardware platforms and test scenarios, effectively supporting high-precision, low-latency real-time data interaction, thereby improving the realism of the simulation and its engineering practicality.
[0082] S105: The simulation software sends the simulation data to the data server via the interaction port.
[0083] After acquiring simulation data, the control server can push the data to the data server in real time through the established interaction port. Upon receiving the simulation data, the data server can further return bound variable information (such as a list of variables that need continuous monitoring or synchronization) to the control server. The control server receives this bound variable information and persistently stores it in an internal data structure (such as a variable mapping table or subscription configuration cache). When the next simulation starts, the control server can proactively and efficiently send the simulation data of the corresponding variables to the data server based on the saved variable configuration. This achieves cross-simulation cycle inheritance of variable binding states and automated data distribution, improving system continuity, configuration reusability, and operational efficiency.
[0084] This application does not limit the simulation data, for example:
[0085] {
[0086] "data": {
[0087] "children": [
[0088] {
[0089] "children": [
[0090] {
[0091] "children": [
[0092] {
[0093] "children": [ ]
[0095] "key": "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}-{WebSocket_1}-{input}-{Var_1}",
[0096] "title": "Var_1",
[0097] "type": "variable
[0098] },
[0099] {
[0100] "children":[ ]
[0102] "key": "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}-{WebSocket_1}-{input}-{Var_2}",
[0103] "title": "Var_2",
[0104] "type": "variable"
[0105] },
[0106] {
[0107] "children":[ ]
[0109] "key": "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}-{WebSocket_1}-{input}-{Var_3}",
[0110] "title": "Var_3",
[0111] "type": "variable"
[0112] }
[0113] ],
[0114] "key": "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}-{WebSocket_1}-{input}",
[0115] "title": "input",
[0116] "type": "causality"
[0117] },
[0118] {
[0119] "children": [
[0120] {
[0121] "children":[ ]
[0123] "key": "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}-{WebSocket_1}-{input}-{Var_4}",
[0124] "title": "Var_4",
[0125] "type": "variable"
[0126] }
[0127] ],
[0128] Here, {2b0d513a-bfdb-424a-a3e5-b415779ce8a2} is a globally unique identifier used to distinguish different simulation components or sessions; WebSocket_1: the communication template name, indicating that the variable belongs to a specific WebSocket channel; input: the input interface or logical group; Var_1: the specific variable name. This design ensures that each variable in a complex system has a unique and resolvable path, supporting precise binding and data location.
[0129] `title` is a user-friendly display name used for interface display or debugging, such as "Var_1" or "Var_2", to facilitate user identification and operation. `type` defines the node type, distinguishing nodes with different functions; `variable` represents a readable and writable data variable; `causality` represents a causal node or input port, usually used as a logical group or signal entry.
[0130] This application does not limit the information of the bound variables, for example:
[0131] {
[0132] "params": [
[0133] "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}.WebSocket_1:Var_1",
[0134] "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}.WebSocket_1:Var_5", ]
[0136] "topic": "BindParam"
[0137] }
[0138] The `params` parameter contains two string elements, each representing a complete path identifier for a variable. `WebSocket_1`: the communication template name, indicating that the variable belongs to a specific WebSocket channel; `Var_1 / Var_5`: the specific variable name, representing the target variable to be bound. This path structure ensures precise variable location and avoids naming conflicts in complex systems.
[0139] The `topic` field value being `BindParam` indicates that the topic of this message is "parameter binding". In message brokers (such as MQTT and WebSocket message frames), `topic` is used to route messages to the corresponding processing logic. `BindParam` indicates that the intent of this message is to bind the specified parameters (i.e., the variables listed in `params`).
[0140] The above describes the main technical solution of this application. Further implementations of the main technical solution are now introduced. Details are as follows:
[0141] For building a control server using the S101 simulation software, this application provides an optional embodiment:
[0142] In response to receiving the first drag operation, drag the blank subsystem template from the template library onto the canvas.
[0143] Upon receiving a double-click operation, the configuration interface of the blank subsystem template is accessed.
[0144] In response to receiving a second drag-and-drop operation, the control server in the template library is dragged to the configuration interface to obtain the settings interface of the control server.
[0145] In response to receiving the setting data, the setting data is added to the setting interface, thus completing the setup of the control server.
[0146] Figure 2 This is a first schematic diagram of setting up a control server according to an embodiment of this application, as shown below. Figure 2 As shown, open the GCAir software and drag a blank subsystem template from the template library on the left onto the canvas. Figure 3 This is a second schematic diagram of setting up a control server according to an embodiment of this application, as shown below. Figure 3 As shown, double-click the blank subsystem template in the canvas to enter the blank subsystem template, find the WebSocket template (i.e., the control server) in the template library on the left, and drag it into the configuration interface. Figure 4 This is a third schematic diagram illustrating the setup of a control server according to an embodiment of this application, as shown below. Figure 4 As shown, a WebSocket template settings interface pops up. Click the "+" sign in the upper right corner to add some input / output ports, completing the setup of the control server. This process achieves flexible deployment and rapid configuration of the control server through a graphical, low-code approach, significantly reducing the barrier to entry and improving the scalability and interaction efficiency of the simulation system.
[0147] Regarding the S102 simulation software's parameter configuration of the control server and the construction of an interaction channel between the control server and the data server based on the interaction port, this application provides an optional embodiment:
[0148] Upon receiving configuration data, the control server is configured with parameters.
[0149] Figure 5 This is a schematic diagram of the configuration interface of the control server provided in the embodiments of this application. Upon receiving configuration data, the configuration data can be added to... Figure 5 The interface shown allows you to configure the parameters of the control server. The configuration data includes at least the template name (default is WebSocket_num, where num starts from 1), address (the IP address of the websocket server, default is the local address), interaction port (the port number of the websocket server, default is 12000), sampling steps (the scheduling cycle of the websocket during simulation, default is 1), input / output port name (the fmu port name of the websocket template, default is Var_num, where num starts from 1), initial value (the initial value of the fmu port, default is 0), variable type (the input / output type of the fmu port, which can be either input or output, default is input), and data type (the data type of the fmu port, which can be either RealType (default) or IntegerType).
[0150] Figure 6 This is a schematic diagram of the control server provided in the embodiments of this application. After configuration, the identifier of the control server will appear in the simulation software, such as... Figure 6 As shown, WebSocket_1 is the identifier of the control server.
[0151] An interaction channel is established between the control server and the data server based on the interaction port, enabling the data server to access the control server through the interaction port.
[0152] The GCAir software (i.e., the simulation software) detects that a WebSocket template already exists in the project, starts the WebSocket control server, and listens on port 21000 (the interaction port). The data server can access the WebSocket control server via ws: / / ip:21000 (where IP is the data server's IP address). All sent and received data packets are in JSON format, and data packets are distinguished by their topic number.
[0153] This application does not limit the data packets. For example, the data packets sent by the data server to the control server may include request variable tree information, simulation initialization information, simulation speed information, simulation start command, bound variable information, simulation pause command, or simulation reset command.
[0154] Figure 7 This is a schematic diagram of the request variable tree information provided in the embodiments of this application, such as... Figure 7 As shown, the subject of the request variable tree information is RequestParamTree, and data field 1 – port: queries the variables of the control server with port port.
[0155] Figure 8 A schematic diagram of simulation initialization information provided in the embodiments of this application, such as... Figure 8 As shown, the subject of the simulation initialization information is Init.
[0156] Figure 9 This is a schematic diagram of the simulation speed information provided in the embodiments of this application, such as... Figure 9 As shown, the subject of the simulation speed information is speed, and the data field is simulation speed, with values of 1X, 2X, and 5X.
[0157] Figure 10 A schematic diagram of the simulation start command provided in the embodiments of this application is shown below. Figure 10 As shown, the topic of the simulation start command is SimStart.
[0158] Figure 11 This is a schematic diagram of the binding variable information provided in the embodiments of this application, such as... Figure 11 As shown, the subject of the bound variable information is BindParam. The data field param is an array, where each element is the port name in the variable tree information, which is replaced with {subsystem id}. websocketName: fmu port name format.
[0159] Figure 12 This is a schematic diagram of the simulation pause command provided in an embodiment of this application, as shown below. Figure 12 As shown, the topic of the simulation pause command is SimStop.
[0160] Figure 13 This is a schematic diagram of the simulation reset command provided in the embodiments of this application, as shown below. Figure 13 As shown, the topic of the simulation reset command is SimReset.
[0161] Considering that other servers may be involved in practical applications, such as building simulation projects through other servers and control servers, and obtaining simulation data based on the simulation projects, this application also provides an optional embodiment for this situation:
[0162] The first server is set up in the simulation software.
[0163] This application does not limit the first server; relevant settings, such as Function, can be made according to the actual situation.
[0164] Establish an interaction channel between the first server and the control server.
[0165] After the first server is set up, an interaction channel needs to be established between the first server and the control server. For example, drag other templates into the canvas in the simulation software and connect them to the port of the control server to simulate the project.
[0166] Figure 14 A schematic diagram of the simulation project provided in the embodiments of this application, such as Figure 14 As shown, this simulation project includes a Function_1 server, a Function_2 server, and a WebSocket_1 server (control server). The Function_1 server includes out0=SIMTIME, out1=SIMTIME2, and out2=SIMTIME3. The out0 port of the Function_1 server is connected to the Var_1 port of the WebSocket_1 server; the out1 port of the Function_1 server is connected to the Var_2 port of the WebSocket_1 server; the out2 port of the Function_1 server is connected to the Var_3 port of the WebSocket_1 server; the int0 port of the Function_2 server is connected to the Var_4 port of the WebSocket_1 server; and the int1 port of the Function_2 server is connected to the Var_5 port of the WebSocket_1 server.
[0167] After the simulation project is completed, the data server sends a simulation start command to the control server or the start button in the GCAir interface is clicked manually. GCAir then starts the SimEngine.exe software and sends all the fmu information in the canvas to SimEngine. SimEngine opens the corresponding interactive port of each control server and starts listening. Figure 15 A schematic diagram of the simulation process provided for the embodiments of this application, such as Figure 15 As shown, if the engine output includes "[WebSocket_1192.168.40.25:12000]begin listen", it indicates that the engine is not performing well.
[0168] The command "[WebSocket_1 192.168.40.25:12000]listen Success-use ws" indicates that the data server on port 12000 has started listening normally.
[0169] After successfully starting the listener, GCAir sends the binding variable information to the corresponding data server, and the data server will send the simulation data of that variable out with each simulation.
[0170] The client can access the data server via ws: / / ip:port, where the IP address and port number are the same as those configured in the settings. By accessing the data server, the client can receive simulation data, such as...
[0171] "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}.WebSocket_1:Var_1":325.12,
[0172] "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}.WebSocket_1:Var_5":30
[0173] },
[0174] {
[0175] "params": {
[0176] "simTime":"325.13"
[0177] "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}.WebSocket_1:Var_1":325.13,
[0178] "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}.WebSocket_1:Var_5":30
[0179] }
[0180] ],
[0181] "topic": "ParamData"
[0182] },
[0183] {
[0184] "params": [
[0185] "simTime":"325.14"
[0186] "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}.WebSocket_1:Var_1":325.14,
[0187] "{2b0d513a-bfdb-424a-a3e5-b415779ce8a2}.WebSocket_1:Var_5":30
[0188] },
[0189] "topic": "ParamData"
[0190] }
[0191] Here, "var:meta" represents the variable's metadata (such as initial value, unit, etc.), where "value" may actually be a simulated numerical value or a configuration value; "var:data" represents the variable's real-time runtime data, which is dynamically updated as the simulation progresses. Each record is precisely identified by a key, supporting high-precision data binding and synchronization in complex systems.
[0192] This application achieves deep integration of GCAir software and the WebSocket protocol, significantly improving the interaction capabilities and automation level between the simulation system and external devices. Specifically, key parameters of the WebSocket template (including IP address, port number, sampling period, data type, etc.) support dynamic configuration across all dimensions, flexibly adapting to the personalized needs of communication protocols and data formats in different simulation scenarios. It innovatively adopts a dual-service architecture of "control server (fixed listening port 21000) + data server (port customizable)," separating simulation flow control commands and real-time variable data transmission at the logic and channel levels. This design effectively avoids mutual interference or congestion between control flow and data flow, significantly improving the stability, response speed, and overall throughput efficiency of system interaction.
[0193] The communication protocol uses a clearly structured JSON format and introduces a "topic" field to categorize messages by theme (such as BindParam, var:data, var:meta, etc.), clearly distinguishing between control commands, metadata, and real-time data. This standardized mechanism eliminates the need for external clients to develop customized parsing logic; they only need to follow the unified message specification to complete the integration, significantly reducing integration complexity and improving development efficiency. Simultaneously, the system supports precise binding of simulation variables. Clients can specify the specific variables they want to monitor, and GCAir only pushes data for the subscribed variables, effectively reducing redundant information transmission, saving network bandwidth resources, and further enhancing the real-time performance and effectiveness of data updates.
[0194] Furthermore, GCAir software possesses automatic detection and service coordination capabilities: upon detecting a configured WebSocket template, it can automatically start the control server (listening on port 21000); simultaneously, the SimEngine.exe process will synchronously start the data server matching the port specified in the template. The entire process requires no manual deployment or intervention from the user, completely resolving the pain point of traditional solutions where "manual service startup and shutdown are still required after configuration," greatly simplifying the operation process, lowering the barrier to entry, and providing solid support for advanced application scenarios such as automated testing and remote collaborative simulation.
[0195] Based on the data interaction method for simulation software provided in the foregoing embodiments, this application also provides a corresponding data interaction device for simulation software. For example... Figure 16 As shown, Figure 16 A structural diagram of a data interaction device for simulation software provided in this application embodiment includes:
[0196] The module is used to build the control server.
[0197] The configuration module is used to configure parameters of the control server and build an interaction channel between the control server and the data server based on the interaction port.
[0198] The first receiving module is used to open the interaction port between the control server and the data server after receiving the simulation command.
[0199] The acquisition module is used to acquire simulation data in real time based on the control server; the simulation data is the operating data of external devices.
[0200] An interaction module is used to send the simulation data to a data server via the interaction port.
[0201] As an optional embodiment, the building module is specifically used for:
[0202] In response to receiving a first drag-and-drop operation, a blank subsystem template from the template library is dragged onto the canvas; in response to receiving a double-click operation, the configuration interface of the blank subsystem template is entered; in response to receiving a second drag-and-drop operation, a control server from the template library is dragged onto the configuration interface to obtain the control server's settings interface; in response to receiving settings data, the settings data is added to the settings interface to complete the setup of the control server.
[0203] As an optional embodiment, the configuration module is specifically used for:
[0204] In response to receiving configuration data, the control server is configured with parameters; the configuration data includes at least template name, address, interaction port, sampling steps, input / output port name, initial value, variable type, and data type; an interaction channel between the control server and the data server is constructed based on the interaction port, enabling the data server to access the control server through the interaction port.
[0205] As an optional embodiment, a data interaction device for simulation software further includes:
[0206] The module is also used to build the first server in the simulation software;
[0207] The building module is used to build the interaction channel between the first server and the control server.
[0208] Figure 17 A schematic diagram of a data interaction method for simulation software provided in an embodiment of this application is shown below. Figure 17 As shown, a data interaction method for simulation software includes:
[0209] S1701: The data server sends simulation commands to the control server through the interactive channel.
[0210] The control server is built in simulation software; the interaction channel between the control server and the data server is built based on the interaction port.
[0211] S1702: The data server receives simulation data.
[0212] The simulation data is collected in real time by the control server after receiving the simulation command; the simulation data is sent by the control server to the data server through the interaction port; the simulation data is the operating data of the external device.
[0213] S1703: The data server displays the simulation data.
[0214] As an optional embodiment, the method further includes:
[0215] Based on the simulation data, it is determined whether the external device is faulty. If the determination result indicates that the external device is faulty, the parameters of the external device are corrected.
[0216] As an optional implementation, the setup of the control server specifically includes:
[0217] The simulation software responds to the first drag operation by dragging a blank subsystem template from the template library onto the canvas.
[0218] Upon receiving a double-click operation, the simulation software enters the configuration interface of the blank subsystem template.
[0219] Upon receiving the second drag-and-drop operation, the simulation software drags the control server from the template library to the configuration interface, thereby obtaining the control server's settings interface.
[0220] Upon receiving the setting data, the simulation software adds the setting data to the setting interface, thus completing the setup of the control server.
[0221] As an optional embodiment, the parameter configuration of the control server specifically includes:
[0222] Upon receiving configuration data, the simulation software configures the parameters of the control server; the configuration data includes at least the template name, address, interaction port, number of sampling steps, input / output port name, initial value, variable type, and data type.
[0223] As an optional implementation, the construction of the interaction channel specifically includes:
[0224] The simulation software constructs an interaction channel between the control server and the data server based on the interaction port, enabling the data server to access the control server through the interaction port.
[0225] Based on the data interaction method for simulation software provided in the foregoing embodiments, this application also provides a data interaction device for simulation software applied to a data server. For example... Figure 18 As shown, Figure 18 A structural diagram of a data interaction device for simulation software applied to a data server, provided in an embodiment of this application, includes:
[0226] The sending module is used to send simulation commands to the control server through an interaction channel; the control server is built in the simulation software; the interaction channel between the control server and the data server is built based on the interaction port.
[0227] The second receiving module is used to receive simulation data; the simulation data is collected in real time by the control server after receiving the simulation command; the simulation data is sent by the control server to the data server through the interaction port; the simulation data is the operating data of the external device.
[0228] The display module is used to display the simulation data.
[0229] As an optional embodiment, a data interaction device for simulation software applied to a data server further includes:
[0230] The correction module is used to determine whether the external device has a fault based on the simulation data. If the determination result indicates that the external device has a fault, the parameters of the external device are corrected.
[0231] As an optional implementation, the setup of the control server specifically includes:
[0232] The simulation software responds to the first drag operation by dragging a blank subsystem template from the template library onto the canvas.
[0233] Upon receiving a double-click operation, the simulation software enters the configuration interface of the blank subsystem template.
[0234] Upon receiving the second drag-and-drop operation, the simulation software drags the control server from the template library to the configuration interface, thereby obtaining the control server's settings interface.
[0235] Upon receiving the setting data, the simulation software adds the setting data to the setting interface, thus completing the setup of the control server.
[0236] As an optional embodiment, the parameter configuration of the control server specifically includes:
[0237] Upon receiving configuration data, the simulation software configures the parameters of the control server; the configuration data includes at least the template name, address, interaction port, number of sampling steps, input / output port name, initial value, variable type, and data type.
[0238] As an optional implementation, the construction of the interaction channel specifically includes:
[0239] The simulation software constructs an interaction channel between the control server and the data server based on the interaction port, enabling the data server to access the control server through the interaction port.
[0240] This application provides a computer device, including: simulation software and a data server.
[0241] Simulation software executes computer programs to achieve Figure 1 The data interaction method of the simulation software.
[0242] The data server executes computer programs to achieve Figure 17 The data interaction method of the simulation software.
[0243] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a data interaction method for simulation software.
[0244] This application provides a computer program product, including a computer program that, when executed by a processor, implements a data interaction method for simulation software.
[0245] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and equipment embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components indicated as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0246] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data interaction method for simulation software, characterized in that, The method is applied to simulation software, and the method includes: Set up the control server; Configure the parameters of the control server and build an interaction channel between the control server and the data server based on the interaction port; Upon receiving the simulation command, the interaction port between the control server and the data server is opened; The simulation data is collected in real time by the control server; the simulation data is the operating data of external devices. The simulation data is sent to the data server via the interaction port.
2. The data interaction method for simulation software according to claim 1, characterized in that, The establishment of the control server specifically includes: In response to receiving the first drag operation, drag the blank subsystem template from the template library to the canvas; Upon receiving a double-click operation, the configuration interface of the blank subsystem template is entered; In response to receiving a second drag-and-drop operation, the control server in the template library is dragged to the configuration interface to obtain the settings interface of the control server; In response to receiving the setting data, the setting data is added to the setting interface, thus completing the setup of the control server.
3. The data interaction method for simulation software according to claim 1, characterized in that, The step of configuring parameters for the control server and establishing an interaction channel between the control server and the data server based on the interaction port specifically includes: In response to receiving configuration data, the control server is configured with parameters; the configuration data includes at least template name, address, interaction port, number of sampling steps, input / output port name, initial value, variable type, and data type. An interaction channel is established between the control server and the data server based on the interaction port, enabling the data server to access the control server through the interaction port.
4. The data interaction method for simulation software according to claim 1, characterized in that, The step of opening the interaction port between the control server and the data server after receiving the simulation command also includes: A first server is set up in the simulation software; Establish an interaction channel between the first server and the control server.
5. A data interaction method for simulation software, characterized in that, The method is applied to a data server, and the method includes: Simulation commands are sent to the control server via an interactive channel; the control server is built within simulation software; the interactive channel between the control server and the data server is constructed based on an interactive port. The system receives simulation data; the simulation data is collected in real time by the control server after receiving the simulation command; the simulation data is sent by the control server to the data server through the interaction port; the simulation data is the operating data of the external device. The simulation data is then displayed.
6. The data interaction method for simulation software according to claim 5, characterized in that, The method further includes: Based on the simulation data, it is determined whether the external device is faulty. If the determination result indicates that the external device is faulty, the parameters of the external device are corrected.
7. A data interaction device for simulation software, characterized in that, The data interaction device for the simulation software is used in the simulation software, and the device includes: The module is used to build the control server; The configuration module is used to configure parameters of the control server and build an interaction channel between the control server and the data server based on the interaction port. The first receiving module is used to open the interaction port between the control server and the data server after receiving the simulation command. The data acquisition module is used to acquire simulation data in real time based on the control server; the simulation data is the operating data of external devices. An interaction module is used to send the simulation data to a data server via the interaction port.
8. A data interaction device for simulation software, characterized in that, The data interaction device of the simulation software is applied to the data server, and the device includes: The sending module is used to send simulation commands to the control server through an interaction channel; the control server is built in the simulation software; the interaction channel between the control server and the data server is built based on the interaction port. The second receiving module is used to receive simulation data; the simulation data is collected in real time by the control server after receiving the simulation command; the simulation data is sent by the control server to the data server through the interaction port; the simulation data is the operating data of the external device. The display module is used to display the simulation data.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the data interaction method of the simulation software as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the data interaction method of the simulation software as described in any one of claims 1-6.