WO2022007212A1 - Software microservice combination optimization method for edge cloud system - Google Patents

Software microservice combination optimization method for edge cloud system Download PDF

Info

Publication number
WO2022007212A1
WO2022007212A1 PCT/CN2020/119196 CN2020119196W WO2022007212A1 WO 2022007212 A1 WO2022007212 A1 WO 2022007212A1 CN 2020119196 W CN2020119196 W CN 2020119196W WO 2022007212 A1 WO2022007212 A1 WO 2022007212A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
microservice
combination
value
microservices
Prior art date
Application number
PCT/CN2020/119196
Other languages
French (fr)
Chinese (zh)
Inventor
徐小龙
姜宇
李洋
Original Assignee
南京邮电大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 南京邮电大学 filed Critical 南京邮电大学
Publication of WO2022007212A1 publication Critical patent/WO2022007212A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1061Peer-to-peer [P2P] networks using node-based peer discovery mechanisms
    • H04L67/1065Discovery involving distributed pre-established resource-based relationships among peers, e.g. based on distributed hash tables [DHT] 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/61Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]

Definitions

  • the invention relates to the technical field of information integration and software engineering application, in particular to a software microservice combination optimization method oriented to an edge cloud system.
  • microservice architecture Since the advent of the "microservice architecture", the design of software application systems has shifted towards sets of independently deployable services. Compared with the traditional monolithic development style, microservices focus more on developing an independent application system by developing a set of small services, each of which runs in its own process. These services are built around business functionality and can be deployed independently through a fully automated deployment mechanism.
  • a monolithic application system is built as a single unit. As more and more application systems are deployed to the cloud, software changes are greatly restricted. Once a part of the application system is changed, the entire monolithic application system needs to be rebuilt and deployed. Obviously, monolithic application systems are increasingly difficult to maintain a good modular structure. For this limitation, the architecture of microservices can be well filled. In microservices, each service can provide a solid module boundary, even allowing different programming languages to be used to write different services. The "componentization" of microservices is characterized by decomposing software into many services, which can communicate through web service requests or remote procedure calls.
  • microservices are combined into a software application system, that is, the system is decomposed into several services according to business functions.
  • a software application system that is, the system is decomposed into several services according to business functions.
  • People can use different programming languages and technical tools to develop their own microservice modules, and with the large increase in the number of published microservices, it becomes a difficult choice for software application systems to choose which microservices to use. This is caused by the widespread problem of service heterogeneity, which reduces the accuracy of service discovery, matching and selection, and the ability to interoperate between services, affects the effectiveness and correctness of composite services, and becomes a dynamic composite development. one of the bottlenecks.
  • Uncertainty problems include whether the availability of microservices is uncertain.
  • the service quality standards of microservices can be adopted and introduced into the evaluation of microservices.
  • the quality of service (QoS) of microservices is dynamic, uncontrollable, and different.
  • QoS quality of service
  • users have different requirements for microservice quality QoS.
  • the combination of microservices Schemas and associations are different. Uncertainty issues bring a variety of problems to microservice composition, which affect the effective design, development, reliability, availability, and quality of the system.
  • Microservices have been applied in the development of software application systems.
  • the quality of service (QoS) problem is very critical to the successful application of microservices.
  • How to provide microservices with QoS guarantees is a hot issue in the research and application of microservices.
  • From the perspective of microservices how to select appropriate microservices from a large number of microservices and optimize the combination so that the QoS of the service composition service can meet the requirements is an important issue in the research of microservice composition.
  • microservices composition For today's microservices composition, most of them are aimed at the cloud computing environment.
  • cloud computing in order to improve cost efficiency, multiple microservices are usually placed on the server at the same time, but with the increase of server resources (core, cache, bandwidth, etc.) With the increase and the diversity of microservices, the space for scheduling exploration is rapidly expanding.
  • Cloud computing adopts microservices and container technology to increase the elasticity and scalability of cloud computing.
  • Microservices are deployed in containers to add multiple copies of services to balance the load.
  • Edge computing is to sink tasks to the edge of the network.
  • the edge cloud also provides micro-services for users, in order to meet the increasingly complex application needs of users, the micro-service composition also needs to be applied in the edge environment, and the related service composition algorithms are also Improvements are needed to accommodate service mix in edge environments.
  • the matching problem of each service in a microservice composition is a complex composition optimization problem, that is, a large number of microservice collections are searched for a combination that satisfies a certain service quality and meets the needs of users. Solving this problem is not only time-consuming, but it is also difficult to find the best microservice combination solution. The results of the solution directly affect the quality and cost of the microservice combination. Especially in the edge environment, each edge server is scattered in various locations. Combining microservices deployed on edge servers requires high costs. In response to this problem, the use of intelligent optimization algorithms to solve the microservice composition optimization problem is the current mainstream idea. This optimizes the microservice composition to a certain extent, but there are still the following shortcomings:
  • the data stored in the service registry may be subject to malicious attacks at any time. The most important thing is to tamper with the service attribute value. It is also a very important issue to ensure the safety and reliability of each service quality attribute value stored in the service registry.
  • the purpose of the present invention is to provide a software microservice combination optimization method oriented to edge cloud systems.
  • the QoS service quality of the microservice combination is guaranteed to be optimal, and the efficiency of the microservice combination is further improved, and the reliability of the service quality of the provided microservice is also guaranteed.
  • a method for optimizing software micro-service combination for edge cloud system described in the present invention includes the following steps:
  • S1 The user submits his own task, which includes the corresponding task input and the expected output result.
  • the task is submitted to the edge cloud, received by the edge orchestration manager, and deployed in each edge server through the registration center.
  • Microservices information and choose a combination of services;
  • S2 Introduce the predatory search strategy, and use the predatory search strategy to obtain a feasible service chain globally, that is, to search for a service chain that meets the requirements of the user's microservice composition;
  • S3 The length of the feasible service chain is m, and the candidate service corresponding to each microservice on the feasible service chain is searched, that is, the microservices with the same input set and output set as the microservices on the feasible service chain are put into the same service class , get m candidate service classes;
  • S4 In the candidate service class, use a cotangent sequence with chaotic properties to select a candidate service from each candidate service class in turn to form a micro-service combination.
  • the micro-service combination is mapped to a driver individual, according to the previous driver The individual performs chaotic initialization n-1 times, which obtains n light-driving individuals;
  • S5 Evaluate the n microservice composition schemes according to the individualized fitness function, find the optimal microservice composition scheme among the n microservice composition schemes, and judge whether the corresponding fitness function value reaches the theoretical maximum If yes, then the microservice composition scheme is the global optimal microservice composition scheme; otherwise, execute S6, when the final optimal microservice composition scheme is found or the number of iterations reaches the upper limit, stop, and output the maximum value when stopped. Excellent microservice composition scheme;
  • S6 Update the micro-service combination scheme of 20% of the light-driving individuals with the chaotic disturbance rules, and these 20% of the light-driving individuals are to select 10% of the light-driving individuals with the best fitness value and 10% of the fitness value in the current iteration
  • the rest of the optical drive individuals are still calculated according to the position transformation formula of the original combination algorithm. 20% of the optical drive individuals need to update their positions, and then perform a local search. After the update is completed, return to S5;
  • the edge orchestration manager will save the QoS attribute values of the microservices registered in the service registry in the service registry, and use the hash tree concept to hash the QoS attribute values of the microservices in pairs, similar to a tree structure Finally get a hash root.
  • the edge orchestration manager encrypts the hash value with the private key, and then broadcasts it to each edge server.
  • the edge server decrypts the broadcast information with the stored public key and saves the hash value.
  • the edge server will periodically ask the registry to see if the hash root stored in the registry is consistent with the locally stored hash value. If it is inconsistent, it is judged that the service QoS attribute value stored by the service registry has been tampered with, and the attribute value of which service has been modified can be quickly located by using the properties of the hash tree, and the specific edge server can also be located.
  • the specific process of the S2 is as follows:
  • S2.1 Set the searchSet collection to be empty, search all microservices, add the microservices that meet the user's microservice composition requirements to the service chain, and store the input collection of the microservices in the searchSet collection;
  • the specific process of the S4 is as follows:
  • the calculation formula of the fitness function value in the S5 is:
  • f represents the fitness value
  • R represents the product of the reliability of each microservice on the service chain
  • T represents the sum of the response times of each microservice on the service chain
  • C represents the sum of the execution costs of each microservice on the service chain
  • A represents the service The product of the availability of each microservice on the chain
  • represents the weight of R
  • represents the weight of A
  • represents the weight of T
  • represents the weight of C
  • ⁇ + ⁇ + ⁇ + ⁇ 1.
  • the specific process of the S6 is:
  • the position update also needs to be calculated according to the cotangent sequence.
  • the jth dimension position of the ith driver individual The update is obtained iteratively according to the cotangent sequence obtained at the tth time, where h represents the dimension of the individual driver, that is, the length of the service chain, and n represents the maximum number of iterations.
  • the updated cotangent function value needs to calculate the corresponding candidate service according to S4;
  • S6.3 The light-driving individuals participating in chaotic disturbance need to compare the locally optimal combination scheme found by themselves with the historical global optimal combination scheme. If it is better than the historical global optimal combination scheme, update the historical optimal combination scheme with this scheme as the new fBest, otherwise continue to S5.
  • the present invention adopts the above technical scheme compared with the prior art, has the following technical effects:
  • the microservice composition optimization problem is a complex NP-Hard problem with a polynomial time complexity. With the expansion of the problem scale, it will lead to composition explosion, and it is unrealistic to completely traverse all composition schemes.
  • the present invention classifies the microservices by utilizing the characteristics of the microservices, and divides the services with the same input and output into the same class, thereby reducing the combination reduction and making it possible to completely enumerate all combination schemes.
  • the present invention introduces the cotangent sequence method with chaotic properties.
  • the cotangent sequence is used to initialize the position of the driver individual, and the ergodicity, regularity and pseudo-randomness of the cotangent sequence are used to make up for the original
  • the random search strategy with the algorithm improves the overall search efficiency of the algorithm; in the chaotic disturbance stage, a new set of disturbance rules is used to fully disrupt some of the drive individuals, so that the algorithm is not easy to fall into local optimum and has global search ability .
  • the present invention improves the step size factor and the attraction formula of the algorithm, so that the random item can exert its effective detection ability, balance the local search and the global search, and also prevent the attraction between population individuals due to excessive distance. When it is 0, the optimization ability is improved.
  • microservices and application service composition algorithms in the edge cloud, provide services to users at the edge, reduce transmission delay, and improve user experience; the concept of hash tree is introduced to improve the QoS of services.
  • the attribute values are hashed layer by layer and stored in each edge server to ensure the reliability of the provided microservices.
  • Figure 1 is a simulation diagram of the optimization of the microservice composition scheme
  • Figure 2 is a schematic diagram of falling into a local optimum
  • FIG. 3 is a schematic diagram of a disruptive service combination scheme
  • Figure 4 is a logical structure diagram of microservice composition
  • Figure 5 is the service chain and candidate services
  • Figure 6 is an edge cloud system architecture diagram
  • Figure 7 is a schematic diagram of a hash tree
  • FIG. 8 is a flow chart of a method for optimizing software micro-service composition for an edge cloud system according to the present invention.
  • the invention is an optimization method for software micro-service combination oriented to edge cloud system, which ensures that the QoS service quality of the micro-service combination provided for users is optimal under the premise of satisfying user service requirements in an edge environment, and further improves the Efficiency of microservice composition and increased diversity of microservice composition.
  • intelligent optimization algorithms are often used to solve microservice composition optimization problems, such as particle swarm optimization algorithm, genetic algorithm, simulated annealing algorithm, etc. Aiming at the micro-service combination optimization problem, the present invention also adopts an intelligent optimization algorithm to be improved to be suitable for solving the micro-service combination optimization problem.
  • the intelligent optimization algorithm is a group-based random search algorithm.
  • Each individual in the group is a candidate solution to the corresponding problem, and the optimal position is searched through group intelligence. Because of its simple concept, easy implementation, and good performance The advantages of optimization performance and other advantages are widely used to solve various optimization problems. Aiming at the optimization problem of micro-service combination, the invention improves the intelligent optimization algorithm. By introducing chaos theory in the initialization and update of the population, and optimizing the algorithm itself, a software micro-system oriented to edge cloud system is proposed for the edge environment. Service Portfolio Optimization Methods.
  • each combination of micro-services is represented as a light-driving individual.
  • the position of each light-driving individual needs to be initialized, thereby determining the distance of each individual from the optimal solution.
  • Fig. 1 there is an optimal solution, that is, an optimal combination scheme
  • X 2 ,...,X i ,...,X n-1, etc. represent other combination schemes.
  • X 0 , X 1 ,...,X i ,...,X n-1 each The vectors all represent a microservice composition scheme. All microservice composition schemes are compared, and the globally optimal microservice composition scheme is selected.
  • the first item X i (t) represents the position of the driver i in the t-th iteration
  • the second item X j (t) represents the position of the driver j in the t-th iteration
  • the third item represents the random term, generally ⁇ i is a random number, ⁇ [0.1].
  • the above optimization model considers the situation where there is only one globally optimal microservice combination scheme.
  • the optimization problem is a multi-peak optimization problem, that is, there are multiple extreme values and multiple optimal values. Therefore, when the traditional combinatorial optimization algorithm solves the multi-peak optimization problem, due to the fast convergence speed, it is easy to fall into the local optimum in the calculation process, resulting in premature population.
  • the situation of falling into a local optimum is shown in Figure 2.
  • the current microservice composition scheme is closest to the local optimal microservice composition scheme A, and then all the microservice composition schemes are approaching, falling into the local optimal microservice composition scheme. That is, the state of the microservice composition scheme before the update, and all the microservice composition schemes are close to the local optimal microservice composition scheme A.
  • the present invention uses cotangent disturbance to improve the update of the microservice composition scheme, that is, the cotangent disturbance makes the microservice composition scheme fully disturb the position and trend of the microservice composition scheme during the optimization process, thereby greatly reducing the risk of falling into The probability of the local optimal value; as shown in Figure 3, it is the state of the microservice composition scheme after the update. After the update, the position and trend of the microservice composition scheme are fully disturbed, and the microservice composition scheme falls into the local optimum.
  • the present invention can search for as many globally optimal micro-service combination schemes as possible, ensuring the diversity of the combination schemes, and at the same time, using the concept of hash tree, the service attribute values stored in the service registry are analyzed. Perform hashing, and the obtained hash tree root value can determine whether the data is legal.
  • Chaos is to transform the variables from the original chaotic space to the solution space according to certain rules, and use the regularity, randomness and ergodicity of chaos itself to conduct chaotic search, jump out of the local optimum, and find the global optimal solution. .
  • the chaotic search method is to obtain the random motion state points with the characteristics of pseudo-randomness, ergodicity and regularity from the deterministic equation.
  • a n in formula (2) is a value of the cotangent sequence.
  • the "cotangent formula” is a classic example of the butterfly effect. For example, take the initial values of three cotangents as 1, 1.0001, and 1.00001 respectively, and use the cotangent formula to iterate the initial values respectively.
  • Each item of the three series is the cotangent of the previous item. When the 10th item is calculated, The three series began to form huge divergences. This is the chaotic sequence. After enough items, the resulting numbers are random, chaotic, and traversed.
  • Candidate Services is the basic logical unit that constitutes the service composition, and the candidate service of the jth service class is The input set corresponding to its service class S j is The output set is
  • Each candidate service contains a QoS vector
  • the vector contains 4 parameters:
  • the execution cost c of a service refers to the cost to be paid as a service user to request the execution of the service.
  • 2Service execution time (Response Time, t): The execution time t of the service is equal to the time between the time when the request is sent and the time when the result is received.
  • is a constant set according to the type of service
  • T ⁇ is the time the service is available within time ⁇ .
  • the reliability r of a service is the probability that a request is correctly responded within the maximum expected time, and its expression is:
  • N s represents the number of times the service was successfully invoked during the observation time
  • N t represents the total number of times the service was invoked during the observation time
  • the service chain (L c ) selects the appropriate service from the candidate services, and according to its input and output logic, combines it into a sequential directed graph in logical order, which is the service chain, as shown in Figure 4.
  • the optimization model of the microservice composition oriented by the present invention is as follows:
  • Each service class consists of several candidate services, namely where k j represents a total of k j candidate services in the j-th service class;
  • s j represents a service on the service chain
  • the getInput() and getOutput() functions are to obtain the input set and output set of the corresponding service.
  • ⁇ , ⁇ , ⁇ , and ⁇ represent the weight of each QoS attribute, respectively
  • R, T, C, and A represent the product or sum of each QoS attribute of the service chain, respectively, where R and A are reliability and availability, respectively, multiple service combinations
  • the total reliability is the product of the reliability of each service, and the availability can be obtained in the same way
  • T and C represent the execution time and execution cost respectively, and the total execution time of multiple services is the sum of the time of multiple services. The total cost of execution can be reasonably obtained.
  • Q d,k represents the d-th candidate service
  • Q d,k represents the sum of the kth quality attributes of m d candidate services in the candidate service set.
  • the attribute proportional to the QoS value is calculated according to formula (6)
  • the attribute that is inversely proportional is calculated according to formula (7).
  • the present invention is divided into three steps: first, a feasible service chain is globally searched, and candidate services of each service on the service chain are found; secondly, the driver individual is chaotically initialized by the cotangent sequence; The fitness function value of the individual disc drives is used to evaluate the pros and cons of each disc drive individual, the optimal disc drive individual is selected as the object to be learned, and other disc drive individuals are updated.
  • servname represents the name of the service
  • time, availability, rel, and cost are response time, availability, reliability, and execution cost, respectively.
  • input represents the input set of the service;
  • output represents the output set.
  • binding the microservice to the edge server means that the microservice is deployed in the edge server.
  • a search set is added, which is represented by the variable searchSet.
  • the input set of the microservice on the service chain is stored in this variable.
  • the microservice input set already exists in the searchSet. If it does not exist, and the requirements are met , then the microservice can be added to the service chain, otherwise, it cannot be; when the search is over and no feasible service chain is found, the search set will be cleared, and the microservices that have not been searched will be searched until one is found.
  • a viable service chain or after the maximum number of searches, stop searching.
  • Cotangent initialization is to map the pseudorandom sequence value generated by the cotangent sequence to the initial value of the position of the population individual through certain mapping rules.
  • the microservice composition optimization problem is uncertain.
  • the uncertainty here mainly means that the optimal moderate function value for evaluating the merits of the composition scheme is not known in advance, so we can only find a better solution as much as possible; and different service chains
  • the number of candidate services corresponding to different services is also uncertain.
  • the cotangent sequence required for initialization will be different. Therefore, this paper proposes a dynamic cotangent sequence method to initialize the individual drive.
  • the Logic sequence is a sequence generated by the Logic mapping formula, that is, a linear function iteration
  • the cotangent sequence is a sequence generated by the cotangent function iteration.
  • the calculation time of the cotangent function is slightly larger than that of the linear function, the sequence generated by the cotangent function is more dynamic and ergodic. Therefore, the present invention employs a cotangent function.
  • the present invention designs a dynamic chaotic sequence, and the main steps are as follows:
  • the order of magnitude of the candidate service of a certain type of service determines the number of decimal places to intercept the cotangent sequence; for example, if there are 70 service classes in the j-th type, take two decimal places, and use the intercepted number to calculate the remainder of 70, and the generated The number between 0 and 59 corresponds to a certain candidate service of this class.
  • the fitness function value is the value of the fitness function, which is a quantitative index used to evaluate the pros and cons of the microservice combination scheme.
  • the service composition of the present invention includes four QoS parameters, namely reliability, response time, execution cost and availability. Among them, reliability and availability are a probability, and their values are between 0 and 1. Response time and execution cost are not a probability. As shown in the above formula (7), they need to be unified and normalized.
  • the strategy adopted in this paper is: The characteristics of each attribute of QoS, such as response time and execution cost, should be inversely proportional to the fitness value, normalized according to the above formula (7), reliability and availability are proportional to the fitness value, and normalized according to the above formula (6) Unification, the fitness function is:
  • f represents the fitness value
  • R represents the product of the reliability of each microservice on the service chain
  • T represents the sum of the response times of each microservice on the service chain
  • C represents the sum of the execution costs of each microservice on the service chain
  • A represents the service The product of the availability of each microservice on the chain.
  • represents the weight of R
  • represents the weight of A
  • represents the weight of T
  • represents the weight of C
  • ⁇ + ⁇ + ⁇ + ⁇ 1.
  • the present invention is based on a micro-service scenario. If the method of the present invention is applied to other orderly combination optimization scenarios, the fitness function can be modified to be an indicator for evaluating the pros and cons of individual drivers in a specific scenario.
  • Chaos disturbance means that the microservice composition scheme introduces a cotangent disturbance method in the update process, fully disrupts the microservice composition scheme, and traverses the search space as much as possible.
  • the individual driver When an individual driver falls into a local optimum, the individual driver should be allowed to jump out of the local optimum as much as possible.
  • chaotic disturbance the position of the light-driving individual is re-initialized according to the chaotic sequence. After re-initialization, it is necessary to search locally to find the local optimal value. If the optimal value found by the local search is better than the historical global optimal combination scheme, the replacement will be carried out, and the current chaotic disturbance will end, otherwise the chaotic disturbance needs to be repeated until a new global optimal solution is found or the set chaotic disturbance is reached. number of iterations.
  • Brightness is the fitness value corresponding to the location (combination scheme) of each light-driving individual.
  • the brightness is defined as the fitness value of the light-driving individual, and the light-driving individual with low brightness tends to move toward the light-driving individual with high brightness.
  • the formula is as follows:
  • I i represents the absolute brightness of the light-driving individual i, which is directly determined by the fitness value.
  • is the light absorption coefficient, which is generally set as a constant. The effect of the light absorption coefficient is that the presence of air and other substances will lead to the weakening of light. Introduced into the combination optimization, that is, the better solution with a longer distance will weaken the attraction as the distance increases. degree, which is also reflected in the definition of attraction degree; r ij is the Euclidean distance between the light-driving individual i and the light-driving individual j. Then the distance between the drive individuals i and j can be expressed as:
  • X i and X j are the spatial positions of the light-driving individual i and the light-driving individual j, respectively, xi, d represent the d-dimensional component of the light-driving individual i, and D represents the dimension.
  • Attraction is the attraction between individuals, which depends on the influence of distance.
  • the minimum attractiveness ⁇ min is to ensure that the attractiveness between individuals is not 0.
  • ⁇ min 0, when the distance between individuals approaches infinity, the attractiveness ⁇ approaches 0. Obviously, this will lead to random walks of population individuals due to the large distance between individuals, thereby losing traction on other individuals and losing the ability to seek optimization.
  • the step size factor is the factor that affects the position change in the position change.
  • is used to represent the step size factor, and ⁇ [0.1].
  • the step size factor ⁇ takes a fixed value of 0.5, and ⁇ i in ⁇ i takes a random number. Obviously, the random item depends to a large extent on ⁇ i , then this item becomes a completely random item , obviously it is difficult to exert the detection ability and search ability of its adjustment algorithm during the operation of the algorithm.
  • the present invention sets ⁇ , that is, in the early stage of the algorithm, the random item needs to have a large random step size to exert an effective detection ability. Reduce the step size to exert its effective local search ability, the formula is as follows:
  • T max represents the maximum number of iterations
  • t is the current number of iterations.
  • the initial value ⁇ 0 of ⁇ is generally set to be 0.5.
  • An edge cloud is a cluster composed of multiple edge servers in edge computing.
  • edge computing tasks are sunk to the edge of the network, and services are provided to users nearby.
  • major cloud manufacturers gradually provide some microservices to users at the edge to meet the needs of users nearby.
  • the relevant combination optimization algorithm also needs to be improved according to the characteristics of edge computing to adapt to the service combination in the edge cloud.
  • each edge server is deployed close to the terminal.
  • a server that acts as the edge orchestration manager to manage the registration and management of each microservice in the edge cloud in a unified manner.
  • the orchestrator selects the appropriate microservice combination scheme for the user in the microservice registration center, completes the user's task, and returns the result to end users.
  • Hash tree The hash tree structure is similar to a binary tree, and the value on the leaf node is usually the hash value of the data block, not the value on the leaf node.
  • the first step is to calculate a hash value for the data.
  • a hash algorithm such as SHA-256 is used. But if the only protection against data is not intentional damage or tampering, some less secure but more efficient checksum algorithms, such as CRC, can be used instead.
  • CRC checksum algorithms
  • the edge orchestration manager will save the QoS attribute values of the microservices registered in the service registration center in the service registration center, and use the concept of hash tree to hash the QoS attribute values of the microservices in pairs, and finally obtain a hash root.
  • the edge orchestration manager encrypts the hash value with the private key, and then broadcasts it to each edge server, and the edge server saves the hash value with the saved public key.
  • the edge server will periodically ask the registry to see if the hash root stored in the registry is consistent with the locally stored hash value.
  • the present invention takes microservice composition as an example, and the quality in the service quality determination problem includes service execution time, execution cost, reliability and availability.
  • the production flow chart of the microservice combination scheme of the present invention is shown in FIG. 8 .
  • the specific operation steps are as follows:
  • S1 The user submits his own task, and the task includes the corresponding task input and the expected output result.
  • the task is submitted to the edge cloud, received by the edge orchestration manager, and obtains the information of the microservices deployed in each edge server through the registration center, and selects the combined service.
  • S2 First introduce the predatory search strategy, and use the predatory search strategy to obtain a feasible service chain globally, that is, to search for a service chain that meets the requirements of the user's microservice composition. Its specific description is as follows:
  • the input set of the microservices on the service chain is stored in the searchSet collection variable;
  • the microservice is added to the service chain, it is necessary to determine whether the microservice input set already exists in the searchSet collection. If it does not exist and meets the requirements, the microservice can be added to the service chain, otherwise, it cannot be;
  • the search set is cleared, and the microservices that have not been searched are searched until a feasible service chain is found, or the search is stopped after the maximum number of searches.
  • S3 Assuming that the length of the service chain is m, search the candidate services corresponding to each service on the feasible service chain in S2, and cluster the candidate sets of each abstract task, that is, the microservices with the same input set and output set are grouped together. As one class, put them into the same service class, so as to reduce the number of combinations and improve the search efficiency.
  • the second drive individual needs to be initialized according to the first drive individual, that is, using the cotangent function, the first drive individual
  • the cotangent result is used as a variable to calculate its own cotangent value, and the remaining optical drive individuals proceed in turn. Then it takes n-1 times of the above process, and an n ⁇ m cotangent sequence matrix C can be obtained.
  • the cotangent sequence matrix is obtained by intercepting and taking the remainder operation to obtain a one-to-one correspondence with the individual driving light. matrix.
  • S5 Evaluate the n microservice composition schemes according to the individualized fitness function, find the optimal microservice composition scheme among the n microservice composition schemes, and judge whether the corresponding fitness function value reaches the theoretical maximum excellent. If yes, then the microservice composition scheme is the global optimal microservice composition scheme; otherwise, execute S6. When the final optimal microservice composition scheme is found or the number of iterations reaches the upper limit, it stops, and the optimal microservice composition scheme at the time of stopping is output, which is the global optimal microservice composition scheme. Its specific description is as follows:
  • n drive individuals When initializing n drive individuals, a list of drive individuals fireflies is created to store the drive individuals. By traversing the n micro-service combination schemes, the response function values of each micro-service combination scheme are calculated respectively, and the brightness attribute value of the light-driving individual is modified.
  • Each light-driving individual needs to compare the brightness with other light-driving individuals. If there is a light-driving individual with higher light-brightness than this light-driving individual, the attraction degree between the two is calculated according to formula (11). Until the end of the comparison, according to the principle of maximum attractiveness, move to the light-driving individual that is brighter than yourself and has the greatest attractiveness.
  • S6 Update the micro-service combination scheme of 20% of the light-driving individuals with the chaotic disturbance rules, and these 20% of the light-driving individuals are to select 10% of the light-driving individuals with the best fitness value and 10% of the fitness value in the current iteration
  • the worst optical drive individual, the rest of the optical drive individuals are still calculated according to the formula of the position transformation of the original combination algorithm. 20% of the CD-ROM individuals need to be updated, and then perform a local search. After the update is completed, return to S5.
  • the specific steps are as follows:
  • a chaos count is set to limit the number of comparisons.
  • the edge orchestration manager will save the QoS attribute values of the microservices registered in the service registry in the service registry, and use the hash tree concept to hash the QoS attribute values of the microservices in pairs, and finally get a hash root.
  • the edge orchestration manager encrypts the hash value with the private key, and then broadcasts it to each edge server, and the edge server saves the hash value with the saved public key.
  • the edge server will periodically ask the registry to see if the hash root stored in the registry is consistent with the locally stored hash value. If it is inconsistent, it is judged that the service QoS attribute value stored in the service registry has been tampered with, and the attribute value of which service has been modified can be quickly located by using the properties of the hash tree, and then the specific edge server can be located.

