Simulation system and method and computer readable storage medium

By constructing a simulation system comprising a web-based terminal, a server-side terminal, a data processing terminal, and a simulation tool terminal, the problems of cumbersome integration and inconvenient updates of simulation models in the B/S architecture are solved. This enables model preview and online simulation in a client-side environment without simulation capabilities, reducing deployment difficulty and maintenance costs.

CN120803965APending Publication Date: 2025-10-17CRRC INDUSTRAIL ACADEMY (QINGDAO) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510943077.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

When developing a B/S architecture software platform, the existing technology integrates simulation models in a clumsy way, and has weak portability and accessibility. When the model is updated, each client needs to be updated, which makes maintenance inconvenient.

Method used

A simulation system is constructed, consisting of a web-based interface, a server-side interface, a data processing interface, and a simulation tool interface. The simulation environment is deployed on the server-side, and the model preview and online simulation are realized through the web-based interface. Transmission Control Protocol (TCP) and WebSocket are used for data transmission and command processing to ensure communication consistency across all ports.

Benefits of technology

It enables model preview and online simulation in a client-side environment without simulation, reducing the difficulty of deploying simulation models and eliminating the need for updates on each client when the model is updated, thus improving the convenience of model maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803965A_ABST
    Figure CN120803965A_ABST
Patent Text Reader

Abstract

The invention discloses a simulation system and method and a computer readable storage medium, and relates to the technical field of software development, and the simulation system comprises a webpage end, a server end, a data processing end and a simulation tool end. According to the simulation system, the simulation environment is deployed to the server side, preview and online simulation of a simulation model at the webpage side can be realized through the webpage side, the server side, the data processing side and the simulation tool side, model preview and online simulation can also be realized under the condition that the client side does not have the simulation environment, remote visual simulation is realized, and the simulation efficiency is improved. The deployment difficulty of the simulation model is reduced, each client does not need to update the model during model updating, and model maintenance is more facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software development, in particular to a simulation system and method and a computer readable storage medium. BACKGROUND

[0002] Currently, when developing a software platform of B / S (Browser / Server) architecture, the integration of a simulation model is usually encountered. Generally, the simulation model is deployed separately, and then the simulation model is pulled up by the server. However, this way is relatively cumbersome, has weak portability, has weak accessibility, and needs each accessed client to install a simulation environment to be able to realize. And when the model is modified, each client needs to update the model, which is not conducive to model maintenance. Therefore, how to solve the above technical defects has become a technical problem to be solved by the technical personnel in the field. SUMMARY

[0003] The purpose of the present application is to provide a simulation system and method and a computer readable storage medium, which can preview and online simulation under the condition that the client does not have a simulation environment, and do not need to update the model for each client when the model is updated, which is more conducive to model maintenance.

[0004] To solve the above technical problems, the present application provides a simulation system, comprising: a web page end, a server end, a data processing end and a simulation tool end; The web page end is used for rendering a model according to a web view file obtained from the server end, sending a command to the server end, processing data sent by the server end or rendering into a graph; The server end is used for managing the web view file, processing the command sent by the web page end or transmitting the command to the data processing end, receiving data sent by the simulation tool end and sending data to the web page end; The data processing end is used for processing the command transmitted by the server end or transmitting the command to the simulation tool end, processing parameters of the simulation tool end; The simulation tool end is used for creating a model, exporting the model into a web view file and uploading to the server end, processing the command and returning data to the server end.

[0005] In some embodiments, the server end is used for receiving data sent by the simulation tool end through a first transmission control protocol service, and asynchronously throwing in the form of an application message event, and sending data to the web page end when the application message event is listened to.

[0006] In some embodiments, the data processing end is used for processing the command transmitted by the server end through a second transmission control protocol service, and communicating with the simulation tool end through a built-in interface.

[0007] In some embodiments, the simulation tool end is configured to combine data through multiplexer; and send data to the service end through a transmission control protocol client.

[0008] In some embodiments, the webpage end is configured to have a function of operating a model, and have a function of modifying parameters of a module.

[0009] In some embodiments, the data processing end is a MATLAB end, and the simulation tool end is a Simulink end.

[0010] In some embodiments, the webpage end, the service end, the data processing end and the simulation tool end use the same data format when communicating.

[0011] In some embodiments, the data format includes a command, a model name, a module name, a module parameter key, a module value, a module parameter key array and a module value array.

