Service Management Method, System, Terminal and Storage Medium
Through the collaborative work of the service scheduling unit and the event processing unit, the problem of confusion in service templates and instance management is solved, and the rapid deployment and efficient management of service requests are realized.
Patent Information
- Application Number
- CN202011441757.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-11
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2040-12-11
AI Technical Summary
During the software service management process, the management of service templates and service instances is chaotic, resulting in poor processing efficiency.
The service scheduling unit determines the target service template associated with the service request, generates deployment instructions, and sends it to the service warehouse through the event processing unit. The service warehouse generates and runs the target service instance based on the instructions, realizing the separation management of the service template and instance.
It improves the orderliness and processing efficiency of service management, and realizes the rapid deployment and query of service requests.
Smart Images

Figure CN112667247B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of information processing, and particularly relates to a service management method, system, terminal, and storage medium. Background Art
[0002] In software, specific services can be provided through a service architecture that includes a service registration unit. Currently, in practical scenarios, the service registration unit usually completes service registration and discovery through an active query or polling mode. However, in current applications, a certain service in the service registration unit refers to both the template of the service and the instance of the service, making the management of the service template and the service instance in the service registration unit relatively chaotic in specific applications, resulting in poor processing efficiency. Summary of the Invention
[0003] Embodiments of this application provide a service management method, device, terminal, and storage medium to solve the problem that in the current service management process of software, the management of the service template and the instance of the service is chaotic and the processing efficiency is poor.
[0004] In a first aspect, embodiments of this application provide a service management method, including:
[0005] If a service scheduling unit obtains a first service request, determine, through the service scheduling unit, a first target service template associated with the first service request, and generate deployment instruction information according to the first service request and the first target service template;
[0006] Send the deployment instruction information to an event processing unit through the service scheduling unit;
[0007] Send the received deployment instruction information to a service repository through the event processing unit;
[0008] Generate a first target service instance and run it according to the received deployment instruction information through the service repository.
[0009] Using the service management method provided by this application, the service scheduling unit determines in real time whether there is a first service request. If it is determined that there is a first service request, then according to the first service request, the first target service template associated with the first service request is determined, and deployment instruction information is generated based on the first service request and the first target service template. Then, the deployment instruction information is sent to the event processing unit through the service scheduling unit, and the event processing unit determines the next object for processing the to-be-deployed instruction message based on this deployment instruction information, that is, the received deployment instruction information is sent to the service repository through the event processing unit according to the confirmed result. Further, in the service repository, a first target service instance is generated and run based on the received deployment instruction information. Based on the solution of this application, the service requirements existing in the service scheduling unit are utilized, and by only processing the information of the service instance corresponding to the service template, the service repository can quickly complete the deployment of the corresponding target service instance according to the information of the service instance. Moreover, the operations of obtaining the service request and querying the associated service template according to the service request are separated from the operation of generating the service instance, and the management is more orderly, greatly improving the processing efficiency.
[0010] In a second aspect, an embodiment of this application provides a service management system, including: a service scheduling unit, a service repository, and a service registration unit;
[0011] The service scheduling unit is configured to, if a first service request is obtained, determine, through the service scheduling unit, the first target service template associated with the first service request, and generate deployment instruction information based on the first service request and the first target service template;
[0012] The service scheduling unit is further configured to send the deployment instruction information to the event processing unit;
[0013] The event processing unit is configured to send the received deployment instruction information to the service repository;
[0014] The service repository is configured to generate and run a target service instance based on the received deployment instruction information.
[0015] In a third aspect, an embodiment of this application provides a terminal device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the service management method is implemented.
[0016] In a fourth aspect, an embodiment of this application provides a computer-readable storage medium, including: the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the service management method is implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device is caused to execute the service management method described in any one of the above first aspects.
[0018] It can be understood that for the beneficial effects of the above second aspect to fifth aspect, reference may be made to the relevant descriptions in the above first aspect, which will not be elaborated herein. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 It is a flowchart of a service management method provided by an embodiment of the present application.
[0021] Figure 2 It is a flowchart of a service management method provided by another embodiment of the present application.
[0022] Figure 3 It is a flowchart of a service management method provided by another embodiment of the present application.
[0023] Figure 4 It is a flowchart of a service management method provided by another embodiment of the present application.
[0024] Figure 5 It is a flowchart of a service management method provided by another embodiment of the present application.
[0025] Figure 6 It is a schematic structural diagram of a service management system provided by an embodiment of the present application.
[0026] Figure 7 It is a schematic structural diagram of a terminal provided by another embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0028] To illustrate the technical solution described in this application, the following will be described by specific embodiments.
[0029] Please refer to Figure 1 , Figure 1 which is a flowchart showing the implementation of a service management method provided by an embodiment of this application. In this embodiment, the service management method is used to manage the templates of services and the instances of such services, so as to make the management of service templates and service instances more orderly and greatly improve the corresponding information processing efficiency.
[0030] As Figure 1 shown, the service management method includes the following steps:
[0031] S11: If the service scheduling unit obtains a first service request, then through the service scheduling unit, determine the first target service template associated with the first service request, and generate deployment instruction information according to the first service request and the first target service template.
[0032] In step S11, the service scheduling unit is a software component compiled by a computer language to implement the functions of service instance search and orchestration. Among them, the software component is a reusable functional module in the application architecture and can be implemented by a file compiled by a computer language.
[0033] The first service request is used to describe the requirement of deploying a service instance through the first target service template to complete a logical operation task. At least one work task is recorded in the first service request. It can be understood that in order to complete the work tasks recorded in a first service request, it may be necessary to deploy the corresponding service instances of multiple service templates respectively to cooperate to complete the work tasks recorded in the first service request.
[0034] The first service template is a set of static service description files. For example, the service template includes at least one of the following information: service specifications, service interface files, service codes, service deployment packages, container files, deployment policy files, service description files, etc.
[0035] The deployment instruction information is used to instruct the service repository to deploy the corresponding service instance for the first target service template, so as to complete the work task corresponding to the first service request through the deployed service instance.
[0036] In this embodiment, the service scheduling unit obtains a first service request, determines a first target service template associated with the first service request according to the first service, and generates deployment instruction information according to the first service request and the first target service template. The consideration is to separate the operation on the service template from the subsequent operation of the service repository to generate a first target service instance according to the received deployment instruction information, that is, to perform separate operations for each type of operation, so as to make the management of various operations more orderly, thereby solving the technical problem that in the current service management process of software, the service template and the instance of the service are mixed, resulting in chaotic management of the service template and the instance of the service.
[0037] S12: Through the service scheduling unit, send the deployment instruction information to the event processing unit.
[0038] In step S12, the event processing unit is a software component obtained by compiling a computer language to implement event response and message forwarding functions. It can be understood that when the event processing unit receives a message, it can determine the next object for processing the message based on the message through the event processing unit, and then the event processing unit sends the message to the next object determined by the lock.
[0039] In this embodiment, by the service scheduling unit, the deployment instruction information is sent to the event processing unit. The purpose is to discover the need for deploying service instances through the event processing unit, and at the same time, through the event processing unit, determine the responder of the information according to the deployment instruction message, that is, through the event processing unit, determine whether it is necessary to deploy service instances according to the first service request and the first target service template to complete the tasks corresponding to the first service request based on the deployed service instances, that is, through the time processing unit, determine that the service repository is the next responder to the deployment instruction message, that is, in the way of an event chain, transfer the deployment instruction message to the service repository.
[0040] S13: Through the event processing unit, send the received deployment instruction information to the service repository.
[0041] In step S13, the service repository is a software component obtained by compiling a computer language to implement the management and release of service templates and the deployment function of service instances corresponding to the service templates.
[0042] In this embodiment, after the event processing unit determines that the next responder to the deployment instruction information message is the service repository, the received deployment instruction information is sent to the service repository. The purpose is to facilitate the service repository to complete the first service request and the first target service template according to the deployment instruction message and deploy service instances for completing each task included in the first service request.
[0043] S14: Generate a first target service instance based on the received deployment instruction information through the service repository and run it.
[0044] In step S14, the first target service instance is program code that runs the files recorded in the first target service template according to a preset rule to complete the tasks corresponding to the first service request. Specifically, the first target service template is static program code, and the first target service instance is program code in a running state. The difference is that the first target service template does not occupy the running memory of the terminal and does not perform specific logical operation processes to complete the preset operations in the work tasks corresponding to the first service request, while the first target service instance will occupy the running memory of the terminal to perform certain logical operations using the computing resources of the terminal to complete the preset operations in the work tasks corresponding to the first service request.
[0045] In this embodiment, the service repository determines at least one first target service template involved in the deployment instruction information according to the received deployment instruction information, and establishes a container for accommodating the service instances respectively corresponding to the at least one first target service template according to the determined at least one first target service template. Each service instance for completing the tasks corresponding to the first service request is deployed in the container. Among them, the container is compiled through a computer language to implement a software component that can accommodate multiple service instances.
[0046] It can be understood that after the service repository completes the establishment of the container and deploys the first target service instance in the container according to the deployment instruction information, when the container is activated, the first target service instance deployed in the container also runs accordingly to perform certain logical operations, so as to complete the tasks corresponding to the first service request.
[0047] See Figure 2 , as a possible implementation manner of this embodiment, after generating a first target service instance based on the received deployment instruction information through the service repository and running it, it further includes:
[0048] S21: Generate an identifier of the first target service instance through the service repository, and generate an instance running message according to the identifier and the first target service instance.
[0049] S22: Send the instance running message to the service registration unit through the service repository.
[0050] S23: Associate the identifier with the first target service template according to the received instance running message through the service registration unit.
[0051] In this embodiment, the identifier of the first target service instance is information that uniquely identifies the service instance so as to distinguish the service instance from other service instances. The identifier is composed of at least one of numbers, letters, or other characters. For example, the identifier of the first target service instance A is 13D, and the identifier of the first target service instance B is 13C. For the first target service instance A and the first target service instance B, they can be distinguished by their respective corresponding identifiers.
[0052] The instance running message is used to describe a service instance in a running state. The instance running message may include at least one of the identifier of the service instance, the service template information corresponding to the service instance, and the container information corresponding to the service instance. It can be understood that the instance running messages corresponding to each service instance in a running state are different.
[0053] The service registration unit is a software component compiled by a computer language to manage the template of a service and the instance of the service.
[0054] In one embodiment, the instance running message is sent to the event processing unit through the service repository, and the event processing unit sends the instance running message to the service registration unit. Among them, the event processing unit determines that the service registration unit is the next event responder for the instance running message according to the instance running message. Therefore, the event processing unit sends the received instance running message to the service registration unit.
[0055] In one embodiment, in order to ensure the correctness of the information of each service instance recorded in the service registration unit, the service registration unit determines whether the running state of the service instance corresponding to the instance running message meets the preset running state condition according to the received instance running message. If the running state of the service instance meets the preset running state condition, it means that the service instance corresponding to the instance running message is in a stable running state. Further, the identifier is associated with the first target service template. The preset running state condition is information used to describe whether the service instance is in a state of normally processing tasks.
[0056] In one embodiment, the service registration unit uses registry entries to associate service templates with service instances. Among them, in the registry entries, the relationship between the service template and the service instance can be a one-to-one relationship or a one-to-many relationship, that is, it means that one service template may generate one service instance, or one service template may generate multiple service instances.
[0057] See Figure 3 , in some embodiments, the service management method includes:
[0058] S31: If the service registration unit receives a service instance deregistration request, the service registration unit generates an inspection indication message according to the service instance deregistration request and sends the inspection indication message to the service scheduling unit;
[0059] S32: The service scheduling unit confirms whether there is a second target service instance among at least one first target service instance in operation according to the received inspection indication message, generates a confirmation result, and sends the confirmation result to the service registration unit;
[0060] S33: If the confirmation result indicates that there is no second target service instance among at least one of the first target service instances, the service registration unit deregisters the second target service instance according to the received confirmation result.
[0061] In this embodiment, the service instance deregistration request is used to describe the user's requirement to stop the service instance, that is, the requirement to request the deregistration of the service instance selected by the user. In a service instance deregistration request, there may be a requirement to deregister multiple service instances, that is, a message including the service instances to be deregistered.
[0062] The inspection indication message is used to indicate whether there is a second target service instance among at least one first target service instance in operation by the service scheduling unit and generate a confirmation result. Specifically, the service scheduling unit checks the stored service instance running queue to confirm whether the running queue includes the service instance message to be deregistered, and forms a confirmation result according to the inspection situation.
[0063] The confirmation result is used to describe the information indicating that there is a second target service instance or no second target service instance among at least one of the first target service instances confirmed by the service scheduling unit for the service instances in operation.
[0064] It can be understood that when the service registration unit receives the confirmation result, if it is determined according to the confirmation result that there is no second target service instance among at least one of the first target service instances, the second target service instance is deregistered; otherwise, the information of the second target service instance is deleted from the information of each service instance recorded by the service registration unit. In a specific implementation manner, the information of the second target service instance is deleted from the service instance registration list stored in the service registration unit, so as to facilitate the user to modify the configuration information of the service template corresponding to the service instance.
[0065] In one embodiment, if the service registration unit receives a service instance deregistration request, the service registration unit generates an inspection indication message according to the service instance deregistration request and sends the inspection indication message to the event processing unit, so that the event processing unit sends the inspection indication message to the service scheduling unit. The service scheduling unit sends the confirmation result to the event processing unit, and then the event processing unit sends the confirmation result to the service registration unit.
[0066] See Figure 4 , in some embodiments, the service management method includes:
[0067] S41: If a second service request is received through the service scheduling unit, the service scheduling unit determines the number of second target service templates associated with the second service request according to the second service request.
[0068] In step S41, the second service request is used to request to call a service instance associated with the second target service template to perform a preset operation.
[0069] The second target service template is a set of service description files describing static information. For example, the service template includes at least one of service specifications, service interface files, service codes, service deployment packages, container files, deployment policy files, service description files, etc. It can be understood that corresponding service instances can be generated through the second target service template, and the service instances can be used to complete the preset operations corresponding to the work tasks corresponding to the second service request.
[0070] In some embodiments, the second service request is a service request outside the preset service list recorded in the service scheduling unit. The preset service list is used to describe the range of predetermined service content of the service scheduling unit. For example, the service content recorded in the preset service list of the service scheduling unit includes A and B, and the service content recorded in the second service request includes C, then the second service request is a service request outside the preset service list recorded in the service scheduling unit.
[0071] In this embodiment, when the service scheduling unit receives the second service request, it analyzes the second service request to determine the second target service template involved in the task of the second service request, so as to determine the number of second target service templates associated with the second service request, that is, to determine the number of service instances corresponding to the second target service template required to complete the task of the second service request.
[0072] It can be understood that the more tasks involved in the second service request, the more second target service templates associated with the second service request may be determined. Therefore, in order to facilitate better completion of the tasks corresponding to the second service request and manage the templates and instances of the service, the number of second target service templates associated with the second service request is determined in advance.
[0073] S42: If it is determined by the service scheduling unit that the number is less than the preset number, a first selection message is generated according to the second service request, and the first selection message is sent to the service registration unit.
[0074] In step S42, the preset number is used to describe the minimum number of second target service templates when the call order of the second target service templates associated with the second service request needs to be arranged. For example, when the number of second target service templates associated with the second service request is 2, the call order of these 2 second target service templates needs to be arranged. On the contrary, it means that there is only 1 second target service template associated with the second service request, that is, through the instance of this 1 second target service template, the tasks corresponding to the second service request can be completed.
[0075] The first selection message is used to indicate that according to the second service request, a service instance that meets the preset conditions is selected from at least one running service instance corresponding to the second target service template.
[0076] The preset condition is the minimum qualification condition corresponding to the service instance that can be used to perform the preset operation among the service instances associated with the second target service template.
[0077] In one embodiment, the service scheduling unit sends the first selection message to the event processing unit, and the event processing unit sends the first selection message to the service registration unit.
[0078] S43: The service registration unit selects a third target service instance for completing the tasks of the second service request from at least one running service instance according to the received first selection message, and generates an instance selection message according to the third target service instance, where the third target service instance meets the preset conditions.
[0079] In step S43, the first selection message is used to indicate that the service registration unit selects a third target service instance that meets the preset conditions according to the information of at least one running service instance corresponding to the second target service template.
[0080] The instance selection message is used to describe the confirmed third target service instance. The instance selection message includes at least one of the identifier of the third target service instance, the service template information corresponding to the third target service instance, and the container information in which the third target service instance is deployed.
[0081] It can be understood that when the service registration unit receives the first selection message sent by the service scheduling unit, it can understand the need of the service scheduling unit to determine a service instance for performing the task of the second service request. Furthermore, the service registration unit selects, according to the received first selection message, a third target service instance from at least one running service instance for completing the task of the second service request, and generates an instance selection message according to the third target service instance.
[0082] S44: Send the instance selection message to the service scheduling unit through the service registration unit.
[0083] In step S44, sending the instance selection message to the service scheduling unit through the service registration unit aims to feedback the information of the third target service instance determined by the service registration unit for performing the task of the second service request to the service scheduling unit, so that the service scheduling unit can call the corresponding service instance according to the example selection message to perform the task of the second service request.
[0084] In an embodiment, the instance selection message is sent to the event processing unit through the service registration unit, and the event processing unit sends the instance selection message to the service scheduling unit.
[0085] S45: Generate a service call message according to the received instance selection message through the service scheduling unit, and send the service call message to the event processing unit.
[0086] In step S45, the service call message is used to describe the preset operation of the service instance to be called and the work task corresponding to the second service request to be executed.
[0087] It can be understood that the service instance to perform the task of the second service request can be known through the service call message. The service instance to be called is a running service instance.
[0088] S46: Send the received service call message to the third target service instance through the event processing unit to instruct the third target service instance to perform the preset operation according to the service call message.
[0089] In one embodiment, after the third target service instance executes the operations corresponding to the second service request according to the service call message, an execution result is obtained, and an execution result message is generated based on the execution result. The third target service instance sends the execution result message to the event processing unit, and the event processing unit sends the execution result message to the service scheduling unit, so that the service scheduling unit can confirm the execution status of the task of the second service request according to the execution result message.
[0090] In this embodiment, the execution result is used to describe the situation of the third target service instance executing the task corresponding to the second service request.
[0091] As a possible implementation manner of this embodiment, the service registration unit selects a third target service instance for completing the task corresponding to the second service request from at least one running service instance according to the received first selection message, including:
[0092] The service registration unit obtains the running load information of at least one service instance recorded in the service registration unit according to the first selection message, where at least one service instance recorded in the service registration unit is a running service instance generated based on the second target service template;
[0093] The service registration unit determines the service instance with the smallest running load as the third target service instance according to the running load information of the at least one service instance.
[0094] In this embodiment, the running load information is used to describe the number of tasks borne by the service instance and the length of time required to execute the tasks.
[0095] It can be understood that the service registration unit determines the service instance with the smallest running load as the third target service instance according to the running load information of the at least one service instance, considering that the service instance with the smallest running load executes the operations corresponding to the second service request according to the service call message, so as to shorten the time spent in completing the task of the second service request. In a possible implementation manner of this embodiment, if the service scheduling unit determines that the quantity is greater than the preset quantity, the service scheduling unit determines the call sequence corresponding to the second target service template associated with the second service request according to the second service request;
[0096] The service scheduling unit sequentially generates a second selection message according to the call sequence and sends the second selection message to the service registration unit;
[0097] The service registration unit determines a third target service instance for completing the second service request according to the received second selection message.
[0098] In this embodiment, the call order is the order of tasks for using the service instance corresponding to the second target service template to complete the second service request. It can be understood that there is a certain execution process for the tasks in the second service request. For each stage in this execution process, different service instances may be used to complete it. Therefore, according to the second service request, the call order corresponding to the second target service template associated with the second service request is determined, so as to sequentially call each running service instance to execute the tasks of the second service request according to this call order.
[0099] The second selection message is used to indicate that the service registration unit selects a third target service instance that meets the preset conditions according to the information of at least one running service instance corresponding to the second target service template.
[0100] See Figure 5 , in some embodiments, the service management method includes:
[0101] S51: If at least one new service template is received through the service repository, for each new service template, generate template addition information corresponding to the new service template;
[0102] S52: The service scheduling unit sends the template addition information to the event processing unit;
[0103] S53: The event processing unit sends the received template addition information to the service registration unit;
[0104] S54: If the service registration unit receives the template addition information, the service registration unit records the template addition information.
[0105] In this embodiment, the new service template is a set of static service description files newly developed by a service developer. For example, the new service template includes at least one of information such as service specifications, service interface files, service codes, service deployment packages, container files, deployment policy files, service description files, etc.
[0106] The template addition information is used to describe the corresponding new service template. The template addition information includes at least one of information such as the information of the service template and the time point of addition, etc.
[0107] It can be understood that the purpose of sending the template addition information to the event processing unit through the service scheduling unit is to confirm the next response unit of the template addition information through the event processing unit, so that the response unit can process the template addition information. That is, when the service registration unit receives the template addition information, the service registration unit records the template addition information, records the newly added service template in the service registration unit, completes the registration of the newly added service template, and when there is a service instance corresponding to the newly added service template subsequently, the service instance is associated with the newly added service template.
[0108] By using the service management method provided in this application, the service scheduling unit determines in real time whether there is a first service request. If it is determined that there is a first service request, then according to the first service request, the first target service template associated with the first service request is determined, and deployment indication information is generated based on the first service request and the first target service template. Then, through the service scheduling unit, the deployment indication information is sent to the event processing unit, and the event processing unit determines the object for processing the pending deployment indication message based on the deployment indication information. Further, the event processing unit sends the received deployment indication information to the service repository. Further, in the service repository, a first target service instance is generated and run based on the received deployment indication information. Based on the solution of this application, the service demand existing in the service scheduling unit is utilized, and only the information of the service instance corresponding to the service template is processed, so that the service repository can quickly complete the deployment of the corresponding target service instance according to the information of the service instance, and the operations of obtaining the service request and querying the associated service template according to the service request are separated from the operation of generating the service instance, and the management is more orderly, and the processing efficiency is greatly improved.
[0109] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.
[0110] Corresponding to the service management method described in the above embodiments, Figure 6 The structural block diagram of the service management system provided by the embodiments of this application is shown. For the convenience of description, only the parts related to the embodiments of this application are shown.
[0111] Referring to Figure 6 , the system includes: a service scheduling unit 101, a service repository 103, and a service registration unit;
[0112] The service scheduling unit 101 is configured to, if a first service request is obtained, determine, through the service scheduling unit 101, a first target service template associated with the first service request, and generate deployment instruction information according to the first service request and the first target service template;
[0113] The service scheduling unit 101 is further configured to send the deployment instruction information to the event processing unit 102;
[0114] The event processing unit 102 is configured to send the received deployment instruction information to the service repository 103;
[0115] The service repository 103 is configured to generate a first target service instance according to the received deployment instruction information and run it.
[0116] In one embodiment, the system further includes: a service registration unit.
[0117] The service repository 103 is further configured to generate an identifier of the first target service instance, and generate an instance running message according to the identifier and the first target service instance;
[0118] The service repository 103 is further configured to send the instance running message to the service registration unit;
[0119] The service registration unit is configured to associate the identifier with the first target service template according to the received instance running message.
[0120] In one embodiment, the system further includes: a service registration unit.
[0121] The service registration unit is further configured to, if a service instance cancellation request is received, generate a check instruction message according to the service instance cancellation request through the service registration unit, and send the check instruction message to the service scheduling unit 101;
[0122] The service scheduling unit 101 is further configured to confirm whether there is a first target service instance among at least one first target service instance in operation according to the received check instruction message, generate a confirmation result, and send the confirmation result to the service registration unit;
[0123] The service registration unit is further configured to, if the confirmation result indicates that there is a second target service instance among at least one of the first target service instances, cancel the second target service instance according to the received confirmation result.
[0124] In one embodiment, the system further includes: a service registration unit.
[0125] The service scheduling unit 101 is further configured to, if a second service request is received, determine, according to the second service request, the number of second target service templates associated with the second service request through the service scheduling unit 101, where the second service request is used to request to call a service instance associated with the second target service template to perform a preset operation;
[0126] The service scheduling unit 101 is further configured to, if it is determined that the number is less than a preset number, generate a first selection message according to the second service request and send the first selection message to the service registration unit, where the first selection message is used to indicate that, according to the second service request, a service instance that meets a preset condition is selected from at least one running service instance corresponding to the second target service template, and among them, the third target service instance meets the preset condition;
[0127] The service registration unit is further configured to select, according to the received first selection message, a third target service instance for completing the second service request from at least one running service instance and generate an instance selection message according to the third target service instance;
[0128] The service registration unit is further configured to send the instance selection message to the service scheduling unit 101;
[0129] The service scheduling unit 101 is further configured to generate a service call message according to the received instance selection message and send the service call message to the event processing unit 102;
[0130] The event processing unit 102 is further configured to send the received service call message to the third target service instance to instruct the third target service instance to perform a preset operation according to the service call message.
[0131] In an embodiment, the service registration unit is further configured to obtain the running load information of at least one service instance recorded in the service registration unit according to the first selection message, where the at least one service instance recorded in the service registration unit is a running service instance generated based on the second target service template;
[0132] The service registration unit is further configured to determine that the service instance with the smallest running load is the third target service instance according to the running load information of the at least one service instance.
[0133] In one embodiment, the service scheduling unit 101 is further configured to, if it is determined that the quantity is greater than a preset quantity, determine, according to the second service request through the service scheduling unit 101, a call order corresponding to a second target service template associated with the second service request;
[0134] The service scheduling unit 101 is further configured to sequentially generate a second selection message according to the call order and send the second selection message to the service registration unit;
[0135] The service registration unit is further configured to determine a third target service instance for completing the second service request according to the received second selection message.
[0136] In one embodiment, the service repository 103 is further configured to, if at least one newly added service template is received, generate template addition information corresponding to each newly added service template;
[0137] The service scheduling unit 101 is further configured to send the template addition information to the event processing unit 102;
[0138] The event processing unit 102 is further configured to send the received template addition information to the service registration unit;
[0139] The service registration unit is further configured to record the template addition information through the service registration unit if the template addition information is received.
[0140] Figure 7 It is a schematic structural diagram of a terminal provided by an embodiment of the present application. As Figure 7 shown, the terminal 7 in this embodiment includes: at least one processor 70 ( Figure 7 only one processor is shown in the figure), a memory 71, and a computer program 72 stored in the memory 71 and executable on the at least one processor 70. When the processor 70 executes the computer program 72, the steps in any of the above-mentioned service management method embodiments are implemented.
[0141] The terminal 7 may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art can understand that Figure 7 merely examples of the terminal 7 are shown and do not constitute a limitation on the terminal 7. It may include more or fewer components than those shown in the figure, or combine some components, or different components. For example, it may further include input / output devices, network access devices, etc.
[0142] The processor 70 may be a Central Processing Unit (CPU), and the processor 70 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0143] In some embodiments, the memory 71 may be an internal storage unit of the terminal 7, such as the hard disk or memory of the terminal 7. In other embodiments, the memory 71 may also be an external storage device of the terminal 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc., equipped on the terminal 7. Further, the memory 71 may also include both the internal storage unit and the external storage device of the terminal 7. The memory 71 is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of the computer program, etc. The memory 71 may also be used to temporarily store data that has been output or is to be output.
[0144] It should be noted that, for the content such as information interaction and execution process between the above-mentioned devices / units, since it is based on the same concept as the method embodiment of the present application, for its specific functions and the technical effects brought, reference may be specifically made to the method embodiment part, and details are not described herein again.
[0145] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0146] An embodiment of this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
[0147] An embodiment of this application provides a computer program product. When the computer program product runs on a terminal, the terminal can implement the steps in the foregoing method embodiments.
[0148] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the foregoing method embodiments of this application, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0149] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not described in detail or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0150] Those of ordinary skill in the art will appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.
[0151] In the embodiments provided in this application, it should be understood that the disclosed apparatus / terminal device and method can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0152] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0153] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A service management method, characterized in that, Including: If the service scheduling unit obtains a first service request, then through the service scheduling unit, determine a first target service template associated with the first service request, and generate deployment indication information according to the first service request and the first target service template; Through the service scheduling unit, send the deployment indication information to the event processing unit; Through the event processing unit, send the received deployment indication information to the service repository; Through the service repository, generate a first target service instance according to the received deployment indication information and run it; And, If a second service request is received through the service scheduling unit, then through the service scheduling unit, determine the number of second target service templates associated with the second service request according to the second service request, where the second service request is used to request to call a service instance associated with the second target service template to perform a preset operation; the second service request is a service request outside a preset service list recorded in the service scheduling unit; the preset service list is used to describe the range of predetermined service content of the service scheduling unit; If it is determined through the service scheduling unit that the number is less than a preset number, then generate a first selection message according to the second service request, and send the first selection message to the service registration unit, where the first selection message is used to indicate to select, according to the second service request, a service instance that meets a preset condition from at least one running service instance corresponding to the second target service template; Through the service registration unit, select a third target service instance from at least one running service instance according to the received first selection message, and generate an instance selection message according to the third target service instance, where the third target service instance meets the preset condition; Through the service registration unit, send the instance selection message to the service scheduling unit; Through the service scheduling unit, generate a service call message according to the received instance selection message, and send the service call message to the event processing unit; Through the event processing unit, send the received service call message to the third target service instance to instruct the third target service instance to perform the preset operation according to the service call message.
2. The service management method according to claim 1, wherein After generating the first target service instance and running it according to the received deployment indication information through the service repository, it further includes: Through the service repository, generate an identifier of the first target service instance, and generate an instance running message according to the identifier and the first target service instance; Through the service repository, send the instance running message to the service registration unit; Through the service registration unit, associate the identifier with the first target service template according to the received instance running message.
3. The service management method according to claim 1, characterized in that, The service management method further includes: If the service registration unit receives a service instance cancellation request, then through the service registration unit, generate an inspection indication message according to the service instance cancellation request, and send the inspection indication message to the service scheduling unit; The service scheduling unit confirms whether there is a second target service instance among at least one first target service instance in operation according to the received inspection indication message, generates a confirmation result, and sends the confirmation result to the service registration unit; If the confirmation result indicates that there is no second target service instance among at least one of the first target service instances, the service registration unit cancels the second target service instance according to the received confirmation result.
4. The service management method according to claim 1, wherein The step of the service registration unit selecting a third target service instance from at least one service instance in operation according to the received first selection message includes: The service registration unit obtains the operation load information of at least one service instance recorded in the service registration unit according to the first selection message, where at least one service instance recorded in the service registration unit is a service instance generated based on the second target service template and in an operating state; The service registration unit determines the service instance with the minimum operation load as the third target service instance according to the operation load information of the at least one service instance.
5. The service management method according to claim 1, characterized in that, The service management method further includes: If it is determined by the service scheduling unit that the quantity is greater than a preset quantity, the service scheduling unit determines the call order corresponding to the second target service template associated with the second service request according to the second service request; The service scheduling unit sequentially generates a second selection message according to the call order and sends the second selection message to the service registration unit, where the first selection message is used to indicate that the service registration unit selects a third target service instance that meets preset conditions according to the information of at least one service instance in operation corresponding to the second target service template; The service registration unit determines a third target service instance for completing the second service request according to the received second selection message.
6. The service management method according to any one of claims 1-5, characterized in that The service management method further includes: If at least one new service template is received through the service repository, for each new service template, template addition information corresponding to the new service template is generated; The service scheduling unit sends the template addition information to the event processing unit; The event processing unit sends the received template addition information to the service registration unit; If the service registration unit receives the template addition information, the service registration unit records the template addition information.
7. A service management system, characterized in that, including: a service scheduling unit, a service repository, and a service registration unit; The service scheduling unit, if a first service request is obtained, determines a first target service template associated with the first service request through the service scheduling unit, and generates deployment indication information according to the first service request and the first target service template; The service scheduling unit is further configured to send the deployment indication information to the event processing unit; The event processing unit is configured to send the received deployment indication information to the service repository; The service repository is used to generate and run a first target service instance according to the received deployment instruction information; And, The service scheduling unit is further configured to, if a second service request is received, determine the number of second target service templates associated with the second service request through the service scheduling unit according to the second service request, where the second service request is used to request to call a service instance associated with the second target service template to perform a preset operation; the second service request is a service request outside a preset service list recorded in the service scheduling unit; the preset service list is used to describe the range of predetermined service content of the service scheduling unit; The service scheduling unit is further configured to, if it is determined that the number is less than a preset number, generate a first selection message according to the second service request and send the first selection message to the service registration unit, where the first selection message is used to indicate to select, according to the second service request, a service instance that meets preset conditions from at least one running service instance corresponding to the second target service template; The service registration unit is further configured to select a third target service instance from at least one running service instance according to the received first selection message and generate an instance selection message according to the third target service instance, where the third target service instance meets the preset conditions; The service registration unit is further configured to send the instance selection message to the service scheduling unit; The service scheduling unit is further configured to generate a service call message according to the received instance selection message and send the service call message to the event processing unit; The event processing unit is further configured to send the received service call message to the third target service instance to instruct the third target service instance to perform the preset operation according to the service call message.
8. A terminal, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the service management method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the service management method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Business deployment method and device in virtualized network
CN107689882A
Service calling method and device, storage medium and electronic equipment
CN110336865A
Information processing method and device and storage medium
CN111581203A