Abstract

A software microservice combination optimization method for an edge cloud system which, by resetting a step factor and an attraction degree formula, fully leverages the probing ability of the step factor in the early stage of an algorithm and balances local search and global search. Microservices are classified according to the characteristics of the microservices, and services having the same inputs and outputs are classified into the same type, thereby reducing the number of combinations and making possible the enumeration of all combination schemes. Random initialization and random perturbation are replaced with cotangent initialization and cotangent perturbation in the combination algorithm to improve the initialization and updating of the microservice combination schemes and greatly enhance the diversity of a final combination scheme. Meanwhile, a service attribute value stored in a service registration center is hashed and stored as a root hash using the hash tree concept, thereby ensuring the security and reliability of each quality of service attribute value stored in the service registration center.

Description

一种面向边缘云系统的软件微服务组合优化方法A software microservice composition optimization method for edge cloud system 技术领域technical field
本发明涉及信息集成和软件工程应用技术领域,特别涉及一种面向边缘云系统的软件微服务组合优化方法。The invention relates to the technical field of information integration and software engineering application, in particular to a software microservice combination optimization method oriented to an edge cloud system.
背景技术Background technique
自“微服务架构”出现之后,软件应用系统的设计就朝着以若干组可独立部署的服务的方式转变。相比于传统的单块开发风格,微服务更注重于通过开发一组小型服务的方式来开发一个独立的应用系统,其中的每个小型服务都运行在各自的进程中。这些服务围绕业务功能进行构建,并能通过全自动的部署机制来进行独立部署。Since the advent of the "microservice architecture", the design of software application systems has shifted towards sets of independently deployable services. Compared with the traditional monolithic development style, microservices focus more on developing an independent application system by developing a set of small services, each of which runs in its own process. These services are built around business functionality and can be deployed independently through a fully automated deployment mechanism.
单块应用系统是以一个单个单元的方式来构建的。随着越来越多的应用系统被部署到云端,软件的变更受到了很大的限制,一旦更改应用系统中某一部分,就需要将整个单块应用系统进行重新构建和部署。显然,单块应用系统逐渐难以保持一个良好的模块化结构。对于这种局限性,微服务的架构可以很好地进行填补。在微服务中,每一个服务能提供一个稳固的模块边界,甚至能允许使用不同的编程语言来编写不同的服务。微服务“组件化”的特征表现为将软件分解为诸多服务,可以通过web service请求或远程过程调用的方式进行通信。A monolithic application system is built as a single unit. As more and more application systems are deployed to the cloud, software changes are greatly restricted. Once a part of the application system is changed, the entire monolithic application system needs to be rebuilt and deployed. Obviously, monolithic application systems are increasingly difficult to maintain a good modular structure. For this limitation, the architecture of microservices can be well filled. In microservices, each service can provide a solid module boundary, even allowing different programming languages to be used to write different services. The "componentization" of microservices is characterized by decomposing software into many services, which can communicate through web service requests or remote procedure calls.
随着目前用户的需求越来越多,也越来越复杂,原来单个服务所能解决的问题越来越少,复杂性的增加使得服务组合越来越重要,这样将微服务组合起来能解决更多的问题,而且在软件工程的概念上提高了聚合程度,降低了耦合程度,在组合的基础上维护起来更加方便,增加新的功能和减少原来的功能更加容易,只要单独的微服务模块经过严格的测试,各个方面的参数都满足要求,我们就可以放心的来使用,并且在发现错误后可以很快的定位,最终的服务是经过测试好的微服务组合起来的,并且单个微服务模块是正确的。这就使得微服务组合的应用越来越广泛。With the increasing number and complexity of current user needs, the problems that can be solved by a single service are becoming less and less, and the increase in complexity makes service composition more and more important, so that the combination of microservices can solve the problem. More problems, and in the concept of software engineering, the degree of aggregation is improved, the degree of coupling is reduced, it is more convenient to maintain on the basis of combination, and it is easier to add new functions and reduce original functions, as long as a separate microservice module After strict testing, the parameters in all aspects meet the requirements, we can use it with confidence, and can quickly locate the error after finding the error, the final service is a combination of tested microservices, and a single microservice module is correct. This makes the application of microservice composition more and more widely.
在云计算环境中,将多个微服务组合成一个软件应用系统,也就是根据业务功能将系统分解为若干服务。每个人都可以使用不同的编程语言和技术工具来开发自己的微服务模块,而随着发布的微服务数量的大量增加,软件应用系统选择使用何种微服务就成为了一个困难的选择。这是由于广泛存在的服务异构问题造成的,这样的问题降低了服务发现,匹配和选取的准确率以及服务之间互操作的能力,影响组合服务的有效性和正确性,成为动态组合发展的瓶颈之一。In the cloud computing environment, multiple microservices are combined into a software application system, that is, the system is decomposed into several services according to business functions. Everyone can use different programming languages and technical tools to develop their own microservice modules, and with the large increase in the number of published microservices, it becomes a difficult choice for software application systems to choose which microservices to use. This is caused by the widespread problem of service heterogeneity, which reduces the accuracy of service discovery, matching and selection, and the ability to interoperate between services, affects the effectiveness and correctness of composite services, and becomes a dynamic composite development. one of the bottlenecks.
微服务的不确定性问题也比较突出,不确定性问题包括微服务是否可用是不确定的,可以采用微服务的服务质量的标准,引入微服务的评价中。微服务的服务质量(Quality of Service,QoS)是动态变化的,是不可控的,是不同的,当然用户对微服务质量QoS的要求是不同的,对于不同微服务应用领域,微服务的组合模式和关联关系是不同的。不确定性问题给微服务组合带来的问题是多种多样的,它影响着系统的有效设计、开发、可靠性、可用性以及质量问题。The uncertainty of microservices is also relatively prominent. Uncertainty problems include whether the availability of microservices is uncertain. The service quality standards of microservices can be adopted and introduced into the evaluation of microservices. The quality of service (QoS) of microservices is dynamic, uncontrollable, and different. Of course, users have different requirements for microservice quality QoS. For different microservice application fields, the combination of microservices Schemas and associations are different. Uncertainty issues bring a variety of problems to microservice composition, which affect the effective design, development, reliability, availability, and quality of the system.
微服务目前已经在软件应用系统开发上得到了应用,服务质量QoS问题对于微服务的成功应用非常关键,如何提供具有QoS保证的微服务是目前微服务研究和应用的一个热点问题,从服务组合的角度看,如何从大量微服务中选择合适的微服务并进行优化组 合,以使得服务组合服务的QoS满足需求,是微服务组合研究中的一个重要问题。Microservices have been applied in the development of software application systems. The quality of service (QoS) problem is very critical to the successful application of microservices. How to provide microservices with QoS guarantees is a hot issue in the research and application of microservices. From the perspective of microservices, how to select appropriate microservices from a large number of microservices and optimize the combination so that the QoS of the service composition service can meet the requirements is an important issue in the research of microservice composition.
对于如今的微服务组合,大多针对的是云计算环境,对于云计算,为了提高成本效率,通常将多个微服务同时放置在服务器上,但随着服务器资源(核心,缓存,带宽等)的增加以及微服务的多样性,调度探索空间迅速扩大,云计算采用微服务和容器技术增加云计算的弹性和可扩展性,在容器中部署微服务,为服务增加多个副本,以此平衡负载。而边缘计算是将任务下沉到网络边缘端,当边缘云也为用户提供微服务时,为了满足用户日益复杂的应用需求,微服务组合也需要应用在边缘环境中,相关的服务组合算法也需要改进,以适应边缘环境下的服务组合。For today's microservices composition, most of them are aimed at the cloud computing environment. For cloud computing, in order to improve cost efficiency, multiple microservices are usually placed on the server at the same time, but with the increase of server resources (core, cache, bandwidth, etc.) With the increase and the diversity of microservices, the space for scheduling exploration is rapidly expanding. Cloud computing adopts microservices and container technology to increase the elasticity and scalability of cloud computing. Microservices are deployed in containers to add multiple copies of services to balance the load. . Edge computing is to sink tasks to the edge of the network. When the edge cloud also provides micro-services for users, in order to meet the increasingly complex application needs of users, the micro-service composition also needs to be applied in the edge environment, and the related service composition algorithms are also Improvements are needed to accommodate service mix in edge environments.
在微服务组合中,一个微服务组合中各个服务的选配问题,这是复杂的组合优化问题,即在大量的微服务集合中搜索满足一定的服务质量且符合用户的需求的组合。求解该问题不但耗时,而且很难找到最佳微服务组合方案,求解的结果直接影响微服务组合的质量和成本,特别在边缘环境中,各边缘服务器分散地分布在各个位置,如果需要对部署在边缘服务器上的微服务进行组合,需要很高的成本。针对这一问题,采用智能优化算法求解微服务组合优化问题是目前的主流思路。这样在一定程度上对微服务组合进行了优化,但仍然存在以下不足:In the microservice composition, the matching problem of each service in a microservice composition is a complex composition optimization problem, that is, a large number of microservice collections are searched for a combination that satisfies a certain service quality and meets the needs of users. Solving this problem is not only time-consuming, but it is also difficult to find the best microservice combination solution. The results of the solution directly affect the quality and cost of the microservice combination. Especially in the edge environment, each edge server is scattered in various locations. Combining microservices deployed on edge servers requires high costs. In response to this problem, the use of intelligent optimization algorithms to solve the microservice composition optimization problem is the current mainstream idea. This optimizes the microservice composition to a certain extent, but there are still the following shortcomings:
1)由于随着微服务的数量增大,其计算量成指数增长,所以求解优化问题的效率低下;1) As the number of microservices increases, the amount of computation increases exponentially, so the efficiency of solving optimization problems is low;
2)在搜索最优解过程中,随机搜索策略不能保证最终解的多样性,需要新的搜索策略;2) In the process of searching for the optimal solution, the random search strategy cannot guarantee the diversity of the final solution, and a new search strategy is required;
3)求解微服务组合优化问题时,不但需要考虑微服务的选取,还需要考虑微服务之间的逻辑关系问题;3) When solving the microservice composition optimization problem, it is necessary to consider not only the selection of microservices, but also the logical relationship between microservices;
4)边缘环境中由于边缘服务器的位置分散,导致微服务也处于分散状态,很难对微服务进行组合,组合优化算法需要考虑边缘环境的特点;4) In the edge environment, due to the scattered locations of edge servers, microservices are also in a scattered state, and it is difficult to combine microservices. The combination optimization algorithm needs to consider the characteristics of the edge environment;
5)服务注册中心存储的数据随时可能受到恶意攻击,最主要的就是篡改服务属性值,保证存储在服务注册中心的各服务质量属性值安全可靠也成为一个很重要的问题。5) The data stored in the service registry may be subject to malicious attacks at any time. The most important thing is to tamper with the service attribute value. It is also a very important issue to ensure the safety and reliability of each service quality attribute value stored in the service registry.
发明内容SUMMARY OF THE INVENTION
发明目的:本发明的目的是提供一种面向边缘云系统的软件微服务组合优化方法,在面向边缘计算的软件微服务组合的环境中,实现在边缘端就近控制满足用户服务需求的前提下,保证微服务组合的QoS服务质量达到最优,并且进一步提高了微服务组合的效率,同时也保证提供的微服务的服务质量的可靠性。Purpose of the invention: The purpose of the present invention is to provide a software microservice combination optimization method oriented to edge cloud systems. The QoS service quality of the microservice combination is guaranteed to be optimal, and the efficiency of the microservice combination is further improved, and the reliability of the service quality of the provided microservice is also guaranteed.
技术方案:本发明所述的一种面向边缘云系统的软件微服务组合优化方法,包括如下步骤:Technical solution: A method for optimizing software micro-service combination for edge cloud system described in the present invention includes the following steps:
S1:用户提交自己的任务,任务中包括相对应的任务输入以及预想的输出结果,该任务提交到边缘云中,由边缘编排管理器接收,并通过注册中心得到部署在各个边缘服务器中微服务的信息,进行组合服务的选择;S1: The user submits his own task, which includes the corresponding task input and the expected output result. The task is submitted to the edge cloud, received by the edge orchestration manager, and deployed in each edge server through the registration center. Microservices information, and choose a combination of services;
S2:引入捕食搜索策略,采用捕食搜索策略在全局求得一个可行的服务链,即搜索一条满足用户微服务组合要求的服务链;S2: Introduce the predatory search strategy, and use the predatory search strategy to obtain a feasible service chain globally, that is, to search for a service chain that meets the requirements of the user's microservice composition;
S3:可行服务链的长度为m,搜索可行服务链上每个微服务对应的候选服务,即将与可行服务链上各微服务具有相同输入集合和输出集合的微服务放入同一个服务类中, 得到m个候选服务类;S3: The length of the feasible service chain is m, and the candidate service corresponding to each microservice on the feasible service chain is searched, that is, the microservices with the same input set and output set as the microservices on the feasible service chain are put into the same service class , get m candidate service classes;
S4:在候选服务类中,使用具有混沌性质的余切序列依次从各候选服务类中选择一个候选服务,形成一个微服务组合,该微服务组合映射为一个驱光个体,依照前一个驱光个体进行混沌初始化n-1次,这就得到n个驱光个体;S4: In the candidate service class, use a cotangent sequence with chaotic properties to select a candidate service from each candidate service class in turn to form a micro-service combination. The micro-service combination is mapped to a driver individual, according to the previous driver The individual performs chaotic initialization n-1 times, which obtains n light-driving individuals;
S5:根据具有个性化的适应度函数来评价这n个微服务组合方案,找到这n个微服务组合方案中的最优的微服务组合方案,并判断对应的适应度函数值是否达到理论最优,如果是,则该微服务组合方案即为全局最优微服务组合方案;否则,执行S6,当找到最终的最优微服务组合方案或者迭代次数达到上限,则停止,输出停止时的最优的微服务组合方案;S5: Evaluate the n microservice composition schemes according to the individualized fitness function, find the optimal microservice composition scheme among the n microservice composition schemes, and judge whether the corresponding fitness function value reaches the theoretical maximum If yes, then the microservice composition scheme is the global optimal microservice composition scheme; otherwise, execute S6, when the final optimal microservice composition scheme is found or the number of iterations reaches the upper limit, stop, and output the maximum value when stopped. Excellent microservice composition scheme;
S6:用混沌扰乱规则更新20%的驱光个体的微服务组合方案,这20%的驱光个体是选择10%的当前迭代中适应度值最优的驱光个体以及10%的适应度值最差的驱光个体,其余的驱光个体依然按照原本组合算法的位置变换的公式进行计算,20%的驱光个体需要进行位置更新,之后在局部搜索,更新完成后,返回执行S5;S6: Update the micro-service combination scheme of 20% of the light-driving individuals with the chaotic disturbance rules, and these 20% of the light-driving individuals are to select 10% of the light-driving individuals with the best fitness value and 10% of the fitness value in the current iteration For the worst optical drive individuals, the rest of the optical drive individuals are still calculated according to the position transformation formula of the original combination algorithm. 20% of the optical drive individuals need to update their positions, and then perform a local search. After the update is completed, return to S5;
S7:通过组合算法的求得基于当前服务链的全局最优解,或者达到最大迭代次数,对应的服务链为当前最优服务链。微服务组合选择成功之后,对用户的任务进行执行,之后边缘编排管理器会将执行之后的结果返回给用户,并对相应的微服务中QoS各属性值进行更新,并将更新的结果保存在微服务注册中心;S7: The global optimal solution based on the current service chain is obtained through the combined algorithm, or the maximum number of iterations is reached, and the corresponding service chain is the current optimal service chain. After the microservice combination is successfully selected, the user's task is executed, and then the edge orchestration manager will return the execution result to the user, update the QoS attribute values in the corresponding microservice, and save the updated result in the Microservice registry;
S8:边缘编排管理器会将服务注册中心中注册的微服务的QoS属性值保存在服务注册中心中,利用hash树的概念对微服务的QoS属性值进行两两哈希,类似于树形结构最后得到一个hash根。边缘编排管理器将这个hash值用私钥加密,然后广播给各个边缘服务器,边缘服务器会用保存的公钥对广播信息解密,保存这个hash值。边缘服务器会定时询问注册中心,看是否注册中心中保存的哈希根与本地存储哈希值是否一致。如果不一致,则判断服务注册中心保存服务QoS属性值遭到篡改,利用哈希树的性质可以很快定位到哪个服务的属性值遭到了修改,也就可以定位到具体的边缘服务器。S8: The edge orchestration manager will save the QoS attribute values of the microservices registered in the service registry in the service registry, and use the hash tree concept to hash the QoS attribute values of the microservices in pairs, similar to a tree structure Finally get a hash root. The edge orchestration manager encrypts the hash value with the private key, and then broadcasts it to each edge server. The edge server decrypts the broadcast information with the stored public key and saves the hash value. The edge server will periodically ask the registry to see if the hash root stored in the registry is consistent with the locally stored hash value. If it is inconsistent, it is judged that the service QoS attribute value stored by the service registry has been tampered with, and the attribute value of which service has been modified can be quickly located by using the properties of the hash tree, and the specific edge server can also be located.
作为优选,所述S2的具体过程如下:Preferably, the specific process of the S2 is as follows:
S2.1:设置searchSet集合为空,搜索所有的微服务,将满足用户微服务组合要求的微服务加入服务链,同时将该微服务的输入集合存放于searchSet集合中;S2.1: Set the searchSet collection to be empty, search all microservices, add the microservices that meet the user's microservice composition requirements to the service chain, and store the input collection of the microservices in the searchSet collection;
S2.2:在将满足用户微服务组合要求的微服务加入服务链之前,判断searchSet集合中是否已有该微服务的输入集合,若没有,则将该微服务加入服务链,否则,不加入;S2.2: Before adding a microservice that meets the user's microservice composition requirements to the service chain, determine whether there is an input set of the microservice in the searchSet collection, if not, add the microservice to the service chain, otherwise, do not join ;
S2.3:当前搜索结束后,若没有得到可行服务链,则将searchSet集合清空,在没有被搜索过的微服务中重复S2.1-S2.2,直到找到一条可行服务链或到达最大搜索次数,停止搜索。S2.3: After the current search is over, if no feasible service chain is obtained, the searchSet collection will be cleared, and S2.1-S2.2 will be repeated in the microservices that have not been searched until a feasible service chain is found or the maximum search is reached. times, stop searching.
作为优选,所述S4的具体过程如下:Preferably, the specific process of the S4 is as follows:
S4.1:可行服务链的长度为m,j=0,…,m-1,第j个微服务有k j个候选服务; S4.1: The length of the feasible service chain is m, j=0,...,m-1, and the jth microservice has k j candidate services;
S4.2:确定k j的数量级
Figure PCTCN2020119196-appb-000001
根据与第j个微服务对应的余切序列值
Figure PCTCN2020119196-appb-000002
截取余切序列值小数点后φ j位作为整数值u i,j
Figure PCTCN2020119196-appb-000003
i=0,…,n-1,n为驱光 个体总数;
S4.2: Determine the order of magnitude of k j
Figure PCTCN2020119196-appb-000001
According to the cotangent sequence value corresponding to the jth microservice
Figure PCTCN2020119196-appb-000002
Truncate the cotangent sequence value with φ j bits after the decimal point as an integer value u i,j ,
Figure PCTCN2020119196-appb-000003
i=0,...,n-1, n is the total number of drive individuals;
S4.3:将u i,j对k j取余,产生混沌值ξ i,j,混沌值与第j个微服务对应的候选服务类中的一个候选服务对应,该值与该服务对应的候选服务中的某一个服务对应,则所对应的候选服务被选中,同样,服务链上的所有服务均执行该操作后,则第i个驱光个体的位置X i初始化完成。 S4.3: Take the remainder of u i,j to k j to generate a chaotic value ξ i,j , the chaotic value corresponds to a candidate service in the candidate service class corresponding to the jth microservice, and this value corresponds to the If a certain service in the candidate services corresponds, the corresponding candidate service is selected. Similarly, after all services in the service chain perform this operation, the initialization of the position X i of the i-th optical drive individual is completed.
作为优选,所述S5中适应度函数值的计算公式为:Preferably, the calculation formula of the fitness function value in the S5 is:
Figure PCTCN2020119196-appb-000004
Figure PCTCN2020119196-appb-000004
其中,f代表适应度值,R表示服务链上各微服务可靠性的积,T表示服务链上各微服务响应时间的和,C表示服务链上各微服务执行成本的和,A表示服务链上各微服务可用性的积,α分别表示R的权重,β表示A的权重,γ表示T的权重,η表示C的权重,且α+β+γ+η=1。Among them, f represents the fitness value, R represents the product of the reliability of each microservice on the service chain, T represents the sum of the response times of each microservice on the service chain, C represents the sum of the execution costs of each microservice on the service chain, and A represents the service The product of the availability of each microservice on the chain, α represents the weight of R, β represents the weight of A, γ represents the weight of T, η represents the weight of C, and α+β+γ+η=1.
作为优选,所述S6的具体过程为:Preferably, the specific process of the S6 is:
S6.1:筛选的20%的驱光个体需要按照混沌序列更新自己的位置,公式如下:S6.1: The screened 20% of the light-driving individuals need to update their positions according to the chaotic sequence. The formula is as follows:
Figure PCTCN2020119196-appb-000005
Figure PCTCN2020119196-appb-000005
上式中
Figure PCTCN2020119196-appb-000006
表示驱光个体i在t次迭代的第j维的位置,也就是服务链第j个分量的选择方案。位置更新也需要按照余切序列来计算,在第t+1次迭代时,第i个驱光个体的第j维位置
Figure PCTCN2020119196-appb-000007
更新是按照第t次得出的余切序列来进行迭代得出,其中h表示该驱光个体的维度,也就是服务链的长度,n表示最大迭代次数。更新之后的余切函数值需要根据S4进行计算对应的候选服务;
In the above formula
Figure PCTCN2020119196-appb-000006
Indicates the position of the driver i in the jth dimension of the t iterations, that is, the selection scheme of the jth component of the service chain. The position update also needs to be calculated according to the cotangent sequence. At the t+1th iteration, the jth dimension position of the ith driver individual
Figure PCTCN2020119196-appb-000007
The update is obtained iteratively according to the cotangent sequence obtained at the tth time, where h represents the dimension of the individual driver, that is, the length of the service chain, and n represents the maximum number of iterations. The updated cotangent function value needs to calculate the corresponding candidate service according to S4;
S6.2:20%的驱光个体进行局部搜索,找出自己的局部微服务组合最优方案,这里设置了一个混沌次数chaoNum来限制比较次数,当驱光个体在局部搜索中找到局部最优或者超过这个混沌次数,便可以结束查找;S6.2: 20% of the CD-ROM individuals conduct a local search to find their own optimal solution for local micro-service combination. Here, a chaos count, chaoNum, is set to limit the number of comparisons. When the CD-ROM individuals find the local optimum in the local search Or if this number of chaos is exceeded, the search can be ended;
S6.3:参与混沌扰乱的驱光个体需要将自己找出的局部最优的组合方案与历史全局最优组合方案进行比较。如果更优于历史全局最优组合方案,则用该方案更新历史最优组合方案,作为新的fBest,否则继续S5。S6.3: The light-driving individuals participating in chaotic disturbance need to compare the locally optimal combination scheme found by themselves with the historical global optimal combination scheme. If it is better than the historical global optimal combination scheme, update the historical optimal combination scheme with this scheme as the new fBest, otherwise continue to S5.
有益效果:本发明采用以上技术方案与现有技术相比,具有以下技术效果:Beneficial effect: the present invention adopts the above technical scheme compared with the prior art, has the following technical effects:
1、微服务组合优化问题是复杂的NP-Hard问题,时间复杂度为多项式时间的问题,随着问题规模的扩大,会导致组合爆炸,完全遍历所有的组合方案是不现实的。本发明利用微服务的特点对微服务进行分类,将具有相同的输入和输出的服务分在同一个类中,从而减少组合降低,使得完全枚举所有组合方案成为可能。1. The microservice composition optimization problem is a complex NP-Hard problem with a polynomial time complexity. With the expansion of the problem scale, it will lead to composition explosion, and it is unrealistic to completely traverse all composition schemes. The present invention classifies the microservices by utilizing the characteristics of the microservices, and divides the services with the same input and output into the same class, thereby reducing the combination reduction and making it possible to completely enumerate all combination schemes.
2、本发明引入具有混沌性质的余切序列方法,在组合初始化阶段,使用余切序列初始化驱光个体的位置,利用余切序列的遍历性、规律性、伪随机性的特点,弥补了原有算法的随机搜索策略,使得算法整体搜索效率提高;在混沌扰乱阶段,使用一套全新的 扰乱规则,对部分驱光个体进行充分的扰乱,使得算法不容易陷入局部最优,具有全局搜索能力。2. The present invention introduces the cotangent sequence method with chaotic properties. In the combined initialization stage, the cotangent sequence is used to initialize the position of the driver individual, and the ergodicity, regularity and pseudo-randomness of the cotangent sequence are used to make up for the original The random search strategy with the algorithm improves the overall search efficiency of the algorithm; in the chaotic disturbance stage, a new set of disturbance rules is used to fully disrupt some of the drive individuals, so that the algorithm is not easy to fall into local optimum and has global search ability .
3、本发明改进了算法的步长因子和吸引度公式,使得随机项能够发挥其有效的探测能力,平衡了局域搜索和全局搜索,还防止了种群个体间由于距离过大而导致吸引力为0的情况,提高了寻优能力。3. The present invention improves the step size factor and the attraction formula of the algorithm, so that the random item can exert its effective detection ability, balance the local search and the global search, and also prevent the attraction between population individuals due to excessive distance. When it is 0, the optimization ability is improved.
4、基于边缘计算环境,针对边缘云中部署微服务以及应用服务组合算法,在边缘端就近为用户提供服务,减少传输的时延,改善用户体验;引入哈希树的概念,对服务的QoS属性值进行层层哈希,保存在各个边缘服务器中,保障提供的微服务的可靠性。4. Based on the edge computing environment, deploy microservices and application service composition algorithms in the edge cloud, provide services to users at the edge, reduce transmission delay, and improve user experience; the concept of hash tree is introduced to improve the QoS of services. The attribute values are hashed layer by layer and stored in each edge server to ensure the reliability of the provided microservices.
附图说明Description of drawings
图1是微服务组合方案寻优模拟图;Figure 1 is a simulation diagram of the optimization of the microservice composition scheme;
图2是陷入局部最优示意图;Figure 2 is a schematic diagram of falling into a local optimum;
图3是扰乱服务组合方案示意图;FIG. 3 is a schematic diagram of a disruptive service combination scheme;
图4是微服务组合逻辑结构图;Figure 4 is a logical structure diagram of microservice composition;
图5是服务链和候选服务;Figure 5 is the service chain and candidate services;
图6是边缘云系统架构图;Figure 6 is an edge cloud system architecture diagram;
图7是哈希树的原理图;Figure 7 is a schematic diagram of a hash tree;
图8是本发明一种面向边缘云系统的软件微服务组合优化方法的流程图。FIG. 8 is a flow chart of a method for optimizing software micro-service composition for an edge cloud system according to the present invention.
具体实施方式detailed description
下面详细描述本发明的实施方式,所述实施方式的示例在附图中示出。下面通过参考附图描述的实施方式是示例性的,仅用于解释本发明,而不能解释为对本发明的限制。Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but not to be construed as a limitation of the present invention.
本发明是一种面向边缘云系统的软件微服务组合优化方法,实现在边缘环境下满足用户服务需求的前提下,保证为用户提供的微服务组合的QoS服务质量达到最优,并且进一步提高了微服务组合的效率,以及提高了微服务组合的多样性。传统云计算环境下,多采用智能优化算法求解微服务组合优化问题,例如粒子群优化算法、遗传算法、模拟退火算法等。本发明针对微服务组合优化问题,也采用对一种智能优化算法进行改进以适合微服务组合优化问题的解决。该智能优化算法,是一个基于群体的随机搜索算法,群体中的每个个体是对应问题的一个候选解,通过群体智慧搜索出最优的位置,因其概念简单、易于实现,并且具有较好优化性能等优点,被广泛使用到各种优化问题的求解。本发明针对微服务组合优化问题,对该智能优化算法进行改进,通过在种群的初始化和更新中引入混沌理论,以及对算法本身进行优化,针对边缘环境提出了一种面向边缘云系统的软件微服务组合优化方法。The invention is an optimization method for software micro-service combination oriented to edge cloud system, which ensures that the QoS service quality of the micro-service combination provided for users is optimal under the premise of satisfying user service requirements in an edge environment, and further improves the Efficiency of microservice composition and increased diversity of microservice composition. In the traditional cloud computing environment, intelligent optimization algorithms are often used to solve microservice composition optimization problems, such as particle swarm optimization algorithm, genetic algorithm, simulated annealing algorithm, etc. Aiming at the micro-service combination optimization problem, the present invention also adopts an intelligent optimization algorithm to be improved to be suitable for solving the micro-service combination optimization problem. The intelligent optimization algorithm is a group-based random search algorithm. Each individual in the group is a candidate solution to the corresponding problem, and the optimal position is searched through group intelligence. Because of its simple concept, easy implementation, and good performance The advantages of optimization performance and other advantages are widely used to solve various optimization problems. Aiming at the optimization problem of micro-service combination, the invention improves the intelligent optimization algorithm. By introducing chaos theory in the initialization and update of the population, and optimizing the algorithm itself, a software micro-system oriented to edge cloud system is proposed for the edge environment. Service Portfolio Optimization Methods.
在本发明中,每种微服务组合都表示成一个驱光个体,在种群初始化时,需要对每个驱光个体进行位置的初始化,从而决定了每个个体距离最优解的距离。如图1所示,存在最优解,也就是最优的组合方案,而X 2,…,X i,…,X n-1等则表示其它的组合方案。这里用X j(j=0,1,2,...,n-1)代表某种微服务组合方案,X 0,X 1,…,X i,…,X n-1中,每一个向量均表示一种微服务组合方案,将所有微服务组合方案进行比较,选出全局最优的微服务组合方案。 In the present invention, each combination of micro-services is represented as a light-driving individual. When the population is initialized, the position of each light-driving individual needs to be initialized, thereby determining the distance of each individual from the optimal solution. As shown in Fig. 1, there is an optimal solution, that is, an optimal combination scheme, and X 2 ,...,X i ,...,X n-1, etc., represent other combination schemes. Here, X j (j=0, 1, 2,..., n-1) is used to represent a certain microservice composition scheme. Among X 0 , X 1 ,...,X i ,...,X n-1 , each The vectors all represent a microservice composition scheme. All microservice composition schemes are compared, and the globally optimal microservice composition scheme is selected.
假设微服务组合方案X i距离最优微服务组合方案最近,所以设X i为当前全局最优微服务组合方案,并且设该全局最优微服务组合方案为X g。每个微服务组合方案在寻优过程中,会向比自己更优的组合方案靠近。而当前最优的组合方案为了靠近真正的全局最优组合方案,会进行随机变化,在周围寻找是否存在比自己更优的组合方案。为了避免随机扰动会导致最优解的错过,这里引入粒子群算法(PSO)历史全局最优解的方法,保存累计迭代的最优解。每个微组合方案会被更优的解吸引,逐步靠近更优解,更新自己的位置,更新公式如式(1)所示: Suppose X i micro program service composition from the optimal combination of micro programs and services Recently, the set X i is the current global optimum combination of micro program service, and let the global optimal solutions for the micro-service composition X g. In the process of optimization, each microservice combination solution will approach a combination solution that is better than its own. However, in order to get close to the real global optimal combination scheme, the current optimal combination scheme will make random changes to find out whether there is a better combination scheme than itself. In order to avoid the loss of the optimal solution caused by random disturbance, the method of particle swarm optimization (PSO) historical global optimal solution is introduced here, and the optimal solution of the cumulative iteration is saved. Each micro-combination scheme will be attracted by a better solution, gradually approach the better solution, and update its position. The update formula is shown in formula (1):
Figure PCTCN2020119196-appb-000008
Figure PCTCN2020119196-appb-000008
其中,第一项X i(t)表示驱光个体i在第t次迭代的位置,第二项中X j(t)表示驱光个体j在第t次迭代的位置,第三项表示随机项,一般ε i取随机数,α∈[0.1]。 Among them, the first item X i (t) represents the position of the driver i in the t-th iteration, the second item X j (t) represents the position of the driver j in the t-th iteration, and the third item represents the random term, generally ε i is a random number, α∈[0.1].
上述寻优模型考虑的是只有一个全局最优微服务组合方案的情况,通常情况下的优化问题均为多峰值的优化问题,即有多个极值和多个最优值。所以传统的组合优化算法在求解多峰值的优化问题时,由于收敛速度快,在计算过程中容易陷入局部最优,导致群体早熟。陷入局部最优情况如图2所示,图中有一个最优微服务组合方案,两个局部最优微服务组合方案。当前微服务组合方案距离局部最优微服务组合方案A最近,然后所有的微服务组合方案均向靠近,陷入了局部最优微服务组合方案。即更新前微服务组合方案的状态,所有微服务组合方案向局部最优微服务组合方案A靠近。The above optimization model considers the situation where there is only one globally optimal microservice combination scheme. Usually, the optimization problem is a multi-peak optimization problem, that is, there are multiple extreme values and multiple optimal values. Therefore, when the traditional combinatorial optimization algorithm solves the multi-peak optimization problem, due to the fast convergence speed, it is easy to fall into the local optimum in the calculation process, resulting in premature population. The situation of falling into a local optimum is shown in Figure 2. In the figure, there is an optimal microservice composition scheme and two local optimal microservice composition schemes. The current microservice composition scheme is closest to the local optimal microservice composition scheme A, and then all the microservice composition schemes are approaching, falling into the local optimal microservice composition scheme. That is, the state of the microservice composition scheme before the update, and all the microservice composition schemes are close to the local optimal microservice composition scheme A.
本发明采用余切扰乱,对微服务组合方案的更新做了改进,即余切扰乱使得微服务组合方案在寻优过程中充分扰乱微服务组合方案的位置和动向,从而极大的降低了陷入局部最优值的概率;如图3所示,是微服务组合方案更新后的状态,更新后充分扰乱了微服务组合方案的位置和动向,破坏了微服务组合方案陷入局部最优。对于为多峰值的优化问题,本发明可以搜索到尽可能多的全局最优微服务组合方案,保证了组合方案的多样性,同时利用hash树的概念,对保存在服务注册中心的服务属性值进行哈希,得到的hash树根值可以确定数据是否合法。The present invention uses cotangent disturbance to improve the update of the microservice composition scheme, that is, the cotangent disturbance makes the microservice composition scheme fully disturb the position and trend of the microservice composition scheme during the optimization process, thereby greatly reducing the risk of falling into The probability of the local optimal value; as shown in Figure 3, it is the state of the microservice composition scheme after the update. After the update, the position and trend of the microservice composition scheme are fully disturbed, and the microservice composition scheme falls into the local optimum. For the multi-peak optimization problem, the present invention can search for as many globally optimal micro-service combination schemes as possible, ensuring the diversity of the combination schemes, and at the same time, using the concept of hash tree, the service attribute values stored in the service registry are analyzed. Perform hashing, and the obtained hash tree root value can determine whether the data is legal.
为了方便理解本发明的技术方案,下面定义一些概念:For the convenience of understanding the technical solutions of the present invention, some concepts are defined below:
定义1驱光个体每种微服务组合都表示成一个驱光个体,驱光个体的位置变换对应着微服务组合方案的变化。 Definition 1. Drive individual Each microservice combination is represented as a drive individual, and the position change of the drive individual corresponds to the change of the microservice combination scheme.
定义2混沌即根据一定的规则将变量由原本的混沌空间变换到求解空间,利用混沌本身的规律性、随机性和遍历性等特点进行混沌搜索,跳出局部最优,从而求出全局最优解。Definition 2 Chaos is to transform the variables from the original chaotic space to the solution space according to certain rules, and use the regularity, randomness and ergodicity of chaos itself to conduct chaotic search, jump out of the local optimum, and find the global optimal solution. .
定义3混沌搜索方法是由确定方程得到具有伪随机性、遍历性和规律性等特点的随机运动状态点。Definition 3 The chaotic search method is to obtain the random motion state points with the characteristics of pseudo-randomness, ergodicity and regularity from the deterministic equation.
本发明中采用的是具有混沌性质的余切公式作为混沌搜索方法,其公式如式(2)所示:In the present invention, the cotangent formula with chaotic properties is used as the chaotic search method, and its formula is shown in formula (2):
a n+1=cot(a n)         (2) a n + 1 = cot (a n) (2)
式(2)中的a n是余切序列的一次取值,当给余切序列一个初值时,需要满足a 0∈(0,π),将初值通过余切序列公式迭代,可以产生一个伪随机序列。“余切公式”是蝴蝶效应的一个典型例子。例如,取三个余切初值分别为1、1.0001、1.00001,使用余切公式分别将初值迭代,三个数列每一项都是前一项的余切,当计算到第10项后,三个数列开始形成巨大的分歧。这就是混沌的数列,经过足够多项后,得到的数字是随机的、混沌的、遍历的。 a n in formula (2) is a value of the cotangent sequence. When an initial value of the cotangent sequence is given, it needs to satisfy a 0 ∈(0,π), and iterating the initial value through the cotangent sequence formula can generate A pseudorandom sequence. The "cotangent formula" is a classic example of the butterfly effect. For example, take the initial values of three cotangents as 1, 1.0001, and 1.00001 respectively, and use the cotangent formula to iterate the initial values respectively. Each item of the three series is the cotangent of the previous item. When the 10th item is calculated, The three series began to form huge divergences. This is the chaotic sequence. After enough items, the resulting numbers are random, chaotic, and traversed.
定义4服务类(S j)S j是具有相同服务功能的集合,具有相同的输入集合和输出结合的服务归类为同一个服务类,表示为S={S 0,S 1,…,S m-1},其中S j表示第j类服务。 Definition 4. Service class (S j ) S j is a set with the same service function, and the services with the same input set and output combination are classified into the same service class, expressed as S={S 0 , S 1 ,...,S m-1 }, where S j represents the j-th type of service.
定义5候选服务
Figure PCTCN2020119196-appb-000009
是构成服务组合的基本逻辑单元,第j个服务类的候选服务为
Figure PCTCN2020119196-appb-000010
其服务类S j对应的输入集合为
Figure PCTCN2020119196-appb-000011
输出集合为
Figure PCTCN2020119196-appb-000012
Definition 5 Candidate Services
Figure PCTCN2020119196-appb-000009
is the basic logical unit that constitutes the service composition, and the candidate service of the jth service class is
Figure PCTCN2020119196-appb-000010
The input set corresponding to its service class S j is
Figure PCTCN2020119196-appb-000011
The output set is
Figure PCTCN2020119196-appb-000012
每一个候选服务包含一个QoS向量
Figure PCTCN2020119196-appb-000013
该向量包含4个参数:
Each candidate service contains a QoS vector
Figure PCTCN2020119196-appb-000013
The vector contains 4 parameters:
①执行成本(Execution Cost,c):服务的执行费用c是指作为服务使用者请求执行该服务要付出的费用。①Execution Cost (c): The execution cost c of a service refers to the cost to be paid as a service user to request the execution of the service.
②服务执行时间(Response Time,t):服务的执行时间t等于请求发送的时间点到结果被收到的时间点之间这段时间。②Service execution time (Response Time, t): The execution time t of the service is equal to the time between the time when the request is sent and the time when the result is received.
③可用性(Availability,a):服务的可用性是服务可使用的概率,其计算公式为:③Availability (a): The availability of a service is the probability that the service can be used, and its calculation formula is:
a=T λ/λ          (3) a=T λ /λ (3)
式中λ是根据服务的类型设置的常量,T λ是服务在时间λ内可用的时间。 where λ is a constant set according to the type of service, and T λ is the time the service is available within time λ.
④可靠性(Reliability,r):服务的可靠性r是一个请求在最大期望时间内被正确响应的概率,其表达式为:④Reliability (r): The reliability r of a service is the probability that a request is correctly responded within the maximum expected time, and its expression is:
r=N s/N t          (4) r=N s /N t (4)
式中N s表示服务在观察时间内被成功调用的次数,N t表示在观察时间内调用服务的总次数。 where N s represents the number of times the service was successfully invoked during the observation time, and N t represents the total number of times the service was invoked during the observation time.
定义6服务链(L c)从候选服务中选择出合适的服务,并根据其输入输出逻辑,按照逻辑顺序组合成顺序有向图,即为服务链,如图4所示。 Definition 6 The service chain (L c ) selects the appropriate service from the candidate services, and according to its input and output logic, combines it into a sequential directed graph in logical order, which is the service chain, as shown in Figure 4.
本发明面向的微服务组合的优化模型如下:The optimization model of the microservice composition oriented by the present invention is as follows:
(1)假设服务共有m个服务类,即S={S 0,S 1,…,S m-1}; (1) Suppose there are m service classes in total, that is, S={S 0 , S 1 ,...,S m-1 };
(2)每个服务类中有若干个候选服务组成,即
Figure PCTCN2020119196-appb-000014
其中k j表示第j个服务类中共有k j个候选服务;
(2) Each service class consists of several candidate services, namely
Figure PCTCN2020119196-appb-000014
where k j represents a total of k j candidate services in the j-th service class;
(3)每个服务均有描述其质量的属性参数;(3) Each service has attribute parameters describing its quality;
(4)假设有服务链L c=s 0→s 1→...→s j→...→s m-1(s j属于服务类S j); (4) Suppose there is a service chain L c =s 0 →s 1 →...→s j →...→s m-1 (s j belongs to the service class S j );
(5)服务组合尽可能的提高服务质量。(5) Service portfolio to improve service quality as much as possible.
Figure PCTCN2020119196-appb-000015
Figure PCTCN2020119196-appb-000015
s.t getOutput(s j)==getInput(s j+1)s j∈L c st getOutput(s j )==getInput(s j+1 )s j ∈L c
α+β+γ+η=1α+β+γ+η=1
Figure PCTCN2020119196-appb-000016
Figure PCTCN2020119196-appb-000016
其中s j表示服务链上的某一服务,getInput()和getOutput()函数是获取对应服务的输入集合和输出集合。α、β、γ和η,分别表示各个QoS属性权重,R、T、C和A分别表示服务链的各个QoS属性的积或和,其中R和A分别为可靠性和可用性,多个服务组合起来的总的可靠性为各个服务的可靠性的乘积,同理可得可用性;而T和C分别表示执行时间和执行成本,多个服务的执行总时间为多个服务的时间之和,同理可得执行总成本。但因为不同的QoS属性单位不同、数量级不同,难以直接对全部的QoS属性进行对比,而且时间和成本属性值越大,QoS的评价就越低,相反,可用性、可靠性与QoS值成正比,因此需要对QoS属性统一量纲,以及做归一化处理。 Among them, s j represents a service on the service chain, and the getInput() and getOutput() functions are to obtain the input set and output set of the corresponding service. α, β, γ, and η represent the weight of each QoS attribute, respectively, R, T, C, and A represent the product or sum of each QoS attribute of the service chain, respectively, where R and A are reliability and availability, respectively, multiple service combinations The total reliability is the product of the reliability of each service, and the availability can be obtained in the same way; while T and C represent the execution time and execution cost respectively, and the total execution time of multiple services is the sum of the time of multiple services. The total cost of execution can be reasonably obtained. However, because different QoS attributes have different units and different orders of magnitude, it is difficult to directly compare all QoS attributes, and the greater the time and cost attribute values, the lower the QoS evaluation. On the contrary, availability and reliability are proportional to QoS values. Therefore, it is necessary to unify the dimensions of the QoS attributes and perform normalization processing.
Figure PCTCN2020119196-appb-000017
Figure PCTCN2020119196-appb-000017
Figure PCTCN2020119196-appb-000018
Figure PCTCN2020119196-appb-000018
其中,Q d,k表示第d个候选服务,
Figure PCTCN2020119196-appb-000019
代表该候选服务集中m d个候选服务的第k个质量属性之和。按照上段提到的,与QoS值成正比的属性,按照公式(6)计算,而成反比的则按照公式(7)计算。
Among them, Q d,k represents the d-th candidate service,
Figure PCTCN2020119196-appb-000019
represents the sum of the kth quality attributes of m d candidate services in the candidate service set. As mentioned in the previous paragraph, the attribute proportional to the QoS value is calculated according to formula (6), and the attribute that is inversely proportional is calculated according to formula (7).
根据以上定义,本发明分为三个步骤:首先,全局搜索一条可行的服务链,并找到服务链上的各个服务的候选服务;其次,通过余切序列混沌初始化驱光个体;最后,计算各个驱光个体的适应度函数值,评价各个驱光个体的优劣,选择最优的驱光个体作为被学习的对象,以及更新其它驱光个体。According to the above definition, the present invention is divided into three steps: first, a feasible service chain is globally searched, and candidate services of each service on the service chain are found; secondly, the driver individual is chaotically initialized by the cotangent sequence; The fitness function value of the individual disc drives is used to evaluate the pros and cons of each disc drive individual, the optimal disc drive individual is selected as the object to be learned, and other disc drive individuals are updated.
首先,采用捕食搜索策略在全局求得一条可行的服务链,所有的微服务数据存放在xml文件中,如First, a feasible service chain is obtained globally using the predator search strategy. All microservice data are stored in xml files, such as
<webservice><webservice>
   <servname>FoodService</servname><servname>FoodService</servname>
   <time>111</time><time>111</time>
   <avail>72</avail><avail>72</avail>
   <rel>83</rel><rel>83</rel>
   <cost>15</cost><cost>15</cost>
   <input>USFoodInfo</input><input>USFoodInfo</input>
   <output>HotelInfo</output><output>HotelInfo</output>