[0012] To solve the above technical problems, the application further provides a simulation method, comprising: rendering a model according to a webpage view file obtained from the service end through the webpage end, sending a command to the service end, processing data sent by the service end or rendering into a graph; processing a command sent by the webpage end or transmitting the command to the data processing end through the service end, receiving data sent by the simulation tool end and sending the data to the webpage end; processing a command transmitted by the service end or transmitting the command to the simulation tool end through the data processing end, processing parameters of the simulation tool end; creating a model through the simulation tool end, exporting the model into a webpage view file and uploading the model to the service end, processing the command and returning data to the service end.

[0013] To solve the above technical problems, the application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement steps of the simulation method.

[0014] To solve the above technical problems, the application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement steps of the simulation method.

[0015] The simulation system provided in the present application includes: a web page end, a server end, a data processing end and a simulation tool end; the web page end is used to render a model according to a web view file obtained from the server end, send commands to the server end, process the data sent by the server end or render it into a picture; the server end is used to manage the web view file, process the commands sent by the web page end or pass the commands to the data processing end, receive the data sent by the simulation tool end and send the data to the web page end; the data processing end is used to process the commands transmitted by the server end or pass the commands to the simulation tool end, and process the parameters of the simulation tool end; the simulation tool end is used to create a model, export the model as a web view file and upload it to the server end, process the commands, and return data to the server end.

[0016] It can be seen that the simulation system provided by this application constructs four ends: a web page end, a server end, a data processing end, and a simulation tool end, and deploys the simulation environment to the server end. Through the web page end, the server end, the data processing end, and the simulation tool end, the simulation model can be previewed and simulated online on the web page end. Even if the client does not have a simulation environment, the model can be previewed and simulated online, realizing remote visual simulation, reducing the difficulty of deploying the simulation model, and when the model is updated, it is not necessary for each client to update the model, which is more conducive to model maintenance.

[0017] The simulation method and computer-readable storage medium provided in this application both have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the prior art and the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A schematic diagram of a simulation system provided in an embodiment of the present application; Figure 2 A schematic diagram of a web page provided in an embodiment of the present application; Figure 3 A schematic diagram of a server provided in an embodiment of the present application; Figure 4 A schematic diagram of a MATLAB terminal provided in an embodiment of the present application; Figure 5 A schematic diagram of a Simulink terminal provided in an embodiment of the present application; Figure 6A four-terminal interaction schematic diagram provided by an embodiment of the present application; Figure 7 A simulation method schematic diagram provided by an embodiment of the present application. DETAILED DESCRIPTION

[0020] The core of the present application is to provide a simulation system, method and computer readable storage medium, which can preview and online simulate a model without a simulation environment on a client side, and does not need to update the model on each client side when the model is updated, and is more conducive to model maintenance.

[0021] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in a clear and complete manner with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0022] Reference is made to Figure 1 , Figure 1 A simulation system schematic diagram provided by an embodiment of the present application, as shown in Figure 1 , the simulation system comprises: a webpage end 10, a server end 20, a data processing end 30 and a simulation tool end 40; The webpage end 10 is configured to render a model according to a webpage view file obtained from the server end 20, send a command to the server end 20, process data sent by the server end 20 or render a graph; The server end 20 is configured to manage the webpage view file, process a command sent by the webpage end 10 or transmit the command to the data processing end 30, receive data sent by the simulation tool end 40 and send data to the webpage end 10; The data processing end 30 is configured to process a command transmitted by the server end 20 or transmit the command to the simulation tool end 40, and process a parameter of the simulation tool end 40; The simulation tool end 40 is configured to create a model, export the model as a webpage view file and upload the model to the server end 20, process the command and return data to the server end 20.

[0023] The simulation system provided by the embodiment includes four ends, namely a webpage end 10, a server end 20, a data processing end 30, and a simulation tool end 40. In some embodiments, the data processing end 30 is a MATLAB end, and the simulation tool end 40 is a Simulink end. The server deploys a MATLAB and Simulink environment. A TCP (Transmission Control Protocol) service script is created to receive the request of the server end 20, analyze the command of the server end 20, process the command and return a response, or transmit to the Simulink end through the TCP script. A server end project is created, which is used to connect the webpage end 10, the MATLAB end, and the Simulink end. The server end project is the server end of the webpage end 10 and the server end of the Simulink end, and is also the client end of the MATLAB end. A webpage end project is created. The framework of the webpage end project is not limited, for example, it can be Vue / React / ... and the like.

[0024] In some embodiments, the webpage end 10 has the function of operating the model and the function of modifying the parameters of the module.

