Microservice completion method, device, related equipment and computer program product
By determining and deploying the multi-objective optimization function values of service completion fragments on multiple device combinations, the problem of completion of missing parts in microservice combinations is solved, and efficient service completion and performance improvement are achieved.
Patent Information
- Application Number
- CN202410578481.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-10
AI Technical Summary
In a microservice combination, microservices fail due to emergencies such as physical device failure or communication port failure. How to complete and reconstruct efficiently and accurately is an important challenge.
By obtaining candidate microservices, determine the service completion fragments of the missing parts of the target microservice combination, determine the optimal device combination among multiple physical devices to be deployed, deploy the service completion fragments to complete the missing parts, and utilize multi-target The optimization function value determines the optimal combination of equipment and services.
It achieves efficient completion of the target microservice combination, improves service experience, and selects the optimal device combination and service combination based on multi-objective optimization function values to ensure the integrity and performance of the service.
Smart Images

Figure CN118151983B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer and Internet technology, and in particular to a microservice completion method, device, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] An application is usually composed of several single microservices that provide specific functions according to a certain call logic. The microservices of an application are usually deployed on different physical devices in a dispersed manner, and data is transmitted through network connections to achieve the complex functions of the application. However, in actual operation, microservice failures caused by various emergencies will always occur, such as failure of some microservices due to physical device failure or communication port failure.
[0004] At this point, how to complete and reconstruct the failed parts of the microservice combination is an important challenge currently faced. Summary of the invention
[0005] The purpose of the present disclosure is to provide a microservice completion method, device, electronic device, computer-readable storage medium and computer program product, which can efficiently and accurately complete and reconstruct a target microservice combination.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] The disclosed embodiment provides a microservice completion method, in which a target application is provided with services by a target microservice combination, and the target microservice combination has a service missing, the method comprising: obtaining at least one candidate microservice; determining a service completion fragment of the missing part of the target microservice combination in the at least one candidate microservice; obtaining a plurality of physical devices to be deployed, and determining a plurality of first device combinations based on the plurality of physical devices to be deployed; determining different first multi-objective optimization function values corresponding to the target microservice combination when the service completion fragment is deployed on each first device combination to perform service completion on the missing part; determining a target device combination with the largest or smallest first multi-objective optimization function value among the plurality of first device combinations; and deploying the service completion fragment through the target device combination to complete the missing part of the target microservice combination.
[0008] In some embodiments, determining the service completion fragment of the missing part of the target microservice combination in the at least one candidate microservice includes: determining the preceding microservice of the missing part as the initial microservice; determining the following microservice of the missing part as the terminating microservice; acquiring the service composition semantic information of the target microservice combination and the service semantic information of the initial microservice; determining a first following microservice of the initial microservice in the at least one candidate microservice according to the service composition semantic information of the target microservice combination and the service semantic information of the initial microservice; determining the output data of the first following microservice is the input data of the terminating microservice, and generating the service completion fragment according to the first following microservice.
[0009] In some embodiments, the method further includes: determining that output data of the first post-placed microservice is not input data of the terminating microservice; determining a first parallel microservice of the first post-placed microservice from the at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the first post-placed microservice; determining that the output data of the initial microservice is the input data of the first parallel microservice, and the output data of the first parallel microservice is the input data of the terminating microservice; and generating the service completion fragment according to the first parallel microservice.
[0010] In some embodiments, the method further includes: if it is determined that the output data of the initial microservice is not the input data of the first parallel microservice, discarding the first parallel microservice; if it is determined that the output data of the initial microservice is the input data of the first parallel microservice, but the output data of the first parallel microservice is not the input data of the termination microservice, merging the first parallel microservice into the first post-service; determining a post-service of the first post-service from the at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the first post-service; if the output data of the post-service of the first post-service is the input data of the termination microservice, generating the service completion fragment according to the first post-service and the post-service of the first post-service.
[0011] In some embodiments, determining the first post-placement microservice of the initial microservice in the at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice includes: obtaining the training service composition semantic information of the training microservice composition, the service semantic information of each training microservice in the training microservice composition, and the actual association relationship between each training microservice; predicting the training service composition semantic information and the service semantic information of each training microservice through a target network model to obtain the predicted association relationship between each training microservice; reverse training the target network model according to the actual association relationship and the predicted association relationship; predicting the service composition semantic information of the target microservice composition, the service semantic information of the initial microservice, and the service semantic information of each candidate microservice through the trained target network model to predict the first post-placement microservice of the initial microservice in the at least one candidate microservice.
[0012] In some embodiments, the method also includes: performing crossover, mutation and replacement processing on the first device combination to generate multiple second device combinations; determining different second multi-objective optimization function values corresponding to the target microservice combination when the service completion fragment is deployed on each second device combination to complete the missing part; wherein, determining the multi-objective optimization function value of the target device combination with the maximum or minimum first multi-objective optimization function value among the multiple first device combinations includes: determining the target device combination in the first device combination and the second device combination according to the first multi-objective optimization function value and the second multi-objective optimization function value.
[0013] The disclosed embodiment provides a microservice completion device, wherein a target application is provided with services by a target microservice combination, and the target microservice combination has service missing. The microservice completion device may include: a candidate microservice determination module, a service completion fragment determination module, a first device combination determination module, a first multi-objective optimization function value determination module, a target device combination determination module, and a completion module.
[0014] Among them, a candidate microservice determination module is used to obtain at least one candidate microservice; a service completion fragment determination module is used to determine the service completion fragment of the missing part of the target microservice combination in the at least one candidate microservice; a first device combination determination module is used to obtain multiple physical devices to be deployed, and determine multiple first device combinations based on the multiple physical devices to be deployed; a first multi-objective optimization function value determination module is used to determine the different first multi-objective optimization function values corresponding to the target microservice combination when the service completion fragment is deployed on each first device combination to perform service completion on the missing part; a target device combination determination module is used to determine the target device combination with the largest or smallest first multi-objective optimization function value among the multiple first device combinations; a completion module is used to deploy the service completion fragment through the target device combination to complete the missing part of the target microservice combination.
[0015] An embodiment of the present disclosure provides an electronic device, comprising: a memory and a processor; the memory is used to store computer program instructions; the processor calls the computer program instructions stored in the memory to implement any of the microservice completion methods described above.
[0016] The embodiment of the present disclosure provides a computer-readable storage medium on which computer program instructions are stored to implement the microservice completion method as described in any one of the above items.
[0017] The embodiment of the present disclosure provides a computer program product or a computer program, which includes computer program instructions stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and a processor executes the computer program instructions to implement the above-mentioned microservice completion method.
[0018] The microservice completion method, apparatus, electronic device, computer-readable storage medium, and computer program product provided by the embodiments of the present disclosure can determine the optimal service combination fragment and the optimal device combination according to the first multi-objective optimization function values corresponding to the service combination fragments on multiple first device combinations, so as to complete the target microservice combination through the optimal service combination fragment and the optimal device combination, thereby achieving service completion of the target application and improving the service experience of the target application.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0021] Figure 1 A scenario schematic diagram of a microservice completion method or a microservice completion device that can be applied to an embodiment of the present disclosure is shown.
[0022] Figure 2 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0023] Figure 3 The figure is a flowchart of a method for determining a service completion fragment according to an exemplary embodiment.
[0024] Figure 4 The figure is a schematic diagram showing a target microservice combination according to an exemplary embodiment.
[0025] Figure 5 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0026] Figure 6 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0027] Figure 7 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0028] Figure 8 The diagram is a schematic diagram showing deployment of microservices on a physical device to be deployed according to an exemplary embodiment.
[0029] Fig. 9 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0030] Fig.10 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0031] Fig.11 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0032] Fig.12 It is a diagram of a cloud-edge-device collaborative architecture according to an exemplary embodiment.
[0033] Fig.13 The figure is a schematic diagram of a microservice combination completion structure according to an exemplary embodiment.
[0034] Fig.14 The figure is a block diagram of a microservice completion device according to an exemplary embodiment.
[0035] Fig.15 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0037] Those skilled in the art will appreciate that the embodiments of the present disclosure may be a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0038] The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0039] In the embodiments of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0040] The accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0041] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0042] In the description of the present disclosure, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a kind of association relationship describing the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different; the terms "comprising", "including" and "having" are used to express the meaning of open inclusion and mean that in addition to the listed elements / components / etc., there may be other elements / components / etc.
[0043] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0044] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.
[0045] First, some terms involved in the embodiments of the present disclosure are explained below to facilitate understanding by those skilled in the art.
[0046] An application can be split into a series of small and independent microservices. Each microservice runs in its own process and interacts using lightweight communication mechanisms. These microservices are built around business functions and can be independently deployed through a fully automated deployment mechanism. These services can be written in different programming languages, frameworks, and data storage technologies to achieve high cohesion and low coupling.
[0047] Microservices can be deployed on servers, virtual machines, containers, or cloud platforms. In some specific cases, microservices may also need to be deployed directly on physical terminal devices. For example, in IoT applications, microservices may need to be deployed directly on sensors, controllers, or other embedded devices to process data in real time, control device operations, or communicate with other devices.
[0048] Microservice composition can achieve specific business functions or goals through a series of microservices working together. In a microservice architecture, each microservice is a small, autonomous service built and deployed around a specific business function or requirement. These microservices can connect and interact with each other through lightweight communication mechanisms to jointly complete more complex business logic or tasks. For example, a large online retail platform may need to handle multiple functional modules such as product management, order processing, user authentication, payment integration, etc. Through microservice composition, these functions can be split into independent microservices, each of which is responsible for handling specific business logic. For example, the product management microservice is responsible for adding, deleting, modifying and querying product information, and the order processing microservice is responsible for creating, modifying and querying orders. These microservices can communicate through the Application Programming Interface (API) to jointly provide users with a smooth shopping experience.
[0049] Multi-objective optimization involves considering multiple objectives or criteria simultaneously in a decision-making process and finding the best solution that makes all objectives as optimal as possible.
[0050] The foregoing introduces some terms and concepts involved in the embodiments of the present disclosure. The following introduces the technical features involved in the embodiments of the present disclosure.
[0051] The exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0052] Figure 1 A scenario schematic diagram of a microservice completion method or a microservice completion device that can be applied to an embodiment of the present disclosure is shown.
[0053] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present disclosure.
[0054] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0055] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, wearable devices, virtual reality devices, smart homes, etc.
[0056] The server 105 may be a server that provides various services, such as a background management server that provides support for devices operated by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received request data, and feed back the processing results to the terminal device.
[0057] The server can be an independent physical server or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as basic cloud computing services such as big data and artificial intelligence platforms, etc. The present disclosure does not impose any restrictions on this.
[0058] The server 105 may, for example, obtain at least one candidate microservice; the server 105 may, for example
[0059] Determine a service completion fragment of the missing part of the target microservice combination in the at least one candidate microservice; the server 105 may, for example, obtain a plurality of physical devices to be deployed, and determine a plurality of first device combinations based on the plurality of physical devices to be deployed; the server 105 may, for example, determine different first multi-objective optimization function values corresponding to the target microservice combination when the service completion fragment is deployed on each first device combination to perform service completion on the missing part; the server 105 may, for example, determine a target device combination with the largest or smallest first multi-objective optimization function value among the plurality of first device combinations; the server 105 may, for example, deploy the service completion fragment through the target device combination to complete the missing part of the target microservice combination.
[0060] It should be understood that Figure 1 The number of terminal devices, networks and servers in the figure is only for illustration. The server 105 may be a physical server or may be composed of multiple servers. According to actual needs, it may have any number of terminal devices, networks and servers.
[0061] Figure 2 is a flowchart of a microservice completion method according to an exemplary embodiment. The method provided by the embodiment of the present disclosure can be executed by any electronic device with computing processing capabilities. For example, the method can be executed by the above Figure 1 The server or terminal device in the embodiment may be executed, or the server and the terminal device may be executed together. In the following embodiments, the server is used as the execution subject for example, but the present disclosure is not limited to this.
[0062] refer to Figure 2 The microservice completion method provided by the embodiment of the present disclosure may include the following steps.
[0063] In some embodiments, the target application may be provided with services by the target microservice combination, and the target microservice combination has service missing (eg, service missing caused by failure of some microservices in the target microservice combination).
[0064] In some embodiments, the target microservice combination may include multiple microservices, wherein the multiple microservices may be combined according to a certain calling logic to provide services for the target application.
[0065] In some embodiments, a service may be missing in the target application. The service may be caused by a device failure or communication failure in the physical device where one or some microservices in the target microservice combination are located, or there may be a problem with the code of a microservice itself. This application does not limit the reasons for the service missing in the target microservice combination.
[0066] Step S202: Obtain at least one candidate microservice.
[0067] In some embodiments, microservices that may be involved in the target application may be used as the candidate services.
[0068] In some embodiments, the candidate microservices may be logical concepts, and only when the microservices are deployed on a device to form a microservice instance can the service be provided. In other words, the candidate microservices may be programming codes, and only when the programming code is run on a device can the service be provided.
[0069] The candidate microservices mentioned above may refer to preset microservices in a microservice pool, and the candidate microservices may be used to complete the target microservice combination.
[0070] Step S204: determine a service completion fragment of a missing part of the target microservice combination in at least one candidate microservice.
[0071] In some embodiments, the missing part of the microservice combination may refer to the part corresponding to the missing service in the microservice combination. The missing part may include one, two or more microservices. The microservices in the missing part may be connected according to a certain logical relationship, and this application does not impose any restrictions on this.
[0072] In some embodiments, the missing part of the target microservice combination can be completed by the service completion fragment. The service completion fragment can be associated with one microservice, two microservices, or multiple microservices through a certain logical relationship (such as a calling and called relationship, a parallel relationship, etc.), and this application does not limit this.
[0073] In some embodiments, the target microservice combination may have one, two, or more missing parts, which is not limited in this application.
[0074] This application will explain and illustrate the example of a target microservice combination including a missing part. Those skilled in the art can transfer the technical solution provided by this application to a scenario where there are multiple missing parts in the target microservice combination, and this application does not impose any restrictions on this.
[0075] In some embodiments, a service completion fragment of a missing part of the target microservice combination may be determined from at least one candidate microservice according to a preset association relationship.
[0076] In some embodiments, a service completion fragment of a missing part of the target microservice combination may also be determined in at least one candidate microservice by training a neural network.
[0077] The present application does not limit how to determine the service completion fragment of the missing part of the target microservice combination in at least one candidate microservice.
[0078] Step S206: Acquire a plurality of physical devices to be deployed, and determine a plurality of first device combinations based on the plurality of physical devices to be deployed.
[0079] In some embodiments, after determining the service completion fragment of the target microservice combination, multiple physical devices to be deployed may be obtained so as to select a suitable physical device from the multiple physical devices to be deployed to deploy the service completion fragment.
[0080] The above-mentioned physical devices to be deployed can be edge IoT devices and / or edge servers in the cloud-edge system; they can also be distributed devices or distributed servers, which is not limited in this application.
[0081] It should be noted that one microservice, two microservices, or multiple microservices can be deployed in a physical device to be deployed, and this application does not impose any restrictions on this; a physical device with deployment must be fully deployed on the same device.
[0082] Step S208, determining different first multi-objective optimization function values corresponding to the target microservice combination when the service completion fragment is deployed on each first device combination to complete the missing part of the service.
[0083] In some embodiments, when the service completion fragment is deployed on the first device combination to complete the target microservice combination, the first multi-objective optimization function value corresponding to the completed target microservice combination may be calculated.
[0084] It should be noted that a person skilled in the art can determine a deployment scheme for deploying the service completion fragment on the first device combination according to actual needs, and this application does not limit it. For example, a traversal method can be used to determine how to deploy the service completion fragment on the first device combination. It should be noted that when deploying microservices on a device within the first device combination, it is necessary to ensure that the resources on the device can support the corresponding microservices (one, two or more).
[0085] It should also be noted that, because a physical device to be deployed can support at least one microservice, there can be multiple deployment schemes when deploying a microservice completion fragment on a device in the first device combination, that is, a service completion fragment deployed on the first device combination can correspond to different first multi-objective optimization function values.
[0086] In some embodiments, the first multi-objective optimization function value corresponding to the completed target microservice combination can be calculated by the following method: calculating multiple function values corresponding to the completed target microservice combination; and then performing weighted calculation on the multiple function values to determine the target microservice combination.
[0087] For example, it can be determined first whether the resources in the first device combination can support the corresponding service completion fragment; if the resources in the first device combination can support the corresponding service completion fragment, the total delay (function value), total energy (function value), etc. corresponding to the target microservice set when the service completion fragment is deployed on the first device combination can be calculated, and then the inverse of the total delay and the total energy are weighted and summed to obtain the above-mentioned first multi-objective optimization function value. For details, please refer to the following formula (1), which will not be repeated in this embodiment.
[0088] Step S210: determining a target device combination having a maximum or minimum first multi-objective optimization function value among multiple first device combinations.
[0089] Step S212: Deploy the service completion fragment through the target device combination to complete the missing part of the target microservice combination.
[0090] Through the above embodiments, the optimal service combination fragment and the optimal device combination can be determined according to the first multi-objective optimization function values corresponding to the service combination fragments on multiple first device combinations, so as to complete the target microservice combination through the optimal service combination fragment and the optimal device combination, thereby achieving service completion of the target application and improving the service experience of the target application.
[0091] Figure 3 The figure is a flowchart of a method for determining a service completion fragment according to an exemplary embodiment.
[0092] Reference Figure 3 The service completion fragment determination method provided by the embodiment of the present disclosure may include the following steps.
[0093] In some embodiments, the target application may be provided with services by the target microservice combination, and the target microservice combination has service missing (eg, service missing caused by failure of some microservices in the target microservice combination).
[0094] In some embodiments, the target microservice combination may include multiple microservices, wherein the multiple microservices may be combined according to a certain calling logic to provide services for the target application.
[0095] In some embodiments, a service may be missing in the target application. The service may be caused by a device failure or communication failure in the physical device where one or some microservices in the target microservice combination are located, or there may be a problem with the code of a microservice itself. This application does not limit the reasons for the service missing in the target microservice combination.
[0096] Step S302: determine the missing part of the front-end microservice as the initial microservice.
[0097] In some embodiments, the output data of the initial microservice may be the input data of the missing portion.
[0098] In some embodiments, it is possible to detect where the target microservice combination starts to lose services. Since multiple microservices of the target microservice combination can be combined according to a certain call logic to provide services for the target application, once it is determined that the target microservice combination has a service loss, the microservice that calls the missing part can be determined as the pre-microservice of the missing part, and the microservice to be called by the missing part is called the post-microservice.
[0099] It should be noted that the missing part may have one, two or more front-end microservices, such as multiple front-end microservices that call the missing part microservices, and this application does not limit this. The missing part may also have one, two or more back-end microservices, such as the missing part may call the data of multiple back-end services, and this application does not limit this.
[0100] In some embodiments, the missing part of the front-end microservice can be used as the initial microservice, where there can be one, two, or more initial microservices, which is not limited in this application.
[0101] The above initial microservice can call the missing part, or the output data of the initial microservice can be the input data of the missing part.
[0102] Step S304: determine the missing post-processing microservice as the terminating microservice.
[0103] In some embodiments, the output data of the missing portion is the input data of the terminated microservice.
[0104] In some embodiments, the post-processing microservice of the missing part may be used as a termination microservice, where there may be one, two, or more termination microservices.
[0105] The above-mentioned post-processing microservice can be called by the missing part, or the output data of the missing part can be the input data of the post-processing microservice.
[0106] Figure 4 The figure is a schematic diagram showing a target microservice combination according to an exemplary embodiment.
[0107] like Figure 4 As shown, microservices such as “Euclidean distance”, “slope”, “raster to polygon”, “filter” and “select” may exist in the target microservice combination.
[0108] like Figure 4 As shown, the target microservice combination may have missing services (such as the missing part indicated by 401). Then the preceding microservices "Euclidean distance" and "slope" of the missing part 401 can be used as the initial microservices, and the following microservice "grid to surface" of the missing part 401 can be used as the termination microservice.
[0109] It should be noted that the missing part 401 may have one microservice, two microservices or multiple microservices, and this application does not impose any restrictions on this, which is subject to the actual situation.
[0110] Step S306: Obtain service composition semantic information of the target microservice composition and service semantic information of the initial microservice.
[0111] In some embodiments, service composition semantic information of the target microservice composition and service semantic information of the initial microservice may be obtained, wherein the service composition semantic information is used to describe the functions and application scenarios of the target microservice composition, and the service semantic information of the initial microservice is used to describe the functions, application scenarios, input parameters, and output parameters of the initial microservice.
[0112] In some embodiments, a microservice can be represented as a four-tuple, ,in, Can be used to represent the name of a microservice; Represents a microservice tag set, which can be composed of several tags. The tag can be used to describe the function, environment, performance, technology, security, usage method or application scenario of the microservice. Each tag can be composed of several keywords. i is an integer greater than or equal to 1, and LN is the number of tags of the microservice; Representing microservices The input parameter set, , Indicates Input parameters, composed of several keywords, is the total number of input parameters; Representing microservices The output parameter set, , Indicates output parameters, is the total number of output parameters, i is an integer greater than or equal to 0, and j is an integer greater than or equal to 0.
[0113] In some embodiments, the service semantic information of a microservice may include the name, function, environment, performance, technology, security, usage method, application scenario, input parameter, and one or more of the input parameters of the microservice. This application does not limit this. Any semantic information that can describe the microservice is within the scope of protection of this application. For example, it can be the four-tuple parameter of the microservice .
[0114] In some embodiments, the microservices composition It can be composed of several single microservices according to certain functional logic to realize complex functions, which can be expressed as a four-tuple. ,in: Combining Microservices The name contains several keywords, which describe the functions and application scenarios of the combination in concise terms; Functional description, usually a long text containing several paragraphs, used to explain the functions and application scenarios of the combination in detail; express The collection of microservices contained in is the total number of microservices; express The relationship between different microservices in the process (such as calling relationship, called relationship or parallel relationship, etc.).
[0115] In some embodiments, the service composition semantic information of the target microservice composition can be used to describe the function, application scenario, usage method, attribute and other information of the target microservice composition. This application restricts the service composition information, and any semantic information that can describe the target microservice composition is within the protection scope of this application. For example, it can include the above-mentioned microservice composition quadruple information .
[0116] Step S308: determining a first post-initial microservice from at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice.
[0117] In some embodiments, a post-placed microservice of the initial microservice may be determined from at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice, and the post-placed microservice of the initial microservice may be used as the first post-placed microservice.
[0118] In some embodiments, according to the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice, a post-positioned microservice of the initial microservice may be determined from at least one candidate microservice and the post-positioned microservice of the initial microservice may be used as the first post-positioned microservice.
[0119] For example, a microservice whose input parameter is the output parameter of the initial microservice may be determined from at least one candidate microservice as a post-microservice of the initial microservice.
[0120] It should be noted that an initial microservice can correspond to at least one subsequent microservice, that is, an initial microservice can have one, two or more subsequent microservices, and this application does not impose any restrictions on this.
[0121] In some embodiments, it is possible to determine whether there is a parallel relationship (or a calling relationship or a called relationship) between two microservices by determining the input and output data of the two microservices. For example, if the input data of one microservice is the output data of another microservice, it can be determined that the two have a calling and called relationship; for another example, if the output data of one microservice is complementary to or identical to the output data of another microservice, it can be determined that the two are in a parallel relationship.
[0122] In some embodiments, it is also possible to determine whether there is a parallel relationship (or a calling relationship or a called relationship) between two microservices based on a preset association relationship, thereby determining a parallel microservice or a post-processing microservice or a pre-processing microservice of the first post-processing microservice.
[0123] In some embodiments, a parallel microservice, a front microservice, or a back microservice of the first back microservice may also be determined by training a neural network.
[0124] For example, a neural network model can be trained with microservice pairs with a call relationship (positive samples) and microservice pairs without a call relationship (negative samples) to obtain a classifier that can judge whether there is a call relationship between two microservices; then use the classifier to compare the initial microservice with each candidate microservice, so as to determine the post-microservice of the initial microservice in at least one candidate microservice. Among them, the post-microservice of the initial microservice can be one, two or more, and this application does not limit this. It can be understood that the result output by the above classifier can be a probability value, which is used to indicate the probability of the existence of a call relationship between the two microservices.
[0125] For another example, a neural network can be trained using multiple microservices (training samples) and the relationship (label) matrix between them to obtain a neural network that can predict the relationship between microservices (parallel relationship or calling relationship or called relationship). The control relationship between multiple microservices can be judged by the matrix. For example, if the value of the i-th row and the j-th column in the matrix is aij (aij is an integer greater than or equal to 0 and less than or equal to 1), it can be considered that the probability of aij between the i-th microservice and the j-th microservice is a parallel relationship (or calling relationship or called relationship). Where i is an integer greater than or equal to 1, and j is an integer greater than or equal to 1.
[0126] Step S310: Determine that the output data of the first post-position microservice is the input data of the termination microservice, and then generate a service completion fragment according to the first post-position microservice.
[0127] In some embodiments, if it is determined that the output data of the first post-positioned microservice is the input data of the termination microservice, a service completion fragment is generated according to the first post-positioned microservice.
[0128] In some embodiments, if the output data of the first post-positioned microservice is the input data of the termination microservice (or the first post-positioned microservice calls the termination microservice), a service completion fragment can be generated according to the first post-positioned microservice, for example, the first post-positioned microservice is directly used as the service completion fragment. One service completion fragment may include one, two or more microservices, and this application does not limit this.
[0129] In some embodiments, if there are multiple first post-position microservices, the first post-position microservice whose output data is the input data of the terminating microservice can be screened out from the multiple first post-position microservices to generate a service completion fragment to complete the target microservice combination.
[0130] If the output data of multiple first post-processing microservices are the input data of the termination microservice, multiple service completion fragments can be generated accordingly.
[0131] It should be noted that if some first post-position microservices can connect the initial microservice and the termination microservice, and some first post-position microservices cannot connect the initial microservice and the termination microservice, the first post-position microservice that can connect the initial microservice and the termination microservice will be used to complete the target microservice combination, and the first post-position microservice that cannot connect the initial microservice and the termination microservice will be discarded.
[0132] In some embodiments, the service completion fragment can be deployed to a suitable device to form a microservice instance, and then the microservice instance deployed on the device is connected to the initial microservice and the termination microservice to complete the missing parts of the target microservice combination, so that the target microservice combination can provide complete services for the target application.
[0133] In some embodiments, the above-mentioned initial microservices can be one, two or more, and an initial microservice can have one, two or more subsequent microservices, so there can be multiple service completion fragments generated according to the subsequent microservices of the initial microservice.
[0134] In some embodiments, if there are multiple service completion fragments, the best one can be selected randomly or according to a certain algorithm from the multiple service completion fragments to complete the target microservice combination; the multiple service completion fragments can also be jointly calculated with the following first device combination to determine the first multi-objective optimization function value, so as to select the target service completion fragment from the multiple service completion fragments to complete the target microservice combination.
[0135] In some embodiments, the initial microservice may include at least two microservices, and the at least two microservices may include a first initial microservice and a second initial microservice. Then, according to the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice, determining the post-position microservice of the initial microservice in at least one candidate microservice and using the post-position microservice of the initial microservice as the first post-position microservice may include: determining the post-position microservice of the first initial microservice in at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the first initial microservice; determining the post-position microservice of the second initial microservice in at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the second initial microservice; if the post-position microservice of the first initial microservice and the post-position microservice of the second initial microservice are the same microservice, using the post-position microservice of the first initial microservice as the first post-position microservice; if the post-position microservice of the first initial microservice and the post-position microservice of the second initial microservice are different microservices, processing the post-position microservice of the first initial microservice and the post-position microservice of the second initial microservice as the first post-position microservice respectively.
[0136] In some embodiments, determining that the output data of the first post-microservice is the input data of the terminating microservice may include: determining that the output data of the post-microservice of the first initial microservice and the output data of the post-microservice of the second initial microservice are both the input data of the terminating microservice.
[0137] The service completion fragment may include a first service completion fragment and a second service completion fragment. Generating the service completion fragment according to the first post-positioned microservice includes: generating the first service completion fragment according to the first initial microservice and the post-positioned microservice of the first initial microservice (for example, directly using the post-positioned microservice of the first initial microservice as the first service completion fragment); generating the second service completion fragment according to the second initial microservice and the post-positioned microservice of the second initial microservice (for example, directly using the post-positioned microservice of the second initial microservice as the second service completion fragment).
[0138] In some embodiments, a suitable service fragment can be selected from the first service completion fragment and the second service completion fragment to complete the target microservice combination. For example, the one with the highest probability can be selected from the first service fragment and the second service fragment to complete the target microservice combination. Specifically, when determining the first post-service of the initial microservice, the probability that each first post-service is a post-service of the initial microservice can be determined, and then the probabilities corresponding to each microservice in each service fragment can be added as the probability corresponding to the service fragment, and then the service fragment with a high probability can be selected to complete the target microservice combination.
[0139] The technical solution provided by the above embodiment can determine the missing services of the target microservice combination according to the service combination semantic information of the target microservice combination and the functions and application scenarios of the missing preceding microservices, and automatically complete the target microservice combination through the determined microservices.
[0140] Figure 5 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0141] refer to Figure 5 , the above microservice completion method may include the following steps.
[0142] Step S502: Obtain at least one candidate microservice.
[0143] Step S504, determining a preceding microservice of the missing part of the target microservice combination as an initial microservice, wherein the output data of the initial microservice is the input data of the missing part.
[0144] Step S506: determine a post-microservice of the missing part of the target microservice combination as a terminating microservice, wherein the output data of the missing part is the input data of the terminating microservice.
[0145] Step S508, obtaining the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice, wherein the service composition semantic information is used to describe the function and application scenario of the target microservice composition, and the service semantic information of the initial microservice is used to describe the function, application scenario, input parameters, and output parameters of the initial microservice.
[0146] Step S510: According to the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice, a post-positioned microservice of the initial microservice is determined from at least one candidate microservice and the post-positioned microservice of the initial microservice is used as the first post-positioned microservice.
[0147] Step S512: determine that the output data of the first post-service is not the input data of the terminating microservice.
[0148] Step S514: determining a first parallel microservice of the first post-positioned microservice from at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the first post-positioned microservice.
[0149] In some embodiments, a parallel microservice of the first post-positioned microservice may be determined from at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the first post-positioned microservice, and the parallel microservice of the first post-positioned microservice may be used as the first parallel microservice.
[0150] In some embodiments, if the output data of the subsequent microservice of the initial microservice is not the input data of the terminating microservice, a parallel microservice of the first subsequent microservice may be determined from at least one candidate microservice according to the service semantic information of the first subsequent microservice.
[0151] The parallel microservice of the first post-positioned microservice may refer to a microservice that is in a parallel relationship with the first post-positioned microservice. For example, the first post-positioned microservice has the same association relationship with its corresponding parallel microservice (eg, it is called by the same microservice or calls the same microservice).
[0152] In some embodiments, it is possible to determine whether there is a parallel relationship (or a calling relationship or a called relationship) between two microservices by determining the input and output data of the two microservices. For example, if the input data of one microservice is the output data of another microservice, it can be determined that the two have a calling and called relationship; for another example, if the output data of one microservice is complementary to or identical to the output data of another microservice, it can be determined that the two are in a parallel relationship.
[0153] In some embodiments, it is also possible to determine whether there is a parallel relationship (or a calling relationship or a called relationship) between two microservices based on a preset association relationship, thereby determining a parallel microservice or a post-processing microservice or a pre-processing microservice of the first post-processing microservice.
[0154] In some embodiments, a parallel microservice, a front microservice, or a back microservice of the first back microservice may also be determined by training a neural network.
[0155] For example, a neural network model can be trained with microservice pairs with a parallel relationship (positive samples) and microservice pairs without a parallel relationship (negative samples) to obtain a classifier that can judge whether two microservices have a parallel relationship; then the classifier is used to compare the first post-positioned microservice with each candidate microservice, so as to determine the parallel microservice of the first post-positioned microservice in at least one candidate microservice. Among them, the parallel microservices of the first post-positioned microservice can be one, two or more, and this application does not limit this. It can be understood that the result output by the above classifier can be a probability value, which is used to indicate the probability that there is a parallel relationship (or a calling relationship or a called relationship) between the two microservices.
[0156] For another example, a neural network can be trained using multiple microservices and the control relationship matrix between them to obtain a neural network that can predict the control relationship between microservices. The control relationship between multiple microservices can be judged by the matrix. For example, if the value of the i-th row and the j-th column in the matrix is aij (aij is an integer greater than or equal to 0 and less than or equal to 1), it can be considered that the probability of aij between the i-th microservice and the j-th microservice is a parallel relationship (or a calling relationship or a called relationship). Where i is an integer greater than or equal to 1, and j is an integer greater than or equal to 1.
[0157] Step S516: determine that the output data of the initial microservice is the input data of the first parallel microservice, and the output data of the first parallel microservice is the input data of the terminating microservice.
[0158] Step S518: Generate a service completion fragment according to the first parallel microservice.
[0159] In some embodiments, if the output data of the initial microservice is the input data of the first parallel microservice, and the output data of the first parallel microservice is the input data of the termination microservice, a service completion fragment may be generated according to the first parallel microservice, for example, the first parallel microservice may be directly used as the service completion fragment.
[0160] It is understandable that multiple first parallel microservices may correspond to multiple service completion fragments, and a target service completion fragment may be selected from the multiple service completion fragments to complete the target microservice combination. For example, if a neural network is used to determine whether two microservices have a parallel relationship (a calling relationship or a called relationship), the probabilities corresponding to each microservice in the service completion fragment may be added together as the completion probability corresponding to the service completion fragment; then, a service completion fragment with a high completion probability may be selected from the multiple service completion fragments to continue to complete the target microservice combination.
[0161] Figure 6 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0162] refer to Figure 6 , the above microservice completion method may include the following steps.
[0163] Step S602: If it is determined that the output data of the initial microservice is the input data of the first parallel microservice, but the output data of the first parallel microservice is not the input data of the terminating microservice, the first parallel microservice is merged into the first post-positioned microservice.
[0164] In some embodiments, after determining that the output data of the initial microservice is the input data of the parallel microservice of the first subsequent microservice, it can be determined that the first parallel microservice is actually also a subsequent microservice of the initial microservice, that is, it can be the first subsequent microservice.
[0165] If it is determined that the output data of the first parallel microservice is not the input data of the termination microservice, it can be determined that the first parallel microservice cannot communicate directly with the termination microservice, and the subsequent microservices can be searched for the first parallel microservice to connect the initial microservice and the termination microservice. Then the first parallel microservice can be merged into the first subsequent microservice to continue searching for the subsequent microservices of each first subsequent microservice.
[0166] Step S604: If it is determined that the output data of the initial microservice is not the input data of the first parallel microservice, the first parallel microservice is discarded.
[0167] In some embodiments, if it is determined that the output data of the initial microservice is not the input data of the first parallel microservice, it can be determined that the first parallel microservice is not the microservice of the missing part, and the first parallel microservice can be discarded.
[0168] Step S606: determining a post-position microservice of the first post-position microservice from at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the first post-position microservice.
[0169] In some embodiments, at least one post-positioned microservice may be determined for each first post-positioned microservice by referring to the above method for determining post-positioned microservices.
[0170] Step S608: If the output data of the post-positioned microservice of the first post-positioned microservice is the input data of the termination microservice, a service completion fragment is generated according to the first post-positioned microservice and the post-positioned microservice of the first post-positioned microservice.
[0171] In some embodiments, if the output data of the post-microservice of the first post-microservice is the input data of the termination microservice, it can be considered that the first post-microservice and the post-microservice of the first post-microservice can connect the initial microservice and the termination microservice, then a service completion fragment can be generated according to the first post-microservice and the post-microservice of the first post-microservice, so as to complete the target microservice combination through the service completion fragment.
[0172] Figure 7 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0173] refer to Figure 7 , the above microservice completion method may include the following steps.
[0174] Step S702: Acquire multiple physical devices to be deployed.
[0175] In some embodiments, one, two, or more microservices may be deployed on a physical device to be deployed, and this application does not limit this. Figure 8 As shown, microservices such as "reclassification", "weighted overlay" and "slope" can be deployed on device 801, and microservices such as "reclassification", "raster calculator" and "selection" can be deployed on device 802. This application does not limit how many microservices can be deployed on a physical device to be deployed, and which microservices can be deployed. Those skilled in the art can determine which microservices can be deployed on the physical device to be deployed based on resources such as power, bandwidth and memory on the physical device to be deployed.
[0176] Step S704: randomly determine a plurality of first device combinations according to a plurality of physical devices to be deployed.
[0177] In some embodiments, multiple devices may be randomly determined from multiple physical devices to be deployed to generate a first device combination. The present application does not impose any restrictions on the number and type of devices in the first device combination.
[0178] Step S706, determining different first multi-objective optimization function values corresponding to the completed target microservice combination when the service completion fragment is deployed through different first device combinations to complete the target microservice combination, and the first multi-objective optimization function value is used to measure the latency and / or energy of the target microservice combination.
[0179] In some embodiments, when the service completion fragment is deployed on the first device combination to complete the target microservice combination, the first multi-objective optimization function value corresponding to the completed target microservice combination may be calculated.
[0180] It should be noted that a person skilled in the art can determine a deployment scheme for deploying the service completion fragment on the first device combination according to actual needs, and this application does not limit it. For example, a traversal method can be used to determine how to deploy the service completion fragment on the first device combination. It should be noted that when deploying microservices on a device within the first device combination, it is necessary to ensure that the resources on the device can support the corresponding microservices (one, two or more).
[0181] It should also be noted that, because a physical device to be deployed can support at least one microservice, there can be multiple deployment schemes when deploying a microservice completion fragment on a device in the first device combination, that is, a service completion fragment deployed on the first device combination can correspond to different first multi-objective optimization function values.
[0182] In some embodiments, the first multi-objective optimization function value corresponding to the completed target microservice combination can be calculated by the following method: calculating multiple function values corresponding to the completed target microservice combination; and then performing weighted calculation on the multiple function values to determine the target microservice combination.
[0183] For example, it can be determined first whether the resources in the first device combination can support the corresponding service completion fragment; if the resources in the first device combination can support the corresponding service completion fragment, the total delay, total energy, etc. corresponding to the target microservice set when the service completion fragment is deployed on the first device combination can be calculated, and then the inverse of the total delay and the total energy are weighted summed to obtain the above-mentioned first multi-objective optimization function value. For details, please refer to the following formula (1), which will not be repeated in this embodiment.
[0184] Step S708: determining a target device combination from a plurality of first device combinations according to the first multi-objective optimization function value.
[0185] In some embodiments, one service completion segment corresponds to one device combination, and then one service completion segment and one device combination can calculate at least one first multi-objective optimization function value.
[0186] In some embodiments, the target device combination may be selected based on the device combination with the lowest (or highest) first multi-objective optimization function value among multiple first device combinations.
[0187] In some embodiments, if there are multiple service completion segments, a device combination with the lowest (or highest) first multi-objective optimization function value may be determined as the target service completion segment among the multiple service completion segments.
[0188] Step S710: Deploy the service completion fragment through the target device combination to complete the target microservice combination.
[0189] In some embodiments, the target service completion fragment may be deployed on a device corresponding to the target device combination to complete the target microservice combination.
[0190] Fig. 9 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0191] refer to Fig. 9 , the above microservice completion method may include the following steps.
[0192] Step S902: Acquire multiple physical devices to be deployed.
[0193] Step S904: randomly determine a plurality of first device combinations according to a plurality of physical devices to be deployed.
[0194] Step S906, determining different first multi-objective optimization function values corresponding to the completed target microservice combination when the service completion fragment is deployed through different first device combinations to complete the target microservice combination, and the first multi-objective optimization function value is used to measure the latency and / or energy of the target microservice combination.
[0195] Step S908: performing crossover, mutation and replacement processing on the first device combination to generate a plurality of second device combinations.
[0196] In some embodiments, the first device combination may be subjected to crossover, mutation, replacement, or addition and subtraction processing to generate a plurality of second device combinations.
[0197] Step S910, determining different second multi-objective optimization function values corresponding to the completed target microservice combination when the service completion fragment is deployed through different second device combinations to complete the target microservice combination.
[0198] In some embodiments, the above service completion fragments may be one, two or more.
[0199] Among them, a service completion fragment can have multiple deployment schemes on a second device combination, and thus can correspond to multiple second multi-objective optimization function values.
[0200] Step S912: determining a target device combination in the first device combination and the second device combination according to the first multi-objective optimization function value and the second multi-objective optimization function value.
[0201] In some embodiments, a minimum value (or maximum value) can be determined among the first multi-objective optimization function value and the second multi-objective optimization function value, and the device combination corresponding to the minimum value (or maximum value) is used as the target device combination, and the service completion fragment corresponding to the minimum value (or maximum value) is used as the target service completion fragment.
[0202] Step S914: deploy the service completion fragment through the target device combination to complete the target microservice combination.
[0203] In some embodiments, the target service completion fragment may be deployed on a device corresponding to the target device combination to complete the target microservice combination.
[0204] Fig.10 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0205] In some embodiments, the first multi-objective optimization function value may include a first sub-function value and a second sub-function value, and the service complement fragment may include a first service complement fragment and a second service complement fragment.
[0206] refer to Fig.10 , the above microservice completion method may include the following steps.
[0207] Step S1002, determining different first sub-function values corresponding to the completed target microservice combination when the first service completion fragment is deployed through different first device combinations to complete the target microservice combination.
[0208] Step S1004, determining different second sub-function values corresponding to the completed target microservice combination when the second service completion fragment is deployed through different first device combinations to complete the target microservice combination.
[0209] Step S1006: taking the first objective sub-function and the second sub-function value as the first multi-objective optimization function value.
[0210] In some embodiments, a service completion fragment deployed on the same device combination may correspond to different function values, and different service completion fragments deployed on the same device combination may also correspond to different function values. In this case, all first multi-objective optimization function values corresponding to different service completion fragments when deployed on different devices may be calculated, and then the device combination with the lowest first multi-objective optimization function value is found as the target device combination, and the service completion fragment with the lowest first multi-objective optimization function value is found as the target service completion fragment; finally, the target service completion fragment is deployed on the device corresponding to the target device combination according to the deployment plan corresponding to the lowest multi-objective optimization function value to complete the target microservice combination.
[0211] Below, this application will introduce the microservice completion method in combination with specific application scenarios.
[0212] With the rapid development of artificial intelligence technology, cloud computing networks and terminal systems are rapidly evolving from simple networks and applications consisting of several services to complex, hierarchical, heterogeneous and intelligent network structures and multimedia application platforms. Various intelligent IoT applications derived from these changes, such as online games, healthcare, home automation, virtual reality multimedia and artificial intelligence robots, play a vital role in various fields. Since user needs have certain geographical attributes, such as regional validity (such as weather forecasts have regional validity), edge computing is introduced to handle scenarios such as regional needs and low latency needs. For a complex application based on a microservice architecture configured in an edge environment, it is composed of several single microservices that provide specific functions according to a certain call logic. Considering the limited resources such as physical device computing, these microservices are usually dispersedly configured on different physical devices, and data is transmitted through network connections to achieve the final complex functions. This makes environmental perception information such as location very important, because users and applications usually expect to request and interact with nearby devices and services. However, in actual operation, service failures caused by various emergencies always occur, such as physical device failures. At this point, how to use the environmental information in the current edge environment to select appropriate microservices to complete the failed parts and reconstruct the microservice combination is an important challenge facing the edge computing application field.
[0213] At present, the problem of microservice combination completion in edge environments has received widespread attention. A large number of studies are devoted to selecting appropriate microservices for combination based on quality of service (QoS), and then selecting appropriate instances to unload the microservice combination from the perspectives of response time optimization, cost optimization, energy consumption optimization, and multi-objective optimization. However, selecting microservices based on QoS can only guarantee the quality of the microservice combination to a certain extent, and the functional relevance of the microservice combination cannot be well guaranteed. Therefore, this application focuses on how to perceive the current environment and automatically select appropriate microservices for completion when part of the microservice combination is missing and needs to be completed, so as to ensure that the new microservice combination has good quality and high functional relevance. Explore the correlation between environmental information and microservice combination completion, and study the microservice completion method based on environment perception. Compared with existing methods, this research content ensures the rationality of the functional logic and physical deployment of the new microservice combination through the perception of the current environment, so that the new microservice combination has high functional relevance while having low latency and energy consumption.
[0214] This application proposes a microservice completion method based on environment perception, and constructs a logical-physical two-layer microservice combination completion model. At the logical layer, a microservice completion model based on functional semantics is constructed and deployed in the cloud, and functionally related abstract microservices are selected to complete the missing parts; at the physical layer, a microservice instance completion model based on multi-objective optimization is constructed and deployed on the edge server, and appropriate devices are selected to provide specific instances of the logical services selected in the previous step, ensuring the low latency and low energy consumption characteristics of the new microservice combination instance.
[0215] In some embodiments, a microservice can be represented as a four-tuple, ,in, Can be used to represent the name of a microservice; Represents a microservice tag set, which can be composed of several tags. The tag can be used to describe the function, environment, performance, technology, security, usage method or application scenario of the microservice. Each tag It can be composed of several keywords, i is an integer greater than or equal to 1, The number of labels for microservices; Representing microservices The input parameter set, , Indicates Input parameters, composed of several keywords, is the total number of input parameters; Representing microservices The output parameter set, , Indicates output parameters, is the total number of output parameters, i is an integer greater than or equal to 1, and j is an integer greater than or equal to 0.
[0216] In some embodiments, the service semantic information of a microservice may include the name, function, environment, performance, technology, security, usage method, application scenario, input parameter, and one or more of the input parameters of the microservice. This application does not limit this. Any semantic information that can describe the microservice is within the scope of protection of this application. For example, it can be the four-tuple parameter of the microservice .
[0217] In some embodiments, the microservices composition It can be composed of several single microservices according to certain functional logic to realize complex functions, which can be expressed as a four-tuple. ,in: Combining Microservices The name contains several keywords, which describe the functions and application scenarios of the combination in concise terms; for Functional description, usually a long text containing several paragraphs, used to explain the functions and application scenarios of the combination in detail; express The collection of microservices contained in is the total number of microservices; express The control relationship between different microservices (such as calling and associated relationships, parallel relationships, etc.).
[0218] In some embodiments, the service composition semantic information of the target microservice composition can be used to describe the function, application scenario, usage method, attribute and other information of the target microservice composition. This application restricts the service composition information, and any semantic information that can describe the target microservice composition is within the protection scope of this application. For example, it can include the above-mentioned microservice composition quadruple information .
[0219] The edge IoT network model is a technical architecture that deploys IoT devices and data analysis and processing resources closer to the edge of the network. Its core idea is to push computing and data processing to the edge of the network, that is, closer to the terminal device, to reduce communication links and communication delays, enhance real-time processing and response capabilities, and thus improve the overall efficiency of the IoT system.
[0220] In some embodiments, the edge IoT network model can be formalized as a graph: .in, It is a collection of IoT devices in the network, including three types of devices: cloud, edge server and terminal device. The cloud has the strongest computing power and unlimited energy, and stores a large number of abstract microservice resources and their historical combination information; compared with the cloud, the edge server is deployed at a layer close to the demand, has certain computing power, and unlimited power (unlimited energy means uninterrupted power supply); the terminal device is located in a specific demand area, usually supports several specific microservices, and has limited energy. The physical characteristics of each device (including capabilities and location) can be formally expressed as: ,in, Represents computing power, Indicates storage capacity. represents bandwidth, Indicates energy, Indicates the location of the device, where x represents longitude and y represents latitude. Represents the connections in the network, including the connections between edge server nodes and cloud nodes, and the connections between edge server nodes and terminal device nodes.
[0221] Fig.11 The figure is a flowchart of a microservice completion method according to an exemplary embodiment.
[0222] refer to Fig.11 , the above microservice completion method may include the following steps.
[0223] Step S1101, start.
[0224] Step S1102, training an environmental semantic information perception model, such as training the following LSTMseq or LSTMprl model, where LSTM (Long Short Term Memory) is a long short-term memory network model.
[0225] Step S1103: capturing the missing semantic information, such as capturing the service composition semantic information of the target microservice composition and the service semantic information of the missing preceding microservice and following microservice.
[0226] Step S1104, call the environment semantic information perception model to select a microservice node, such as the trained LSTMseq or LSTMprl model below.
[0227] Step S1105, determining whether the iteration termination condition is satisfied.
[0228] If the iteration termination condition is not met, step S1106 is executed; if the iteration termination condition is met, step S1107 is executed.
[0229] Step S1106, calling the LSTMseq or LSTMprl model to select a microservice node.
[0230] Step S1107: randomly select a device from the candidate set.
[0231] Step S1108, calculating the individual multi-objective optimization function value.
[0232] Step S1109, determining whether the iteration termination condition is met.
[0233] If the iteration termination condition is not met, step S1111 is executed; if the iteration termination condition is met, step S1110 is executed.
[0234] Step S1110, end.
[0235] Step S1111, performing selection and crossover mutation operations to optimize the current solution.
[0236] The technical solution recorded in the above flowchart can be specifically implemented in the following scenarios.
[0237] In order to cope with complex application scenarios, developers usually build microservice combinations and use certain control processes to integrate the functions of single microservices to achieve functional value-added of microservices to meet business needs. However, due to reasons such as microservice registration failure and equipment failure, the existing microservice combination may be partially missing in special scenarios. In order to solve this problem, this embodiment proposes a completion method based on environment perception, including current context semantic perception and current network environment capability perception, so as to realize automatic completion of missing parts based on the perceived information, and ensure the functional rationality of the reconstructed microservice combination as well as low latency and energy consumption.
[0238] Generally, for deployed microservice combinations, two types of environmental information are included. The first is the contextual semantic information at the logical layer. This type of information is mainly used to express the functions and available scenarios of microservices and microservice combinations. Microservices are combined according to the functional relevance and control relationship. The capture and perception of this type of information can effectively ensure the functional rationality of the completed fragment from a functional perspective. The second is the performance information at the physical layer. This type of information is mainly used to reflect the physical characteristics of the device where the microservice is deployed, such as computing power, location, memory, etc., which can be used as a physical basis for selecting appropriate microservices. For example, when the remaining energy and other performance are the same, of two devices that support microservices, the one that is closer to the other device will be selected to ensure lower transmission latency.
[0239] In order to capture the contextual semantic information of the logic layer, two types of LSTM models can be deployed in the cloud. The cloud, as a resource pool, has the configuration information of all microservices and their historical combination information. For the target microservice combination, that is, the microservice combination with a certain part missing, the semantic information at the microservice combination level is extracted, including and , extract the semantic information of the microservice level currently contained in the combination, including . For the short text in the above semantic information, the camel case algorithm can be used for word segmentation, stop words can be removed and word roots can be extracted, and the model can be used for vectorization to generate the corresponding space vector set. For the long text in the semantic information, preprocessing operations such as removing stop words and extracting word roots can be performed, and the model can be used for vectorization to generate the corresponding vector set. The two types of vector sets are integrated to form the semantic information set of the final target microservice set. .
[0240] In the model training phase, the semantic information of the historical microservice combination and the relationship between microservices stored in the cloud are captured to generate several data pairs for training two types of LSTM neural network models. The training set of environmental semantic information data can be formally expressed as: n is the number of data pairs. According to the control relationship between microservices, two types of LSTM models are trained to capture sequential calls and parallel calls between microservices. and , use the training data set to select the optimal parameters. For details, please refer to the neural network model training method provided above, which will not be described in detail in this embodiment.
[0241] In the model calling phase, appropriate microservices can be selected to complete the target microservice combination according to the current fragment situation. First, the environment semantic information of the target microservice combination is captured and vectorized. Then, the front-end microservices of the missing parts are set up. is the initial node, and the input data of the missing part of the front-end microservice is the output data of the microservice. Model search can be combined with current microservices Parallel microservice nodes , until the stop condition is met. Next, add the selected microservice to the current fragment and add its related semantic information to the environment semantic information set. Then, for each newly added microservice call Model, select its post-processing microservice, the post-processing microservice refers to the output data of the current microservice is the input data of the microservice, until the stop condition is met. Then, add the selected microservice to the current fragment, and add its related semantic information to the environment semantic information set. Finally, repeat the above steps until the candidate service set is searched or the output of the current fragment meets the input of the missing post-processing service, and return the top K (an integer greater than or equal to 1) reconstructed microservice combinations.
[0242] Among them, returning the top K solutions may include: according to the above search method, multiple solutions for the front-end microservices and the back-end microservices that can connect the missing parts can be determined, each solution can include multiple microservices, and the probability of being selected corresponding to each microservice can be added to obtain the solution score, and finally the top K solutions are ranked by the solution score, where K is an integer greater than or equal to 1.
[0243] The above embodiment starts from the starting point, visits all its directly adjacent nodes in sequence, and then visits the adjacent nodes of these adjacent nodes in sequence, until the target node is found or the entire graph is searched.
[0244] Through the above method, multiple completion solutions (i.e., service completion fragments) that can be used to complete the missing parts can be determined for the target microservice combination at the logical level.
[0245] In order to capture the environmental device information of the physical layer, a multi-objective genetic algorithm can be deployed on the edge server. Since the same microservice can be deployed on several different terminal devices to meet regional needs, it is crucial to select appropriate physical devices that support microservices based on the physical characteristics of the devices in the current network in terms of network transmission delay and overall energy consumption. This problem can be modeled as a multi-objective optimization problem, formally expressed as formula (1).
[0246]
[0247] in, To reconstruct the total latency of the microservice combination, it is obtained by combining the transmission latency and computation latency of each part. is the total number of microservices in the current microservice portfolio, Indicates the distance between the current device and the subsequent device. In particular, when two microservices are supported by the same device, the distance is 0. is the size of the data to be transmitted, is the data transmission rate, is the computing rate of data. Eng is the total energy consumption of the reconstructed microservice combination, which is obtained by combining the transmission energy consumption and computing energy consumption of each part. is the transmission energy consumption rate, To calculate the energy consumption rate. For Microservices The computing, storage, and bandwidth capabilities required for deployment, where i is an integer greater than or equal to 1.
[0248] Based on the above multi-objective function, first randomly (regardless of quantity, size, etc.) select a set of terminal devices that can support the logical microservice combination. Next, calculate the adaptive function of the current solution (such as the multi-objective function shown in formula (1)). Then, perform a selection operation to retain the optimized individuals of the current solution (i.e., the current set of terminal devices); then perform a crossover operation on the current solution to replace some individuals in the current solution; perform a mutation operation to randomly replace some individuals in the current solution to achieve individual evolution. Finally, repeat the above steps until the maximum number of iterations is met, and complete the microservice combination completion task based on environmental physical information.
[0249] Specific embodiment: A microservice completion method based on environment perception, characterized by comprising the following steps.
[0250] Step 1: Use the historical microservice combination dataset to train two types of LSTM models in the cloud. Fig.12For example, two types of environmental semantic perception models are deployed in the cloud, and the historical microservice combinations stored in the cloud are used to build a model training data set. For example, for the microservice combination "select the best school location", its functional description is "the school site selection problem needs to consider factors such as geographical location, supporting student entertainment venues, and distance from existing schools. From a general perspective, these factors can determine the school site selection area with better suitability. New schools should be located in flat areas; the establishment of new schools should be considered in combination with existing land use types, and areas with low costs should be selected...". The combination contains several microservices, such as "slope", and the functional description of this microservice is "identify the slope (gradient or steepness) from each cell of the grid...". The semantic information of the microservice combination and the semantic information of the included microservices are captured and processed to generate . Use this training set to train the model. and Perform parameter tuning.
[0251] Step 2: Call the model in the cloud to complete the missing parts of the microservice combination from the logical layer. Fig.13 For example, for the "Select the best school location" microservice combination, due to some failures, the middle part of the combination is missing. This step aims to use the model in the cloud to complete the current missing fragments at the logical layer. First, collect the name and description of "Select the best school location", collect the names and descriptions of "Euclidean distance" and "slope", and perform vector processing. Take "Euclidean distance" and "slope" as the initial nodes and call The model searches for parallel microservices, adds the selected microservices to the current segment, and adds their related semantic information to the environment semantic information set. Then, for each newly added microservice, call Model, add the selected microservice to the current fragment, and add its related semantic information to the environment semantic information set. Finally, repeat the above steps until the candidate service set is searched or the output of the current fragment matches the input of "raster to surface", and return the top reconstructed microservice combination.
[0252] Step 3: Call the environment device perception model deployed on the edge server to complete the missing parts of the microservice combination from the physical layer. Fig.12 and Fig.13 For example, for the microservices in the logic layer, they can be supported by different physical devices, such as "reclassification", which can be supported by two devices. Therefore, the physical layer needs to comprehensively consider the status of each device and select a better deployment solution. For the microservice completion fragment selected by the logic layer, the physical layer first randomly selects a set of terminal devices that can support the fragment and calculates the current adaptive function. Then, optimize individual retention, such as It supports "reclassification" and "weighted superposition". Selecting this device can reduce the delay and energy consumption caused by transmission to a certain extent. Then, replace some individuals in the current solution to achieve individual evolution. Finally, repeat the above steps until the maximum number of iterations is met, and return the final device selection solution.
[0253] The microservice completion method in the cloud computing environment provided in the above embodiment, on the one hand, defines a three-layer network model in the cloud computing edge environment, including a cloud center, an edge server, and a terminal device. A logic layer microservice completion model based on environmental semantic information perception is deployed in the cloud, and a physical layer microservice completion model based on environmental device information perception is deployed on the edge server; on the other hand, a logic layer microservice completion model based on environmental semantic information perception is defined in the cloud computing edge environment, including two types of LSTM models for calling and parallel relationships between microservices based on semantic information perception; a physical layer microservice completion model based on environmental device information perception is also defined in the cloud computing edge environment, and an optimized multi-objective genetic algorithm is used to select appropriate physical devices, thereby ensuring low latency and low energy consumption of the network.
[0254] It should be noted that the various steps in the various embodiments of the above-mentioned microservice completion method can be mutually crossed, replaced, added, or deleted. Therefore, these reasonable permutations, combinations, and transformations of the microservice completion method should also fall within the scope of protection of the present disclosure, and the scope of protection of the present disclosure should not be limited to the embodiments.
[0255] Based on the same inventive concept, the present disclosure also provides a microservice completion device in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0256] Fig.14 The invention is a block diagram of a microservice completion device according to an exemplary embodiment. In some embodiments, a target application is provided with services by a target microservice combination, and the target microservice combination has service missing.
[0257] Reference Fig.14 The microservice completion device 1400 provided in the embodiment of the present disclosure may include: a candidate microservice determination module 1401, a service completion fragment determination module 1402, a first device combination determination module 1403, a first multi-objective optimization function value determination module 1404, a target device combination determination module 1405 and a completion module 1406.
[0258] Among them, the candidate microservice determination module 1401 can be used to obtain at least one candidate microservice; the service completion fragment determination module 1402 can be used to determine the service completion fragment of the missing part of the target microservice combination in the at least one candidate microservice; the first device combination determination module 1403 can be used to obtain multiple physical devices to be deployed, and determine multiple first device combinations based on the multiple physical devices to be deployed; the first multi-objective optimization function value determination module 1404 can be used to determine the different first multi-objective optimization function values corresponding to the target microservice combination when the service completion fragment is deployed on each first device combination to perform service completion on the missing part; the target device combination determination module 1405 can be used to determine the target device combination with the largest or smallest first multi-objective optimization function value among the multiple first device combinations; the completion module 1406 can be used to deploy the service completion fragment through the target device combination to complete the missing part of the target microservice combination.
[0259] In some embodiments, the service completion fragment determination module 1402 may include: an initial microservice determination submodule, a termination microservice determination submodule, a service semantic information acquisition submodule, a first post-microservice determination submodule, and a service completion fragment first generation submodule.
[0260] Among them, the initial microservice determination submodule can be used to determine the preceding microservice of the missing part as the initial microservice; the termination microservice determination submodule can be used to determine the post-processing microservice of the missing part as the termination microservice; the service semantic information acquisition submodule can be used to obtain the service combination semantic information of the target microservice combination and the service semantic information of the initial microservice; the first post-processing microservice determination submodule can be used to determine the first post-processing microservice of the initial microservice from the at least one candidate microservice according to the service combination semantic information of the target microservice combination and the service semantic information of the initial microservice; the service completion fragment first generation submodule can be used to determine that the output data of the first post-processing microservice is the input data of the termination microservice, and then generate the service completion fragment according to the first post-processing microservice.
[0261] In some embodiments, the microservice completion device 1400 may further include: a first judgment module, a first parallel microservice determination module, a second judgment module, and a service completion fragment second generation module.
[0262] Among them, the first judgment module can be used to determine that the output data of the first post-placed microservice is not the input data of the termination microservice; the first parallel microservice determination module can be used to determine the first parallel microservice of the first post-placed microservice in the at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the first post-placed microservice; the second judgment module can be used to determine that the output data of the initial microservice is the input data of the first parallel microservice, and the output data of the first parallel microservice is the input data of the termination microservice; the service completion fragment second generation module can be used to generate the service completion fragment according to the first parallel microservice.
[0263] In some embodiments, the microservice completion device 1400 may further include: a third judgment module, a fourth judgment module, a post-microservice determination module, and a fifth judgment module.
[0264] Among them, the third judgment module can be used to discard the first parallel microservice if it is determined that the output data of the initial microservice is not the input data of the first parallel microservice; the fourth judgment module can be used to merge the first parallel microservice into the first post-service if it is determined that the output data of the initial microservice is the input data of the first parallel microservice, but the output data of the first parallel microservice is not the input data of the termination microservice; the post-service microservice determination module can be used to determine the post-service of the first post-service in the at least one candidate microservice according to the service combination semantic information of the target microservice combination and the service semantic information of the first post-service; the fifth judgment module can be used to generate the service completion fragment according to the first post-service and the post-service of the first post-service if the output data of the post-service of the first post-service is the input data of the termination microservice.
[0265] In some embodiments, the first post-microservice determination submodule may include: an actual association relationship acquisition unit, a predicted association relationship acquisition unit, a training unit, and a first post-microservice determination unit.
[0266] Among them, the actual association relationship acquisition unit can be used to obtain the training service combination semantic information of the training microservice combination, the service semantic information of each training microservice in the training microservice combination, and the actual association relationship between each training microservice; the predicted association relationship acquisition unit can be used to predict the training service combination semantic information and the service semantic information of each training microservice through the target network model to obtain the predicted association relationship between each training microservice; the training unit can be used to reverse train the target network model according to the actual association relationship and the predicted association relationship; the first post-microservice determination unit can be used to predict the service combination semantic information of the target microservice combination, the service semantic information of the initial microservice, and the service semantic information of each candidate microservice through the trained target network model to predict the first post-microservice of the initial microservice among the at least one candidate microservice.
[0267] In some embodiments, the microservice completion apparatus 1400 may further include: a second device combination generating module and a second multi-objective optimization function value determining module.
[0268] Among them, the second device combination generation module can be used to cross, mutate and replace the first device combination to generate multiple second device combinations; the second multi-objective optimization function value determination module can be used to determine the different second multi-objective optimization function values corresponding to the target microservice combination when the service completion fragment is deployed on each second device combination to complete the missing part.
[0269] The target device combination determining module 1405 may include: a target device combination determining submodule.
[0270] The target device combination determination submodule may be configured to determine the target device combination in the first device combination and the second device combination according to the first multi-objective optimization function value and the second multi-objective optimization function value.
[0271] Since the functions of the device 1400 have been described in detail in the corresponding method embodiments, the present disclosure will not elaborate on them here.
[0272] The modules and / or submodules and / or units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. The modules and / or submodules and / or units described may also be arranged in a processor. The names of these modules and / or submodules and / or units do not, in certain circumstances, constitute limitations on the modules and / or submodules and / or units themselves.
[0273] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a part of a module or program segment, and a part of the above-mentioned module or program segment contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer program instructions.
[0274] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0275] Fig.15 FIG. 1 shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. It should be noted that: Fig.15 The electronic device 1500 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0276] like Fig.15 As shown, the electronic device 1500 includes a central processing unit (CPU) 1501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1502 or a program loaded from a storage part 1508 into a random access memory (RAM) 1503. In the RAM 1503, various programs and data required for the operation of the electronic device 1500 are also stored. The CPU 1501, the ROM 1502, and the RAM 1503 are connected to each other via a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.
[0277] The following components are connected to the I / O interface 1505: an input section 1506 including a keyboard, a mouse, etc.; an output section 1507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a LAN card, a modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the I / O interface 1505 as needed. A removable medium 1511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1510 as needed, so that a computer program read therefrom is installed into the storage section 1508 as needed.
[0278] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains computer program instructions for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1509, and / or installed from a removable medium 1511. When the computer program is executed by the central processing unit (CPU) 1501, the above-mentioned functions defined in the system of the present disclosure are executed.
[0279] It should be noted that the computer-readable storage medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable computer program instructions. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The computer program instructions contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0280] As another aspect, the present disclosure also provides a computer-readable storage medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by a device, the device can implement functions including: obtaining at least one candidate microservice; determining a preceding microservice of the missing part of the target microservice combination as an initial microservice, wherein the output data of the initial microservice is the input data of the missing part; determining a succeeding microservice of the missing part of the target microservice combination as a terminating microservice, wherein the output data of the missing part is the input data of the terminating microservice; obtaining service combination semantic information of the target microservice combination and service semantic information of the initial microservice, wherein the service combination The combined semantic information is used to describe the functions and application scenarios of the target microservice combination, and the service semantic information of the initial microservice is used to describe the functions, application scenarios, input parameters and output parameters of the initial microservice; according to the service combination semantic information of the target microservice combination and the service semantic information of the initial microservice, a post-positioned microservice of the initial microservice is determined from at least one candidate microservice and the post-positioned microservice of the initial microservice is used as the first post-positioned microservice; if it is determined that the output data of the first post-positioned microservice is the input data of the terminating microservice, a service completion fragment is generated according to the first post-positioned microservice; and the target microservice combination is completed by the service completion fragment.
[0281] According to one aspect of the present disclosure, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer program instructions, the computer program instructions being stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and a processor executes the computer program instructions to implement the methods provided in various optional implementations of the above embodiments.
[0282] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of computer program instructions for enabling an electronic device (which can be a server or a terminal device, etc.) to execute the method according to the embodiment of the present disclosure.
[0283] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0284] It should be understood that the present disclosure is not limited to the detailed structures, drawings or implementations shown herein, but rather the present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A microservice completion method, characterized in that: The target application is served by the target microservice combination, and the target microservice combination has service deficiencies, including: Get at least one candidate microservice; Determine, in the at least one candidate microservice, a service completion fragment of a missing portion of the target microservice combination; Acquire a plurality of physical devices to be deployed, and determine a plurality of first device combinations based on the plurality of physical devices to be deployed; Determining different first multi-objective optimization function values corresponding to the target microservice combination when deploying the service completion fragment on each first device combination to perform service completion on the missing part; Determine a target device combination having a maximum or minimum first multi-objective optimization function value among the plurality of first device combinations; Deploying the service completion fragment through the target device combination to complete the missing part of the target microservice combination; Wherein, determining the service completion fragment of the missing part of the target microservice combination in the at least one candidate microservice includes: Determine the front-end microservice of the missing part as the initial microservice; Determine the post-placement microservice of the missing part as the termination microservice; Acquire service composition semantic information of the target microservice composition and service semantic information of the initial microservice; Determine, according to the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice, a first post-positioned microservice of the initial microservice from among the at least one candidate microservice; Determining that the output data of the first post-positioned microservice is the input data of the termination microservice, generating the service completion fragment according to the first post-positioned microservice; Wherein, determining a first post-positioned microservice of the initial microservice from the at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice includes: Acquire the training service combination semantic information of the training microservice combination, the service semantic information of each training microservice in the training microservice combination, and the actual association relationship between each training microservice; Predicting and processing the training service combination semantic information and the service semantic information of each training microservice through the target network model to obtain the predicted association relationship between each training microservice; Performing reverse training on the target network model according to the actual association relationship and the predicted association relationship; The trained target network model is used to predict the service composition semantic information of the target microservice composition, the service semantic information of the initial microservice, and the service semantic information of each candidate microservice, so as to predict a first post-processing microservice of the initial microservice from among the at least one candidate microservice.
2. The method according to claim 1, characterized in that: The method further comprises: Determining that the output data of the first post-service is not the input data of the termination microservice; Determine, according to the service composition semantic information of the target microservice composition and the service semantic information of the first post-positioned microservice, a first parallel microservice of the first post-positioned microservice from the at least one candidate microservice; Determine that the output data of the initial microservice is the input data of the first parallel microservice, and the output data of the first parallel microservice is the input data of the terminating microservice; The service completion fragment is generated according to the first parallel microservice.
3. The method according to claim 2, characterized in that: The method further comprises: If it is determined that the output data of the initial microservice is not the input data of the first parallel microservice, discarding the first parallel microservice; If it is determined that the output data of the initial microservice is the input data of the first parallel microservice, but the output data of the first parallel microservice is not the input data of the termination microservice, merging the first parallel microservice into the first post-placement microservice; Determine a post-position microservice of the first post-position microservice from the at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the first post-position microservice; If the output data of the post-positioned microservice of the first post-positioned microservice is the input data of the terminating microservice, the service completion fragment is generated according to the first post-positioned microservice and the post-positioned microservice of the first post-positioned microservice.
4. The method according to claim 1, characterized in that: The method further comprises: Performing crossover, mutation and replacement processing on the first device combination to generate a plurality of second device combinations; Determining different second multi-objective optimization function values corresponding to the target microservice combination when deploying the service completion fragment on each second device combination to perform service completion on the missing part; Wherein, determining a target device combination having a maximum or minimum first multi-objective optimization function value among the plurality of first device combinations comprises: The target device combination is determined in the first device combination and the second device combination according to the first multi-objective optimization function value and the second multi-objective optimization function value.
5. A microservice completion device, characterized in that: The target application is served by the target microservice combination, and the target microservice combination has service deficiencies, including: A candidate microservice determination module, used to obtain at least one candidate microservice; A service completion fragment determination module, configured to determine, from the at least one candidate microservice, a service completion fragment of a missing portion of the target microservice combination; A first device combination determining module, used to obtain a plurality of physical devices to be deployed, and determine a plurality of first device combinations according to the plurality of physical devices to be deployed; A first multi-objective optimization function value determination module, used to determine different first multi-objective optimization function values corresponding to the target microservice combination when the service completion fragment is deployed on each first device combination to perform service completion on the missing part; A target device combination determination module, configured to determine a target device combination with a maximum or minimum first multi-objective optimization function value among the plurality of first device combinations; A completion module, used to deploy the service completion fragment through the target device combination to complete the missing part of the target microservice combination; Wherein, determining the service completion fragment of the missing part of the target microservice combination in the at least one candidate microservice includes: Determine the front-end microservice of the missing part as the initial microservice; Determine the post-placement microservice of the missing part as the termination microservice; Acquire service composition semantic information of the target microservice composition and service semantic information of the initial microservice; Determine, according to the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice, a first post-positioned microservice of the initial microservice from among the at least one candidate microservice; Determining that the output data of the first post-positioned microservice is the input data of the termination microservice, generating the service completion fragment according to the first post-positioned microservice; Wherein, determining a first post-positioned microservice of the initial microservice from the at least one candidate microservice according to the service composition semantic information of the target microservice composition and the service semantic information of the initial microservice includes: Acquire the training service combination semantic information of the training microservice combination, the service semantic information of each training microservice in the training microservice combination, and the actual association relationship between each training microservice; Predicting and processing the training service combination semantic information and the service semantic information of each training microservice through the target network model to obtain the predicted association relationship between each training microservice; Performing reverse training on the target network model according to the actual association relationship and the predicted association relationship; The trained target network model is used to predict the service composition semantic information of the target microservice composition, the service semantic information of the initial microservice, and the service semantic information of each candidate microservice, so as to predict a first post-processing microservice of the initial microservice from among the at least one candidate microservice.
6. An electronic device, characterized in that: include: Memory; as well as A processor coupled to the memory, the processor being configured to execute the microservice completion method according to any one of claims 1 to 4 based on computer program instructions stored in the memory.
7. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the microservice completion method according to any one of claims 1 to 4 is implemented.
8. A computer program product, comprising computer program instructions, wherein the computer program instructions are stored in a computer-readable storage medium, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.
