Scalable simulation service framework system based on microservice architecture
Through the simulation service framework system based on microservice architecture, the problems of unified data interaction, cloud resource support and service access forms in simulation services are solved, lightweight management and scalability improvement of simulation services are realized, and unified interfaces and Interactive mechanism to meet the management and monitoring needs of the simulation engine.
Patent Information
- Application Number
- CN202410904586.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-07-08
AI Technical Summary
Existing technology makes it difficult to achieve unified interactive object data interaction, multiple cloud resource support, unified service access forms, and interface generation in simulation services, resulting in low simulation service management and expansion efficiency.
A scalable simulation service framework system based on microservice architecture is designed, including simulation service instance management module, registration and discovery module, calling and interaction module, status management module and cloud platform unified interface module. Through service-oriented architecture and message middle The software realizes unified management and monitoring of simulation services and supports seamless collaboration between cloud and local services.
It realizes lightweight and decoupled management of simulation services, supports full life cycle management of service registration, discovery, access and uninstallation, improves the scalability and efficiency of simulation services, and provides a unified interface and interaction mechanism to meet the needs of simulation engines. management and monitoring needs.
Smart Images

Figure CN118449995B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer simulation technology, and in particular to an extensible simulation service framework system based on a microservice architecture. Background Art
[0002] During the simulation process, in addition to core functions such as computational scheduling and interaction, the simulation platform also needs to provide some auxiliary functions to the model and other application terminals during operation. Extended simulation services not only unify the management of basic simulation services, but also provide a functional extension mechanism for engine functions.
[0003] The simulation platform needs to provide simulation resources that are compatible, interoperable, rollingly updated, and shared on demand. On the basis of unified management and edge-cloud collaboration, it must provide service-oriented sharing of infrastructure resources, model data resources, and simulation platform functions to achieve efficient service sharing capabilities with seamless scalability, convenient integration, and transparent access.
[0004] The simulation engine can extend the simulation service to provide management and access support for the simulation service, and it is necessary to focus on solving the following problems: for microservice-based simulation services; unify the interactive object data interaction format; support multiple types of cloud resources; unify the service access form; and unify the interface generation. Existing research results have poor results in these methods, so it is necessary to develop an extensible simulation service framework system based on a microservice architecture. Summary of the invention
[0005] Based on this, it is necessary to provide an extensible simulation service framework system based on microservice architecture to address the above technical issues. The system implements the public computing service module of the simulation engine subsystem, adopts a service-oriented architecture, defines the service interaction process and interaction format, supports the unified access and normal operation of simulation services, meets the monitoring and early warning needs of simulation services, and realizes local and cloud support for simulation services, providing the engine with simulation service lifecycle management capabilities.
[0006] An extensible simulation service framework system based on a microservice architecture comprises: a simulation service instance management module, a simulation service registration and discovery module, a simulation service call and interaction module, a simulation service state management module and a cloud platform unified interface module.
[0007] The simulation service instance management module is used to manage simulation services in the form of service packages, manage service instances in the form of virtual machines according to the two-level structure of namespace-service package, and constrain service access according to preset service development specifications and standards.
[0008] The simulation service registration and discovery module is used to register the extended simulation service using a predetermined service governance framework and message middleware; it is also used to provide service discovery capabilities for simulation engines or model entities.
[0009] The simulation service call and interaction module is used to obtain the parameters and their types required for simulation service registration, call and uninstallation by specifying the namespace and service name, and to obtain the simulation service calculation results; it is also used to interact with the engine memory blackboard or memory database and model by providing a unified interaction object.
[0010] The simulation service status management module is used to provide a service status management solution on the simulation server and use a service proxy model to implement periodic updates of the service status.
[0011] The cloud platform unified interface module is used to generate a unified management and monitoring interface by abstracting the differences between different cloud platforms, and provide a unified service access interface for the model.
[0012] The above-mentioned extensible simulation service framework system based on microservice architecture includes: simulation service instance management module, simulation service registration and discovery module, simulation service call and interaction module, simulation service state management module and cloud platform unified interface module. The system uses extensible simulation service as the main component of the simulation engine, provides service management and unified call functions, and realizes lightweight, decoupled and centralized management of specific simulation service businesses based on microservice architecture, supporting full life cycle management including service registration, service discovery, service access and service uninstallation. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 A logical structure diagram of an extensible simulation service framework system based on a microservice architecture in one embodiment;
[0014] Figure 2 It is a flowchart of an extensible simulation service framework system based on microservice architecture in another embodiment. DETAILED DESCRIPTION
[0015] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0016] In one embodiment, Figure 1 As shown, a scalable simulation service framework system based on a microservice architecture is provided, which includes: a simulation service instance management module 10, a simulation service registration and discovery module 20, a simulation service call and interaction module 30, a simulation service state management module 40 and a cloud platform unified interface module 50.
[0017] The simulation service instance management module 10 is used to manage simulation services in the form of service packages, manage service instances in the form of virtual machines according to the two-level structure of namespace-service package, and constrain service access according to preset service development specifications and standards.
[0018] Specifically, the service includes one or more simulation services, supporting the simulation service management needs based on the microservice architecture. It provides service instance management capabilities such as creation, query, update, and deletion of service instances, and also provides service development specifications and standards to constrain service access.
[0019] The simulation service registration and discovery module 20 is used to register the extended simulation service using a predetermined service governance framework and message middleware; it is also used to provide a service discovery function for the simulation engine or model entity.
[0020] Specifically, the simulation service registration and discovery module 20 adopts the mainstream service governance framework and message middleware to support service lifecycle management such as service registration and discovery, follows general communication protocols such as HTTP, and supports service management based on a variety of performance-optimized message publishing and subscription models.
[0021] For microservice-based simulation services, this application implements an HTTP server to mount service packages in DLL form, and converts HTTP, message bus and other calls into calls to the service package entry, and based on the unified service interface provided for other modules of the simulation engine, implements HTTP and message bus calls to provide cloud service support.
[0022] The simulation service calling and interaction module 30 is used to obtain the parameters and their types required for simulation service registration, calling and uninstalling by specifying the namespace and service name, and to obtain the simulation service calculation results; it is also used to interact with the engine memory blackboard or memory database and model by providing a unified interaction object.
[0023] Specifically, the service call is to obtain the parameters and their types required for simulation service registration, calling and uninstalling by specifying the namespace and service name, and obtain the simulation service calculation results; the service interaction provides a unified interaction object to interact with the engine memory blackboard or memory database and model for data.
[0024] In the simulation service management submodule, a unified service call interaction component is provided to provide service call functions for the model. According to the service load and response requirements, the synchronous mode of directly calling the service and the asynchronous mode based on the message queue are supported.
[0025] The simulation service status management module 40 is used to provide a service status management solution on the simulation server and implement periodic update of the service status by using a service proxy model.
[0026] Specifically, the simulation service state management module 40 supports stateful services, allowing the service to save caller information and the last access state, and allowing the model to periodically update the state information maintained by the simulation service.
[0027] The cloud platform unified interface module 50 is used to generate a unified management and monitoring interface by abstracting the differences between different cloud platforms, and provide a unified service access interface for the model.
[0028] Specifically, the cloud platform unified interface module 50 runs on the cloud platform based on the microservice simulation service. It is necessary to isolate the specific process of the model calling different cloud platform services through interface encapsulation and provide the model with a unified, lightweight and easy-to-use service access interface.
[0029] The cloud platform SDK is parsed based on the static syntax tree and reflection method, which can quickly parse the API information of the cloud platform. Based on this information, this application uses templates and heuristic rules to generate a unified interface, realizes rapid matching of API information based on meta-templates, and quickly completes the generation and adaptation of the unified interface.
[0030] A self-built cloud platform calling module is introduced to provide a unified interface for the management functions of the four resources of the cloud platform: CPU, memory, disk, and network. Unified interface generation and call mapping are performed for different API versions of each cloud platform to achieve support for cloud platform resources.
[0031] The workflow of the scalable simulation service framework system based on microservice architecture is as follows Figure 2 The specific steps include:
[0032] Step 101: Create a namespace and related parameters.
[0033] Specifically, a namespace and related parameters (such as description, etc.) are created according to the provided namespace name. If the namespace already exists, an error is reported to ensure the uniqueness of the namespace globally.
[0034] Step 102: Create a service image by calling the unified interface module of the self-built cloud platform.
[0035] Specifically, the service image is created by calling the module through the unified interface of the self-built cloud platform. After receiving the service instance management request, the service instance information is queried in the database through the namespace-service package-instance name, and created if it does not exist.
[0036] Step 103: Create a virtual machine by calling the self-built cloud platform unified interface module.
[0037] Specifically, the service development team builds a service image, specifies the namespace and name of the corresponding service package, and uploads the image to the service instance management component through the user interface. The service instance management component calls the virtual machine creation interface through the self-built cloud platform unified call module and returns the upload result to the user interface. At the same time, it provides service instance query, update and deletion functions based on the namespace and service package name.
[0038] Step 104: The resource management interface provided by the self-built cloud platform is uniformly called to realize the creation, query, update and deletion of service instance resources.
[0039] Specifically, the simulation platform administrator can send instance resource query and modification requests to the service instance management component through the user interface. The simulation service management submodule namespace-service package-service instance name queries the database for the IP and other information of the corresponding service instance, and then, based on the resource requirements of the service, uses the resource management interface provided by the self-built cloud platform unified call module to create, query, update, and delete virtual machine resources, install these resources to the virtual machine, or uninstall resources from the virtual machine to adjust the resources of the service instance. Finally, the self-built cloud platform unified call module returns the resource status information to the service instance management component, and finally displays it on the user interface.
[0040] Step 105: After the service instance is started, it is registered through the service registration interface.
[0041] Specifically, after the service instance is started, the server implementation provided by this application will call the Nacos service registration interface and actively send the service instance information (namespace, all service names in the service package, IP, port number, etc.). Nacos updates the service registration information and returns the service registration result to the service instance.
[0042] Step 106: Query the service instance through the service namespace and name and return it.
[0043] Specifically, when other modules of the simulation engine or simulation models call services, they provide service namespaces and service names. Nacos will query the current service instance and return the IP address and port number of an instance in the service package to the caller of the service discovery, thereby achieving access to the service instance.
[0044] Step 107: Local service and cloud service unified interface request.
[0045] Specifically, for simulation services running on the cloud platform, the service unified call function provides an HTTP client to interact with the service.
[0046] Step 108: Transform the interaction between the engine, services and service management into a unified format.
[0047] Specifically, when the simulation engine / model makes a related call, the service unified call interaction component sends a request to the service gateway through the HTTP client and obtains the service response result.
[0048] The interactive component implements the unified interactive object in JSON format for the interaction between the simulation engine memory blackboard or memory database, the simulation model and the simulation service. During the service package mounting / calling / uninstalling phase of the service lifecycle management, the unified interactive object returns the parameter information required for the service lifecycle management and calling of all services in this service package.
[0049] Step 109: Maintain the service status by establishing a session.
[0050] Specifically, when processing a service request, the simulation service checks whether the request contains a session identifier. If not, a session is created and stored. If a session identifier is included, the state cache database is read and written according to the session identifier in the simulation request. This maintains the service status during the request call, including the service life cycle status and service business status.
[0051] Step 110: Periodically update the service status through the service proxy model.
[0052] Specifically, the periodic update of the service status is achieved through the service proxy model. When the simulation engine initiates a call to a stateful service, a service proxy model is created to update the service status, allowing the simulation engine to query the service status through the service proxy model. When the stateful service call ends, the simulation engine can request to delete the service proxy model.
[0053] Step 111: The cloud platform generates a unified external interface code.
[0054] Specifically, when the cloud platform simulation service is started, the cloud platform unified interface generation submodule will automatically analyze the cloud platform API and extract key information. With these features, the metadata information of the cloud service API and its related operation parameters can be analyzed through reflection and syntax tree methods, and the unified interface code can be generated based on the meta template.
[0055] Step 112: Cloud platform unified interface calling module.
[0056] Specifically, when calling these unified interfaces, first prepare the call request file and parse the interface parameters. Then, through the self-built hash mapping table, query the call method name of the specific cloud platform according to the specific cloud platform and interface type, and call the interface function based on reflection. Finally, based on the reflection mechanism, pass the parameters and actually call the interface of the specific cloud platform to obtain the return result. In the case of combined calls, ensure that all interface calls in the combination are called successfully and summarize the return results.
[0057] In the above-mentioned scalable simulation service framework system based on microservice architecture, the system includes: simulation service instance management module, simulation service registration and discovery module, simulation service call and interaction module, simulation service state management module and cloud platform unified interface module. The system uses scalable simulation service as the main component of the simulation engine, provides service management and unified call functions, and realizes lightweight, decoupled and centralized management of specific simulation service businesses based on microservice architecture, supporting full life cycle management including service registration, service discovery, service access and service uninstallation.
[0058] In one of the embodiments, the simulation service instance management module includes a namespace management submodule, a service image management submodule, a virtual machine management submodule and an instance resource management submodule.
[0059] The namespace management submodule is used to logically divide the service packages according to preset rules, determine the namespace, and manage the service and resource namespaces using namespace management rules; the namespace management rules include: namespaces must not have duplicate names in the simulation system, and service packages and services in the same namespace must not have duplicate names; service package names are only used in the service package mounting / unmounting stage; when the service is mounted / unmounted / called, the namespace and service name are specified to uniquely specify a service.
[0060] Specifically, the namespace management submodule is used for service and resource namespace management. According to certain rules, service packages are logically divided. For example, several service packages developed by the same unit can be organized under the same namespace.
[0061] The working process of the namespace management submodule in the simulation service instance management module is as follows:
[0062] (1) The simulation engine user calls the namespace creation / query / update / delete interface of the simulation service management submodule to operate the namespace.
[0063] (2) The service package management module obtains namespace information.
[0064] (3) Determine whether the namespace already exists. If the namespace exists, create / query / update / delete the namespace.
[0065] (4) If the namespace does not exist, create the namespace or return an exception result to the user.
[0066] (5) Complete namespace creation / query / update / delete operations.
[0067] The workflow of the namespace management submodule in the simulation service instance management module specifically includes the following steps:
[0068] Step 301: The user starts to perform namespace operations.
[0069] Step 302: The simulation service management obtains the namespace name.
[0070] Step 303: Query the namespace.
[0071] Step 304: Determine whether the namespace exists.
[0072] Step 305: If the namespace exists, determine whether it is a namespace creation operation. If it is a namespace creation operation, jump to step 309.
[0073] Step 306: If it is not a namespace creation operation, then execute the namespace query / update / delete operation, record the namespace operation result and return it.
[0074] Step 307: If the namespace does not exist, determine whether it is an operation to create a namespace. If it is not an operation to create a namespace, jump to step 309.
[0075] Step 308: If it is a namespace creation operation, the namespace creation operation is executed.
[0076] Step 309: Record the namespace operation result and return it.
[0077] Step 310: Complete the namespace operation.
[0078] The service image management submodule is used to provide service image management functions and manage simulation service images in service packages to support simulation service instance management requirements.
[0079] Specifically, the service image management submodule is used for image management based on service packages, providing local and cloud services. According to certain classification standards, all services are implemented in a dynamic library file, for example, weather forecast services, path planning services, and terrain services are organized into a certain scene environment service package according to the relevance of simulation services.
[0080] The service image management submodule includes a unified service entry, through which the simulation engine can obtain the service package management object and perform service lifecycle management and service calls based on this object. The service package implementation base class, the service development team needs to inherit this base class, add the service to this service package, and complete the implementation of the service package. The service implementation base class, the service developer inherits the base class to implement the business logic of the service.
[0081] The working process of the service image management submodule in the simulation service instance management module is as follows:
[0082] (1) The simulation engine user calls the service image creation / query / update / deletion interface of the simulation service management submodule to operate the service image.
[0083] (2) The service package management module obtains service image information.
[0084] (3) Determine whether the service image already exists. If the service image exists, create / query / update / delete the service image.
[0085] (4) If the service image does not exist, create a service image or return an abnormal result to the user.
[0086] (5) Complete the creation / query / update / deletion operations of the service image.
[0087] The workflow of the service image management submodule specifically includes the following steps:
[0088] Step 401: The user starts to perform a service mirroring operation.
[0089] Step 402: Call the service image operation interface.
[0090] Step 403: The simulation service management obtains service image information, including namespace name, service package name, service image and corresponding platform information.
[0091] Step 404: The simulation service management calls the cloud platform unified interface calling module.
[0092] Step 405: Execute relevant service mirroring operation logic on the corresponding interface.
[0093] Step 406: Record the service mirroring status.
[0094] Step 407: Get the service mirroring operation result and return it.
[0095] Step 408: Complete the service mirroring operation.
[0096] The virtual machine management submodule is used to manage service instances according to the two-level structure of namespace-service package; the service instance management process includes: the simulation platform administrator accesses a service instance through the namespace-service package-service instance name, and calls the cloud platform virtual machine related interface through the self-built cloud platform calling submodule to realize the virtual machine management of the service instance; the simulation service runs in the virtual machine, the virtual machine is called a service instance, and the service instance is managed according to the two-level structure of namespace-service package.
[0097] Specifically, the virtual machine management submodule is used for service instance management. For service instance management, the simulation platform manager accesses a service instance through the namespace-service package-service instance name, and calls the cloud platform virtual machine related interface through the self-built cloud platform calling submodule to implement virtual machine management of the service instance.
[0098] The working process of the virtual machine management submodule in the simulation service instance management module is as follows:
[0099] (1) The user calls the create / query / update / delete virtual machine interface based on the specified service image and service instance resource configuration.
[0100] (2) The virtual machine and instance resource management module obtains information such as namespace, service package, and service instance.
[0101] (3) Query the service instance to determine whether the virtual machine exists. If the virtual machine does not exist, create it or return an exception result to the user.
[0102] (4) If the virtual machine exists, call the create / query / update / delete virtual machine interface and return the operation result.
[0103] (5) Complete the creation / query / update / deletion operations of the service instance.
[0104] The workflow of the virtual machine management submodule in the simulation service instance management module specifically includes the following steps:
[0105] Step 501: The user starts to perform virtual machine operations.
[0106] Step 502: The simulation service management obtains the namespace name and the service instance name.
[0107] Step 503: Query the virtual machine.
[0108] Step 504: Determine whether the virtual machine exists.
[0109] Step 505: If the virtual machine exists, determine whether it is an operation to create a virtual machine. If it is an operation to create a virtual machine, jump to step 510.
[0110] Step 506: If it is not a virtual machine creation operation, then a virtual machine query / update / delete operation is performed.
[0111] Step 507: Update the virtual machine status in the database.
[0112] Step 508: If the virtual machine does not exist, determine whether it is an operation to create a virtual machine. If it is not an operation to create a virtual machine, jump to step 510.
[0113] Step 509: If it is a virtual machine creation operation, execute the virtual machine creation operation and jump to step 507.
[0114] Step 510: Record the virtual machine operation result and return it.
[0115] Step 511: Complete the virtual machine operation.
[0116] The instance resource management submodule is used to manage service instance resources. Service instance resources refer to the resources of the virtual machine running the simulation service; service instance resources include the virtual machine hard disk and network card.
[0117] Specifically, in the instance resource management submodule, the service instance runs the service in the virtual machine, and the virtual machine is called the service instance, which is used for service instance resource management. For resource management, the simulation platform manager can call the cloud platform resource-related interface through the self-built cloud platform calling submodule to create, query, update and delete resources such as disks and network cards, and adjust the resource configuration of the virtual machine by calling the virtual machine management interface. Ultimately, the demand for simulation services in multi-machine scenarios is guaranteed.
[0118] The working process of the instance resource management submodule in the simulation service instance management module is as follows:
[0119] (1) Users call the create / query / update / delete virtual machine resource interface based on resources such as hard disks and network cards.
[0120] (2) The virtual machine and instance resource management module obtains information such as resource names.
[0121] (3) Query virtual machine resources to determine whether the resources exist. If the resources do not exist, create them or return an exception result to the user.
[0122] (4) If the resource exists, call the create / query / update / delete virtual machine resource interface and return the operation result.
[0123] (5) Complete the creation / query / update / deletion operations of virtual machine resources;
[0124] The workflow of the instance resource (i.e. virtual machine resource) management submodule in the simulation service instance management module specifically includes the following steps:
[0125] Step 601: The user starts to perform virtual machine resource operations.
[0126] Step 602: The simulation service management obtains the resource name and service resource configuration information.
[0127] Step 603: Query virtual machine resources.
[0128] Step 604: Determine whether the virtual machine resources exist.
[0129] Step 605: If the virtual machine resource exists, determine whether it is an operation to create a virtual machine resource. If it is an operation to create a virtual machine resource, jump to step 610.
[0130] Step 606: If it is not a create virtual machine resource operation, then execute a query / update / delete virtual machine resource operation.
[0131] Step 607: Update the virtual machine resource status in the database.
[0132] Step 608: If the virtual machine resource does not exist, determine whether it is an operation to create a virtual machine resource. If it is not an operation to create a virtual machine resource, jump to step 610.
[0133] Step 609: If it is a virtual machine resource creation operation, execute the virtual machine resource creation operation and jump to step 607.
[0134] Step 610: Record the virtual machine resource operation result and return it.
[0135] Step 611: Complete the virtual machine resource operation.
[0136] In one of the embodiments, the simulation service registration and discovery module includes: a service registration submodule and a service discovery submodule; the service registration submodule is used to perform service registration for the extended simulation service.
[0137] Specifically, the service registration submodule is used to register services with the extended simulation service. In the multi-machine scenario, the service instance information currently available for each service is maintained in real time to ensure the interaction between the simulation engine and the simulation service. The service instance management component of the simulation service management provides service registration and maintains all current simulation service information. Through service registration, the simulation service sends its own information to the service registration and discovery center. The information provided includes namespace, service package name, service instance IP, port number, etc. Based on this information, the service instance is associated with the namespace and service package.
[0138] The working process of the service registration submodule in the simulation service registration and discovery module is as follows:
[0139] (1) Start the service.
[0140] (2) Initialize service instance information.
[0141] (3) Call the service registration interface.
[0142] (4) The simulation service management module saves service instance information.
[0143] (5) The simulation service management module returns the service registration result to the service.
[0144] (6) Complete service registration.
[0145] The workflow of the service registration submodule in the simulation service registration and discovery module specifically includes the following steps:
[0146] Step 701: Start to execute service registration.
[0147] Step 702: Start the simulation service.
[0148] Step 703: The simulation service management obtains service instance information, including the virtual machine IP, service port number, namespace and service package name.
[0149] Step 704: Query whether the service instance exists. If the service instance exists, jump to step 707.
[0150] Step 705: If the query service instance does not exist, create the service.
[0151] Step 706: Save the service instance information.
[0152] Step 707: Call the service registration interface.
[0153] Step 708: Save the service instance registration information.
[0154] Step 709: Record the service registration result and return.
[0155] Step 710: Complete service registration;
[0156] The service discovery submodule is used by the simulation engine to access an instance of this service based on the service namespace and service name through the service discovery mechanism.
[0157] Specifically, the service discovery submodule provides service discovery functions for simulation engines or model entities. It supports the discovery of multiple simulation services of the same service package and the selectivity of simulation services with the same name in multiple service packages. It mainly obtains information such as namespace and service package name based on service discovery requests; calls the service discovery interface, and the simulation service management module queries the service instance information and returns information such as the simulation service instance IP and port number.
[0158] The working process of the service discovery submodule is:
[0159] (1) Mounting service.
[0160] (2) Obtain information such as namespace and service package name.
[0161] (3) Call the service discovery interface.
[0162] (4) The simulation service management module queries the service instance information.
[0163] (5) The simulation service management module returns the service instance information to the service.
[0164] (6) Complete service discovery.
[0165] The workflow of the service discovery submodule in the simulation service registration and discovery module specifically includes the following steps:
[0166] Step 801: Start executing service discovery.
[0167] Step 802: Mount the simulation service.
[0168] Step 803: Obtain the service instance namespace and service package name.
[0169] Step 804: The simulation service management queries a list of all associated virtual machine instances to check whether the service instance exists.
[0170] Step 805: If the query service instance does not exist, report an exception and jump to step 809.
[0171] Step 806: If the query service instance exists, call the service discovery interface.
[0172] Step 807: Obtain service instance information.
[0173] Step 808: Return the service discovery result.
[0174] Step 809: Complete service discovery.
[0175] In one of the embodiments, the working process of the service registration submodule includes: in a multi-machine scenario, real-time maintenance of the currently available service instance information of each service to ensure the interaction between the simulation engine and the simulation service; the service instance management component of the simulation service management provides service registration and maintains all current simulation service information; the simulation service sends its own information to the service registration and discovery center through service registration, and the simulation service information includes namespace, service package name, service instance IP, and port number; based on the namespace, service package name, service instance IP and port number of the simulation service, the service instance is associated with the namespace and service package.
[0176] In one embodiment, the simulation service calling and interaction module includes: a service unified calling submodule and a service unified interaction submodule; the service unified calling submodule is used to provide a service unified interface for the simulation engine and the simulation model.
[0177] Specifically, the service unified call submodule provides a unified service interface for the simulation engine and model. It includes service lifecycle management, providing service package mounting, service mounting, service uninstallation, and service package uninstallation service lifecycle management functions; it supports synchronous and asynchronous service call modes. Synchronous calls send service requests to the corresponding services and block and wait for the return result. Asynchronous calls add service requests to the service request queue and return the result through the callback interface.
[0178] Preferably, the working process of the service unified calling submodule is:
[0179] (1) Simulation service management processes service requests.
[0180] (2) Convert service call information into a unified interaction object.
[0181] (3) Determine whether it is a local service or a cloud service.
[0182] (4) If it is a local service, directly call the service function interface and return the service result.
[0183] (5) If it is a cloud service, determine whether it is an HTTP service. If it is an HTTP service, send an HTTP request, call the corresponding service interface according to the request parameters, and return the service result.
[0184] (6) If it is not an HTTP service, publish a service call message, subscribe to a service call message, and return the service result.
[0185] (7) Complete the service call.
[0186] The workflow of the service unified call submodule in the simulation service call and interaction module specifically includes the following steps:
[0187] Step 901: Start executing service call.
[0188] Step 902: The simulation service management processes the service request.
[0189] Step 903: Convert the service call information into a unified interaction object.
[0190] Step 904: Determine whether the called service is a cloud service.
[0191] Step 905: If it is not a cloud service, directly call the local service interface, and after the call is completed, jump to step 911.
[0192] Step 906: If it is a cloud service, determine whether it is an HTTP request.
[0193] Step 907: If it is not an HTTP request, a service call message is published.
[0194] Step 908: Subscribe to the service call, receive the service call message and return.
[0195] Step 909: If it is an HTTP request, send the HTTP request to the service.
[0196] Step 910: Corresponding service response request.
[0197] Step 911: Return the request result.
[0198] Step 912: Complete the service call.
[0199] The service unified interaction submodule is used to define and implement unified interaction objects between the simulation engine, simulation module and simulation service; when the service is mounted, the service parameters and parameter types are passed to the simulation service management through the unified interaction object; when the service is called, the calling parameters and parameter types, the returned values and parameter types are also passed through the unified interaction object; when the service is uninstalled, the uninstall parameters and parameter types are passed to the simulation service management through the unified interaction object.
[0200] The service unified interaction submodule is used to provide a unified calling interface and interaction specification between the simulation engine, model and simulation service. When the service is mounted, the service parameters and parameter types are passed to the simulation service management through the unified interaction object; when the service is called, the calling parameters and parameter types, the returned values and parameter types are also passed through the unified interaction object; when the service is uninstalled, the uninstallation parameters and parameter types are passed to the simulation service management through the unified interaction object.
[0201] The working process of the service unified interaction submodule is as follows:
[0202] (1) The simulation engine / model provides service interaction information.
[0203] (2) The simulation engine / model builds the interaction object and the service fills the interaction fields.
[0204] (3) The service obtains the interaction object and determines whether the interaction format is a unified interaction object. If it is a unified interaction object, the interaction fields are filled in.
[0205] (4) If it is not a unified interaction object, call the conversion function to convert the interaction into a unified interaction object and fill in the interaction field.
[0206] (5) Complete the use of unified interaction objects.
[0207] The service unified interaction submodule in the simulation service call and interaction module specifically includes the following steps:
[0208] Step 1001: Start to execute unified interactive object generation.
[0209] Step 1002: The simulation model sends a service interaction.
[0210] Step 1003: The service receives the interaction and obtains service information.
[0211] Step 1004: Start building a unified interactive object.
[0212] Step 1005: Fill in fields in the interactive object according to the service information.
[0213] Step 1006: Verify the unified interaction object.
[0214] Step 1007: Determine whether the verification rule has been executed.
[0215] Step 1008: If the execution is completed, the load verification pass status code and pass message are sent.
[0216] Step 1009: If the execution is not completed, perform verification.
[0217] Step 1010: Get the verification result. If it passes, jump to step 1007 to determine whether the execution is completed.
[0218] Step 1011: If it fails, then the verification error status code and error message are loaded.
[0219] Step 1012: Return the unified verification object verification result.
[0220] Step 1013: Generate a unified interactive object.
[0221] Step 1014: Completed.
[0222] In one of the embodiments, the simulation service status management module includes: a service status maintenance submodule and a service status periodic update submodule; the service status maintenance submodule is used to provide a service status management solution on the simulation server; the service status includes: service life cycle status and service business status.
[0223] Specifically, the service status maintenance submodule is used to provide a service status management solution on the simulation server; the service status includes two categories: service life cycle status and service business status.
[0224] When processing a simulation request, the simulation service checks whether the request contains a session identifier. If not, a session identifier is created and stored in the cache database. If a session identifier is included, the session identifier is queried from the database and returned. The session identifier is continuously read and written to the cache database. Session deletion includes database deletion of the session identifier and automatic deletion of the session when it expires.
[0225] The working process of the service status maintenance submodule in the simulation service status management module is as follows:
[0226] (1) The simulation engine / model calls a stateful service.
[0227] (2) Submit service management / service call request.
[0228] (3) The service receives the request and loads state information based on the session.
[0229] (4) The simulation service management module returns service status information based on the session.
[0230] (5) Service processing request.
[0231] (6) The service and simulation service management modules store status information based on sessions.
[0232] (7) The service returns the request result.
[0233] (8) Complete the service status maintenance operation;
[0234] The service state maintenance submodule in the simulation service state management module, the service life cycle state management specifically includes the following steps:
[0235] Step 11-101: The model starts calling the stateful service.
[0236] Step 11-102: The model obtains service management / call parameters.
[0237] Step 11-103: Model sets session fields.
[0238] Step 11-104: The model submits a service management / call request.
[0239] Step 11-105: The simulation service management receives the request and loads the service status information according to the session.
[0240] Step 11-106: The simulation service management returns service status information.
[0241] Step 11-107: The service processes the request.
[0242] Step 11-108: After the processing is completed, the service status information is stored in the request result.
[0243] Step 11-109: Return the stateful service request result.
[0244] Step 11-1010: Complete service lifecycle state management.
[0245] The service state maintenance submodule in the simulation service state management module, the service business state management specifically includes the following steps:
[0246] Step 11-201: The model starts calling the stateful service.
[0247] Step 11-202: Model sends service interaction.
[0248] Step 11-203: The model creates a heartbeat signal.
[0249] Step 11-204: The model sets the session fields, including the heartbeat signal.
[0250] Step 11-205: The model sends a service request.
[0251] Step 11-206: The simulation service management receives the service request.
[0252] Step 11-207: Determine whether the session includes a heartbeat signal.
[0253] Step 11-208: If a heartbeat signal is included, update the service business status.
[0254] Step 11-209: If the heartbeat signal is not included, the connection between the service and the model is terminated.
[0255] Step 11-2010: Record the connection termination.
[0256] Step 11-2011: The request is completed and the request result and service status are returned.
[0257] Step 11-2012: Complete service connection status management.
[0258] The service status periodic update submodule is used to implement the periodic update of the service status by adopting the service proxy model.
[0259] Specifically, the service status periodic update submodule uses the service proxy model to implement the periodic update of the service status. The service proxy model is implemented in a threaded manner and runs between the simulation engine and the simulation service. When the simulation engine initiates a call to a stateful service, a service proxy model is created. According to the timing constraints of the simulation engine, the service status is periodically obtained from the call request, and the service status is updated and queried through the service proxy model. The service proxy model and the simulation model transmit status data through interaction.
[0260] The service status periodic update submodule in the simulation service status management module specifically includes the following steps:
[0261] Step 1201: Start executing the service status periodic update operation.
[0262] Step 1202: The service proxy model receives a request interaction.
[0263] Step 1203: Determine whether the request is for local service.
[0264] Step 1204: If it is a local service, retrieve the local service instance list.
[0265] Step 1205: If it is not a local service, the service proxy model publishes an update message.
[0266] Step 1206: The service instance subscribes to update messages.
[0267] Step 1207: Send the service interaction to the simulation service management through the service proxy model.
[0268] Step 1208: The service management receives the update request and completes the service status update.
[0269] Step 1209: Completed.
[0270] In one of the embodiments, the working process of the service status maintenance submodule includes: when the simulation service processes the simulation request, it checks whether the simulation request contains a session identifier; if it does not contain the session identifier, the connection between the service and the model is terminated; if the session identifier exists, the service business status is updated.
[0271] In one of the embodiments, the working process of the service status periodic update submodule includes: the service proxy model is implemented in a threaded manner and runs between the simulation engine and the simulation service; when the simulation engine initiates a call to a stateful service, a service proxy model is created, and according to the timing constraints of the simulation engine, the service status is periodically obtained from the call request, and the service status is updated and queried through the service proxy model; wherein, the status data is transmitted between the service proxy model and the simulation model through interaction.
[0272] The working process of the service status periodic update submodule is as follows:
[0273] (1) Simulation engine / model sending interaction.
[0274] (2) Generate a heartbeat signal and set the session field.
[0275] (3) Send a heartbeat signal to the service.
[0276] (4) Check whether the service receives the heartbeat signal. If not, the service disconnects from the engine / model and completes the service connection status management.
[0277] (5) If a heartbeat signal is received, the service connection status is updated.
[0278] (6) Complete service connection status management.
[0279] In one of the embodiments, the cloud platform unified interface module includes: a cloud platform unified interface generation submodule and a cloud platform unified interface calling submodule.
[0280] The cloud platform unified interface generation submodule is used to generate a unified management and monitoring interface by abstracting the differences between different cloud platforms; the unified management and monitoring interface includes: virtual machine image management interface, virtual machine management interface, storage management interface, network card management interface, elastic scaling interface and service interface.
[0281] Specifically, the cloud platform unified interface generation submodule is used to abstract the differences between different cloud platforms and provide a unified management and monitoring interface. The unified interface includes virtual machine image management interface, virtual machine management interface, storage management interface, network card management interface, elastic scaling interface and service interface, which are adapted for specific interface generation of specific cloud platforms. Interface mapping and parameter mapping schemes are automatically generated through meta templates. Parameter values are filled in by reflection, and the request parameters are structures ending with request, which encapsulate all the parameters required for the request and are decoupled when calling the underlying API. The results returned by the underlying API will also be encapsulated in the corresponding structure ending with response, and sent to the user by encoding it into structured data.
[0282] The working process of the cloud platform unified interface generation submodule is as follows:
[0283] (1) The user initiates a unified interface generation operation and uploads the specified cloud platform software development kit.
[0284] (2) The cloud platform parses the interface information in the software development kit.
[0285] (3) The cloud platform generates a unified interface.
[0286] (4) The user end obtains a unified interface.
[0287] (5) Complete the unified interface generation.
[0288] The cloud platform unified interface generation submodule in the cloud platform unified interface module specifically includes the following steps:
[0289] Step 1301: Start generating the cloud platform unified interface.
[0290] Step 1302: The user initiates a unified interface generation operation.
[0291] Step 1303: Upload the cloud platform software development kit.
[0292] Step 1304: The cloud platform uniformly calls the module to analyze the interface in the software development kit and obtain interface information.
[0293] Step 1305: The cloud platform unified calling module generates a unified interface based on the interface information and the meta template.
[0294] Step 1306: An interface generated by the virtual machine management.
[0295] Step 1307: Complete the generation of the cloud platform unified interface.
[0296] The cloud platform unified interface calling submodule is used to provide a unified calling interface. By calling a certain cloud platform interface or combining multiple cloud platform interfaces, virtual machine management, virtual machine resource management, and virtual machine resource status acquisition are performed.
[0297] Specifically, the cloud platform unified interface calling submodule provides a unified calling interface, and realizes virtual machine management, virtual machine resource management, virtual machine resource status acquisition and other functions by calling a certain cloud platform interface, or combining multiple cloud platform interfaces. First, use a file in JSON or YAML format to describe the cloud platform type, the calling interface name (such as the load balancing interface) and the corresponding parameters; the unified interface calling module has built-in JSON and YAML type encoders / decoders to parse the parameter names and values under a specific path; through the self-built hash mapping table, according to the specific cloud platform and interface type, query the calling method name of the specific cloud platform, and call the interface function based on reflection; after obtaining the calling method and parameters of the specific cloud platform, based on the reflection mechanism, pass the parameters and actually call the interface of the specific cloud platform to obtain the return result.
[0298] The working process of the unified interface calling submodule is as follows:
[0299] (1) Simulation service management and simulation service monitoring send unified interface call requests to the self-built cloud platform.
[0300] (2) Cloud platform loading interface calling scheme.
[0301] (3) Cloud platform conversion interface name and parameters.
[0302] (4) Determine whether it is a combined call. If not, directly call the corresponding interface of the cloud platform.
[0303] (5) If it is a combined call, the combined call to the cloud platform interface is repeated until the call is completed.
[0304] (6) Return the interface call results to the simulation service management and simulation service monitoring.
[0305] (7) The unified interface call is completed.
[0306] The cloud platform unified interface calling submodule in the cloud platform unified interface module specifically includes the following steps:
[0307] Step 1401: Start executing the cloud platform unified interface call.
[0308] Step 1402: The simulation service management sends a virtual machine management unified interface call request to the cloud platform calling module.
[0309] Step 1403: The cloud platform calling module obtains the calling parameters of the virtual machine management unified interface call.
[0310] Step 1404: The cloud platform calling module maps the virtual machine management unified interface call to the virtual machine management interface call of the specific cloud platform.
[0311] Step 1405: The cloud platform calls the module to convert the interface name and parameters.
[0312] Step 1406: The cloud platform calling module determines whether the call is a combined call.
[0313] Step 1407: If it is not a combined call, just call the corresponding cloud platform interface and jump to step 1410.
[0314] Step 1408: If it is a combined call, the cloud platform interfaces included in the combined call are called in sequence.
[0315] Step 1409: Determine whether the call is completed. If not, jump to step 1408.
[0316] Step 1410: If the call is completed, the virtual machine resource management counts the call results and returns.
[0317] Step 1411: Complete the unified interface call;
[0318] In one of the embodiments, the working process of the cloud platform unified interface generation submodule includes: using a file in JSON or YAML format to describe the cloud platform type, the calling interface name and the corresponding parameters; the unified interface calling module has built-in JSON and YAML type encoders / decoders to parse the parameter names and values under a specific path; through a self-built hash mapping table, according to the specific cloud platform and interface type, the calling method name of the specific cloud platform is queried, and the interface function call is performed based on reflection; after obtaining the specific cloud platform calling method and parameters, based on the reflection mechanism, the parameters are passed and the interface of the specific cloud platform is actually called to obtain the return result.
[0319] Specifically, the present application builds a unified interaction object based on mainstream JSON, and provides conversion functions between the engine's internal data blackboard object. For JSON strings, the unified interaction object implemented by the present application based on mainstream JSON can be serialized into a string, or a unified interaction object can be constructed through a string that conforms to the JSON specification. For the engine's internal data blackboard object, the present application provides a function for converting from a unified interaction object to an engine's internal data blackboard object, and a function for converting from an engine's internal data blackboard object to a unified interaction object, to achieve efficient conversion.
[0320] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0321] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A scalable simulation service framework system based on microservice architecture, characterized in that: The system includes: a simulation service instance management module, a simulation service registration and discovery module, a simulation service call and interaction module, a simulation service state management module and a cloud platform unified interface module; The simulation service instance management module is used to manage simulation services in the form of service packages, manage service instances in the form of virtual machines according to the two-level structure of namespace-service package, and constrain service access according to preset service development specifications and standards; The simulation service registration and discovery module is used to register the extended simulation service using a predetermined service governance framework and message middleware; it is also used to provide a service discovery function for the simulation engine or model entity; The simulation service calling and interaction module is used to obtain the parameters and their types required for simulation service registration, calling and uninstalling by specifying the namespace and service name, and obtain the simulation service calculation results; it is also used to interact with the engine memory blackboard or memory database and model by providing a unified interaction object; The simulation service status management module is used to provide a service status management solution on the simulation server and implement periodic update of service status using a service proxy model; The cloud platform unified interface module is used to generate a unified management and monitoring interface by abstracting the differences between different cloud platforms, and provide a unified service access interface to the model; Wherein, the simulation service instance management module includes a namespace management submodule, a service image management submodule, a virtual machine management submodule and an instance resource management submodule; The namespace management submodule is used to logically divide the service package according to preset rules, determine the namespace, and manage the service and resource namespace using the namespace management rules; the namespace management rules include: the namespace must not have the same name in the simulation system, and the service package and service in the same namespace must not have the same name; the service package name is only used in the service package mounting / unmounting stage; when the service is mounted / unmounted / called, the namespace and service name are specified to uniquely specify a certain service; The service image management submodule is used to provide a service image management function, manage the simulation service image in units of service packages to support the simulation service instance management requirements; The virtual machine management submodule is used to manage service instances according to the two-level structure of namespace-service package; the service instance management process includes: the simulation platform manager accesses a service instance through the namespace-service package-service instance name, and calls the cloud platform virtual machine related interface through the self-built cloud platform calling submodule to realize the virtual machine management of the service instance; the simulation service runs in the virtual machine, the virtual machine is called the service instance, and the service instance is managed according to the two-level structure of namespace-service package; The instance resource management submodule is used to manage service instance resources; the service instance resources refer to the resources of the virtual machine running the simulation service; the service instance resources include the virtual machine hard disk and network card.
2. The system according to claim 1, characterized in that The simulation service registration and discovery module includes: a service registration submodule and a service discovery submodule; The service registration submodule is used to register the extended simulation service; The service discovery submodule is used for the simulation engine to access a certain instance of this service based on the service namespace and the service name through the service discovery mechanism.
3. The system according to claim 2, characterized in that The working process of the service registration submodule includes: In multi-machine scenarios, the service instance information currently available for each service is maintained in real time to ensure the interaction between the simulation engine and the simulation service; The service instance management component of simulation service management provides service registration and maintains all current simulation service information; The simulation service sends its own information to the service registration and discovery center through service registration. The information of the simulation service includes namespace, service package name, service instance IP, and port number. Based on the namespace, service package name, service instance IP, and port number of the simulation service, associate the service instance with the namespace and service package.
4. The system according to claim 1, characterized in that The simulation service calling and interaction module includes: a service unified calling submodule and a service unified interaction submodule; The service unified calling submodule is used to provide a unified service interface for the simulation engine and the simulation model; The service unified interaction submodule is used to define and implement unified interaction objects between the simulation engine, simulation module and simulation service; when the service is mounted, the service parameters and parameter types are passed to the simulation service management through the unified interaction object; when the service is called, the called parameters and parameter types, the returned values and parameter types are also passed through the unified interaction object; when the service is uninstalled, the uninstall parameters and parameter types are passed to the simulation service management through the unified interaction object.
5. The system according to claim 1, characterized in that The simulation service status management module includes: a service status maintenance submodule and a service status periodic update submodule; The service status maintenance submodule is used to provide a service status management solution on the simulation server; the service status includes: service life cycle status and service business status; The service status periodic update submodule is used to implement the periodic update of the service status by adopting the service proxy model.
6. The system according to claim 5, characterized in that The working process of the service status maintenance submodule includes: When processing a simulation request, the simulation service checks whether the simulation request contains a session identifier; If the session identifier is not included, the service's connection to the model is terminated; If the session identifier exists, the service business state is updated.
7. The system according to claim 5, characterized in that The working process of the service status periodic update submodule includes: The service proxy model is implemented in a threaded manner and runs between the simulation engine and the simulation service; When the simulation engine initiates a call to a stateful service, a service proxy model is created. According to the timing constraints of the simulation engine, the service status is periodically obtained from the call request, and the service status is updated and queried through the service proxy model. The service proxy model and the simulation model transmit status data through interaction.
8. The system according to claim 1, characterized in that The cloud platform unified interface module includes: a cloud platform unified interface generation submodule and a cloud platform unified interface calling submodule; The cloud platform unified interface generation submodule is used to generate a unified management and monitoring interface by abstracting the differences between different cloud platforms; the unified management and monitoring interface includes: virtual machine image management interface, virtual machine management interface, storage management interface, network card management interface, elastic scaling interface and service interface; The cloud platform unified interface calling submodule is used to provide a unified calling interface, and perform virtual machine management, virtual machine resource management, and virtual machine resource status acquisition by calling a certain cloud platform interface or combining multiple cloud platform interfaces.
9. The system according to claim 8, characterized in that The working process of the cloud platform unified interface generation submodule includes: Use a file in JSON or YAML format to describe the cloud platform type, calling interface name, and corresponding parameters; The unified interface call module has built-in JSON and YAML type encoders / decoders to parse parameter names and values under specific paths; Through the self-built hash mapping table, according to the specific cloud platform and interface type, the calling method name of the specific cloud platform is queried, and the interface function call is made based on reflection; After obtaining the calling method and parameters of a specific cloud platform, based on the reflection mechanism, the parameters are passed and the interface of the specific cloud platform is actually called to obtain the return result.
Citation Information
Patent Citations
Multi-cloud management implementation method based on Liblock
CN111124286A
Centralized combat simulation system and modularized construction method of service thereof
CN116450090A
Implementation method and system of simulation middleware based on message center communication
CN116455972A
Signal-level simulation platform cloudization method based on cloud + end architecture
CN116502437A
Real-time simulation platform system and simulation system construction method
CN116822135A