</webservice></webservice>
其中,servname表示服务的名字;time、avail、rel、cost分别响应时间、可用性、可 靠性和执行成本。input表示服务的输入集合;output表示输出集合。为了更符合边缘环境,将微服务与边缘服务器绑定,即代表该微服务部署在边缘服务器中。Among them, servname represents the name of the service; time, availability, rel, and cost are response time, availability, reliability, and execution cost, respectively. input represents the input set of the service; output represents the output set. In order to be more in line with the edge environment, binding the microservice to the edge server means that the microservice is deployed in the edge server.
在搜索服务链的过程中,为了保证服务链中没无效的服务(即对最终输出结果没有影响的服务),增加了一个搜索集合,用变量searchSet表示。在一次搜索过程中将服务链上微服务的输入集合存放于该变量中,在微服务加入到服务链上之前,需要判断searchSet中是否已有该微服务输入集合,若不存在,且满足要求,则该微服务可加入服务链中,否则,不可以;当该次搜索结束后,没有搜索到可行服务链,则将搜索集合清空,在没有被搜索过的微服务中搜索,直到找到一条可行的服务链,或者经过最大搜索次数,停止搜索。In the process of searching the service chain, in order to ensure that there are no invalid services in the service chain (that is, services that have no influence on the final output result), a search set is added, which is represented by the variable searchSet. In a search process, the input set of the microservice on the service chain is stored in this variable. Before the microservice is added to the service chain, it is necessary to determine whether the microservice input set already exists in the searchSet. If it does not exist, and the requirements are met , then the microservice can be added to the service chain, otherwise, it cannot be; when the search is over and no feasible service chain is found, the search set will be cleared, and the microservices that have not been searched will be searched until one is found. A viable service chain, or after the maximum number of searches, stop searching.
定义7余切初始化即通过一定的映射规则,将余切序列产生的伪随机序列值映射到种群个体的位置的初始值。Definition 7 Cotangent initialization is to map the pseudorandom sequence value generated by the cotangent sequence to the initial value of the position of the population individual through certain mapping rules.
经过捕食搜索在全局已经搜索得到一条可行的服务链,在混沌初始化前,首先对混沌初始化中所需的参数进行说明:After predation search, a feasible service chain has been searched globally. Before chaotic initialization, the parameters required in chaotic initialization are explained first:
(1)根据捕食搜索策略搜索一条全局可行的服务链,假设服务链是由m个服务组成的;(1) Search for a globally feasible service chain according to the predator search strategy, assuming that the service chain is composed of m services;
(2)根据服务链上的服务,找到服务链的候选服务,服务链上每一个服务均对应一类候选服务,令每一种类分别为S j={s j,0,s j,1,…}(j=0,1,…,m-1),服务链和与之对应的候选服务如图5所示; (2) According to the services on the service chain, find the candidate services of the service chain, each service on the service chain corresponds to a type of candidate service, and let each type be S j ={s j,0 ,s j,1 , ...}(j=0,1,...,m-1), the service chain and its corresponding candidate services are shown in Figure 5;
(3)将具有相同功能的微服务分为一类(本发明将具有相同的输入集合和输出集合归为同一类);通过分类,使组合数降低,这样完全枚举所有组合方案成为可能;(3) Divide the microservices with the same function into one category (the present invention classifies the same input set and output set into the same category); through the classification, the number of combinations is reduced, so that it is possible to completely enumerate all the combination schemes;
(4)假设每一候选服务项目的个数为k j(j=0,1,…,m-1),所以
Figure PCTCN2020119196-appb-000020
(4) Suppose the number of each candidate service item is k j (j=0,1,...,m-1), so
Figure PCTCN2020119196-appb-000020
(5)根据(1)和(2)两点假设得驱光个体的位置X i=(S 0,S 1,…,S m-1),驱光个体的维数为
Figure PCTCN2020119196-appb-000021
(5) According to the two points (1) and (2), it is assumed that the position X i = (S 0 , S 1 , . . . , S m-1 ) of the light-driving individual.
Figure PCTCN2020119196-appb-000021
微服务组合优化问题具有不确定性,这里的不确定性主要是指评估组合方案优劣的最优适度函数值提前是不知道的,所以只能尽可能的找到更优解;以及不同服务链上的不同服务对应的候选服务数量也是不确定的,对应不同的服务链,初始化所需的余切序列会有所不同,所以本文提出一种动态的余切序列方法来初始化驱光个体。The microservice composition optimization problem is uncertain. The uncertainty here mainly means that the optimal moderate function value for evaluating the merits of the composition scheme is not known in advance, so we can only find a better solution as much as possible; and different service chains The number of candidate services corresponding to different services is also uncertain. Corresponding to different service chains, the cotangent sequence required for initialization will be different. Therefore, this paper proposes a dynamic cotangent sequence method to initialize the individual drive.
余切序列和Logic序列都是混沌的,Logic序列是通过Logic映射公式,即线性函数迭代产生的序列,而余切序列是通过余切函数迭代产生序列。尽管余切函数计算消耗的时间略大于线性函数,不过余切函数产生的序列有更好的动态性和遍历性。因此,本发明采用了余切函数。Both the cotangent sequence and the Logic sequence are chaotic, the Logic sequence is a sequence generated by the Logic mapping formula, that is, a linear function iteration, and the cotangent sequence is a sequence generated by the cotangent function iteration. Although the calculation time of the cotangent function is slightly larger than that of the linear function, the sequence generated by the cotangent function is more dynamic and ergodic. Therefore, the present invention employs a cotangent function.
为了符合微服务组合的应用,本发明设计一种动态的混沌序列,主要步骤如下:In order to meet the application of micro-service combination, the present invention designs a dynamic chaotic sequence, and the main steps are as follows:
(1)假设服务链上的微服务种类为m,每种服务对应的候选服务的个数为k j(1) Assume that the type of microservices on the service chain is m, and the number of candidate services corresponding to each service is k j ;
(2)m个0~π之间的随机double类型的数值,作为序列的初始值
Figure PCTCN2020119196-appb-000022
(2) m random double type values between 0 and π as the initial value of the sequence
Figure PCTCN2020119196-appb-000022
(3)代公式a n+1=cot(a n)依次计算出后面的余切序列值; (3) substituting equation a n + 1 = cot (a n) are sequentially calculated by the cotangent of sequence values;
(4)某一类服务的候选服务的数量级来决定截取余切序列小数点后几位;例如第j 类服务类有70个则取小数点后两位,使用截取的数对70求余,生成的数在0~59之间,就与该类的某一个候选服务对应。(4) The order of magnitude of the candidate service of a certain type of service determines the number of decimal places to intercept the cotangent sequence; for example, if there are 70 service classes in the j-th type, take two decimal places, and use the intercepted number to calculate the remainder of 70, and the generated The number between 0 and 59 corresponds to a certain candidate service of this class.
定义8适应度函数值即适应度函数的值,该值是量化指标,用来评价微服务组合方案的优劣程度。Definition 8. The fitness function value is the value of the fitness function, which is a quantitative index used to evaluate the pros and cons of the microservice combination scheme.
本发明服务组合包含4个QoS参数,即可靠性、响应时间、执行成本和可用性。其中可靠性和可用性是一个概率,其值在0-1之间,响应时间和执行成本并不是一个概率,如上式(7)所示,需要统一进行归一化,本文采用的策略为:按照QoS各属性的特点,例如响应时间与执行成本应该与适应度值成反比,按照上式(7)进行归一化,可靠性与可用性与适应度值成正比,按照上式(6)进行归一化,适应度函数为:The service composition of the present invention includes four QoS parameters, namely reliability, response time, execution cost and availability. Among them, reliability and availability are a probability, and their values are between 0 and 1. Response time and execution cost are not a probability. As shown in the above formula (7), they need to be unified and normalized. The strategy adopted in this paper is: The characteristics of each attribute of QoS, such as response time and execution cost, should be inversely proportional to the fitness value, normalized according to the above formula (7), reliability and availability are proportional to the fitness value, and normalized according to the above formula (6) Unification, the fitness function is:
Figure PCTCN2020119196-appb-000023
Figure PCTCN2020119196-appb-000023
其中,f代表适应度值,R表示服务链上各微服务可靠性的积,T表示服务链上各微服务响应时间的和,C表示服务链上各微服务执行成本的和,A表示服务链上各微服务可用性的积。α分别表示R的权重,β表示A的权重,γ表示T的权重,η表示C的权重,且α+β+γ+η=1。Among them, f represents the fitness value, R represents the product of the reliability of each microservice on the service chain, T represents the sum of the response times of each microservice on the service chain, C represents the sum of the execution costs of each microservice on the service chain, and A represents the service The product of the availability of each microservice on the chain. α represents the weight of R, β represents the weight of A, γ represents the weight of T, η represents the weight of C, and α+β+γ+η=1.
本发明是基于微服务场景,若将本发明的方法应用于其他有序组合优化场景中,将适应度函数修改为具体场景的评价驱光个体优劣的指标即可。The present invention is based on a micro-service scenario. If the method of the present invention is applied to other orderly combination optimization scenarios, the fitness function can be modified to be an indicator for evaluating the pros and cons of individual drivers in a specific scenario.
定义9混沌扰乱即微服务组合方案在更新过程中引入余切扰乱方法,充分扰乱微服务组合方案,尽可能遍历搜索空间。Definition 9 Chaos disturbance means that the microservice composition scheme introduces a cotangent disturbance method in the update process, fully disrupts the microservice composition scheme, and traverses the search space as much as possible.
当某一驱光个体陷入局部最优时,应该尽有可能地让该驱光个体跳出局部最优。通过采用混沌扰动,即对驱光个体的位置按照混沌序列进行重新初始化。重新初始化之后,需要在局部进行搜索,找出局部的最优值。如果局部搜索到的最优值优于历史全局最优组合方案,则进行替换,本次的混动扰动结束,否则需要重复进行混沌扰动,直到找到新的全局最优解或者达到设置的混沌扰动迭代次数。When an individual driver falls into a local optimum, the individual driver should be allowed to jump out of the local optimum as much as possible. By adopting chaotic disturbance, the position of the light-driving individual is re-initialized according to the chaotic sequence. After re-initialization, it is necessary to search locally to find the local optimal value. If the optimal value found by the local search is better than the historical global optimal combination scheme, the replacement will be carried out, and the current chaotic disturbance will end, otherwise the chaotic disturbance needs to be repeated until a new global optimal solution is found or the set chaotic disturbance is reached. number of iterations.
定义10光亮度即每个驱光个体所在位置(组合方案)对应的适应度值。Definition 10 Brightness is the fitness value corresponding to the location (combination scheme) of each light-driving individual.
这里将光亮度定义为驱光个体的适应度值,光亮小的驱光个体会趋向于光亮大的驱光个体进行移动。公式如下:Here, the brightness is defined as the fitness value of the light-driving individual, and the light-driving individual with low brightness tends to move toward the light-driving individual with high brightness. The formula is as follows:
Figure PCTCN2020119196-appb-000024
Figure PCTCN2020119196-appb-000024
公式中I i代表驱光个体i的绝对光亮度,这直接由适应度值决定。γ为光吸收系数,一般设置为常数,光吸收系数的作用是空气等物质的存在会导致光的减弱,引入组合优化中,就是距离较远的更优方案会随着距离的加大减弱吸引度,这在吸引度的定义中也有体现;r ij为驱光个体i到驱光个体j之间的欧式距离。则驱光个体i和j之间的距离可以表示为: In the formula, I i represents the absolute brightness of the light-driving individual i, which is directly determined by the fitness value. γ is the light absorption coefficient, which is generally set as a constant. The effect of the light absorption coefficient is that the presence of air and other substances will lead to the weakening of light. Introduced into the combination optimization, that is, the better solution with a longer distance will weaken the attraction as the distance increases. degree, which is also reflected in the definition of attraction degree; r ij is the Euclidean distance between the light-driving individual i and the light-driving individual j. Then the distance between the drive individuals i and j can be expressed as:
Figure PCTCN2020119196-appb-000025
Figure PCTCN2020119196-appb-000025
公式(10)中X i和X j分别是驱光个体i和驱光个体j所处的空间位置,x i,d代表驱光个体i的d维分量,D代表维度。 In formula (10), X i and X j are the spatial positions of the light-driving individual i and the light-driving individual j, respectively, xi, d represent the d-dimensional component of the light-driving individual i, and D represents the dimension.
定义11吸引度即驱光个体之间的吸引度,取决于距离的影响。Definition 11 Attraction is the attraction between individuals, which depends on the influence of distance.
该算法中的驱光个体之间的吸引度如下:The attractiveness between the drive individuals in this algorithm is as follows:
Figure PCTCN2020119196-appb-000026
Figure PCTCN2020119196-appb-000026
其中β 0代表最大吸引度,即在距离为0(r=0处)驱光个体的吸引度。其中最小吸引度β min是为了确保个体间的吸引度不为0。经分析,若置β min=0时,当个体间距离趋近于无穷时,吸引度β趋近于0。显然这样会导致个体间由于距离过大发生种群个体随机游走,从而失去对其它个体的牵引,失去寻优能力。 Among them, β 0 represents the maximum attractiveness, that is, the attractiveness of the driving individual at a distance of 0 (r=0). The minimum attractiveness βmin is to ensure that the attractiveness between individuals is not 0. After analysis, if β min = 0, when the distance between individuals approaches infinity, the attractiveness β approaches 0. Obviously, this will lead to random walks of population individuals due to the large distance between individuals, thereby losing traction on other individuals and losing the ability to seek optimization.
加入β min之后,取β min=0.25,这样可以防止驱光个体间缺乏吸引度的牵引。即使出现距离过大的情况,
Figure PCTCN2020119196-appb-000027
趋近于0,但由于β min的存在,吸引度不为0,而且β min的引入可以解决高位组合优化问题中种群个体间距离较大时缺乏吸引度的问题,适合解决微组合问题。
After adding β min , take β min =0.25, which can prevent the lack of attractive traction between the driving individuals. Even if the distance is too great,
Figure PCTCN2020119196-appb-000027
approaching 0, but due to the existence of β min , the attractiveness is not 0, and the introduction of β min can solve the problem of lack of attractiveness when the distance between population individuals is large in the high-level combinatorial optimization problem, and is suitable for solving micro-combination problems.
定义12步长因子即在位置变化中影响位置变化的因子,一般用α表示步长因子,且α∈[0.1]。Definition 12 The step size factor is the factor that affects the position change in the position change. Generally, α is used to represent the step size factor, and α∈[0.1].
在理想情况中,该算法在收敛过程中种群个体会逐渐聚集,最终收敛到一点,对于个体X i,可以得到: In an ideal situation, the population of the algorithm will gradually gather during the convergence process, and eventually converge to a point. For the individual X i , we can get:
lim t→∞X i(t+1)=lim t→∞X i(t)      (12) lim t→∞ X i (t+1)=lim t→∞ X i (t) (12)
按照位置公式(1)可以得出,According to the position formula (1), it can be obtained,
lim t→∞α=0          (13) lim t→∞ α=0 (13)
从式(13)可以看出,当算法收敛时,步长因子α趋近于0。It can be seen from equation (13) that when the algorithm converges, the step size factor α tends to 0.
一般的位置变换公式中作为随机项,步长因子α取固定值0.5,而αε i中ε i取随机数,显然随机项很大程度取决于ε i,那么该项就变成了完全随机项,显然在算法运行中难以发挥其调节算法的探测能力和搜索能力。为了在很大程度上发挥步长因子在算法中的作用,本发明对α进行设置,即在算法初期,随机项需要拥有较大的随机步长,发挥有效的探测能力,在迭代后期,再减小步长,以发挥其在局部的有效搜索能力,公式如下: As a random item in the general position transformation formula, the step size factor α takes a fixed value of 0.5, and ε i in αε i takes a random number. Obviously, the random item depends to a large extent on ε i , then this item becomes a completely random item , obviously it is difficult to exert the detection ability and search ability of its adjustment algorithm during the operation of the algorithm. In order to play the role of the step size factor in the algorithm to a large extent, the present invention sets α, that is, in the early stage of the algorithm, the random item needs to have a large random step size to exert an effective detection ability. Reduce the step size to exert its effective local search ability, the formula is as follows:
α(t+1)=α(t)·exp(-0.5·t/T max)      (14) α(t+1)=α(t)·exp(-0.5·t/T max ) (14)
上式中T max表示最大迭代次数,t为当前迭代次数。随着迭代次数的增加,α逐渐减小。设定α的初始值α 0一般取0.5。 In the above formula, T max represents the maximum number of iterations, and t is the current number of iterations. As the number of iterations increases, α gradually decreases. The initial value α 0 of α is generally set to be 0.5.
定义13边缘云即边缘计算中由多个边缘服务器构成的集群。Definition 13 An edge cloud is a cluster composed of multiple edge servers in edge computing.
传统的微服务都是部署在云计算环境中,因此微服务组合大多也是针对云计算环境。边缘计算中将任务下沉到网络边缘端,就近为用户提供服务,其中各大云厂商在满足用户就近使用的需求下,逐步也将一些微服务就近在边缘端提供给用户。为了提高用户的服务体验,相关的组合优化算法也需要根据边缘计算的特点进行改进,以适应边缘云中的服务组合。Traditional microservices are deployed in the cloud computing environment, so most of the microservice combinations are also for the cloud computing environment. In edge computing, tasks are sunk to the edge of the network, and services are provided to users nearby. Among them, major cloud manufacturers gradually provide some microservices to users at the edge to meet the needs of users nearby. In order to improve the user's service experience, the relevant combination optimization algorithm also needs to be improved according to the characteristics of edge computing to adapt to the service combination in the edge cloud.
在边缘云的环境下,各个边缘服务器部署在靠近终端的位置。如图7所示,在整个边缘云中,有一台服务器充当边缘编排管理器,用来统一管理边缘云中各微服务的注册和管理。当用户的设备通过基站连接到边缘云之后,将任务上传到边缘编排管理器中,由编排器为用户在微服务注册中心中筛选适合的微服务组合方案,完成用户的任务,并返回结果给终端用户。In the edge cloud environment, each edge server is deployed close to the terminal. As shown in Figure 7, in the entire edge cloud, there is a server that acts as the edge orchestration manager to manage the registration and management of each microservice in the edge cloud in a unified manner. After the user's device is connected to the edge cloud through the base station, the task is uploaded to the edge orchestration manager, and the orchestrator selects the appropriate microservice combination scheme for the user in the microservice registration center, completes the user's task, and returns the result to end users.
定义14哈希树哈希树结构类似于二叉树,其叶子节点上的值通常为数据块的哈希值,而非叶子节点上的值。Definition 14 Hash tree The hash tree structure is similar to a binary tree, and the value on the leaf node is usually the hash value of the data block, not the value on the leaf node.
在构造hash树时,首先要对数据计算哈希值,通常,选用SHA-256等哈希算法。但如果仅仅防止数据不是蓄意的损坏或篡改,可以改用一些安全性低但效率高的校验和算法,如CRC。然后将数据计算的哈希值两两配对(如果是奇数个数,最后一个自己与自己配对),计算上一层哈希,再重复这个步骤,一直到计算出根哈希值。如果任何底层数据块发生变化,最终都会传导到根哈希。如果根哈希不一致,可以通过hash树快速定位到导致不一致的数据。哈希树还可以用来对数据进行快速比对,快速定位到不一致的数据,如图8所示。When constructing a hash tree, the first step is to calculate a hash value for the data. Usually, a hash algorithm such as SHA-256 is used. But if the only protection against data is not intentional damage or tampering, some less secure but more efficient checksum algorithms, such as CRC, can be used instead. Then pair the hash values calculated by the data in pairs (if it is an odd number, the last one is paired with itself), calculate the hash of the previous layer, and repeat this step until the root hash value is calculated. If any underlying data block changes, it will eventually propagate to the root hash. If the root hash is inconsistent, the data causing the inconsistency can be quickly located through the hash tree. The hash tree can also be used to quickly compare data and quickly locate inconsistent data, as shown in Figure 8.
在本发明中,边缘编排管理器会将服务注册中心中注册的微服务的QoS属性值保存在服务注册中心中,利用hash树的概念对微服务的QoS属性值进行两两hash,最后得到一个hash根。边缘编排管理器将这个hash值用私钥加密,然后广播给各个边缘服务器,边缘服务器会用保存的公钥保存这个hash值。边缘服务器会定时询问注册中心,看是否注册中心中保存的哈希根与本地存储哈希值是否一致。如果不一致,则判断服务注册中心保存的服务QoS属性值遭到篡改,利用哈希树的性质可以很快定位到哪个服务的属性值遭到了修改,这样就可以保证微服务QoS属性值的可靠性。In the present invention, the edge orchestration manager will save the QoS attribute values of the microservices registered in the service registration center in the service registration center, and use the concept of hash tree to hash the QoS attribute values of the microservices in pairs, and finally obtain a hash root. The edge orchestration manager encrypts the hash value with the private key, and then broadcasts it to each edge server, and the edge server saves the hash value with the saved public key. The edge server will periodically ask the registry to see if the hash root stored in the registry is consistent with the locally stored hash value. If it is inconsistent, it is judged that the service QoS attribute value saved by the service registry has been tampered with, and the attribute value of which service has been modified can be quickly located by using the properties of the hash tree, so as to ensure the reliability of the microservice QoS attribute value. .
本发明以微服务组合为例,其服务质量确定问题中的质量包括服务执行的时间、执行成本、可靠性和可用性。本发明的微服务组合方案生产流程图如图8所示。其具体操作步骤如下:The present invention takes microservice composition as an example, and the quality in the service quality determination problem includes service execution time, execution cost, reliability and availability. The production flow chart of the microservice combination scheme of the present invention is shown in FIG. 8 . The specific operation steps are as follows:
S1:用户提交自己的任务,任务中包括相对应的任务输入以及预想的输出结果。该任务提交到边缘云中,由边缘编排管理器接收,并通过注册中心得到部署在各个边缘服务器中微服务的信息,进行组合服务的选择。S1: The user submits his own task, and the task includes the corresponding task input and the expected output result. The task is submitted to the edge cloud, received by the edge orchestration manager, and obtains the information of the microservices deployed in each edge server through the registration center, and selects the combined service.
S2:首先引入捕食搜索策略,采用捕食搜索策略在全局求得一个可行的服务链,即搜索一条满足用户微服务组合要求的服务链。其具体描述如下:S2: First introduce the predatory search strategy, and use the predatory search strategy to obtain a feasible service chain globally, that is, to search for a service chain that meets the requirements of the user's microservice composition. Its specific description is as follows:
①在一次搜索过程中将服务链上微服务的输入集合存放于searchSet集合变量中;① In a search process, the input set of the microservices on the service chain is stored in the searchSet collection variable;
②在微服务加入到服务链上之前,需要判断searchSet集合中是否已有该微服务输入集合,若不存在,且满足要求,则该微服务可加入服务链中,否则,不可以;②Before the microservice is added to the service chain, it is necessary to determine whether the microservice input set already exists in the searchSet collection. If it does not exist and meets the requirements, the microservice can be added to the service chain, otherwise, it cannot be;
③当该次搜索结束后,没有搜索到可行服务链,则将搜索集合清空,在没有被搜索过的微服务中搜索,直到找到一条可行的服务链,或者经过最大搜索次数,停止搜索。③ When the search is over, and no feasible service chain is found, the search set is cleared, and the microservices that have not been searched are searched until a feasible service chain is found, or the search is stopped after the maximum number of searches.
S3:假设该服务链的长度为m,搜索S2中的可行服务链上的每个服务对应的候选服务,聚类各抽象任务的候选集,即将具有相同的输入集合和输出集合的微服务归为一类,放入同一个服务类中,从而使组合数降低,提高搜索效率,根据服务链长度可得m个候选服务类,即S={S 0,S 1,…,S m-1}。 S3: Assuming that the length of the service chain is m, search the candidate services corresponding to each service on the feasible service chain in S2, and cluster the candidate sets of each abstract task, that is, the microservices with the same input set and output set are grouped together. As one class, put them into the same service class, so as to reduce the number of combinations and improve the search efficiency. According to the length of the service chain, m candidate service classes can be obtained, that is, S={S 0 , S 1 ,...,S m-1 }.
S4:然后在组合算法初始化中,引入混沌搜索方法替代随机初始化,在候选服务中使用混沌序列依次从各个候选服务中取一个候选服务,形成一个可行的服务链,每个服务链对应一个驱光个体,多次执行初始化操作生成多个驱光个体;服务链上的每个服务有k j个候选服务,这里假设是给第i个驱光个体进行初始化。其具体步骤如下: S4: Then, in the initialization of the combined algorithm, the chaotic search method is introduced to replace the random initialization, and the chaotic sequence is used in the candidate service to select a candidate service from each candidate service in turn to form a feasible service chain, and each service chain corresponds to a driver. individual, perform the initialization operation multiple times to generate multiple optical drive individuals; each service on the service chain has k j candidate services, and it is assumed here that the i-th optical drive individual is initialized. The specific steps are as follows:
①首先确定k j的数量级φ j
Figure PCTCN2020119196-appb-000028
根据与服务对应的余切序列值
Figure PCTCN2020119196-appb-000029
截取小数点后φ j位作为整数值u 0,j,其范围为
Figure PCTCN2020119196-appb-000030
(不包括
Figure PCTCN2020119196-appb-000031
);
① First determine the order of magnitude of k j φ j
Figure PCTCN2020119196-appb-000028
According to the cotangent sequence value corresponding to the service
Figure PCTCN2020119196-appb-000029
Truncate φ j bits after the decimal point as an integer value u 0,j , whose range is
Figure PCTCN2020119196-appb-000030
(excluding
Figure PCTCN2020119196-appb-000031
);
②然后将u 0,j对k j取余,产生0~k j(不包括k j)之间的混沌值,这里将该混沌值设为ξ 0,j,该值与该服务对应的候选服务中的某一个服务对应,则所对应的候选服务被选中。同样,服务链上的所有服务均执行该操作后,则第i个驱光个体的位置X i初始化完成。 ②Then take the remainder of u 0,j to k j to generate a chaotic value between 0~k j (excluding k j ), here the chaotic value is set as ξ 0,j , which is the candidate corresponding to the service If one of the services corresponds to one of the services, the corresponding candidate service is selected. Likewise, after all the services in the service chain perform this operation, the initialization of the position X i of the i-th optical drive individual is completed.
假设共有n个驱光个体,当第一个驱光个体初始化结束之后,第二个驱光个体需要根据第一个驱光个体初始化,也就是利用余切函数,将第一个驱光个体的余切结果作为变量计算自己的余切值,剩下的驱光个体依次进行。则需要上述过程共n-1次,可以得到一个n×m的余切序列矩阵C,如式(15)所示,通过余切序列矩阵通过截取并取余数操作得到与驱光个体一一对应的矩阵。其具体步骤如下:Assuming that there are n drive individuals in total, after the initialization of the first drive individual is completed, the second drive individual needs to be initialized according to the first drive individual, that is, using the cotangent function, the first drive individual The cotangent result is used as a variable to calculate its own cotangent value, and the remaining optical drive individuals proceed in turn. Then it takes n-1 times of the above process, and an n×m cotangent sequence matrix C can be obtained. As shown in formula (15), the cotangent sequence matrix is obtained by intercepting and taking the remainder operation to obtain a one-to-one correspondence with the individual driving light. matrix. The specific steps are as follows:
①迭代n次,即生成一个n×m的余切序列矩阵,如式(15)所示。从第二个驱光个体开始,是根据前一个驱光个体的余切值得到,如式(16)所示:①Iterate n times, that is, generate an n×m cotangent sequence matrix, as shown in equation (15). Starting from the second drive individual, it is obtained according to the cotangent of the previous drive individual, as shown in formula (16):
Figure PCTCN2020119196-appb-000032
Figure PCTCN2020119196-appb-000032
Figure PCTCN2020119196-appb-000033
Figure PCTCN2020119196-appb-000033
②将余切序列矩阵根据对应候选服务数量的数量级φ j确定截取小数点后几位数,并将截取后的值对k j取余,得到混沌矩阵Φ,如式(17)所示。 (2) Determine the number of digits after the decimal point of the cotangent sequence matrix according to the magnitude of the corresponding candidate service quantity φ j , and take the remainder of the truncated value to k j to obtain the chaos matrix Φ, as shown in Equation (17).
Figure PCTCN2020119196-appb-000034
Figure PCTCN2020119196-appb-000034
初始化中,各个参数的初始值如式(18)所示。During initialization, the initial value of each parameter is shown in equation (18).
Figure PCTCN2020119196-appb-000035
Figure PCTCN2020119196-appb-000035
S5:根据具有个性化的适应度函数来评价这n个微服务组合方案,找到这n个微服 务组合方案中的最优的微服务组合方案,并判断对应的适应度函数值是否达到理论最优。如果是,则该微服务组合方案即为全局最优微服务组合方案;否则,执行S6。当找到最终的最优微服务组合方案或者迭代次数达到上限,则停止,输出停止时的最优的微服务组合方案,即为全局最优微服务组合方案。其具体描述如下:S5: Evaluate the n microservice composition schemes according to the individualized fitness function, find the optimal microservice composition scheme among the n microservice composition schemes, and judge whether the corresponding fitness function value reaches the theoretical maximum excellent. If yes, then the microservice composition scheme is the global optimal microservice composition scheme; otherwise, execute S6. When the final optimal microservice composition scheme is found or the number of iterations reaches the upper limit, it stops, and the optimal microservice composition scheme at the time of stopping is output, which is the global optimal microservice composition scheme. Its specific description is as follows:
①初始化n个驱光个体时,创建了一个驱光个体列表fireflies,用来存放驱光个体。通过遍历n个微服务组合方案,分别计算出各个微服务组合方案的应度函数值,并修改驱光个体的光亮度属性值。① When initializing n drive individuals, a list of drive individuals fireflies is created to store the drive individuals. By traversing the n micro-service combination schemes, the response function values of each micro-service combination scheme are calculated respectively, and the brightness attribute value of the light-driving individual is modified.
②每个驱光个体需要与其它驱光个体进行光亮度对比,如果存在驱光个体比这个驱光个体光亮度高,则按照式(11)计算两者之间吸引度。直到比较结束之后,按照最大吸引度原则,向比自己光亮度高,同时吸引力最大的驱光个体移动。② Each light-driving individual needs to compare the brightness with other light-driving individuals. If there is a light-driving individual with higher light-brightness than this light-driving individual, the attraction degree between the two is calculated according to formula (11). Until the end of the comparison, according to the principle of maximum attractiveness, move to the light-driving individual that is brighter than yourself and has the greatest attractiveness.
③遍历驱光个体列表,将适应度值最大值赋值给全局最优适度值fBest。③ Traverse the list of drive individuals, and assign the maximum fitness value to the global optimal fitness value fBest.
④判断fBest是否达到理论最优值fTheory(该值表示在相应的目标成本下,微服务组合的服务质量可达到的理论最优适度值),如果达到理论最优,则X index=(S 0 (index),S 1 (index),…,S m-1 (index))为最佳微服务组合方案。否则,Count++(Count值表示已经迭代的次数,初值为0),并且判断Count是否达到最大迭代次数MaxIteration,如果是,输出X index,结束搜索;否则执行S6。 ④ Determine whether fBest reaches the theoretical optimal value fTheory (this value represents the theoretical optimal moderate value of the service quality of the microservice combination under the corresponding target cost), if it reaches the theoretical optimal value, then X index = (S 0 (index) , S 1 (index) ,…,S m-1 (index) ) is the best microservice composition scheme. Otherwise, Count++ (the value of Count indicates the number of iterations, the initial value is 0), and judge whether Count reaches the maximum number of iterations MaxIteration, if so, output X index to end the search; otherwise, execute S6.
S6:用混沌扰乱规则更新20%的驱光个体的微服务组合方案,这20%的驱光个体是选择10%的当前迭代中适应度值最优的驱光个体以及10%的适应度值最差的驱光个体,其余的驱光个体依然按照原本组合算法的位置变换的公式进行计算。20%的驱光个体需要进行更新,之后在局部搜索,更新完成后,返回执行S5。其具体步骤如下:S6: Update the micro-service combination scheme of 20% of the light-driving individuals with the chaotic disturbance rules, and these 20% of the light-driving individuals are to select 10% of the light-driving individuals with the best fitness value and 10% of the fitness value in the current iteration The worst optical drive individual, the rest of the optical drive individuals are still calculated according to the formula of the position transformation of the original combination algorithm. 20% of the CD-ROM individuals need to be updated, and then perform a local search. After the update is completed, return to S5. The specific steps are as follows:
①筛选的20%的驱光个体需要按照混沌序列更新自己的位置,公式如下:①The 20% of the selected CD-ROM individuals need to update their positions according to the chaotic sequence. The formula is as follows:
Figure PCTCN2020119196-appb-000036
Figure PCTCN2020119196-appb-000036
式(19)中
Figure PCTCN2020119196-appb-000037
表示驱光个体i在t次迭代的第j维的位置,也就是服务链第j个分量的选择方案。位置更新也需要按照余切序列来计算,在第t+1次迭代时,第i个驱光个体的第j维位置
Figure PCTCN2020119196-appb-000038
更新是按照第t次得出的余切序列来进行迭代得出,其中h表示该驱光个体的维度,也就是服务链的长度,n表示最大迭代次数。更新之后的余切函数值需要根据S4进行计算对应的候选服务。
In formula (19)
Figure PCTCN2020119196-appb-000037
Indicates the position of the driver i in the jth dimension of the t iterations, that is, the selection scheme of the jth component of the service chain. The position update also needs to be calculated according to the cotangent sequence. At the t+1th iteration, the jth dimension position of the ith driver individual
Figure PCTCN2020119196-appb-000038
The update is obtained iteratively according to the cotangent sequence obtained at the tth time, where h represents the dimension of the individual driver, that is, the length of the service chain, and n represents the maximum number of iterations. The updated cotangent function value needs to be calculated according to S4 for the corresponding candidate service.
②20%的驱光个体进行局部搜索,找出自己的局部微服务组合最优方案,这里设置了一个混沌次数chaoNum来限制比较次数,当驱光个体在局部搜索中找到局部最优或者超过这个混沌次数,便可以结束查找。② 20% of the light-driving individuals conduct a local search to find their own optimal solution for the local microservice combination. Here, a chaos count, chaoNum, is set to limit the number of comparisons. When the light-driving individual finds the local optimum in the local search or exceeds this chaos number of times to end the search.
③参与混沌扰乱的驱光个体需要将自己找出的局部最优的组合方案与历史全局最优组合方案进行比较。如果更优于历史全局最优组合方案,则用该方案更新历史最优组合方案,作为新的fBest,否则继续S5。(3) The light-driving individuals participating in the chaotic disturbance need to compare the locally optimal combination scheme found by themselves with the historical global optimal combination scheme. If it is better than the historical global optimal combination scheme, update the historical optimal combination scheme with this scheme as the new fBest, otherwise continue to S5.
S7:通过组合算法的求得基于当前服务链的全局最优解,或者达到最大迭代次数,对应的服务链为当前最优服务链。微服务组合选择成功之后,对用户的任务进行执行,之后边缘编排管理器会将执行之后的结果返回给用户,并对相应的微服务中QoS各属性 值进行更新,并将更新的结果保存在服务注册中心。S7: The global optimal solution based on the current service chain is obtained through the combined algorithm, or the maximum number of iterations is reached, and the corresponding service chain is the current optimal service chain. After the microservice combination is successfully selected, the user's task is executed, and then the edge orchestration manager will return the execution result to the user, update the QoS attribute values in the corresponding microservice, and save the updated result in the Service Registry.
S8:边缘编排管理器会将服务注册中心中注册的微服务的QoS属性值保存在服务注册中心中,利用hash树的概念对微服务的QoS属性值进行两两hash,最后得到一个hash根。边缘编排管理器将这个hash值用私钥加密,然后广播给各个边缘服务器,边缘服务器会用保存的公钥保存这个hash值。边缘服务器会定时询问注册中心,看是否注册中心中保存的哈希根与本地存储哈希值是否一致。如果不一致,则判断服务注册中心保存服务QoS属性值遭到篡改,利用hash树的性质可以很快定位到哪个服务的属性值遭到了修改,就可以定位到具体的边缘服务器。S8: The edge orchestration manager will save the QoS attribute values of the microservices registered in the service registry in the service registry, and use the hash tree concept to hash the QoS attribute values of the microservices in pairs, and finally get a hash root. The edge orchestration manager encrypts the hash value with the private key, and then broadcasts it to each edge server, and the edge server saves the hash value with the saved public key. The edge server will periodically ask the registry to see if the hash root stored in the registry is consistent with the locally stored hash value. If it is inconsistent, it is judged that the service QoS attribute value stored in the service registry has been tampered with, and the attribute value of which service has been modified can be quickly located by using the properties of the hash tree, and then the specific edge server can be located.
以上实施例仅为说明本发明的技术思想,不能以此限定本发明的保护范围,凡是按照本发明提出的技术思想,在技术方案基础上所做的任何改动,均落入本发明保护范围之内。The above embodiments are only to illustrate the technical idea of the present invention, and cannot limit the protection scope of the present invention. Any modification made on the basis of the technical solution according to the technical idea proposed by the present invention falls within the protection scope of the present invention. Inside.