[0025] The webpage end 10 can send a request to the server end 20 according to the model name to obtain the webpage view file of the model. The webpage end 10 renders the model according to the webpage view file, constructs the parameter query and modification logic of the module according to the structured data of the model, and constructs the model operation (for example, starting, pausing, stepping, stepping back, stopping, and the like). The user can preview and simulate the model on the webpage end 10.

[0026] Reference Figure 2 As shown, the webpage end 10 obtains the webpage view file uploaded by the user from the server end 20 according to the model name. The visualization view file is parsed and integrated with zoom-in, zoom-out, drag-and-drop, and other convenient operation capabilities. After the model is rendered, clicking the module can display the module name, type, parameter, and the like. If the module is a subsystem module, double-clicking the subsystem module can load the visualization view file of the subsystem.

[0027] The webpage end 10 adds operation capabilities for the model, such as starting, pausing, stepping, stepping back, and the like. The webpage end 10 adds parameter modification capabilities for the module, and each parameter can be individually issued a modification instruction. The webpage end 10 obtains the real-time simulation parameters of the module. After the simulation is started, the webpage end 10 receives the data sent by the server end 20, renders the received data into a graph, or performs a specified operation according to the data type.

[0028] The server 20 creates a model table to manage the webpage view file of the uploaded model. The server 20 sends the webpage view file to the webpage 10, and the webpage 10 renders the model according to the webpage view file. In addition, the server 20 receives the request of the webpage 10 and transmits the request to the data processing end 30 after being transparently transmitted or processed.

[0029] In some embodiments, the server 20 is configured to receive the data sent by the simulation tool end 40 through a first transmission control protocol service, and asynchronously throw the data in the form of an application message event. When the application message event is listened to, the data is sent to the webpage 10.

[0030] Reference Figure 3 As shown, the server 20 creates a TCP service (the TCP service created by the server 20 is referred to as a first transmission control protocol service) to receive the data sent by the Simulink end through a transmission control protocol client, and then asynchronously throws the data in the form of an application message event. When the application message event is listened to, the data is sent to the webpage 10 through a WebSocket (a duplex network communication protocol) or other communication mode, and the webpage 10 performs rendering or other operations according to the data type. In addition, the server 20 receives the request of the webpage 10 and transmits the request to the TCP service created by MATLAB after being transparently transmitted or processed.

[0031] The data processing end 30 processes the commands transmitted by the server 20, such as loading a model, starting simulation, pausing simulation, obtaining a real-time value of a model parameter, and setting a value of a model execution parameter. In addition, the data processing end 30 communicates with the simulation tool end 40 and can obtain, set, and execute the parameters exposed by the simulation tool end 40.

[0032] In some embodiments, the data processing end 30 is configured to process the commands transmitted by the server 20 through a second transmission control protocol service, and communicate with the simulation tool end 40 through a built-in interface.

[0033] Reference Figure 4 As shown, the MATLAB end creates a TCP service (the TCP service created by the MATLAB end is referred to as a second transmission control protocol service). Through the created TCP service, the MATLAB end can parse and process the commands transmitted by the server 20, such as loading a model, starting simulation, pausing simulation, obtaining a real-time value of a model parameter, and setting a value of a specified model parameter. The MATLAB end can communicate with the Simulink end by using the built-in interfaces get_param and set_param of MATLAB, to obtain, set, and execute all the parameters exposed by the Simulink model.

[0034] The simulation tool end 40 creates a model, exports the model into a webpage view file, and uploads the webpage view file to the service end 20.

[0035] In some embodiments, the simulation tool end 40 is configured to combine data through a multiplexer and send the data to the service end 20 through a transmission control protocol client.

[0036] Reference Figure 5 As shown in the figure, after the Simulink end model is created, a multiplexer and a TCP client are additionally added. The multiplexer is configured to combine exposed data together. The TCP client is configured to send the data to the service end 20. For example, as shown in the figure, the Simulink end sends clock and sine wave data to the service end 20. Figure 5 Figure 5 The TCP sending module shown in the figure is a transmission control protocol client.

[0037] In some embodiments, the webpage end 10, the service end 20, the data processing end 30, and the simulation tool end 40 use the same data format when communicating.

[0038] The webpage end 10, the service end 20, the data processing end 30, and the simulation tool end 40 use the same data format when communicating, which can reduce the data parsing pressure.

[0039] In some embodiments, the data format includes a command, a model name, a module name, a module parameter key, a module value, a module parameter key array, and a module value array.

