Customized method, device, equipment and storage medium for simulation solution algorithm
By registering and calling the encapsulated algorithm in the preset solution framework, the customizability of the dynamic system simulation solution algorithm is realized, which solves the problem that the simulation solution algorithm cannot be customized according to user needs in the existing technology and meets the user's customization needs.
Patent Information
- Application Number
- CN202011226417.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-05
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2040-11-05
AI Technical Summary
Existing dynamic system simulation modeling software cannot customize simulation solution algorithms according to user needs, which leads to advanced users needing to manually control the algorithm.
By acquiring the solution algorithm, encapsulating it with a standard interface, registering it in the preset solution framework, and using a unified solution process to call the registered algorithm, the dynamic system can be simulated and solved, thus enabling the algorithm to be customized.
Customization of simulation solution algorithms has been achieved, meeting the customization needs of software developers and users, and solving the problem that existing technologies cannot customize simulation solution algorithms.
Smart Images

Figure CN112256242B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for customizing a simulation solution algorithm. Background Art
[0002] In recent years, the dynamic system simulation modeling industry has developed rapidly, with an increasing number of modeling users and increasingly diversified user needs.
[0003] In existing simulation modeling software, some general dynamic system solution algorithms are usually provided so that users can rely on these general solution algorithms to perform simulation solutions.
[0004] However, when some advanced users need to use their own algorithms or third-party algorithms to simulate and solve dynamic systems, they need to manually control the algorithms. Therefore, there is a problem that existing dynamic system simulation modeling software cannot customize general algorithms for simulation solution algorithms according to user needs.
[0005] With regard to the problem in the related art that the existing dynamic system simulation modeling software cannot customize the general algorithm of the simulation solution algorithm for the user according to the user's needs, no effective solution has been proposed yet. Summary of the invention
[0006] The main purpose of the present application is to provide a method, device, equipment and storage medium for customizing a simulation solution algorithm to solve the problem in the related art that the existing dynamic system simulation modeling software cannot customize a general algorithm of the simulation solution algorithm for the user according to the user's needs.
[0007] In order to achieve the above objectives, in a first aspect, the present application provides a method for customizing a simulation solution algorithm.
[0008] The method according to the present application comprises:
[0009] Obtaining a solution algorithm, wherein the solution algorithm includes a built-in algorithm and a customized algorithm;
[0010] Perform standard interface encapsulation on the solution algorithm to obtain an encapsulated algorithm;
[0011] Register the encapsulated algorithm in a preset solution framework to obtain a registered algorithm;
[0012] The registered algorithm in the preset solution framework is called according to the preset solution process to simulate and solve the dynamic system.
[0013] In a possible implementation of the present application, the built-in algorithm is a preset algorithm of the dynamic system, and the customized algorithm is at least one of a user-defined algorithm or a third-party algorithm.
[0014] In a possible implementation of the present application, the preset solution process includes multiple solution template processes, and each solution template process calls the preset solution framework in a unified manner.
[0015] In a possible implementation of the present application, before calling the registration algorithm in the preset solution framework according to the preset solution process, the solution template process calls the interface function of the registration algorithm.
[0016] In a possible implementation of the present application, the interface function includes a preset algorithm creation interface function, a preset option setting interface function, a preset algorithm initialization interface function, a preset algorithm solution interface function and a preset algorithm destruction interface function, and the interface function of the solution template process calling the registration algorithm includes:
[0017] Call the preset algorithm creation interface function to create a registered algorithm instance;
[0018] Call the preset option setting interface function to set the solution options;
[0019] Call the preset algorithm initialization interface function to initialize the dynamic system;
[0020] Call the preset algorithm solution interface function to simulate and solve the dynamic system;
[0021] Call the preset algorithm destruction interface function to destroy the registered algorithm instance.
[0022] In a possible implementation of the present application, the encapsulation algorithm includes a built-in encapsulation algorithm and a customized encapsulation algorithm, and the solution algorithm is encapsulated by a standard interface to obtain the encapsulation algorithm, including:
[0023] Perform standard interface encapsulation on the built-in algorithm to obtain the built-in encapsulated algorithm;
[0024] The customized algorithm is encapsulated with a standard interface to obtain a customized encapsulated algorithm.
[0025] In a possible implementation of the present application, the registration algorithm includes a built-in registration algorithm and a customized registration algorithm, and the encapsulated algorithm is registered in a preset solution framework to obtain a registration algorithm, including:
[0026] Register the built-in encapsulated algorithm in the preset solution framework to obtain the built-in registered algorithm;
[0027] The customized encapsulated algorithm is registered in the preset solution framework to obtain a customized registered algorithm.
[0028] In a second aspect, the present application also provides a customized device for a simulation solution algorithm, the device comprising:
[0029] An acquisition module is used to acquire a solution algorithm, wherein the solution algorithm includes a built-in algorithm and a customized algorithm;
[0030] The algorithm standard interface module is used to perform standard interface encapsulation on the solution algorithm to obtain the encapsulated algorithm;
[0031] A solution framework module is used to register the encapsulated algorithm in a preset solution framework to obtain a registered algorithm;
[0032] The solution module is used to call the registered algorithm in the preset solution framework according to the preset solution process to simulate and solve the dynamic system.
[0033] In a possible implementation of the present application, the algorithm standard interface module is specifically used to:
[0034] Call the preset algorithm creation interface function to create a registered algorithm instance;
[0035] Call the preset option setting interface function to set the solution options;
[0036] Call the preset algorithm initialization interface function to initialize the dynamic system;
[0037] Call the preset algorithm solution interface function to simulate and solve the dynamic system;
[0038] Call the preset algorithm destruction interface function to destroy the registered algorithm instance.
[0039] In a possible implementation of the present application, the algorithm standard interface module is further used to:
[0040] Perform standard interface encapsulation on the built-in algorithm to obtain the built-in encapsulated algorithm;
[0041] The customized algorithm is encapsulated with a standard interface to obtain a customized encapsulated algorithm.
[0042] In a possible implementation of the present application, the solution framework module is specifically used to:
[0043] Register the built-in encapsulated algorithm in the preset solution framework to obtain the built-in registered algorithm;
[0044] The customized encapsulated algorithm is registered in the preset solution framework to obtain a customized registered algorithm.
[0045] In a third aspect, the present application also provides a customized electronic device for a simulation solution algorithm, the electronic device comprising:
[0046] one or more processors;
[0047] Memory; and
[0048] One or more applications, wherein the one or more applications are stored in a memory and configured to be executed by a processor to implement the customized method of the simulation solution algorithm of any one of the first aspects.
[0049] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and the computer program is loaded by a processor to execute the steps in the customization method of the simulation solution algorithm of any one of the first aspects.
[0050] In an embodiment of the present application, a method for customizing a simulation solution algorithm is provided. After the built-in algorithm and the customized algorithm are encapsulated with a standard interface, they are registered in a preset solution framework, and the registered algorithm in the preset solution framework is called according to the preset solution process to simulate and solve the dynamic system. By adopting a unified solution framework, applying a template-based solution process, and formulating a standard algorithm interface, the simulation solution algorithm is customizable, which can meet the customization needs of software developers and users for the solution algorithm; thereby solving the technical problem in the related art that the existing dynamic system simulation modeling software cannot customize the general algorithm of the simulation solution algorithm for users according to user needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings constituting a part of this application are used to provide a further understanding of this application, so that other features, purposes and advantages of this application become more obvious. The schematic embodiment drawings and their descriptions of this application are used to explain this application and do not constitute an improper limitation on this application. In the drawings:
[0052] Figure 1 It is a schematic diagram of an embodiment of a flow chart of a method for customizing a simulation solution algorithm provided in an embodiment of the present application;
[0053] Figure 2 It is a flowchart of an embodiment of calling the interface function of the registration algorithm according to the template solution process provided in the embodiment of the present application;
[0054] Figure 3 It is a schematic diagram of an embodiment flow of obtaining a packaging algorithm provided according to an embodiment of the present application;
[0055] Figure 4 It is a schematic diagram of an implementation flow of a registration algorithm provided according to an embodiment of the present application;
[0056] Figure 5 It is a schematic diagram of the structure of an embodiment of a customization device for a simulation solution algorithm provided in an embodiment of the present application;
[0057] Figure 6 It is a schematic diagram of the structure of an embodiment of a customized electronic device according to a simulation solution algorithm provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0060] In the present application, the terms "upper", "lower", "left", "right", "front", "back", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings. These terms are mainly used to better describe the present application and its embodiments, and are not used to limit the indicated devices, elements or components to have a specific orientation, or to be constructed and operated in a specific orientation.
[0061] In addition, some of the above terms may be used to express other meanings in addition to indicating orientation or positional relationship. For example, the term "on" may also be used to express a certain dependency or connection relationship in some cases. For those of ordinary skill in the art, the specific meanings of these terms in this application can be understood according to specific circumstances.
[0062] In addition, the term "plurality" shall mean two or more.
[0063] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0064] First, an embodiment of the present application provides a customization method for a simulation solution algorithm, the execution body of the customization method for the simulation solution algorithm is a customization device for the simulation solution algorithm, the customization device for the simulation solution algorithm is applied to a processor, and the customization method for the simulation solution algorithm includes: obtaining a solution algorithm, wherein the solution algorithm includes a built-in algorithm and a customized algorithm; encapsulating the solution algorithm with a standard interface to obtain a packaged algorithm; registering the packaged algorithm in a preset solution framework to obtain a registered algorithm; calling the registered algorithm in the preset solution framework according to a preset solution process to simulate and solve the dynamic system.
[0065] See also Figure 1 , Figure 1 A schematic flow chart of an embodiment of a method for customizing a simulation solution algorithm provided in an embodiment of the present application, wherein the method for customizing a simulation solution algorithm comprises:
[0066] 101. Obtain a solution algorithm, where the solution algorithm includes a built-in algorithm and a customized algorithm.
[0067] In the embodiments of the present application, the goal is to achieve the customization of the simulation solution algorithm for the dynamic system. Therefore, the solution algorithm in the present application may include a built-in algorithm and a customized algorithm, wherein the built-in algorithm may be a preset algorithm of the dynamic system, such as some general algorithms that have been built into the dynamic system during the development stage, and the customized algorithm may be at least one of a user-defined algorithm or a third-party algorithm, wherein the user-defined algorithm may be an algorithm customized by the user according to application requirements, and the third-party algorithm may be an application algorithm of other dynamic systems or application software.
[0068] 102. Perform standard interface encapsulation on the solution algorithm to obtain an encapsulated algorithm.
[0069] In order to facilitate the unified calling and processing of various algorithms by the subsequent preset solution process and preset solution framework, in the embodiment of the present application, the algorithm interface of the solution algorithm is standardized, that is, the solution algorithm is encapsulated with a standard interface to obtain a packaged algorithm. It should be noted that since the built-in algorithm is a preset algorithm for the dynamic system, it is possible that its algorithm interface is already a standard interface. In this case, there is no need to encapsulate the built-in algorithm with a standard interface. Only when the algorithm interface of the built-in algorithm is not a unified standard interface of the dynamic system, it is necessary to encapsulate the built-in algorithm with a standard interface so that each type of algorithm in the solution algorithm has an algorithm interface in a unified format.
[0070] 103. Register the encapsulated algorithm in a preset solution framework to obtain a registered algorithm.
[0071] In the embodiment of the present application, whether it is a built-in algorithm or a customized algorithm, it needs to be registered in the preset solution framework. After registration, the preset solution framework can call and control the built-in algorithm and the customized algorithm in the same way. At this time, the call of the registered algorithm is no longer directly called by the user, but is called and controlled by the preset solution framework. In other words, the control of the registered algorithm is transferred from user control to framework control, thus achieving reverse control.
[0072] 104. Call the registered algorithm in the preset solution framework according to the preset solution process to simulate and solve the dynamic system.
[0073] In the embodiment of the present application, the preset solution process of the dynamic system includes multiple solution template processes, each solution template process calls the preset solution framework in a unified manner, and the preset solution framework and the registered algorithm work together to complete the simulation solution of the dynamic system. The user inputs the relevant algorithm configuration to the dynamic system, the preset solution framework reads the configuration, and according to the user-configured solution algorithm, finds an algorithm that matches the user-configured solution algorithm from the registered algorithms, and then calls the solution template process to simulate and solve the dynamic system according to the preset solution process.
[0074] In addition, in the embodiment of the present application, the preset solution framework, the preset solution process and the algorithm interface ensure that various solution algorithms can be integrated into the simulation solver of the dynamic system, which can facilitate software developers to add solution algorithms, but it cannot guarantee that the end user can also integrate their own algorithms. Therefore, in the present application, the code of the dynamic system simulation solver is divided into two parts, one of which is a fixed part, compiled into a binary library file, and the other part is a part that changes with the dynamic system, which is compiled in the process of translating the dynamic system into a solver. The code of the integrated user algorithm is the same as the code that changes with the dynamic system, and is compiled in the process of translation, and is constructed into a simulation solver together with the fixed part. In this way, the end user can also easily integrate the solution algorithm. In the embodiment of the present application, the dynamic system structure also includes the organizational structure of the code, which is the key to realizing the customization of the end user. The simulation model code is generated by the modeling system, and the algorithm registration and solution algorithm are written by the end user, and are all in the form of source code. After compilation, it is connected with the fixed solution code to build a complete simulation solver.
[0075] In an embodiment of the present application, a method for customizing a simulation solution algorithm is provided. After the built-in algorithm and the customized algorithm are encapsulated with a standard interface, they are registered in a preset solution framework, and the registered algorithm in the preset solution framework is called according to the preset solution process to simulate and solve the dynamic system. By adopting a unified solution framework, applying a template-based solution process, and formulating a standard algorithm interface, the simulation solution algorithm is customizable, which can meet the customization needs of software developers and users for the solution algorithm.
[0076] like Figure 2 As shown, it is a flow chart of an embodiment of the interface function of the registration algorithm called by the solution template process provided by the embodiment of the present application. In some embodiments of the present application, before calling the registration algorithm in the preset solution framework according to the preset solution process, the solution template process calls the interface function of the registration algorithm, and the interface function includes a preset algorithm creation interface function, a preset option setting interface function, a preset algorithm initialization interface function, a preset algorithm solution interface function and a preset algorithm destruction interface function. The solution template process calls the interface function of the registration algorithm, and the solution template process calls the interface function of the registration algorithm, which may further include:
[0077] 201. Call the preset algorithm creation interface function to create a registered algorithm instance;
[0078] 202. Call the preset option setting interface function to set the solution options;
[0079] 203. Call the preset algorithm initialization interface function to initialize the dynamic system;
[0080] 204. Calling a preset algorithm solution interface function to simulate and solve the dynamic system;
[0081] 205. Call the preset algorithm destruction interface function to destroy the registered algorithm instance.
[0082] like Figure 3 As shown, it is a flowchart of an embodiment of obtaining a packaging algorithm provided according to an embodiment of the present application. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0083] In some embodiments of the present application, the encapsulation algorithm includes a built-in encapsulation algorithm and a customized encapsulation algorithm, and the solution algorithm is encapsulated by a standard interface to obtain the encapsulation algorithm, which may further include:
[0084] 301. Perform standard interface encapsulation on the built-in algorithm to obtain the built-in encapsulated algorithm.
[0085] It should be noted that since the built-in algorithm is the preset algorithm of the dynamic system, it is possible that its algorithm interface is already a standard interface. In this case, there is no need to encapsulate the built-in algorithm with a standard interface. Only when the algorithm interface of the built-in algorithm is not a unified standard interface of the dynamic system, it is necessary to encapsulate the built-in algorithm with a standard interface so that each type of algorithm in the solving algorithm has an algorithm interface of a unified format.
[0086] 302. Perform standard interface encapsulation on the customized algorithm to obtain a customized encapsulated algorithm.
[0087] In an embodiment of the present application, a customized algorithm, such as a user-defined algorithm or a third-party algorithm, is encapsulated as a standard interface and registered to a preset solution framework, which is called by the preset solution framework in a template manner in a preset solution process, so that the preset solution framework can adapt to various solution algorithms.
[0088] like Figure 4 As shown, it is a flowchart of an embodiment of obtaining a registration algorithm provided according to an embodiment of the present application. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0089] In some embodiments of the present application, the registration algorithm includes a built-in registration algorithm and a customized registration algorithm. The encapsulated algorithm is registered in a preset solution framework to obtain the registration algorithm, which may further include:
[0090] 401. Register the built-in encapsulated algorithm in a preset solution framework to obtain a built-in registered algorithm.
[0091] 402. Register the customized encapsulated algorithm in a preset solution framework to obtain a customized registered algorithm.
[0092] In an embodiment of the present application, the solution algorithm is encapsulated and registered with a preset solution framework so that the preset solution framework can perceive the encapsulated solution algorithms. At the same time, the control of calling the solution algorithm is transferred to the preset solution framework. The preset solution framework selects the corresponding registered algorithm from the preset solution framework according to the solution algorithm configured by the user, and then simulates and solves the dynamic system.
[0093] In order to better implement the customization method of the simulation solution algorithm in the embodiment of the present application, on the basis of the customization method of the simulation solution algorithm, the embodiment of the present application also provides a customization device for the simulation solution algorithm, such as Figure 5 As shown, the custom device 500 for the simulation solution algorithm includes:
[0094] An acquisition module 501 is used to acquire a solution algorithm, wherein the solution algorithm includes a built-in algorithm and a customized algorithm;
[0095] The algorithm standard interface module 502 is used to perform standard interface encapsulation on the solution algorithm to obtain an encapsulated algorithm;
[0096] A solution framework module 503 is used to register the encapsulated algorithm in a preset solution framework to obtain a registered algorithm;
[0097] The solution module 504 is used to call the registered algorithm in the preset solution framework according to the preset solution process to simulate and solve the dynamic system.
[0098] In some embodiments of the present application, the algorithm standard interface module 502 is specifically used to:
[0099] Call the preset algorithm creation interface function to create a registered algorithm instance;
[0100] Call the preset option setting interface function to set the solution options;
[0101] Call the preset algorithm initialization interface function to initialize the dynamic system;
[0102] Call the preset algorithm solution interface function to simulate and solve the dynamic system;
[0103] Call the preset algorithm destruction interface function to destroy the registered algorithm instance.
[0104] In some embodiments of the present application, the algorithm standard interface module 502 is further used to:
[0105] Perform standard interface encapsulation on the built-in algorithm to obtain the built-in encapsulated algorithm;
[0106] The customized algorithm is encapsulated with a standard interface to obtain a customized encapsulated algorithm.
[0107] In some embodiments of the present application, the solution framework module 503 is specifically used to:
[0108] Register the built-in encapsulated algorithm in the preset solution framework to obtain the built-in registered algorithm;
[0109] The customized encapsulated algorithm is registered in the preset solution framework to obtain a customized registered algorithm.
[0110] Specifically, the specific process of each module in the device of the embodiment of the present application to realize its function can be referred to as Figures 1 to 4 The description of the customization method of the simulation solution algorithm in any embodiment will not be repeated here in detail.
[0111] The embodiment of the present application further provides a customized electronic device for a simulation solution algorithm, which integrates any customized device for a simulation solution algorithm provided in the embodiment of the present application, and the electronic device includes:
[0112] one or more processors;
[0113] Memory; and
[0114] One or more applications, wherein the one or more applications are stored in a memory and configured to be executed by a processor to execute the steps of the method for customizing a simulation solution algorithm in any of the above-mentioned embodiments of the method for customizing a simulation solution algorithm.
[0115] A customized electronic device for a simulation solution algorithm in an embodiment of the present application integrates any customized device for a simulation solution algorithm provided in an embodiment of the present application. Figure 6 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:
[0116] The electronic device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will appreciate that Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0117] The processor 601 is the control center of the electronic device, which uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 602, and calling data stored in the memory 602, so as to monitor the electronic device as a whole. Optionally, the processor 601 may include one or more processing cores; the processor 601 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.
[0118] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0119] The electronic device also includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions. The power supply 603 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0120] The electronic device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0121] Although not shown, the server may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 601 in the electronic device will load the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 will run the application stored in the memory 602 to implement various functions, as follows:
[0122] Obtaining a solution algorithm, wherein the solution algorithm includes a built-in algorithm and a customized algorithm;
[0123] Perform standard interface encapsulation on the solution algorithm to obtain an encapsulated algorithm;
[0124] Register the encapsulated algorithm in a preset solution framework to obtain a registered algorithm;
[0125] The registered algorithm in the preset solution framework is called according to the preset solution process to simulate and solve the dynamic system.
[0126] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the customization device, electronic device and corresponding units of the simulation solution algorithm described above can refer to the following. Figures 1 to 4 The description of the customization method of the simulation solution algorithm in any embodiment will not be repeated here in detail.
[0127] A person skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by the processor 601.
[0128] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any one of the customization methods of the simulation solution algorithm provided in the embodiment of the present application. For example, the computer program is loaded by the processor to execute the following steps:
[0129] Obtaining a solution algorithm, wherein the solution algorithm includes a built-in algorithm and a customized algorithm;
[0130] Perform standard interface encapsulation on the solution algorithm to obtain an encapsulated algorithm;
[0131] Register the encapsulated algorithm in a preset solution framework to obtain a registered algorithm;
[0132] The registered algorithm in the preset solution framework is called according to the preset solution process to simulate and solve the dynamic system.
[0133] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for customizing a simulation solution algorithm, characterized in that: include: Obtaining a solution algorithm, wherein the solution algorithm includes a built-in algorithm and a customized algorithm; Performing standard interface encapsulation on the solution algorithm to obtain an encapsulated algorithm; Registering the encapsulated algorithm in a preset solution framework to obtain a registered algorithm; Calling the registered algorithm in the preset solution framework according to the preset solution process to simulate and solve the dynamic system; The preset solution process includes multiple solution template processes, each of which calls the preset solution framework in a unified manner, and before calling the registration algorithm in the preset solution framework according to the preset solution process, the solution template process calls the interface function of the registration algorithm, and the interface function includes a preset algorithm creation interface function, a preset option setting interface function, a preset algorithm initialization interface function, a preset algorithm solution interface function and a preset algorithm destruction interface function. The solution template process calls the interface function of the registration algorithm, including: Call the preset algorithm creation interface function to create a registered algorithm instance; Call the preset option setting interface function to set the solution options; Calling the preset algorithm initialization interface function to initialize the dynamic system; Calling the preset algorithm solution interface function to simulate and solve the dynamic system; Call the preset algorithm destruction interface function to destroy the registered algorithm instance.
2. The method according to claim 1, characterized in that The built-in algorithm is a preset algorithm of the dynamic system, and the customized algorithm is at least one of a user-defined algorithm or a third-party algorithm.
3. The method according to claim 1, characterized in that The encapsulation algorithm includes a built-in encapsulation algorithm and a customized encapsulation algorithm. The standard interface encapsulation of the solution algorithm to obtain the encapsulation algorithm includes: Performing standard interface encapsulation on the built-in algorithm to obtain a built-in encapsulated algorithm; The customized algorithm is encapsulated with a standard interface to obtain a customized encapsulated algorithm.
4. The method according to claim 3, characterized in that The registration algorithm includes a built-in registration algorithm and a customized registration algorithm. The encapsulated algorithm is registered in a preset solution framework to obtain a registration algorithm, including: Registering the built-in encapsulated algorithm in a preset solution framework to obtain a built-in registered algorithm; The customized encapsulation algorithm is registered in a preset solution framework to obtain a customized registered algorithm.
5. A custom device for a simulation solution algorithm, characterized in that: include: An acquisition module, used for acquiring a solution algorithm, wherein the solution algorithm includes a built-in algorithm and a customized algorithm; An algorithm standard interface module is used to perform standard interface encapsulation on the solution algorithm to obtain an encapsulated algorithm; A solution framework module, used for registering the encapsulated algorithm in a preset solution framework to obtain a registered algorithm; A solution module, used for calling the registered algorithm in the preset solution framework according to a preset solution process to simulate and solve the dynamic system; The preset solution process includes multiple solution template processes, each of which calls the preset solution framework in a unified manner, and before the solution module calls the registered algorithm in the preset solution framework according to the preset solution process, the solution template process calls the interface function of the registered algorithm, and the interface function includes a preset algorithm creation interface function, a preset option setting interface function, a preset algorithm initialization interface function, a preset algorithm solution interface function and a preset algorithm destruction interface function, and the algorithm standard interface module is specifically used for: Call the preset algorithm creation interface function to create a registered algorithm instance; Call the preset option setting interface function to set the solution options; Calling the preset algorithm initialization interface function to initialize the dynamic system; Calling the preset algorithm solution interface function to simulate and solve the dynamic system; Call the preset algorithm destruction interface function to destroy the registered algorithm instance.
6. A custom electronic device for a simulation solution algorithm, characterized in that: include: one or more processors; Memory; as well as One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the customized method of the simulation solution algorithm described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the customization method of the simulation solution algorithm described in any one of claims 1-4.