Claims (5)

  1. 一种面向边缘云系统的软件微服务组合优化方法,其特征在于:包括有以下步骤:An edge cloud system-oriented software microservice combination optimization method, characterized in that it includes the following steps:
    S1:用户提交自己的任务,任务中包括相对应的任务输入以及预想的输出结果,该任务提交到边缘云中,由边缘编排管理器接收,并通过注册中心得到部署在各个边缘服务器中微服务的信息,进行组合服务的选择;S1: The user submits his own task, which includes the corresponding task input and the expected output result. The task is submitted to the edge cloud, received by the edge orchestration manager, and deployed in each edge server through the registration center. Microservices information, and choose a combination of services;
    S2:引入捕食搜索策略,采用捕食搜索策略在全局求得一个可行的服务链,即搜索一条满足用户微服务组合要求的服务链;S2: Introduce the predatory search strategy, and use the predatory search strategy to obtain a feasible service chain globally, that is, to search for a service chain that meets the requirements of the user's microservice composition;
    S3:可行服务链的长度为m,搜索可行服务链上每个微服务对应的候选服务,即将与可行服务链上各微服务具有相同输入集合和输出集合的微服务放入同一个服务类中,得到m个候选服务类;S3: The length of the feasible service chain is m, and the candidate service corresponding to each microservice on the feasible service chain is searched, that is, the microservices with the same input set and output set as the microservices on the feasible service chain are put into the same service class , get m candidate service classes;
    S4:在候选服务类中,使用具有混沌性质的余切序列依次从各候选服务类中选择一个候选服务,形成一个微服务组合,该微服务组合映射为一个驱光个体,依照前一个驱光个体进行混沌初始化n-1次,这就得到n个驱光个体;S4: In the candidate service class, use a cotangent sequence with chaotic properties to select a candidate service from each candidate service class in turn to form a micro-service combination. The micro-service combination is mapped to a driver individual, according to the previous driver The individual performs chaotic initialization n-1 times, which obtains n light-driving individuals;
    S5:根据具有个性化的适应度函数来评价这n个微服务组合方案,找到这n个微服务组合方案中的最优的微服务组合方案,并判断对应的适应度函数值是否达到理论最优,如果是,则该微服务组合方案即为全局最优微服务组合方案;否则,执行S6,当找到最终的最优微服务组合方案或者迭代次数达到上限,则停止,输出停止时的最优的微服务组合方案;S5: Evaluate the n microservice composition schemes according to the individualized fitness function, find the optimal microservice composition scheme among the n microservice composition schemes, and judge whether the corresponding fitness function value reaches the theoretical maximum If yes, then the microservice composition scheme is the global optimal microservice composition scheme; otherwise, execute S6, when the final optimal microservice composition scheme is found or the number of iterations reaches the upper limit, stop, and output the maximum value when stopped. Excellent microservice composition scheme;
    S6:用混沌扰乱规则更新20%的驱光个体的微服务组合方案,这20%的驱光个体是选择10%的当前迭代中适应度值最优的驱光个体以及10%的适应度值最差的驱光个体,其余的驱光个体依然按照原本组合算法的位置变换的公式进行计算,20%的驱光个体需要进行位置更新,之后在局部搜索,更新完成后,返回执行S5;S6: Update the micro-service combination scheme of 20% of the light-driving individuals with the chaotic disturbance rules, and these 20% of the light-driving individuals are to select 10% of the light-driving individuals with the best fitness value and 10% of the fitness value in the current iteration For the worst optical drive individuals, the rest of the optical drive individuals are still calculated according to the position transformation formula of the original combination algorithm. 20% of the optical drive individuals need to update their positions, and then perform a local search. After the update is completed, return to S5;
    S7:通过组合算法的求得基于当前服务链的全局最优解,或者达到最大迭代次数,对应的服务链为当前最优服务链。微服务组合选择成功之后,对用户的任务进行执行,之后边缘编排管理器会将执行之后的结果返回给用户,并对相应的微服务中QoS各属性值进行更新,并将更新的结果保存在微服务注册中心;S7: The global optimal solution based on the current service chain is obtained through the combined algorithm, or the maximum number of iterations is reached, and the corresponding service chain is the current optimal service chain. After the microservice combination is successfully selected, the user's task is executed, and then the edge orchestration manager will return the execution result to the user, update the QoS attribute values in the corresponding microservice, and save the updated result in the Microservice registry;
    S8:边缘编排管理器会将服务注册中心中注册的微服务的QoS属性值保存在服务注册中心中,利用hash树的概念对微服务的QoS属性值进行两两哈希,类似于树形结构最后得到一个hash根。边缘编排管理器将这个hash值用私钥加密,然后广播给各个边缘服务器,边缘服务器会用保存的公钥对广播信息解密,保存这个hash值。边缘服务器会定时询问注册中心,看是否注册中心中保存的哈希根与本地存储哈希值是否一致,如果不一致,则判断服务注册中心保存服务QoS属性值遭到篡改,利用哈希树的性质可以很快定位到哪个服务的属性值遭到了修改,也就可以定位到具体的边缘服务器。S8: The edge orchestration manager will save the QoS attribute values of the microservices registered in the service registry in the service registry, and use the hash tree concept to hash the QoS attribute values of the microservices in pairs, similar to a tree structure Finally get a hash root. The edge orchestration manager encrypts the hash value with the private key, and then broadcasts it to each edge server. The edge server decrypts the broadcast information with the stored public key and saves the hash value. The edge server will periodically ask the registration center to see if the hash root stored in the registration center is consistent with the locally stored hash value. The attribute value of which service has been modified can be quickly located, and the specific edge server can also be located.
  2. 根据权利要求1所述的一种面向边缘云系统的软件微服务组合优化方法,其特征 在于:所述S2的具体过程如下:A kind of software microservice combination optimization method for edge cloud system according to claim 1, it is characterized in that: the concrete process of described S2 is as follows:
    S2.1:设置searchSet集合为空,搜索所有的微服务,将满足用户微服务组合要求的微服务加入服务链,同时将该微服务的输入集合存放于searchSet集合中;S2.1: Set the searchSet collection to be empty, search all microservices, add the microservices that meet the user's microservice composition requirements to the service chain, and store the input collection of the microservices in the searchSet collection;
    S2.2:在将满足用户微服务组合要求的微服务加入服务链之前,判断searchSet集合中是否已有该微服务的输入集合,若没有,则将该微服务加入服务链,否则,不加入;S2.2: Before adding a microservice that meets the user's microservice composition requirements to the service chain, determine whether there is an input set of the microservice in the searchSet collection, if not, add the microservice to the service chain, otherwise, do not join ;
    S2.3:当前搜索结束后,若没有得到可行服务链,则将searchSet集合清空,在没有被搜索过的微服务中重复S2.1-S2.2,直到找到一条可行服务链或到达最大搜索次数,停止搜索。S2.3: After the current search is over, if no feasible service chain is obtained, the searchSet collection will be cleared, and S2.1-S2.2 will be repeated in the microservices that have not been searched until a feasible service chain is found or the maximum search is reached. times, stop searching.
  3. 根据权利要求1所述的一种面向边缘云系统的软件微服务组合优化方法,其特征在于:所述S4的具体过程如下:The method for optimizing software micro-service composition for edge cloud systems according to claim 1, characterized in that: the specific process of S4 is as follows:
    S4.1:可行服务链的长度为m,j=0,…,m-1,第j个微服务有k j个候选服务; S4.1: The length of the feasible service chain is m, j=0,...,m-1, and the jth microservice has k j candidate services;
    S4.2:确定k j的数量级
    Figure PCTCN2020119196-appb-100001
    根据与第j个微服务对应的余切序列值
    Figure PCTCN2020119196-appb-100002
    截取余切序列值小数点后φ j位作为整数值u i,j
    Figure PCTCN2020119196-appb-100003
    n为驱光个体总数;
    S4.2: Determine the order of magnitude of k j
    Figure PCTCN2020119196-appb-100001
    According to the cotangent sequence value corresponding to the jth microservice
    Figure PCTCN2020119196-appb-100002
    Truncate the cotangent sequence value with φ j bits after the decimal point as an integer value u i,j ,
    Figure PCTCN2020119196-appb-100003
    n is the total number of drive units;
    S4.3:将u i,j对k j取余,产生混沌值ξ i,j,混沌值与第j个微服务对应的候选服务类中的一个候选服务对应,该值与该服务对应的候选服务中的某一个服务对应,则所对应的候选服务被选中,同样,服务链上的所有服务均执行该操作后,则第i个驱光个体的位置X i初始化完成。 S4.3: Take the remainder of u i,j to k j to generate a chaotic value ξ i,j , the chaotic value corresponds to a candidate service in the candidate service class corresponding to the jth microservice, and this value corresponds to the If a certain service in the candidate services corresponds, the corresponding candidate service is selected. Similarly, after all services in the service chain perform this operation, the initialization of the position X i of the i-th optical drive individual is completed.
  4. 根据权利要求1所述的一种面向边缘云系统的软件微服务组合优化方法,其特征在于:所述S5中适应度函数值的计算公式为:The software microservice combination optimization method oriented to an edge cloud system according to claim 1, wherein the calculation formula of the fitness function value in the S5 is:
    Figure PCTCN2020119196-appb-100004
    Figure PCTCN2020119196-appb-100004
    其中,f代表适应度值,R表示服务链上各微服务可靠性的积,T表示服务链上各微服务响应时间的和,C表示服务链上各微服务执行成本的和,A表示服务链上各微服务可用性的积,α分别表示R的权重,β表示A的权重,γ表示T的权重,η表示C的权重,且α+β+γ+η=1。Among them, f represents the fitness value, R represents the product of the reliability of each microservice on the service chain, T represents the sum of the response times of each microservice on the service chain, C represents the sum of the execution costs of each microservice on the service chain, and A represents the service The product of the availability of each microservice on the chain, α represents the weight of R, β represents the weight of A, γ represents the weight of T, η represents the weight of C, and α+β+γ+η=1.
  5. 根据权利要求1所述的一种面向边缘云系统的软件微服务组合优化方法,其特征在于:所述S6的具体过程为:The method for optimizing software micro-service composition for edge cloud systems according to claim 1, wherein the specific process of S6 is:
    S6.1:筛选的20%的驱光个体需要按照混沌序列更新自己的位置,公式如下:S6.1: The screened 20% of the light-driving individuals need to update their positions according to the chaotic sequence. The formula is as follows:
    Figure PCTCN2020119196-appb-100005
    Figure PCTCN2020119196-appb-100005
    上式中
    Figure PCTCN2020119196-appb-100006
    表示驱光个体i在t次迭代的第j维的位置,也就是服务链第j个分量的选择方案,位置更新也需要按照余切序列来计算,在第t+1次迭代时,第i个驱光个体的第j维位置
    Figure PCTCN2020119196-appb-100007
    更新是按照第t次得出的余切序列来进行迭代得出,其中h表示该驱光个体的维度,也就是服务链的长度,n表示最大迭代次数。更新之后的余切函数值需要根据S4进行计算对应的候选服务;
    In the above formula
    Figure PCTCN2020119196-appb-100006
    Represents the position of the driver i in the jth dimension of the t iterations, that is, the selection scheme of the jth component of the service chain. The position update also needs to be calculated according to the cotangent sequence. In the t+1th iteration, the ith The j-th dimensional position of each disc-drive individual
    Figure PCTCN2020119196-appb-100007
    The update is obtained iteratively according to the cotangent sequence obtained at the tth time, where h represents the dimension of the individual driver, that is, the length of the service chain, and n represents the maximum number of iterations. The updated cotangent function value needs to calculate the corresponding candidate service according to S4;
    S6.2:20%的驱光个体进行局部搜索,找出自己的局部微服务组合最优方案,这里设置了一个混沌次数chaoNum来限制比较次数,当驱光个体在局部搜索中找到局部最优或者超过这个混沌次数,便可以结束查找;S6.2: 20% of the CD-ROM individuals conduct a local search to find their own optimal solution for local micro-service combination. Here, a chaos count, chaoNum, is set to limit the number of comparisons. When the CD-ROM individuals find the local optimum in the local search Or if this number of chaos is exceeded, the search can be ended;
    S6.3:参与混沌扰乱的驱光个体需要将自己找出的局部最优的组合方案与历史全局最优组合方案进行比较,如果更优于历史全局最优组合方案,则用该方案更新历史最优组合方案,作为新的fBest,否则继续S5。S6.3: Individuals participating in chaos disturbance need to compare the locally optimal combination scheme found by themselves with the historical global optimal combination scheme. If it is better than the historical global optimal combination scheme, use this scheme to update the history The optimal combination scheme is used as the new fBest, otherwise continue to S5.