[0040] The webpage end 10, the service end 20, the data processing end 30, and the simulation tool end 40 use the same data format when communicating, which can reduce the data parsing pressure. { “command”: “”, / / command “model”: “”, / / model name “block”: “”, / / module name “key”: “”, / / module parameter key “value”: “”, / / module value “keys”: [], / / module parameter key array “values”: [], / / module value array }.

[0041] Reference Figure 6 ​As shown, the following describes an embodiment of communication interaction between a webpage end 10, a server end 20, a data processing end 30, and a simulation tool end 40: The user can input a model name, and then the webpage end 10 requests the server end 20 to obtain the webpage view file of the corresponding model according to the model name, and renders the model after receiving the webpage view file of the model.

[0042] The webpage end 10 requests the server end 20 to perform operations, such as starting, pausing, stopping, and the like.

[0043] The server end 20 processes the operation or sends it to the MATLAB end for processing.

[0044] The MATLAB end analyzes and processes the data or sends it to the Simulink end for processing.

[0045] The Simulink end performs the operation and returns it to the MATLAB end or sends it to the server end 20 through a transmission control protocol client.

[0046] The server end 20 receives the data sent by the Simulink end, analyzes it, and throws it in the form of an event in the application.

[0047] The server end 20 internally listens to the event and sends the data to the webpage end 10 through a WebSocket or other duplex communication protocol.

[0048] The webpage end 10 listens to the message, processes the data according to the message type, or renders it into a graph.

[0049] The webpage end 10 can preview the model. After performing simulation, the webpage end 10 obtains the data and renders it into a graph, for example, a curve graph of power, voltage, and the like obtained by the webpage end. In addition, the webpage end 10 can modify the parameters of each module of the model and operate the running state of the model to realize online simulation.

[0050] In summary, the simulation system provided in the present application constructs four ends of a webpage end, a server end, a data processing end, and a simulation tool end, deploys the simulation environment to the server end, and through the webpage end, the server end, the data processing end, and the simulation tool end, can realize preview and online simulation of the simulation model in the webpage end, can realize model preview and online simulation in the case that the client end does not have a simulation environment, realizes remote visual simulation, reduces the deployment difficulty of the simulation model, and when the model is updated, does not need to update the model of each client end, which is more conducive to model maintenance.

[0051] The present application also provides a simulation method, please refer to Figure 7 , Figure 7 A flowchart of a simulation method provided in an embodiment of the present application is shown in Figure 7 , and the method comprises: S101: rendering a model according to a webpage view file obtained from the service end through a webpage end, sending a command to the service end, processing data sent by the service end or rendering into a graph; S102: managing the webpage view file through the service end, processing a command sent by the webpage end or transmitting the command to the data processing end, receiving data sent by the simulation tool end and sending data to the webpage end; S103: processing a command transmitted by the service end through the data processing end or transmitting the command to the simulation tool end, processing parameters of the simulation tool end; S104: through the simulation tool end, creating a model, exporting the model into a webpage view file and uploading to the service end, processing the command and returning data to the service end.

[0052] On the basis of the above embodiment, as a specific implementation, the service end receives data sent by the simulation tool end through a first transmission control protocol service and asynchronously throws out in the form of an application message event, and when the application message event is listened to, data is sent to the webpage end.

[0053] On the basis of the above embodiment, as a specific implementation, the data processing end processes a command transmitted by the service end through a second transmission control protocol service; and communicates with the simulation tool end through a built-in interface.

[0054] On the basis of the above embodiment, as a specific implementation, the simulation tool end combines data through a multiplexer; and sends data to the service end through a transmission control protocol client.

[0055] On the basis of the above embodiment, as a specific implementation, the webpage end has a function of operating a model and a function of modifying parameters of a module.

[0056] On the basis of the above embodiment, as a specific implementation, the data processing end is a MATLAB end and the simulation tool end is a Simulink end.

[0057] On the basis of the above embodiment, as a specific implementation, the webpage end, the service end, the data processing end and the simulation tool end use the same data format when communicating.

[0058] On the basis of the above embodiment, as a specific implementation, the data format includes a command, a model name, a module name, a module parameter key, a module value, a module parameter key array and a module value array.

[0059] The simulation method provided in the application constructs four ends of a webpage end, a server end, a data processing end and a simulation tool end, deploys a simulation environment to the server end, and through the webpage end, the server end, the data processing end and the simulation tool end, the preview and online simulation of the simulation model on the webpage end can be realized, the model preview and online simulation can also be realized in the case that the client end does not have a simulation environment, remote visual simulation is realized, the deployment difficulty of the simulation model is reduced, and when the model is updated, each client end does not need to update the model, which is more beneficial to model maintenance.

