Simulation model servitization integration method
By encapsulating the simulation model into a service and registering it with the service manager, the problem of tight coupling and maintenance difficulties in the existing simulation model integration method is solved, and service-oriented integration of simulation models with high flexibility and maintainability is achieved.
Patent Information
- Application Number
- CN202411852560.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-02-14
AI Technical Summary
The existing simulation model integration methods have problems such as tight coupling, high maintenance costs, long development cycles, and inability to support remote access and resource sharing, resulting in inflexible systems and difficult maintenance.
By encapsulating the simulation model into a service and registering it with the service manager, providing the service user's remote call interface to achieve service integration of the simulation model.
It improves the flexibility and scalability of the system, enhances the reusability and maintainability of the simulation model, supports rapid response to changes in business demands, and reduces development costs.
Smart Images

Figure CN119442699A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a service-oriented integration method, and more specifically, to a simulation model service-oriented integration method. Background Art
[0002] The existing simulation model integration is mainly integrated with the software platform in the form of software modules. This monolithic structure makes the simulation model tightly coupled with the software platform system, and the system is very inflexible. When the logic of the simulation model changes, the entire system needs to be reconstructed, resulting in high system maintenance costs and long development cycles. In the traditional monolithic architecture simulation model integration method, different platforms maintain their own set of simulation models, causing developers to repeat work and unable to ensure the consistency and reliability of simulation model function modules in different systems.
[0003] At present, simulation model integration methods generally have the following shortcomings: the current model development specifications mainly provide local calling interfaces for models, and there is no way to support remote access, making it difficult to support the sharing of simulation model resources; the development and deployment of simulation models is challenging and resource-intensive, requiring a large amount of simulation model-related expertise and the cooperation of many professional researchers with knowledge in different related fields; the current simulation models are highly coupled with application software, and the cost of maintaining simulation models is high; it is not friendly to experts with weak knowledge in related fields, and the cost of using simulation models is high; when many users use simulation model resources at the same time, stability is difficult to guarantee. Summary of the invention
[0004] The present invention provides a simulation model service integration method to solve at least one of the problems existing in the prior art.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A first aspect of the present invention provides a simulation model service integration method, the method comprising:
[0007] Encapsulate the simulation model into a simulation model service, and register the simulation model service to the service manager through the service provider;
[0008] Providing basic information of simulation model services to service users through the service manager;
[0009] The service user obtains the usage information of the required service model by querying the remote call service of the service manager, obtains the service return data according to the usage information of the service model, and completes the integration of the simulation model.
[0010] Optionally, the service user obtains the service return data from the service manager by synchronous calling or asynchronous calling, and saves the service return data.
[0011] Optionally, saving the service return data includes saving the service return data to a local file; or
[0012] Save the service return data to a temporary variable.
[0013] Optionally, the basic information of the simulation model service provided by the service manager to the service user includes:
[0014] The service manager provides the service user with a simulation model service and obtains basic information of the corresponding simulation model service according to the simulation model service.
[0015] Optionally, the basic information of the simulation model service includes the name of the service, the interface address of the service, the request method of the service, the input parameters of the service and the return result of the service.
[0016] Optionally, the simulation model service includes HTTP(s) type service and RPC type service.
[0017] Optionally, the method further comprises
[0018] The service calling method information is obtained, wherein the service calling method information includes the externally exposed interface of the service, the input and output parameters of the externally exposed interface, and the calling method of the externally exposed interface.
[0019] Optionally, the integration method of the simulation model includes SDK type interface integration, Restful Api interface call integration and remote procedure call service interface integration.
[0020] Optionally, the usage information of the service model includes the application of the service model, requirements for the operation of the service model, operating system requirements, network requirements, service initialization requirements, and service external interface requirements.
[0021] Optionally, the method further comprises
[0022] The simulation model is run and maintained by the service manager.
[0023] The beneficial effects of the present invention are as follows:
[0024] The present invention provides a simulation model service integration method, which enables a service user to conveniently use a simulation model provided by a service provider through registration of the simulation model, management of the simulation model, and use of the simulation model. The method encapsulates the simulation model into a service, shields the implementation details of the simulation model, hides the complexity of the implementation, and only builds and uses the simulation model in a plug-in manner for the service provider. The method improves the flexibility and scalability of the system, enhances the reusability of the simulation model, improves the maintainability of the simulation model, and supports rapid response to changes in simulation model requirements, improves user experience, and the simulation model service can meet the personalized needs of users and reduce development costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The specific implementation modes of the present invention are further described in detail below in conjunction with the accompanying drawings.
[0026] Figure 1 A flow chart showing the simulation model service integration method of the present invention;
[0027] Figure 2 A schematic diagram of the service-oriented integrated architecture of the simulation model in the first embodiment of the present invention is shown;
[0028] Figure 3 A schematic diagram showing a synchronous calling method in the first embodiment of the present invention;
[0029] Figure 4 A schematic diagram showing the asynchronous calling method in the first embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to more clearly illustrate the present invention, the present invention is further described below in conjunction with preferred embodiments and accompanying drawings. Similar components in the accompanying drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the content specifically described below is illustrative rather than restrictive, and should not be used to limit the scope of protection of the present invention.
[0031] The present invention provides a simulation model service integration method, which can call the simulation model as a service by a service user, and can also call the application system where the simulation model is located as a service by another service user. The present invention is loosely coupled with the software platform in a service-oriented manner, making the entire system more flexible and supporting the sharing of simulation model resources; secondly, the service-oriented function module makes the simulation model independent of the platform system, improves the reuse rate of the simulation model, and the simulation model service-oriented can quickly respond to changes in business requirements. When business requirements change, only new simulation model server codes need to be added or changed to respond to the requirements. Figure 1 A flowchart of a simulation model service integration method, the method comprising
[0032] Register the simulation model to the service manager through the service provider;
[0033] The service provider provides complete basic service information and service usage information, including the application, server, operating system and operating environment for running the service, service external interface requirements and other information to guide the service manager in providing services.
[0034] Provide basic information of the simulation model to the service user through the service manager;
[0035] The usage information of the service model includes the application of the service model, the requirements for the operation of the service model, the operating system requirements, the network requirements, the service initialization requirements and the service external interface requirements;
[0036] The service manager provides the service user with a simulation model service, and obtains basic information of the corresponding simulation model according to the simulation model service. The simulation model service includes HTTP(s) type service and RPC type service;
[0037] Obtain service call method information from the service manager. The service call method information includes the service's externally exposed interface, the input and output parameters of the externally exposed interface, and the calling method of the externally exposed interface.
[0038] The service manager of the simulation model is responsible for the operation and maintenance of the simulation model service. On the other hand, as the simulation model service registration center, it provides remote procedure call (RPC) services to service users. The service manager also serves as the simulation model service manager, providing basic information and calling method instructions for all simulation models to facilitate service integration by service users. The basic information should clearly describe the name and function of the service in free text. The service calling method includes the service's externally exposed interface, the interface's input and output parameters, and the interface calling method. The simulation model service interface exposed by the service manager includes HTTP(s) type services and RPC type services. The service interface includes the service's functional description, service name, service interface address, request method, parameter list, and return value format.
[0039] The service user obtains the service return data from the service manager through synchronous or asynchronous calls, and saves the service return data. The service return data can be saved to a local file or a temporary variable for subsequent business processing.
[0040] The service user obtains the usage information of the required service model by querying the remote call service of the service manager, obtains the service return data according to the usage information of the service model, and completes the integration of the simulation model.
[0041] The service user of the simulation model obtains the instructions for using the required service model by viewing the services provided by the service manager, and integrates the model into the software according to the instructions for using the simulation model. The integration methods are divided into SDK type interface integration, Restful Api interface call integration and RPC service interface integration; the service user obtains the service return data in two ways: synchronous and asynchronous.
[0042] In a specific embodiment, Figure 2 The schematic diagram of the service-oriented integration architecture of the simulation model is shown in FIG. This embodiment takes the service-oriented integration of the environment simulation model as an example. The service provider, service manager, and service user involved in this embodiment all refer to devices, such as the front-end user device and the back-end service device. The corresponding integration is implemented in response to the user's operation on the device. The service-oriented integration method of the simulation model includes:
[0043] Register the simulation model to the service manager through the service provider;
[0044] The service user uses the services provided by the service manager to obtain the calculation results of the simulation model service.
[0045] There are two types of simulation model services encapsulated by the service provider, one providing HTTP(s) type services and the other providing RPC type services. The simulation model services are registered to the registration center of the service manager.
[0046] When providing HTTP(s) type services in this embodiment, the service provider shall provide basic information and service usage information to the service manager to facilitate the service manager to start and manage the service:
[0047] Basic information includes the service name and service description, among which:
[0048] The service name described in free text form, matching the function of the service. For the environment simulation model, the service name can be set to the environment simulation model service;
[0049] The detailed description of the purpose and functions of the service should be easy to understand and grasp, so that new users of the service can understand the purpose, scope and limitations of the service; for environmental simulation model services, it can be described as providing environmental effect calculation and environmental data query services.
[0050] Service usage information includes service applications, service operation requirements, operating system requirements, network requirements, service initialization requirements, and service external interface requirements, among which:
[0051] Users install / provide service applications as needed, including applications required to access or execute services; for environmental model services, this embodiment is based on the code framework form of the model service dll dynamic library.
[0052] Service operating requirements are the minimum hardware configuration required for the service to run properly when targeting the server running the service, not the computer used to access the service.
[0053] The runtime operating system requirements for a service refer to the operating system required for the service to run on the server that runs the service, not the computer used to access the service.
[0054] The network requirements of the service are the minimum requirements of the user's local network connection to ensure stable access to the service, including the ports required for the service network and the network switching speed requirements.
[0055] Service initialization requirements include all initialization interface names, data types, and value ranges required to run the service.
[0056] The service external interface requirements include the requirements for interface functions during service operation, specifically including the following:
[0057] The type of interface. Currently, the interface type belongs to the RESTful style. The type list can be expanded by adding other interface types (such as SOAP, WMS, etc.). Depending on the interface type, additional parameters may need to be added (for example, SOAP requires XML mode) or some parameters may be deleted (for example, non-Web services do not require a uniform resource locator);
[0058] Uniform Resource Locator, which is the uniform resource locator for accessing the Web service; the following format should be used: <networkprotocol>: / / <host address>: <port> / <path>(Required for every web service).
[0059] A list of functions provided by the interface. Each function is a separate call with separate inputs and outputs. This list should contain all functions provided by the interface.
[0060] The name of the function should be consistent with the function it implements;
[0061] A list of all input parameters required to start executing the function. Parameters can be simple text input or complete files in a specified format. The parameter name should be consistent with the purpose of the parameter, the function description of the parameter, the parameter type (such as floating point number, Boolean value, string, etc.), the parameter value range, the parameter default value, etc. If necessary, the necessity of the input parameter can be explained (mandatory parameter, optional parameter or default parameter);
[0062] Regarding the final output of the service, an easy-to-understand description of the meaning of the return value must be provided so that users can know the expected results after the service completes running; output parameter data type (such as integer, string, or Boolean value, etc.).
[0063] For the environmental simulation model service in this embodiment, as an example, a service such as http:102.20.23.23:8080 / getTerrainData can be provided, where getTerrainData represents the function provided by the service to obtain terrain information. When requesting the service, fill in the input parameters Lon (longitude), Lat (latitude), etc. in the body. After the service processing is completed, the terrain data, etc. are returned in the response.
[0064] When providing RPC type services in this embodiment, in addition to providing the above information consistent with HTTP(s) services, the service manager should also provide a registration center to register the simulation model service to the registration center, and the registration center provides simulation model computing services to the outside world. Taking Zookeeper as the registration center, the environment simulation model service registers the service method name (such as getTerrainData) and communication address information (ip:port) provided by itself to Zookeeper. When the user initiates a remote call, he asks Zookeeper with the service method name (getTerrainData). Zookeeper will inform the caller of the service party's ip:port. The caller requests the service party to call the method, and the service party returns the result after executing the corresponding service method locally.
[0065] On the one hand, the service manager provides simulation model services to the outside world; on the other hand, it provides information such as the service name, main functions, interface address, request method, input parameters, and return results of all simulation models to guide service users to call the services according to the guidelines.
[0066] The simulation model service interface type has different access methods for service users according to the different service modes provided by the service provider, including SDK type interface, Restful Api interface and Remote Procedure Call service interface (Remote Procedure Call, RPC). Among them, SDK type interface and Restful Api interface belong to HTTP(s) service type for service managers, and are different access methods for service users.
[0067] The access method of the SDK type interface is: the user sends an HTTP(s) request to the server, the server does not call the computing service, and directly returns the SDK package and access instructions. The user accesses the SDK on the local software according to the instructions, calls the SDK interface locally to perform simulation model calculations, and obtains the calculation results.
[0068] The access method of the Restful Api service interface is: the user sends an HTTP(s) request to the server, the server completes the simulation model calculation, obtains the simulation model calculation result and puts it into the HTTP(s) response, and the user obtains the model calculation result from the HTTP(s) response for subsequent processing.
[0069] The access method of the RPC service interface is remote procedure call, which is a common distributed system communication mechanism. It allows processes on different computer nodes to communicate and call remote procedures, including user call interface and specific network protocol. The network protocol is implemented by the framework, and the user provider mainly focuses on the user call interface; the service user calls the "local method", sends the request to the service manager through the framework, locates the call code based on the method name + method, and sends the response result to the framework after the simulation model service is processed, and the service user obtains the response data.
[0070] When calling the Restful Api service interface and RPC, synchronous calling and asynchronous calling are two ways for the service user to call the response data returned by the service manager; the service return data can be saved to a local file or a temporary variable as needed for subsequent business processing.
[0071] There are two ways for service consumers to obtain service return data: synchronous and asynchronous. Figure 3 This is a schematic diagram of the synchronous calling method, in which the user end is the service user and the server end is the service manager. The synchronous calling method is used in scenarios that require quick response and scenarios where subsequent service calculations depend on the calculation results of the current model. For example, when a data collection service is called and there are subsequent services that depend on the data returned by the current service, a synchronous calling method is used, including direct calling method, thread synchronous calling mechanism, blocking queue, and synchronous calling in remote procedure call (RPC). Figure 4 This is a schematic diagram of the asynchronous calling method, in which the user end is the service user and the server end is the service manager. The scenarios in which the asynchronous calling method is used include I / O intensive operations and network request scenarios. For example, the simulation process needs to use multiple simulation services, including communication effect services, data acquisition services, etc. The calculation of multiple services takes a long time and there is no dependency between multiple services. The asynchronous calling method can be used, including the Thread class, the use of Future and Callable interfaces, and the use of CompletableFuture class.
[0072] The present invention registers the existing simulation model service into the service management, and the service user accesses and uses the simulation model through the network interface, so that the service user can use the simulation model more conveniently, quickly and simply; by defining the description of basic information and service usage information, a complete and specific model description method is obtained, and the simulation model registrant can clearly describe the function and usage of the simulation model, and the simulation model user can also quickly locate the simulation model to be used and conveniently integrate the simulation model into the application software; the present invention provides a variety of service interface types, supports SDK type interface, Restful Api interface and RPC interface, and is flexibly applied to a variety of usage scenarios.
[0073] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal connection of two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0074] It should also be noted that, in the description of the present invention, relational terms such as first and second, etc., are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0075] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the protection scope of the present invention.< / path> < / port> < / networkprotocol>
Claims
1. A simulation model service integration method, characterized in that: include: Encapsulate the simulation model into a simulation model service, and register the simulation model service to the service manager through the service provider; Providing basic information of simulation model services to service users through the service manager; The service user obtains the usage information of the required service model by querying the remote call service of the service manager, obtains the service return data according to the usage information of the service model, and completes the integration of the simulation model.
2. The method according to claim 1, characterized in that The service user obtains the service return data of the service manager through synchronous calling or asynchronous calling, and saves the service return data.
3. The method according to claim 2, characterized in that Saving the service return data includes Save the service return data to a local file; or Save the service return data to a temporary variable.
4. The method according to claim 1, characterized in that: The basic information of the simulation model service provided by the service manager to the service user includes The service manager provides the service user with a simulation model service and obtains basic information of the corresponding simulation model service according to the simulation model service.
5. The method according to claim 4, characterized in that The basic information of the simulation model service includes the name of the service, the interface address of the service, the request method of the service, the input parameters of the service and the return result of the service.
6. The method according to claim 4, characterized in that The simulation model service includes HTTP(s) type service and RPC type service.
7. The method according to claim 1, characterized in that The method further comprises The service calling method information is obtained, wherein the service calling method information includes the externally exposed interface of the service, the input and output parameters of the externally exposed interface, and the calling method of the externally exposed interface.
8. The method according to claim 1, characterized in that The integration methods of the simulation model include SDK type interface integration, RestfulApi interface call integration and remote procedure call service interface integration.
9. The method according to claim 1, characterized in that: The usage information of the service model includes The application of the service model, the requirements for the operation of the service model, the operating system requirements, the network requirements, the service initialization requirements, and the service external interface requirements.
10. The method according to claim 1, characterized in that The method further comprises The simulation model is run and maintained by the service manager.