PCT/CN2020/119196 2020-07-10 2020-09-30 Software microservice combination optimization method for edge cloud system WO2022007212A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010660217.0A CN112398899B (en) 2020-07-10 2020-07-10 Software micro-service combination optimization method for edge cloud system
CN202010660217.0 2020-07-10

Publications (1)

Publication Number Publication Date
WO2022007212A1 true WO2022007212A1 (en) 2022-01-13

Family

ID=74603049

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119196 WO2022007212A1 (en) 2020-07-10 2020-09-30 Software microservice combination optimization method for edge cloud system

Country Status (2)

Country Link
CN (1) CN112398899B (en)
WO (1) WO2022007212A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114679451A (en) * 2022-02-18 2022-06-28 北京邮电大学 Service scheduling system facing edge calculation and scheduling method thereof
CN114745394A (en) * 2022-04-07 2022-07-12 山东理工大学 Mobile service selection method based on moth fire suppression optimization algorithm in cloud and edge environment
CN114844886A (en) * 2022-03-22 2022-08-02 山东理工大学 Mobile service selection method based on gull optimization algorithm under cloud-edge combination environment
CN115529316A (en) * 2022-09-30 2022-12-27 湖北省楚天云有限公司 Micro-service deployment method based on cloud computing center network architecture
CN115914349A (en) * 2022-10-25 2023-04-04 广东利通科技投资有限公司 Mobile edge computing micro-service placement algorithm based on graph shortest path variant
CN116260730A (en) * 2023-05-15 2023-06-13 武汉大学 Geographic information service evolution particle swarm optimization method in multi-edge computing node
CN117201319A (en) * 2023-11-06 2023-12-08 三峡高科信息技术有限责任公司 Micro-service deployment method and system based on edge calculation

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112882723B (en) * 2021-02-24 2023-09-08 武汉大学 Edge service deployment method for parallel micro-service combination
CN112884248B (en) * 2021-03-24 2023-01-06 苏州大学 Optimization method of large-scale cloud service process
US11847443B2 (en) 2021-09-07 2023-12-19 International Business Machines Corporation Constraints-based refactoring of monolith applications through attributed graph embeddings
US11726778B2 (en) 2021-09-29 2023-08-15 International Business Machines Corporation Translating clusters of a monolith application to microservices
WO2023069163A1 (en) * 2021-10-18 2023-04-27 Microsoft Technology Licensing, Llc. Decentralized configuration integrity check in microservices environment
US11768679B2 (en) * 2021-11-30 2023-09-26 International Business Machines Corporation Identifying microservices for a monolith application through static code analysis

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016077A (en) * 2017-03-28 2017-08-04 南京邮电大学 A kind of optimization method of web oriented Services Composition
CN109889505A (en) * 2019-01-23 2019-06-14 平安科技(深圳)有限公司 The data property held verification method and terminal device
CN110187973A (en) * 2019-05-31 2019-08-30 浙江大学 A kind of service arrangement optimization method towards edge calculations
CN110213363A (en) * 2019-05-30 2019-09-06 华南理工大学 Cloud resource dynamic allocation system and method based on software defined network
CN111327659A (en) * 2018-12-17 2020-06-23 上海赛特斯信息科技股份有限公司 User queuing optimization method based on edge calculation

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110022349B (en) * 2019-01-17 2021-11-09 重庆邮电大学 Heterogeneous industrial network device configuration micro-service method based on edge calculation
CN111107163B (en) * 2019-12-31 2022-04-08 哈尔滨工业大学 User demand change-oriented micro-service self-adaption method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016077A (en) * 2017-03-28 2017-08-04 南京邮电大学 A kind of optimization method of web oriented Services Composition
CN111327659A (en) * 2018-12-17 2020-06-23 上海赛特斯信息科技股份有限公司 User queuing optimization method based on edge calculation
CN109889505A (en) * 2019-01-23 2019-06-14 平安科技(深圳)有限公司 The data property held verification method and terminal device
CN110213363A (en) * 2019-05-30 2019-09-06 华南理工大学 Cloud resource dynamic allocation system and method based on software defined network
CN110187973A (en) * 2019-05-31 2019-08-30 浙江大学 A kind of service arrangement optimization method towards edge calculations

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114679451A (en) * 2022-02-18 2022-06-28 北京邮电大学 Service scheduling system facing edge calculation and scheduling method thereof
CN114844886A (en) * 2022-03-22 2022-08-02 山东理工大学 Mobile service selection method based on gull optimization algorithm under cloud-edge combination environment
CN114844886B (en) * 2022-03-22 2023-11-24 山东理工大学 Mobile service selection method based on seagull optimization algorithm in cloud edge combined environment
CN114745394A (en) * 2022-04-07 2022-07-12 山东理工大学 Mobile service selection method based on moth fire suppression optimization algorithm in cloud and edge environment
CN114745394B (en) * 2022-04-07 2023-07-07 山东理工大学 Mobile service selection method based on moth fire suppression optimization algorithm in cloud and edge environments
CN115529316A (en) * 2022-09-30 2022-12-27 湖北省楚天云有限公司 Micro-service deployment method based on cloud computing center network architecture
CN115914349A (en) * 2022-10-25 2023-04-04 广东利通科技投资有限公司 Mobile edge computing micro-service placement algorithm based on graph shortest path variant
CN115914349B (en) * 2022-10-25 2024-04-19 广东利通科技投资有限公司 Mobile edge calculation micro-service placement method based on graph shortest path variant
CN116260730A (en) * 2023-05-15 2023-06-13 武汉大学 Geographic information service evolution particle swarm optimization method in multi-edge computing node
CN116260730B (en) * 2023-05-15 2023-07-21 武汉大学 Geographic information service evolution particle swarm optimization method in multi-edge computing node
CN117201319A (en) * 2023-11-06 2023-12-08 三峡高科信息技术有限责任公司 Micro-service deployment method and system based on edge calculation
CN117201319B (en) * 2023-11-06 2024-01-09 三峡高科信息技术有限责任公司 Micro-service deployment method and system based on edge calculation