[0060] The application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to realize the following steps: The computer readable storage medium can include a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and various storage program codes.

[0061] The computer readable storage medium can include a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and various storage program codes.

[0062] The computer readable storage medium provided in the application is introduced in the above method embodiments, and the application will not be described here.

[0063] The computer readable storage medium provided in the application constructs four ends of a webpage end, a server end, a data processing end and a simulation tool end, deploys a simulation environment to the server end, and through the webpage end, the server end, the data processing end and the simulation tool end, the preview and online simulation of the simulation model on the webpage end can be realized, the model preview and online simulation can also be realized in the case that the client end does not have a simulation environment, remote visual simulation is realized, the deployment difficulty of the simulation model is reduced, and when the model is updated, each client end does not need to update the model, which is more beneficial to model maintenance.

[0064] The application further provides a computer program product, and the computer program product includes a computer program. rendering model according to the webpage view file obtained from the service end, sending a command to the service end, processing data sent by the service end or rendering into a graph; managing the webpage view file by the service end, processing the command sent by the webpage end or transmitting the command to the data processing end, receiving data sent by the simulation tool end and sending data to the webpage end; processing the command transmitted by the service end or transmitting the command to the simulation tool end by the data processing end, processing parameters of the simulation tool end; creating a model by the simulation tool end, exporting the model as a webpage view file and uploading to the service end, processing the command and returning data to the service end.

[0065] The various embodiments described in the specification are progressive in nature, and each embodiment focuses on the differences from other embodiments. The same or similar parts between embodiments can be referred to each other. For the apparatus, device and computer readable storage medium disclosed by the embodiments, since they correspond to the method disclosed by the embodiments, the description is relatively simple, and the relevant part can be referred to the method part.

[0066] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0067] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.

[0068] The simulation system, method and computer readable storage medium provided by the present application are described in detail above. The principles and implementation methods of the present application are described by applying specific examples. The above description of the examples is only to help understand the method and its core idea of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.

Claims

1. A simulation system, characterized in that: include: Web page, server, data processing and simulation tool; The web page end is used to send commands to the server end according to the web page view file rendering model obtained from the server end, process the data sent by the server end, or render it into a picture; The server is configured to manage the web page view file, process commands sent by the web page or transparently transmit the commands to the data processing end, receive data sent by the simulation tool end, and send data to the web page end; The data processing end is used to process the commands transmitted by the server end or transparently transmit the commands to the simulation tool end, and process the parameters of the simulation tool end; The simulation tool side is used to create a model, export the model as a web view file and upload it to the server side, process the command, and return data to the server side.

2. The simulation system according to claim 1, wherein: The server is used to receive data sent by the simulation tool end through a first transmission control protocol service, and asynchronously throw it in the form of an application message event. When an application message event is monitored, the data is sent to the web page end.

3. The simulation system according to claim 1, wherein: The data processing end is used to process the commands transmitted by the server end through a second transmission control protocol service; and communicate with the simulation tool end through a built-in interface.

4. The simulation system according to claim 1, wherein: The simulation tool end is used to combine data through a multiplexer; and send the data to the server end through a transmission control protocol client.

5. The simulation system according to claim 1, wherein: The web page has the function of operating the model and modifying the parameters of the module.

6. The simulation system according to claim 1, wherein: The data processing end is a MATLAB end, and the simulation tool end is a Simulink end.

7. The simulation system according to claim 1, wherein: The web page end, the server end, the data processing end and the simulation tool end use the same data format when communicating.

8. The simulation system according to claim 7, characterized in that: The data format includes command, model name, module name, module parameter key, module value, module parameter key array and module value array.

9. A simulation method, characterized in that: include: Sending a command to the server through the web page according to the web view file rendering model obtained from the server, processing the data sent by the server or rendering it into a picture; The server manages the web page view file, processes commands sent by the web page or transparently transmits the commands to the data processing end, receives data sent by the simulation tool end and sends the data to the web page end; Processing the command transmitted by the server through the data processing end or transparently transmitting the command to the simulation tool end, and processing the parameters of the simulation tool end; A model is created through the simulation tool end, the model is exported as a web view file and uploaded to the server end, the command is processed, and data is returned to the server end.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which implements the steps of the simulation method according to claim 9 when executed by a processor.