Process simulation method, device, platform, medium and product based on custom module of process simulation software
By judging and calling CPU control instructions corresponding to custom scripts in the process simulation software, the problem of low code execution performance of process simulation software in the prior art is solved, and the effect of quickly obtaining process simulation results is achieved.
Patent Information
- Application Number
- CN202411481116.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-23
AI Technical Summary
When existing process simulation software executes custom scripts, the code execution performance is low, resulting in a long time to obtain process simulation results.
By judging whether there are CPU control instructions corresponding to custom scripts stored in the process simulation software, if they exist, these instructions are called directly to generate process simulation results to avoid executing custom scripts.
It effectively improves the execution performance of the code and shortens the acquisition time of process simulation results.
Smart Images

Figure CN119003045B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of process simulation software, and in particular to a process simulation method, device, platform, medium and product based on a custom module of process simulation software. Background Art
[0002] Process simulation is a key technology, usually used to analyze, optimize and design factory process flows. Therefore, process simulation software is needed to perform process simulation. The execution speed of the process simulation algorithm is an important indicator of the quality of a process simulation software. A higher execution speed helps users get the results predicted by the process simulation software in a shorter time. Since all walks of life have different degrees of customization requirements for process simulation algorithms, general process simulation software will provide custom modules, which provide custom script writing functions to facilitate users to call the basic algorithms of the software platform, thereby quickly implementing custom algorithm logic.
[0003] At present, most process simulation software is developed based on .Net technology, and open source script interpreter components such as IronPython and Jint are generally used to implement the parsing and execution functions of custom scripts. Although development is relatively convenient, the code execution performance is average. Summary of the invention
[0004] The present invention provides a process simulation method, device, platform, medium and product based on a custom module of process simulation software. When performing process simulation based on the process simulation software, the execution performance of the code can be effectively improved and the process simulation results can be quickly obtained.
[0005] According to one aspect of the present invention, a process simulation method based on a custom module of process simulation software is provided, comprising:
[0006] In response to a process simulation event being triggered, obtaining a process simulation custom script; wherein the process simulation custom script is a process simulation script written by a user in a custom module of the process simulation software;
[0007] Determining whether the process simulation software stores a CPU control instruction corresponding to the process simulation custom script;
[0008] If the process simulation software stores a CPU control instruction corresponding to the process simulation custom script, the CPU control instruction is called to generate a process simulation result.
[0009] According to another aspect of the present invention, there is provided a process simulation device based on a custom module of process simulation software, comprising:
[0010] A custom script acquisition module, used for acquiring a process simulation custom script in response to a process simulation event being triggered; wherein the process simulation custom script is a process simulation script written by a user in a custom module of the process simulation software;
[0011] A CPU control instruction judgment module is used to judge whether the process simulation software stores a CPU control instruction corresponding to the process simulation custom script;
[0012] The process simulation result generating module is used to call the CPU control instruction corresponding to the process simulation custom script to generate the process simulation result if the process simulation software stores the CPU control instruction.
[0013] According to another aspect of the present invention, a process simulation platform is provided, the process simulation platform comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the process simulation method based on the custom module of the process simulation software described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the process simulation method based on a custom module of process simulation software as described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is provided, which includes a computer program. When the computer program is executed by a processor, it implements the process simulation method based on the process simulation software custom module described in any embodiment of the present invention.
[0019] The process simulation solution based on the process simulation software custom module of the embodiment of the present invention obtains the process simulation custom script in response to the process simulation event being triggered; wherein the process simulation custom script is a process simulation script written by the user in the custom module of the process simulation software; it is determined whether the process simulation software stores a CPU control instruction corresponding to the process simulation custom script; if the process simulation software stores a CPU control instruction corresponding to the process simulation custom script, the CPU control instruction is called to generate a process simulation result. Through the technical solution provided by the embodiment of the present invention, when performing process simulation based on the process simulation software, the execution performance of the code can be effectively improved and the process simulation result can be quickly obtained.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A flowchart of a process simulation method based on a custom module of process simulation software provided in Embodiment 1 of the present invention;
[0023] Figure 2 A flowchart of a process simulation method based on a custom module of process simulation software provided in Embodiment 2 of the present invention;
[0024] Figure 3 A schematic diagram of the structure of a process simulation device based on a custom module of process simulation software provided in Embodiment 3 of the present invention;
[0025] Figure 4 A schematic diagram of the structure of a process simulation platform for implementing a process simulation method based on a process simulation software custom module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Embodiment 1
[0029] Figure 1 A flowchart of a process simulation method based on a process simulation software custom module is provided for the first embodiment of the present invention. This embodiment is applicable to the case of simulating a process applied to the process simulation software. The method can be executed by a process simulation device based on a process simulation software custom module. The process simulation device based on a process simulation software custom module can be implemented in the form of hardware and / or software. The process simulation device based on a process simulation software custom module can be configured in a process simulation platform. Figure 1 As shown, the method includes:
[0030] S110. In response to a process simulation event being triggered, obtaining a process simulation custom script; wherein the process simulation custom script is a process simulation script written by a user in a custom module of the process simulation software.
[0031] In an embodiment of the present invention, when a process simulation instruction input by a user is received, it is determined that a process simulation event is triggered. In response to the process simulation event being triggered, a process simulation custom script written by the user in a custom module of the process simulation software is obtained. Among them, the process simulation custom script can be a script file that simulates a certain algorithm in the chemical industry. For example, the process simulation custom script can be a script file that simulates an algorithm for measuring the temperature and pressure of water. For example, the process simulation custom script can be a process simulation script file that models the equipment in a chemical plant. It should be noted that the embodiment of the present invention does not limit the type of process simulation (that is, the simulation function) executed by the process simulation custom script.
[0032] S120: Determine whether the process simulation software stores a CPU control instruction corresponding to the process simulation custom script.
[0033] In an embodiment of the present invention, if a process simulation custom script is run, a CPU control instruction corresponding to the process simulation custom script is generated. Therefore, before running the process simulation custom script, it is determined whether the process simulation software stores the CPU control instruction corresponding to the process simulation custom script, that is, it is determined whether the process simulation custom script is run for the first time. If the process simulation custom script is run for the first time, the process simulation software does not store the CPU control instruction corresponding to the process simulation custom script.
[0034] S130. If the process simulation software stores a CPU control instruction corresponding to the process simulation custom script, the CPU control instruction is called to generate a process simulation result.
[0035] In an embodiment of the present invention, if the process simulation software stores a CPU control instruction corresponding to the process simulation custom script, the CPU control instruction can be directly called, that is, the CPU control instruction is executed, so as to generate the process simulation result. It is understandable that if the process simulation software stores a CPU control instruction corresponding to the process simulation custom script, the process simulation custom script can be avoided from running, and the process simulation result can be quickly generated by directly calling the CPU control instruction corresponding to the process simulation custom script.
[0036] The process simulation method based on the process simulation software custom module of the embodiment of the present invention obtains the process simulation custom script in response to the process simulation event being triggered; wherein the process simulation custom script is a process simulation script written by the user in the custom module of the process simulation software; it is determined whether the process simulation software stores a CPU control instruction corresponding to the process simulation custom script; if the process simulation software stores a CPU control instruction corresponding to the process simulation custom script, the CPU control instruction is called to generate a process simulation result. Through the technical solution provided by the embodiment of the present invention, when performing process simulation based on the process simulation software, the execution performance of the code can be effectively improved and the process simulation result can be quickly obtained.
[0037] In some embodiments, if the process simulation software does not store the CPU control instructions corresponding to the process simulation custom script, the process simulation custom script is parsed to determine the script syntax information of the process simulation custom script; an assembly file corresponding to the process simulation custom script is generated based on the script syntax information, and a CPU control instruction is generated based on the assembly file; the CPU control instruction is stored, and the CPU control instruction is run to generate a process simulation result.
[0038] Exemplarily, if the process simulation software does not store the CPU control instructions corresponding to the process simulation custom script, it means that the process simulation custom script is run for the first time, that is, the user performs the process simulation of the corresponding algorithm based on the written process simulation custom script for the first time. At this time, the process simulation custom script is parsed to determine the script syntax information of the process simulation custom script. Exemplarily, the process simulation custom script can be parsed based on a preset syntax parsing algorithm to determine the script syntax information of the process simulation custom script. Another exemplary method is to input the process simulation custom script into a pre-trained script syntax parsing model, and determine the script syntax information of the process simulation custom script according to the output result of the script syntax parsing model, wherein the script syntax parsing model is a pre-trained deep neural network model. Optionally, the process simulation custom script is parsed to determine the script syntax information of the process simulation custom script, including: parsing the process simulation custom script based on a regular expression to determine the script syntax type of the process simulation custom script; and determining the script syntax information of the process simulation custom script based on the script syntax type. Exemplarily, a regular expression is used to parse the script written by the user in the custom module (that is, the process simulation custom script) to determine the script syntax type involved in the process simulation custom script. Among them, the script syntax type may include the assignment statement syntax type, the if statement syntax type and the call statement syntax type. The script syntax information of the process simulation custom script is determined according to the script syntax type. Exemplarily, if the script syntax type of the process simulation custom script is the assignment statement syntax type, the variable name and variable type on the left side of the assignment statement are extracted from the process simulation custom script, and the syntax type of the right part of the assignment statement is determined. If the syntax type of the right part of the assignment statement is a constant, the constant value is extracted from the right part of the assignment statement. If the syntax type of the right part of the assignment statement is not a constant, the script syntax type of the process simulation custom script is further re-analyzed. The variable name and variable type on the left side of the assignment statement in the process simulation custom script, and the constant value extracted from the right part of the assignment statement are used as the script syntax information of the process simulation custom script. If the script syntax type of the process simulation custom script is the if statement syntax type, the if statement in the process simulation custom script is parsed, and the code segment in the curly braces is extracted from the if statement, and the code segment extracted from the curly braces in the if statement is used as the script syntax information of the process simulation custom script. If the script syntax type of the process simulation custom script is the call statement syntax type, the call statement in the process simulation custom script is parsed, and the function name and function parameters are extracted from the call statement, and the function name and function parameters extracted from the call statement are used as the script syntax information of the process simulation custom script.
[0039] In an embodiment of the present invention, an assembly file corresponding to the process simulation custom script is generated according to the script syntax information, wherein the assembly file is a .dll assembly file that can run in the .NET environment. Optionally, the assembly file corresponding to the process simulation custom script is generated based on the script syntax information, including: generating intermediate language IL instructions from the script syntax information through the .NET framework; wherein the intermediate language IL instructions are instructions that can be directly operated by the user; and generating an assembly file corresponding to the process simulation custom script based on the intermediate language IL instructions. Exemplarily, the IL.Emit function provided by the .NET framework is used to create the required fields, properties, methods and other members through TypeBuilder, and the script syntax information is converted into logically consistent intermediate language IL (Intermediate Language) instructions through ILGenerator, wherein the intermediate language IL instructions are instructions that can be directly operated by the user. Create a .dll assembly file corresponding to the process simulation custom script based on the intermediate language IL instructions through AssemblyBuilder.
[0040] In an embodiment of the present invention, a CPU control instruction is generated based on an assembly file. Optionally, the CPU control instruction is generated based on the assembly file, including: dynamically calling the assembly file based on the reflection function of the .NET framework; compiling the assembly file into corresponding CPU control instructions through a JIT just-in-time compiler. Exemplarily, when performing process simulation through a custom module in a process simulation software, the reflection mechanism provided by the .NET framework is used to dynamically call a .dll assembly file, and the .dll assembly file is compiled into a CPU control instruction through a JIT just-in-time compiler, and the CPU control instruction is stored in the process simulation software, so that when performing process simulation through a process simulation custom script later, the CPU control instruction can be directly called, thereby enjoying the efficient execution performance of the native code. Run the CPU control instruction to generate a process simulation result.
[0041] Embodiment 2
[0042] Figure 2 A flowchart of a process simulation method based on a custom module of process simulation software provided in Embodiment 2 of the present invention is shown in FIG. Figure 2 As shown, the method includes:
[0043] S210. In response to a process simulation event being triggered, obtain a process simulation custom script; wherein the process simulation custom script is a process simulation script written by a user in a custom module of the process simulation software.
[0044] S220, determining whether the process simulation software stores a CPU control instruction corresponding to the process simulation custom script, if so, executing S230, otherwise, executing S240.
[0045] S230, calling the CPU control instruction to generate a process simulation result.
[0046] S240: Parse the process simulation custom script based on a regular expression to determine a script syntax type of the process simulation custom script.
[0047] S250: Determine script syntax information of the process simulation custom script based on the script syntax type.
[0048] S260, generating intermediate language IL instructions from the script syntax information through a .NET framework; wherein the intermediate language IL instructions are instructions that can be directly operated by the user.
[0049] S270. Generate an assembly file corresponding to the process simulation custom script based on the intermediate language IL instruction.
[0050] S280, dynamically calling the assembly file based on the reflection function of the .NET framework, and compiling the assembly file into corresponding CPU control instructions through a JIT just-in-time compiler.
[0051] S290, storing the CPU control instruction, and executing the CPU control instruction to generate a process simulation result.
[0052] The process simulation method based on the process simulation software custom module of the embodiment of the present invention can effectively improve the execution performance of the code and quickly obtain the process simulation results when performing process simulation based on the process simulation software.
[0053] Embodiment 3
[0054] Figure 3 The schematic diagram of the structure of a process simulation device based on a process simulation software custom module provided in the third embodiment of the present invention. Figure 3 As shown, the device comprises:
[0055] A custom script acquisition module 310 is used to acquire a process simulation custom script in response to a process simulation event being triggered; wherein the process simulation custom script is a process simulation script written by a user in a custom module of the process simulation software;
[0056] A CPU control instruction determination module 320 is used to determine whether the process simulation software stores a CPU control instruction corresponding to the process simulation custom script;
[0057] The process simulation result generating module 330 is used to call the CPU control instruction corresponding to the process simulation custom script to generate the process simulation result if the process simulation software stores the CPU control instruction.
[0058] Optionally, the device further includes:
[0059] A script syntax information determination module, used for parsing the process simulation custom script to determine the script syntax information of the process simulation custom script if the process simulation software does not store a CPU control instruction corresponding to the process simulation custom script;
[0060] A CPU control instruction generation module, used to generate an assembly file corresponding to the process simulation custom script based on the script syntax information, and generate a CPU control instruction based on the assembly file;
[0061] The CPU control instruction running module is used to store the CPU control instructions, run the CPU control instructions, and generate process simulation results.
[0062] Optionally, a script syntax information determination module is used to:
[0063] Parsing the process simulation custom script based on a regular expression to determine a script syntax type of the process simulation custom script;
[0064] The script syntax information of the process simulation custom script is determined based on the script syntax type.
[0065] Optionally, the script syntax type includes an assignment statement syntax type, an if statement syntax type, and a call statement syntax type.
[0066] Optionally, the CPU control instruction generation module is used to:
[0067] The script syntax information is used to generate intermediate language IL instructions through the .NET framework; wherein the intermediate language IL instructions are instructions that can be directly operated by the user;
[0068] An assembly file corresponding to the process simulation custom script is generated based on the intermediate language IL instruction.
[0069] Optionally, the CPU control instruction generation module is used to:
[0070] Dynamically calling the assembly file based on the reflection function of the .NET framework;
[0071] The assembly file is compiled into corresponding CPU control instructions by a JIT (Just-in-Time) compiler.
[0072] The process simulation device based on the custom module of process simulation software provided in the embodiment of the present invention can execute the process simulation method based on the custom module of process simulation software provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.
[0073] Embodiment 4
[0074] Figure 4 A schematic diagram of a process simulation platform 10 that can be used to implement an embodiment of the present invention is shown. The process simulation platform is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The process simulation platform can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0075] like Figure 4 As shown, the process simulation platform 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the process simulation platform 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0076] Multiple components in the process simulation platform 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the process simulation platform 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0077] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a process simulation method based on a custom module of a process simulation software.
[0078] In some embodiments, the process simulation method based on the process simulation software custom module can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the process simulation platform 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the process simulation method based on the process simulation software custom module described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the process simulation method based on the process simulation software custom module by any other appropriate means (for example, by means of firmware).
[0079] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0080] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0081] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0082] To provide interaction with a user, the systems and techniques described herein may be implemented on a process simulation platform having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the process simulation platform. Other types of devices may also be used to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0083] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0084] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0085] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the process simulation method based on the process simulation software custom module described in any embodiment of the present invention.
[0086] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0087] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A process simulation method based on a custom module of process simulation software, characterized in that: include: In response to a process simulation event being triggered, obtaining a process simulation custom script; wherein the process simulation custom script is a process simulation script written by a user in a custom module of the process simulation software; Determining whether the process simulation software stores a CPU control instruction corresponding to the process simulation custom script; If the process simulation software stores a CPU control instruction corresponding to the process simulation custom script, the CPU control instruction is called to generate a process simulation result; If the process simulation software does not store the CPU control instruction corresponding to the process simulation custom script, the process simulation custom script is parsed to determine the script syntax information of the process simulation custom script; Generate an assembly file corresponding to the process simulation custom script based on the script syntax information, and generate a CPU control instruction based on the assembly file; The CPU control instructions are stored, and the CPU control instructions are executed to generate process simulation results.
2. The method according to claim 1, characterized in that Parsing the process simulation custom script to determine script syntax information of the process simulation custom script includes: Parsing the process simulation custom script based on a regular expression to determine a script syntax type of the process simulation custom script; The script syntax information of the process simulation custom script is determined based on the script syntax type.
3. The method according to claim 2, characterized in that The script syntax type includes an assignment statement syntax type, an if statement syntax type, and a call statement syntax type.
4. The method according to claim 1, characterized in that: Generating an assembly file corresponding to the process simulation custom script based on the script syntax information includes: The script syntax information is used to generate intermediate language IL instructions through the .NET framework; wherein the intermediate language IL instructions are instructions that can be directly operated by the user; An assembly file corresponding to the process simulation custom script is generated based on the intermediate language IL instruction.
5. The method according to claim 1, characterized in that Generating a CPU control instruction based on the assembly file includes: Dynamically calling the assembly file based on the reflection function of the .NET framework; The assembly file is compiled into corresponding CPU control instructions by a JIT (Just-in-Time) compiler.
6. A process simulation device based on a custom module of process simulation software, characterized in that: include: A custom script acquisition module, used for acquiring a process simulation custom script in response to a process simulation event being triggered; wherein the process simulation custom script is a process simulation script written by a user in a custom module of the process simulation software; A CPU control instruction judgment module is used to judge whether the process simulation software stores a CPU control instruction corresponding to the process simulation custom script; A process simulation result generating module, for calling the CPU control instruction corresponding to the process simulation custom script to generate a process simulation result if the process simulation software stores the CPU control instruction; A script syntax information determination module, used for parsing the process simulation custom script to determine the script syntax information of the process simulation custom script if the process simulation software does not store a CPU control instruction corresponding to the process simulation custom script; A CPU control instruction generation module, used to generate an assembly file corresponding to the process simulation custom script based on the script syntax information, and generate a CPU control instruction based on the assembly file; The CPU control instruction running module is used to store the CPU control instructions, run the CPU control instructions, and generate process simulation results.
7. A process simulation platform, characterized in that: The process simulation platform includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the process simulation method based on the process simulation software custom module as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the process simulation method based on a process simulation software custom module according to any one of claims 1 to 5 when executed.
9. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the process simulation method based on a process simulation software custom module according to any one of claims 1 to 5.
Citation Information
Patent Citations
Equipment testing method and device, electronic equipment and storage medium
CN117971581A