Also Published As

Publication number Publication date
CN112398899A (en) 2021-02-23
CN112398899B (en) 2022-02-25

Similar Documents

Publication Publication Date Title
WO2022007212A1 (en) Software microservice combination optimization method for edge cloud system
Liu et al. A task scheduling algorithm based on classification mining in fog computing environment
US10437843B2 (en) Optimization of database queries via transformations of computation graph
US9063710B2 (en) Parallel programming of in memory database utilizing extensible skeletons
Bu et al. Scaling datalog for machine learning on big data
CN107016077B (en) Optimization method for Web service combination
Fu et al. Task scheduling of cloud computing based on hybrid particle swarm algorithm and genetic algorithm
WO2021254114A1 (en) Method and apparatus for constructing multitask learning model, electronic device and storage medium
Sun et al. Enhanced equilibrium optimizer algorithm applied in job shop scheduling problem
Mencagli et al. Harnessing sliding-window execution semantics for parallel stream processing
Yang et al. An improved cop-kmeans clustering for solving constraint violation based on mapreduce framework
Wang et al. Particle swarm optimization service composition algorithm based on prior knowledge
CN107066328A (en) The construction method of large-scale data processing platform
CN116680090B (en) Edge computing network management method and platform based on big data
Li et al. A novel and efficient salp swarm algorithm for large-scale QoS-aware service composition selection
Zhang et al. Development of a new cloudlet content caching algorithm based on web mining
Nasir et al. Partial key grouping: Load-balanced partitioning of distributed streams
Xu et al. Applying an improved elephant herding optimization algorithm with spark-based parallelization to feature selection for intrusion detection
Liu et al. A simple greedy algorithm for the profit-aware social team formation problem
CN108280176A (en) Data mining optimization method based on MapReduce
Ding et al. An efficient query processing optimization based on ELM in the cloud
Bai et al. An efficient skyline query algorithm in the distributed environment
Gavagsaz Weighted spatial skyline queries with distributed dominance tests
Li et al. HFML: heterogeneous hierarchical federated mutual learning on non-IID data
Pires et al. Efficient Parallel Associative Classification Based on Rules Memoization

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20943940

Country of ref document: EP

Kind code of ref document: A1