Service adaptation method and device based on skill dependency graph and QoS perception
By introducing skill dependency graphs and QoS awareness, the robot's microservice composition is dynamically adjusted, solving the problem of low task execution efficiency under environmental changes in existing technologies and achieving efficient task adaptation and execution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-03-27
AI Technical Summary
Existing robot microservice architectures cannot dynamically adjust service composition based on environmental changes at runtime and lack awareness of runtime quality of service (QoS), resulting in low task execution efficiency.
By introducing skill dependency graphs and QoS awareness methods, we can dynamically retrieve and optimize atomic microservice composition schemes, monitor QoS indicators and resource information in real time, and optimize service composition to adapt to environmental changes.
This improves the adaptability and task execution efficiency of the robot system, ensuring that tasks are completed efficiently in dynamic environments.
Smart Images

Figure CN121349706B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of robot autonomous decision-making, and in particular relates to a service adaptation method and device based on a skill dependency graph and QoS perception. BACKGROUND
[0002] With the rapid development of robot technology, robots are increasingly widely used in industrial production and other fields. For example, in an intelligent factory, robots need to dynamically adjust their behaviors according to changes in production tasks to complete complex production processes, such as material handling, component assembly, and quality detection.
[0003] In related technologies, robot functions are modularized into microservices, each of which encapsulates a specific skill (such as navigation, grabbing, recognition, etc.), and these microservices are combined together through predefined processes to complete complex tasks. In addition, related technology frameworks dynamically select appropriate services and generate service combination schemes according to task requirements through service matching and combination algorithms.
[0004] However, although the existing robot microservice architecture modularizes functions into microservices, the combination between microservices relies on predefined static processes and cannot dynamically adjust the service combination mode according to changes in the runtime environment. Although existing technology frameworks generate service combination schemes through service matching, the schemes rely on preset combination rules and lack perception of runtime service quality (QoS), which causes existing systems to be unable to monitor and optimize service combinations in real time, thereby affecting the execution efficiency of the overall task. SUMMARY
[0005] The embodiments of the present application provide a service adaptation method and device based on a skill dependency graph and QoS perception. To have a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not a general review, nor does it determine the key / important components or delineate the protection scope of these embodiments. Its only purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.
[0006] In a first aspect, the embodiments of the present application provide a service adaptation method based on a skill dependency graph and QoS perception, applied to a robot, the method comprising:
[0007] In response to a task execution request sent by a client, retrieving a plurality of candidate atomic microservices available according to task requirement information carried by the task execution request and a preset skill dependency graph; the preset skill dependency graph is composed of a plurality of nodes and edges between the nodes, each node being an atomic microservice corresponding to each basic skill of the robot, and the edges being used to represent the dependency relationship between the atomic microservices;
[0008] Determine an optimal service combination scheme from multiple candidate atomic microservices under resource constraints of a preset multi-objective optimization model;
[0009] Containerize and deploy each atomic microservice in the optimal service combination scheme to obtain a deployed microservice instance for task execution;
[0010] During execution, when it is detected that there is service performance degradation or resource bottleneck according to real-time sensed QoS indicators and resource information, the optimal service combination scheme is optimized and the step of containerized deployment is continued.
[0011] Optionally, the preset skill dependency graph is generated according to the following steps, including:
[0012] Each basic skill predefined by the robot is encapsulated as an atomic microservice;
[0013] A standardized interface for providing skill invocation capability is set for each encapsulated atomic microservice to obtain multiple target atomic microservices;
[0014] Skill function semantics, input / output parameters, pre / post conditions and QoS metadata of each basic skill are obtained to obtain a skill description file corresponding to each target atomic microservice;
[0015] Each target atomic microservice is taken as a node of the graph, and the skill description file corresponding to each target atomic microservice is stored in the node corresponding to each target atomic microservice;
[0016] Based on the skill description file, edges between nodes are created to obtain a directed acyclic skill dependency graph; the edges are used to represent the dependency relationship between atomic microservices, including data dependency, control dependency and semantic dependency;
[0017] The directed acyclic skill dependency graph is taken as the preset skill dependency graph.
[0018] Optionally, based on the skill description file, edges between nodes are created to obtain a directed acyclic skill dependency graph, including:
[0019] Through the skill function semantics contained in the skill description file, a first atomic microservice that has semantic dependency with each target atomic microservice is determined;
[0020] Through the input / output parameters contained in the skill description file, a second atomic microservice that has data dependency with each target atomic microservice is determined;
[0021] Through the pre / post conditions contained in the skill description file, a third atomic microservice that has control dependency with each target atomic microservice is determined;
[0022] Establish a directed edge between the node of each target atomic microservice and the node of the first atomic microservice, the node of the second atomic microservice, and the node of the third atomic microservice.
[0023] Optionally, each node in the preset skill dependency graph stores a skill description file corresponding to an atomic microservice.
[0024] According to the task demand information carried in the task execution request and the preset skill dependency graph, a plurality of candidate atomic microservices available are searched, including:
[0025] The task demand information carried in the task execution request is analyzed to obtain a specific target and requirement of the task.
[0026] From the specific target and requirement of the task, a subtask sequence satisfying the robot to execute according to a time sequence is divided.
[0027] From the preset skill dependency graph, the skill description file stored in each node is obtained.
[0028] According to the subtask description information of each subtask in the subtask sequence and the skill description file, a target node of each subtask is searched.
[0029] The atomic microservice corresponding to the target node of each subtask is traversed to obtain a plurality of candidate atomic microservices available.
[0030] Optionally, the skill description file includes skill function semantics, input / output parameters, and pre / post conditions; and the subtask description information of each subtask includes function demand, input / output demand, and condition demand.
[0031] According to the subtask description information of each subtask in the subtask sequence and the skill description file, a target node of each subtask is searched, including:
[0032] Each first subtask in each subtask is traversed.
[0033] Each first node in the preset skill dependency graph is traversed.
[0034] It is determined whether the skill function semantics of the first node is consistent with the function demand of the first subtask.
[0035] It is determined whether the input / output parameters of the first node are consistent with the input / output demand of the first subtask.
[0036] It is determined whether the pre / post conditions of the first node are consistent with the condition demand of the first subtask.
[0037] In the case that the first node is the target node of the first subtask, or in the case that the first node is not the target node of the first subtask, the step of traversing the first node in the preset skill dependency graph is re-executed until the target node of the first subtask is determined.
[0038] The step of traversing the first subtask in each subtask is continuously executed until each subtask is traversed, and the target node of each subtask is obtained.
[0039] Optionally, each node in the preset skill dependency graph stores a skill description file corresponding to an atomic microservice, and the skill description file includes QoS metadata; the resource constraint is to minimize total execution time, maximize overall reliability, and minimize total resource consumption.
[0040] Under the resource constraint of the preset multi-objective optimization model, an optimal service combination scheme is determined from a plurality of candidate atomic microservices, including:
[0041] From the preset skill dependency graph, backup QoS metadata of each candidate atomic microservice is obtained, and the backup QoS metadata includes execution time, reliability parameters, and resource consumption parameters.
[0042] According to the task demand information, a plurality of candidate atomic microservices are combined to obtain a plurality of candidate service combination schemes.
[0043] The backup QoS metadata of each candidate atomic microservice is used to calculate the total execution time, overall reliability, and total resource consumption of each candidate service combination scheme.
[0044] Through a multi-objective optimization algorithm, in combination with the total execution time, overall reliability, and total resource consumption of each candidate service combination scheme, a candidate service combination scheme that satisfies the minimum total execution time, maximum overall reliability, and minimum total resource consumption is determined as the optimal service combination scheme.
[0045] Optionally, whether there is service performance degradation or resource bottleneck is detected according to real-time sensed QoS indicators and resource information, including:
[0046] The QoS indicators and resource information of each microservice instance are collected in real time, the QoS indicators include response time and success rate, and the resource information includes CPU usage and memory usage.
[0047] The response time and success rate of each microservice instance are compared with preset QoS thresholds.
[0048] In the case that the response time exceeds the preset QoS threshold or the success rate is lower than the preset QoS threshold, it is determined that there is service performance degradation.
[0049] comparing the CPU usage, the memory usage and the network bandwidth of each microservice instance with preset resource thresholds;
[0050] In a case where a result of the comparison shows that the CPU usage exceeds the preset resource threshold or the memory usage exceeds the preset resource threshold or the network bandwidth is lower than the preset resource threshold, it is determined that there is a resource bottleneck.
[0051] Optionally, the optimal service combination scheme is optimized, including:
[0052] locating an abnormal atomic microservice with service performance degradation or a resource bottleneck;
[0053] determining an abnormal subtask corresponding to the abnormal atomic microservice; the abnormal subtask is determined from a subtask sequence that meets a time sequence of execution of the robot, and the subtask sequence is divided according to a specific target and requirement of the task of the task demand information;
[0054] according to task description information of the abnormal subtask, traversing, from a preset skill dependency graph, a final node that meets the abnormal subtask except for a node corresponding to the abnormal atomic microservice;
[0055] adopting an atomic microservice corresponding to the final node to replace the abnormal atomic microservice in the optimal service combination scheme, to obtain a rearranged service combination scheme;
[0056] verifying the rearranged service combination scheme to obtain an optimized optimal service combination scheme.
[0057] Optionally, verifying the rearranged service combination scheme to obtain the optimized optimal service combination scheme includes:
[0058] judging whether the rearranged service combination scheme meets a resource constraint of a preset multi-objective optimization model;
[0059] if yes, taking the rearranged service combination scheme as the optimized optimal service combination scheme;
[0060] if no, continuing to perform the step of traversing the final node that meets the abnormal subtask except for the node corresponding to the abnormal atomic microservice until the rearranged service combination scheme meets the resource constraint of the preset multi-objective optimization model.
[0061] In a second aspect, an embodiment of the present application provides a service adaptation device based on a skill dependency graph and QoS perception, and the device includes:
[0062] The atomic micro-service retrieval module is configured to, in response to a task execution request sent by a client, retrieve a plurality of candidate atomic micro-services according to task requirement information carried in the task execution request and a preset skill dependency graph. The preset skill dependency graph is composed of a plurality of nodes and edges between the nodes. Each node corresponds to an atomic micro-service of each basic skill of the robot, and the edges are used to represent the dependency relationship between the atomic micro-services.
[0063] The optimal service combination scheme determination module is configured to determine an optimal service combination scheme from the plurality of candidate atomic micro-services under the resource constraints of the preset multi-objective optimization model.
[0064] The containerized deployment module is configured to containerize and deploy each atomic micro-service in the optimal service combination scheme to obtain a micro-service instance for task execution.
[0065] The service combination optimization module is configured to, in the execution process, optimize the optimal service combination scheme and continue the step of containerized deployment when it is detected that there is service performance degradation or a resource bottleneck according to real-time sensed QoS indicators and resource information.
[0066] The technical scheme provided by the embodiments of the present application can include the following beneficial effects:
[0067] In the embodiments of the present application, on the one hand, by introducing the preset skill dependency graph, the basic skills of the robot are encapsulated into atomic micro-services, and the candidate atomic micro-services available are dynamically retrieved according to the task requirement information and the skill dependency graph. In the task execution process, the service combination scheme is dynamically optimized according to the real-time sensed QoS indicators and resource information. This dynamic adjustment mechanism enables the robot to flexibly adjust the service combination mode according to the changes in the runtime environment, thereby better adapting to the task requirements and environmental changes and improving the adaptability of the system. On the other hand, by real-time sensing the QoS indicators and resource information, the service performance degradation or resource bottleneck is dynamically detected in the task execution process. After detecting the abnormality, the service combination scheme is optimized, and the containerized deployment is performed again to ensure the efficient execution of the task, thereby improving the execution efficiency of the task.
[0068] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0069] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application.
[0070] Figure 1 is a method flowchart of a service adaptation method based on a skill dependency graph and QoS sensing provided by the embodiments of the present application.
[0071] Figure 2 is a process schematic block diagram of an alternative atomic micro-service retrieval process provided by an embodiment of the present application;
[0072] Figure 3 is a process schematic block diagram of an optimal service combination scheme optimization process provided by an embodiment of the present application;
[0073] Figure 4 is a process schematic block diagram of a service adaptation process based on a skill dependency graph and QoS awareness provided by an embodiment of the present application;
[0074] Figure 5 is a scheme comparison result schematic diagram displayed in the background provided by an embodiment of the present application;
[0075] Figure 6 is a graph construction method flowchart of a preset skill dependency graph provided by an embodiment of the present application;
[0076] Figure 7 is a structural schematic diagram of a service adaptation apparatus based on a skill dependency graph and QoS awareness provided by an embodiment of the present application;
[0077] Figure 8 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0078] The following description and drawings are illustrative of the specific embodiments of the present application and are not intended to be limiting thereof.
[0079] It should be noted that the described embodiments are merely a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0080] The following description refers to the accompanying drawings. Unless otherwise indicated, same numbers in different drawings indicate same or similar elements. The implementations described in the following example embodiments are not meant to represent all implementations in which one can practice the present application. Rather, they are merely examples of apparatuses and methods in which one can practice the present application as detailed in the appended claims.
[0081] In the description of the present application, it should be understood that the terms "first", "second" and the like are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, "multiple" refers to two or more, unless otherwise specified. The association relationship of the associated objects is described, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. The character " / " generally represents an "or" relationship between the associated objects before and after it.
[0082] Currently, the robot function is modularized into microservices, each microservice encapsulates a specific skill (such as navigation, grabbing, recognition, etc.), and these microservices are combined through a predefined process to complete complex tasks. In addition, related technical frameworks dynamically select appropriate services and generate service combination schemes according to task requirements through service matching and combination algorithms.
[0083] The inventors realize that although the existing robot microservice architecture modularizes functions into microservices, the combination between microservices relies on predefined static processes and cannot dynamically adjust service combination methods according to changes in the runtime environment. Although the existing technical framework generates a service combination scheme through service matching, this scheme relies on preset combination rules and lacks awareness of the quality of service (QoS) at runtime, which causes the existing system to be unable to monitor and optimize service combination in real time, thereby affecting the execution efficiency of the overall task.
[0084] To solve the above problems, the present application provides a service adaptation method and device based on skill dependency graph and QoS awareness to solve the problems existing in the above related technical problems. In the embodiments of the present application, on the one hand, by introducing a preset skill dependency graph, the basic skills of the robot are encapsulated as atomic microservices, and the available alternative atomic microservices are dynamically retrieved according to the task demand information and the skill dependency graph. During task execution, the service combination scheme is dynamically optimized according to the real-time sensed QoS indicators and resource information. This dynamic adjustment mechanism enables the robot to flexibly adjust the service combination method according to changes in the runtime environment, thereby better adapting to task requirements and environmental changes and improving the adaptability of the system. On the other hand, by real-time sensing of QoS indicators and resource information, the service performance degradation or resource bottleneck is dynamically detected during task execution. After detecting the abnormality, the service combination scheme is optimized and re-deployed in a container, ensuring efficient execution of the task, thereby improving the execution efficiency of the task. The following will be described in detail by exemplary embodiments.
[0085] The following will be described in detail by exemplary embodiments. Figure 1 -Appendix Figure 6The method provided by the embodiment of the application is based on a skill dependency graph and QoS perception, and can be implemented by relying on a computer program and can run on a skill dependency graph and QoS perception-based service adaptation device based on a von Neumann system. The computer program can be integrated in an application or can run as an independent tool application.
[0086] Please refer to Figure 1 A flowchart of a skill dependency graph and QoS perception-based service adaptation method provided by the embodiment of the application is provided, and the method is applied to a robot. As shown in Figure 1 The method provided by the embodiment of the application includes the following steps:
[0087] S101, in response to a task execution request sent by a client, a plurality of candidate atomic microservices are retrieved according to task demand information carried in the task execution request and a preset skill dependency graph. The preset skill dependency graph is composed of a plurality of nodes and edges between the nodes. Each node corresponds to an atomic microservice of each basic skill of the robot, and the edge is used to represent the dependency relationship between the atomic microservices.
[0088] The task execution request is a request sent by a client (such as a user device, a control terminal, etc.) to a robot system, requiring the robot to perform a specific task. For example, a user sends an instruction through a mobile phone application, requiring the robot to clean the living room. The task demand information is detailed information carried in the task execution request, which describes the specific goal, functional requirement, input / output requirement, and condition requirement of the task. The dependency relationship includes data dependency, control dependency, and semantic dependency. The atomic microservice is a service unit that encapsulates a basic skill of the robot into an independent and callable unit. For example, an atomic microservice is “moving to a specified position” or “cleaning an area”.
[0089] Each node in the preset skill dependency graph stores a skill description file corresponding to the atomic microservice. The skill description file describes the function, input / output parameter, pre / post condition, and QoS metadata of the atomic microservice.
[0090] In some embodiments of the application, the specific process of retrieving a plurality of candidate atomic microservices according to the task demand information carried in the task execution request and the preset skill dependency graph includes: analyzing the task demand information carried in the task execution request to obtain the specific goal and requirements of the task; dividing the specific goal and requirements of the task into a subtask sequence that meets the time sequence of the robot; obtaining the skill description file stored in each node from the preset skill dependency graph; retrieving the target node of each subtask according to the subtask description information of each subtask in the subtask sequence and the skill description file; and traversing the atomic microservice corresponding to the target node of each subtask to obtain a plurality of candidate atomic microservices.
[0091] The target node is a node matched with the subtask description information in the skill dependency graph.
[0092] The skill description file includes skill function semantics, input / output parameters, pre / post conditions; and the subtask description information of each subtask includes function requirements, input / output requirements, and condition requirements.
[0093] In some embodiments of the present application, the specific process of retrieving the target node of each subtask according to the subtask description information of each subtask in the subtask sequence and the skill description file includes: traversing a first subtask in each subtask; traversing a first node in the preset skill dependency graph; determining whether the skill function semantics of the first node is consistent with the function requirements of the first subtask; determining whether the input / output parameters of the first node are consistent with the input / output requirements of the first subtask; determining whether the pre / post conditions of the first node are consistent with the condition requirements of the first subtask; in the case that all the above are yes, taking the first node as the target node of the first subtask; or in the case that one of the above is no, re-executing the step of traversing the first node in the preset skill dependency graph until the target node of the first subtask is determined; continuing to execute the step of traversing the first subtask in each subtask until each subtask is traversed, and obtaining the target node of each subtask.
[0094] In a possible implementation, a task execution request is received, and a specific target and requirement in the task requirement information are extracted. The task requirement information is "clean the living room, avoid furniture, and start from the living room entrance", and the target "clean the living room" and the requirement "avoid furniture and start from the living room entrance" are obtained after analysis. At this time, the task is divided into a subtask sequence executed in time sequence, and the subtask sequence includes moving to the living room entrance, starting cleaning, avoiding furniture, and completing cleaning. The skill description file of each node is obtained from the skill dependency graph, including:
[0095] The skill description file of the node "move" is "function: move, input: target position, output: move completion signal, pre-condition: robot in standby state, post-condition: robot reaches target position". The skill description file of the node "clean" is "function: clean, input: cleaning area, output: clean completion signal, pre-condition: robot reaches cleaning area, post-condition: cleaning area is completed". The skill description file of the node "obstacle avoidance" is "function: obstacle avoidance, input: obstacle information, output: obstacle avoidance completion signal, pre-condition: robot detects obstacle, post-condition: robot avoids obstacle".
[0096] For the subtask "move to living room entrance", according to the subtask description information "function requirement: move, input requirement: living room entrance coordinates, output requirement: move completion signal, condition requirement: robot in standby state", find the node with function "move" as the target node. For the subtask "start cleaning", according to the subtask description information "function requirement: clean, input requirement: cleaning area, output requirement: clean completion signal, condition requirement: robot reaches cleaning area", find the node with function "clean" as the target node. For the subtask "avoid furniture", according to the subtask description information "function requirement: obstacle avoidance, input requirement: obstacle information, output requirement: obstacle avoidance completion signal, condition requirement: robot detects obstacle", find the node with function "obstacle avoidance" as the target node. For the subtask "complete cleaning", according to the subtask description information "function requirement: end task, input requirement: clean completion signal, output requirement: return to charging or standby state", find the node with function "end task" as the target node.
[0097] At this time, for the target node "move", the alternative atomic microservices are "fast move" and "slow move". For the target node "clean", the alternative atomic microservices are "strong clean" and "normal clean". For the target node "obstacle avoidance", the alternative atomic microservices are "laser obstacle avoidance" and "visual obstacle avoidance". For the target node "end task", the alternative atomic microservices are "return to charging" and "standby state".
[0098] For example Figure 2 As shown, Figure 2 is a process schematic block diagram of an alternative atomic microservice retrieval process provided by the present application. The robot extracts task requirement information from the task execution request received from the client, then determines the specific target and requirements of the task from the parsed task requirement information, and decomposes the task into a series of subtasks according to the specific target and requirements of the task. These subtasks are executed in sequence. Next, the skill description file of each node is obtained from the preset skill dependency graph. Each subtask in the subtask sequence is traversed to obtain the subtask description information of the current subtask. Each node in the preset skill dependency graph is traversed to obtain the skill description file of the current node. It is determined whether the skill function semantics of the node is consistent with the function requirement of the subtask. If yes, it is determined whether the input / output parameters of the node are consistent with the input / output requirements of the subtask. If yes, it is determined whether the pre / post conditions of the node are consistent with the condition requirements of the subtask. If yes, the current node is taken as the target node of the subtask. If no, the next node in the preset skill dependency graph is traversed to continue execution. The atomic microservices corresponding to the target node are traversed to collect available alternative atomic microservices. If the traversal of the subtask is completed, a plurality of available alternative atomic microservices are obtained. If not, the next subtask in the subtask sequence is traversed to continue execution.
[0099] S102, under the resource constraints of a preset multi-objective optimization model, determining an optimal service combination scheme from a plurality of candidate atomic microservices;
[0100] The preset skill dependency graph stores skill description files corresponding to the atomic microservices for each node, and the skill description files include QoS metadata. The resource constraints include minimizing total execution time, maximizing overall reliability, and minimizing total resource consumption.
[0101] In some embodiments of the present application, the specific process of determining an optimal service combination scheme from a plurality of candidate atomic microservices under the resource constraints of a preset multi-objective optimization model includes: obtaining backup QoS metadata of each candidate atomic microservice from the preset skill dependency graph, the backup QoS metadata including execution time, reliability parameters, and resource consumption parameters; combining the plurality of candidate atomic microservices according to task demand information to obtain a plurality of candidate service combination schemes; calculating the total execution time, overall reliability, and total resource consumption of each candidate service combination scheme using the backup QoS metadata of each candidate atomic microservice; and determining a candidate service combination scheme that satisfies the minimization of total execution time, the maximization of overall reliability, and the minimization of total resource consumption as the optimal service combination scheme through a multi-objective optimization algorithm combined with the total execution time, overall reliability, and total resource consumption of each candidate service combination scheme.
[0102] The multi-objective optimization algorithm, such as genetic algorithm or NSGA-II, is used to balance between multiple objectives to find the optimal solution. In the present application, the multiple objectives include minimizing total execution time, maximizing overall reliability, and minimizing total resource consumption.
[0103] In one possible implementation, the QoS metadata of each candidate atomic microservice, including execution time, reliability parameters, and resource consumption parameters, is extracted from the skill dependency graph. The plurality of candidate atomic microservices are combined into a plurality of candidate service combination schemes according to task demand information. This can be achieved by an exhaustive method or a heuristic algorithm. For each candidate service combination scheme, its total execution time, overall reliability, and total resource consumption are calculated as follows:
[0104] Total execution time = sum of execution times of all microservices.
[0105] Overall reliability = comprehensive value (such as weighted average or product) of reliability parameters of all microservices.
[0106] Total resource consumption = sum of resource consumption parameters of all microservices.
[0107] At this time, use a multi-objective optimization algorithm (such as genetic algorithm, NSGA-II, etc.) to select the optimal service combination scheme according to the total execution time, overall reliability and total resource consumption.
[0108] S103, containerize and deploy each atomic microservice in the optimal service combination scheme to obtain a deployed microservice instance for task execution.
[0109] The optimal service combination scheme is determined by a multi-objective optimization algorithm and is the most suitable service combination for completing the task. It is the best choice obtained by considering factors such as execution time, reliability and resource consumption under the premise of meeting task requirements. Containerization deployment is to package each atomic microservice into an independent container (such as using a Docker container) and deploy it in a containerized environment. Containerization technology can ensure that each microservice runs in an independent environment, improving system isolation, portability and scalability. The microservice instance is a copy of the microservice that is actually running after containerization deployment. Task execution is the process of actually completing the task by running the deployed microservice instance.
[0110] In some embodiments of the present application, each atomic microservice and its dependencies are packaged into a container image. This is done by writing a Dockerfile, which defines the microservice's runtime environment, dependency installation, startup command, etc. Use the Docker command (such as docker build) to build the container image. Deploy the built container image to the container runtime environment. This can be done using the Docker command (such as docker run) or through container orchestration tools (such as Kubernetes) for automated deployment. Start each microservice instance in the container environment. Each instance runs independently and can handle tasks in parallel. By calling these microservice instances, each subtask is executed in order according to the task requirements and the optimal service combination scheme.
[0111] S104, during execution, when it is detected that there is service performance degradation or resource bottleneck according to real-time sensing of QoS indicators and resource information, optimize the optimal service combination scheme and continue the containerization deployment step.
[0112] In some embodiments of the present application, the specific process of detecting whether there is service performance degradation or resource bottleneck according to the real-time perceived QoS indicators and resource information includes: collecting the QoS indicators and resource information of each microservice instance in real time, the QoS indicators including response time and success rate, and the resource information including CPU usage, memory usage and network bandwidth; comparing the response time and success rate of each microservice instance with the preset QoS threshold; determining that there is service performance degradation if the comparison result shows that the response time exceeds the preset QoS threshold or the success rate is lower than the preset QoS threshold; comparing the CPU usage, memory usage and network bandwidth of each microservice instance with the preset resource threshold; and determining that there is a resource bottleneck if the comparison result shows that the CPU usage exceeds the preset resource threshold, or the memory usage exceeds the preset resource threshold, or the network bandwidth is lower than the preset resource threshold.
[0113] In a possible implementation, the task is composed of three microservice instances: navigation service, crawling service and return service. At this time, the QoS threshold is: response time is 2 seconds, and success rate is 90%. The resource threshold is: CPU usage is 80%, memory usage is 80%, and network bandwidth is 100 Mbps. The QoS indicators (response time and success rate) and resource information (CPU usage, memory usage and network bandwidth) of each microservice instance are collected in real time using a monitoring tool (such as Prometheus, Grafana, Telegraf, etc.), as shown in Table 1.
[0114] Table 1
[0115]
[0116] By comparison, it can be seen that the navigation service has normal service performance. The crawling service has service performance degradation. The return service has normal service performance. The navigation service has normal resource usage. The crawling service has a resource bottleneck (CPU, memory and network). The return service has normal resource usage.
[0117] In some embodiments of the present application, the specific process of optimizing the optimal service combination scheme includes: locating an abnormal atomic microservice that has service performance degradation or a resource bottleneck; determining an abnormal subtask corresponding to the abnormal atomic microservice; the abnormal subtask is determined from a subtask sequence that meets the time sequence of the robot execution, and the subtask sequence is divided according to the specific target and requirement of the task demand information of the task; according to the task description information of the abnormal subtask, traversing the final node that meets the abnormal subtask from the preset skill dependency graph except the node corresponding to the abnormal atomic microservice; replacing the abnormal atomic microservice in the optimal service combination scheme with the atomic microservice corresponding to the final node to obtain a rearranged service combination scheme; and verifying the rearranged service combination scheme to obtain an optimized optimal service combination scheme.
[0118] Specifically, the specific process of verifying the rearranged service combination scheme to obtain the optimized optimal service combination scheme includes: judging whether the rearranged service combination scheme satisfies the resource constraints of the preset multi-objective optimization model; if yes, taking the rearranged service combination scheme as the optimized optimal service combination scheme; if no, continuing to execute the step of traversing the final nodes that meet the abnormal sub-tasks except the nodes corresponding to the abnormal atomic micro-service until the rearranged service combination scheme satisfies the resource constraints of the preset multi-objective optimization model.
[0119] The abnormal atomic micro-service is a micro-service instance that exhibits service performance degradation or resource bottleneck in the running process. The rearranged service combination scheme is a new service combination scheme generated by replacing the abnormal atomic micro-service.
[0120] In a possible implementation, the task target is to move from point A to point B, grab an object, and then return to point A. At this time, the sub-task sequence is: navigating to point B (sub-task 1), grabbing the object (sub-task 2), and returning to point A (sub-task 3). In the running process, the monitoring system finds that the response time of the grabbing service (corresponding to sub-task 2) exceeds the threshold, and there is service performance degradation. At this time, the monitoring system finds that the response time of the grabbing service is 3 seconds (exceeding the threshold of 2 seconds), and determines that the grabbing service is an abnormal atomic micro-service. According to the sub-task sequence, the grabbing service corresponds to sub-task 2 (grabbing the object). In the skill dependency graph, according to the task description information of sub-task 2 (such as the functional requirement of “grabbing the object”, the input and output requirement of “object position”, etc.), other nodes that meet the requirements except the current grabbing service are found by traversing the graph. Assume that two alternative nodes are found: grabbing service A and grabbing service B. Selecting grabbing service A to replace the current grabbing service, a new service combination scheme is generated: navigation service → grabbing service A → return service. The QoS indicators and resource information of the new scheme are calculated: total execution time: navigation service 5 seconds + grabbing service A 2 seconds + return service 5 seconds = 12 seconds, total reliability: navigation service 0.95 × grabbing service A 0.95 × return service 0.95 ≈ 0.857, total resource consumption: navigation service CPU 10% + grabbing service A CPU 15% + return service CPU 10% = 35%. It is judged whether the resource constraints of the preset multi-objective optimization model are satisfied: total execution time: 12 seconds (satisfying the minimization of total execution time), total reliability: 0.857 (satisfying the maximization of total reliability), total resource consumption: 35% (satisfying the minimization of total resource consumption). Since the new scheme satisfies all constraint conditions, it is taken as the optimized optimal service combination scheme.
[0121] If the new solution does not meet the constraint condition, for example, the resource consumption of the grabbing service A is too high, causing the total resource consumption to exceed the threshold, the system will continue to traverse the skill dependency graph, select the grabbing service B to replace, and repeat the above verification process until a solution that meets the constraint is found.
[0122] For example Figure 3 As shown, Figure 3 is a process schematic diagram of an optimal service combination solution provided by the present application. The atomic microservices with performance degradation or resource bottlenecks are identified, which cannot meet the predetermined quality of service (QoS) standard or resource usage limit. After locating the abnormal atomic microservices, the corresponding subtasks of these services need to be determined. After determining the abnormal subtasks, other services that can replace the abnormal atomic microservices need to be found in the preset skill dependency graph. If a suitable replacement service (node) is found in the graph, the found replacement service is used to replace the original abnormal atomic microservice, forming a new service combination solution. The newly generated service combination solution is checked to check whether the rearranged service combination solution meets the preset multi-objective optimization model resource constraint. If the rearranged service combination solution meets the resource constraint, this solution can be used as the optimal service combination solution after optimization. The rearranged service combination solution that meets the condition is confirmed as the final optimization solution, which is used to execute the task. If the rearranged service combination solution does not meet the resource constraint, other replacement nodes are continued to be searched until a solution that meets the condition is found.
[0123] For example Figure 4 As shown, Figure 4 is a process schematic diagram of a service adaptation process based on skill dependency graph and QoS awareness provided by the present application. The robot system first receives a task execution request from a client. The request contains specific demand information of the task. Then the demand information in the task request is parsed to extract key information. Secondly, according to the parsed task demand information and the preset skill dependency graph, the system retrieves all available candidate atomic microservices. Finally, under the resource constraint of the preset multi-objective optimization model, the optimal service combination solution is selected from the candidate atomic microservices. The resource constraints include minimizing the total execution time, maximizing the overall reliability, minimizing the total resource consumption, etc.
[0124] The performance indicators of each candidate combination are calculated by a multi-objective optimization algorithm, and the optimal solution is finally determined. The atomic microservices in the optimal service combination are containerized and deployed, and the task execution is started. Containerized deployment can ensure efficient operation of the service and resource isolation. During task execution, the performance indicators (such as response time and success rate) and resource usage (such as CPU, memory, and network bandwidth) of each microservice instance are monitored in real time. When an anomaly is detected, the system locates the atomic microservice that has the problem, determines the corresponding subtask, and finds an alternative atomic microservice from the skill dependency graph. Replace the abnormal service with the alternative service, re-deploy and execute the task. If no abnormality is detected during task execution, or the task is restored to normal after optimization, the task is successfully completed. The scheme comparison results displayed in the background are as follows Figure 5 as shown.
[0125] In the embodiments of the present application, on the one hand, by introducing a preset skill dependency graph, the basic skills of the robot are encapsulated as atomic microservices, and the available alternative atomic microservices are dynamically retrieved according to the task demand information and the skill dependency graph. During task execution, the service combination scheme is dynamically optimized according to the real-time perceived QoS indicators and resource information. This dynamic adjustment mechanism enables the robot to flexibly adjust the service combination method according to the changes in the runtime environment, thereby better adapting to task requirements and environmental changes and improving the adaptability of the system. On the other hand, by real-time perception of QoS indicators and resource information, service performance degradation or resource bottlenecks are dynamically detected during task execution. After detecting an anomaly, the service combination scheme is optimized and re-deployed in a containerized manner to ensure efficient execution of the task, thereby improving the execution efficiency of the task.
[0126] See Figure 6 , a flowchart of a graph construction method of a preset skill dependency graph is provided for the embodiments of the present application. As Figure 6 shown, the method of the embodiments of the present application includes the following steps:
[0127] S201, encapsulating each basic skill predefined by the robot as an atomic microservice;
[0128] S202, setting a standardized interface for providing skill invocation capability for each encapsulated atomic microservice to obtain a plurality of target atomic microservices;
[0129] S203, obtaining skill function semantics, input / output parameters, pre / post conditions, and QoS metadata of each basic skill to obtain a skill description file corresponding to each target atomic microservice;
[0130] S204, taking each target atomic microservice as a node of the graph, and storing the skill description file corresponding to each target atomic microservice in the node corresponding to each target atomic microservice.
[0131] S205, edges between nodes are created based on the skill description file to obtain a directed acyclic skill dependency graph; the edges are used to represent the dependency relationship between the atomic microservices, including data dependency, control dependency and semantic dependency;
[0132] In some embodiments of the present application, the specific process of creating edges between nodes based on the skill description file to obtain a directed acyclic skill dependency graph includes: determining a first atomic microservice that has semantic dependency with each target atomic microservice through the skill function semantics contained in the skill description file; determining a second atomic microservice that has data dependency with each target atomic microservice through the input / output parameters contained in the skill description file; determining a third atomic microservice that has control dependency with each target atomic microservice through the pre / post conditions contained in the skill description file; and establishing a directed edge between the node of each target atomic microservice and the node of the first atomic microservice, the node of the second atomic microservice and the node of the third atomic microservice.
[0133] S206, the directed acyclic skill dependency graph is used as a preset skill dependency graph.
[0134] In the embodiments of the present application, on the one hand, by introducing the preset skill dependency graph, the basic skills of the robot are encapsulated as atomic microservices, and the available alternative atomic microservices are dynamically retrieved according to the task demand information and the skill dependency graph. During the task execution process, the service combination scheme is dynamically optimized according to the real-time perceived QoS indicators and resource information. This dynamic adjustment mechanism enables the robot to flexibly adjust the service combination mode according to the changes in the runtime environment, thereby better adapting to the task demand and environmental changes and improving the adaptability of the system. On the other hand, by real-time sensing the QoS indicators and resource information, the service performance degradation or resource bottleneck is dynamically detected during the task execution process. After detecting the abnormality, the service combination scheme is optimized and re-deployed in a container, ensuring efficient execution of the task, thereby improving the execution efficiency of the task.
[0135] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the apparatus embodiments of the present application, please refer to the method embodiments of the present application.
[0136] Please refer to Figure 7 which shows a structure schematic diagram of a service adaptation device based on skill dependency graph and QoS perception provided by an example embodiment of the present application. The service adaptation device based on skill dependency graph and QoS perception can be realized by software, hardware or a combination of both to become all or part of an electronic device. The device 1 includes an atomic microservice retrieval module 10, an optimal service combination scheme determination module 20, a container deployment module 30 and a service combination optimization module 40.
[0137] The atomic micro-service retrieval module 10 is configured to, in response to a task execution request sent by a client, retrieve a plurality of candidate atomic micro-services according to task requirement information carried in the task execution request and a preset skill dependency graph. The preset skill dependency graph is composed of a plurality of nodes and edges between the nodes. Each node corresponds to an atomic micro-service of each basic skill of a robot, and the edges are used to represent the dependency relationship between the atomic micro-services.
[0138] The optimal service combination scheme determination module 20 is configured to determine an optimal service combination scheme from the plurality of candidate atomic micro-services under the resource constraints of a preset multi-objective optimization model.
[0139] The containerized deployment module 30 is configured to perform containerized deployment of each atomic micro-service in the optimal service combination scheme, to obtain a deployed micro-service instance for task execution.
[0140] The service combination optimization module 40 is configured to, in the execution process, when it is detected that there is service performance degradation or a resource bottleneck according to real-time sensing of QoS indicators and resource information, optimize the optimal service combination scheme and continue the step of containerized deployment.
[0141] It should be noted that the service adaptation apparatus based on the skill dependency graph and QoS sensing provided in the above embodiments is only used as an example to divide the above functional modules when the service adaptation method based on the skill dependency graph and QoS sensing is executed. In actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the service adaptation apparatus based on the skill dependency graph and QoS sensing provided in the above embodiments and the service adaptation method based on the skill dependency graph and QoS sensing embodiment belong to the same concept, and the implementation process is described in detail in the method embodiment. Here, it is not repeated.
[0142] The above sequence numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0143] In the embodiments of the present application, on the one hand, by introducing a preset skill dependency graph, the basic skills of the robot are encapsulated as atomic microservices, and the available alternative atomic microservices are dynamically retrieved according to the task demand information and the skill dependency graph. During the task execution process, the service combination scheme is dynamically optimized according to the real-time perceived QoS indicators and resource information. This dynamic adjustment mechanism enables the robot to flexibly adjust the service combination mode according to the changes in the runtime environment, thereby better adapting to the task demand and environmental changes and improving the adaptability of the system. On the other hand, by real-time perception of QoS indicators and resource information, the service performance degradation or resource bottleneck is dynamically detected during the task execution process. After detecting the abnormality, the service combination scheme is optimized and containerized deployment is performed again to ensure efficient execution of the task, thereby improving the execution efficiency of the task.
[0144] The present application also provides a computer readable medium having program instructions stored thereon, which, when executed by a processor, implement the service adaptation method based on skill dependency graph and QoS perception provided by each of the above method embodiments.
[0145] The present application also provides a computer program product containing instructions, which, when running on a computer, causes the computer to execute the service adaptation method based on skill dependency graph and QoS perception of each of the above method embodiments.
[0146] Please refer to Figure 8 A structural schematic diagram of an electronic device is provided for the embodiments of the present application. As shown in Figure 8 The electronic device 1000 can include at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.
[0147] The communication bus 1002 is used to realize the connection and communication between the components.
[0148] The user interface 1003 can include a display screen (Display), a camera (Camera), and optionally a standard wired interface, a wireless interface.
[0149] The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface).
[0150] The processor 1001 can include one or more processing cores. The processor 1001 connects various parts within the entire electronic device 1000 through various interfaces and lines, and performs various functions of the electronic device 1000 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Alternatively, the processor 1001 can be implemented in at least one of a hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), a programmable logic array (PLA). The processor 1001 can integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes an operating system, a user interface, and an application program; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 1001, but can be realized by a separate chip.
[0151] The memory 1005 can include a random access memory (RAM) and can also include a read-only memory (ROM). Alternatively, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1005 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area can store data involved in the above-mentioned various method embodiments, etc. The memory 1005 can alternatively be at least one storage system located away from the aforementioned processor 1001. As shown in the figure, the memory 1005 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a service adaptation application based on skill dependency graph and QoS perception. Figure 8 As shown in the figure, the memory 1005 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a service adaptation application based on skill dependency graph and QoS perception.
[0152] In Figure 8In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an interface for user input and obtain user input data; and the processor 1001 can be used to call the service adaptation application based on the skill dependency graph and QoS awareness stored in the memory 1005, and specifically perform the following operations:
[0153] In response to the task execution request sent by the client, a plurality of candidate atomic microservices are retrieved according to the task requirement information carried by the task execution request and the preset skill dependency graph. The preset skill dependency graph is composed of a plurality of nodes and edges between the nodes. Each node corresponds to an atomic microservice of each basic skill of the robot, and the edge is used to represent the dependency relationship between the atomic microservices.
[0154] Under the resource constraint of the preset multi-objective optimization model, an optimal service combination scheme is determined from the plurality of candidate atomic microservices.
[0155] The atomic microservices in the optimal service combination scheme are containerized and deployed for service to obtain a deployed microservice instance for task execution.
[0156] During the execution process, when it is detected that there is service performance degradation or resource bottleneck according to the real-time sensed QoS indicators and resource information, the optimal service combination scheme is optimized and the step of containerized deployment is continued.
[0157] In one embodiment, the processor 1001 specifically performs the following operations when generating the preset skill dependency graph:
[0158] Each basic skill of the robot is encapsulated as an atomic microservice.
[0159] A standardized interface for providing skill invocation capability is set for each encapsulated atomic microservice to obtain a plurality of target atomic microservices.
[0160] The skill function semantics, input / output parameters, pre / post conditions and QoS metadata of each basic skill are obtained to obtain a skill description file corresponding to each target atomic microservice.
[0161] Each target atomic microservice is taken as a node of the graph, and the skill description file corresponding to each target atomic microservice is stored in the node corresponding to each target atomic microservice.
[0162] Based on the skill description file, edges between the nodes are created to obtain a directed acyclic skill dependency graph. The edges are used to represent the dependency relationship between the atomic microservices, including data dependency, control dependency and semantic dependency.
[0163] The directed acyclic skill dependency graph is taken as the preset skill dependency graph.
[0164] In one embodiment, the processor 1001, in creating edges between nodes according to the skill description file, specifically performs the following operations when creating a directed acyclic skill dependency graph:
[0165] Determine the first atomic microservice that has semantic dependency with each target atomic microservice through the skill function semantics contained in the skill description file;
[0166] Determine the second atomic microservice that has data dependency with each target atomic microservice through the input / output parameters contained in the skill description file;
[0167] Determine the third atomic microservice that has control dependency with each target atomic microservice through the pre / post conditions contained in the skill description file;
[0168] Establish a directed edge between the node of each target atomic microservice and the node of the first atomic microservice, the node of the second atomic microservice, and the node of the third atomic microservice.
[0169] In one embodiment, the processor 1001, in retrieving a plurality of alternative atomic microservices according to the task requirement information carried by the task execution request and the preset skill dependency graph, specifically performs the following operations:
[0170] Parse the task requirement information carried by the task execution request to obtain the specific target and requirements of the task;
[0171] Divide the task sequence that meets the robot's execution according to the time sequence from the specific target and requirements of the task;
[0172] Obtain the skill description file stored in each node from the preset skill dependency graph;
[0173] According to the subtask description information of each subtask in the subtask sequence and the skill description file, retrieve the target node of each subtask;
[0174] Iterate through the atomic microservice corresponding to the target node of each subtask to obtain a plurality of alternative atomic microservices.
[0175] In one embodiment, the processor 1001, in retrieving the target node of each subtask according to the subtask description information of each subtask in the subtask sequence and the skill description file, specifically performs the following operations:
[0176] Iterate through the first subtask in each subtask;
[0177] Iterate through the first node in the preset skill dependency graph;
[0178] determine whether the skill function semantics of the first node are consistent with the function requirement of the first subtask;
[0179] determine whether the input / output parameters of the first node are consistent with the input / output requirement of the first subtask;
[0180] determine whether the pre / post conditions of the first node are consistent with the condition requirement of the first subtask;
[0181] if all the above are yes, the first node is taken as the target node of the first subtask; or if one of the above is no, the step of traversing the first node in the preset skill dependency graph is re-executed until the target node of the first subtask is determined;
[0182] the step of traversing the first subtask in each subtask is continuously executed until each subtask is traversed, and the target node of each subtask is obtained.
[0183] In one embodiment, the processor 1001, when performing the determination of the optimal service combination scheme from multiple candidate atomic microservices under the resource constraint of the preset multi-objective optimization model, specifically performs the following operations:
[0184] from the preset skill dependency graph, obtain backup QoS metadata of each candidate atomic microservice, the backup QoS metadata including execution duration, reliability parameter, and resource consumption parameter;
[0185] according to the task requirement information, perform service combination on the multiple candidate atomic microservices to obtain multiple candidate service combination schemes;
[0186] use the backup QoS metadata of each candidate atomic microservice to calculate the total execution time, overall reliability, and total resource consumption of each candidate service combination scheme;
[0187] determine, through a multi-objective optimization algorithm, the candidate service combination scheme that meets the minimization of total execution time, maximization of overall reliability, and minimization of total resource consumption as the optimal service combination scheme, by combining the total execution time, overall reliability, and total resource consumption of each candidate service combination scheme.
[0188] In one embodiment, the processor 1001, when performing the detection of whether there is service performance degradation or resource bottleneck according to the real-time sensed QoS indicators and resource information, specifically performs the following operations:
[0189] real-time collect QoS indicators and resource information of each microservice instance, the QoS indicators including response time and success rate, and the resource information including CPU usage and memory usage;
[0190] compare the response time and success rate of each microservice instance with the preset QoS threshold;
[0191] In the case where the comparison result shows that the response time exceeds the preset QoS threshold or the success rate is lower than the preset QoS threshold, it is determined that there is service performance degradation;
[0192] compare the CPU usage, memory usage and network bandwidth of each microservice instance with the preset resource threshold;
[0193] In the case where the comparison result shows that the CPU usage exceeds the preset resource threshold or the memory usage exceeds the preset resource threshold or the network bandwidth is lower than the preset resource threshold, it is determined that there is a resource bottleneck.
[0194] In one embodiment, the processor 1001 specifically performs the following operations when executing the optimized optimal service combination scheme:
[0195] locate the abnormal atomic microservice that has service performance degradation or a resource bottleneck;
[0196] determine the abnormal subtask corresponding to the abnormal atomic microservice; the abnormal subtask is determined from a subtask sequence that satisfies the robot to execute in time sequence, and the subtask sequence is divided according to the specific goal and requirement of the task of the task demand information;
[0197] According to the task description information of the abnormal subtask, traverse the final node that meets the abnormal subtask from the preset skill dependency graph except the node corresponding to the abnormal atomic microservice;
[0198] replace the abnormal atomic microservice in the optimal service combination scheme with the atomic microservice corresponding to the final node to obtain a rearranged service combination scheme;
[0199] verify the rearranged service combination scheme to obtain an optimized optimal service combination scheme.
[0200] In one embodiment, the processor 1001 specifically performs the following operations when executing the verification of the rearranged service combination scheme to obtain the optimized optimal service combination scheme:
[0201] determine whether the rearranged service combination scheme meets the resource constraint of the preset multi-objective optimization model;
[0202] If yes, the rearranged service combination scheme is taken as the optimized optimal service combination scheme;
[0203] If no, continue to execute the step of traversing the final node that meets the abnormal subtask from the preset skill dependency graph except the node corresponding to the abnormal atomic microservice until the rearranged service combination scheme meets the resource constraint of the preset multi-objective optimization model.
[0204] In the embodiments of the present application, on the one hand, by introducing a preset skill dependency graph, the basic skills of the robot are encapsulated as atomic microservices, and the available alternative atomic microservices are dynamically retrieved according to the task demand information and the skill dependency graph. During the task execution process, the service combination scheme is dynamically optimized according to the real-time perceived QoS indicators and resource information. This dynamic adjustment mechanism enables the robot to flexibly adjust the service combination mode according to the changes in the runtime environment, thereby better adapting to the task demand and environmental changes and improving the adaptability of the system. On the other hand, by real-time perception of QoS indicators and resource information, the service performance degradation or resource bottleneck is dynamically detected during the task execution process. After detecting the abnormality, the service combination scheme is optimized and containerized deployment is performed again to ensure efficient execution of the task, thereby improving the execution efficiency of the task.
[0205] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The program based on the skill dependency graph and QoS perception service adaptation can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. The storage medium of the program based on the skill dependency graph and QoS perception service adaptation can be a disk, an optical disk, a read-only memory, a random access memory, etc.
[0206] The above only discloses the preferred embodiments of the present application, and of course cannot limit the scope of the rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope of the present application.
Claims
1. A service adaptation method based on skill dependency graph and QoS awareness, characterized in that, The method is applied to a robot and comprises the following steps: In response to a task execution request sent by a client, a plurality of candidate atomic microservices are retrieved according to task requirement information carried by the task execution request and a preset skill dependency graph; the preset skill dependency graph is composed of a plurality of nodes and edges between the nodes, each node is an atomic microservice corresponding to each basic skill of the robot, and the edges are used to represent dependency relationships between the atomic microservices; An optimal service combination scheme is determined from the plurality of candidate atomic microservices under resource constraints of a preset multi-objective optimization model; The atomic microservices in the optimal service combination scheme are containerized and deployed to obtain a deployed microservice instance for task execution; During execution, when it is detected according to real-time sensing of QoS indicators and resource information that there is service performance degradation or a resource bottleneck, the optimal service combination scheme is optimized and the containerized deployment step is continued; Each basic skill of the robot is encapsulated as an atomic microservice, a standardized interface is set for each encapsulated atomic microservice to provide skill calling capability, a plurality of target atomic microservices are obtained, skill function semantics, input / output parameters, pre / post conditions and QoS metadata of each basic skill are obtained to obtain a skill description file corresponding to each target atomic microservice, each target atomic microservice is taken as a node of a graph, and the skill description file corresponding to each target atomic microservice is stored in the node corresponding to each target atomic microservice, edges between the nodes are created based on the skill description file to obtain a directed acyclic skill dependency graph, the edges are used to represent dependency relationships between the atomic microservices including data dependency, control dependency and semantic dependency, and the directed acyclic skill dependency graph is taken as a preset skill dependency graph.
2. The method of claim 1, wherein, The edges between the nodes are created based on the skill description file to obtain a directed acyclic skill dependency graph, and the method comprises the following steps: First atomic microservices having semantic dependency with each target atomic microservice are determined through skill function semantics contained in the skill description file; Second atomic microservices having data dependency with each target atomic microservice are determined through input / output parameters contained in the skill description file; Third atomic microservices having control dependency with each target atomic microservice are determined through pre / post conditions contained in the skill description file; Directed edges are established between the node of each target atomic microservice and the nodes of the first, second and third atomic microservices.
3. The method of claim 1, wherein, The preset skill dependency graph stores the skill description file corresponding to the atomic microservice in each node; The task requirement information carried by the task execution request is analyzed to obtain specific objectives and requirements of the task. Dividing a sub-task sequence meeting a robot performing according to time sequence from specific targets and requirements of the task; Obtaining a skill description file stored in each node from the preset skill dependency graph; Retrieving a target node of each sub-task according to sub-task description information of each sub-task in the sub-task sequence and the skill description file; Obtaining a plurality of alternative atomic microservices available by traversing atomic microservices corresponding to the target node of each sub-task.
4. The method of claim 3, wherein, The skill description file includes skill function semantics, input / output parameters, pre / post conditions; and the sub-task description information of each sub-task includes function requirements, input / output requirements and condition requirements; The retrieving of the target node of each sub-task according to the sub-task description information of each sub-task in the sub-task sequence and the skill description file includes: Traversing a first sub-task in each sub-task; Traversing a first node in the preset skill dependency graph; Determining whether the skill function semantics of the first node is consistent with the function requirements of the first sub-task; Determining whether the input / output parameters of the first node are consistent with the input / output requirements of the first sub-task; Determining whether the pre / post conditions of the first node are consistent with the condition requirements of the first sub-task; In the case that all the above are yes, the first node is taken as the target node of the first sub-task; or in the case that one of the above is no, the step of traversing the first node in the preset skill dependency graph is re-executed until the target node of the first sub-task is determined; Continuing to execute the step of traversing the first sub-task in each sub-task until the target node of each sub-task is obtained in the case that the traversal of each sub-task ends.
5. The method of claim 1, wherein, The skill description file corresponding to the atomic microservice is stored in each node in the preset skill dependency graph, and the skill description file includes QoS metadata; and the resource constraint is minimizing total execution time, maximizing overall reliability and minimizing total resource consumption; The determining of the optimal service combination scheme from the plurality of alternative atomic microservices under the resource constraint of the preset multi-objective optimization model includes: Obtaining backup QoS metadata of each alternative atomic microservice from the preset skill dependency graph, the backup QoS metadata including execution time, reliability parameters and resource consumption parameters; Combining the plurality of alternative atomic microservices to obtain a plurality of candidate service combination schemes according to the task requirement information; Calculating total execution time, overall reliability and total resource consumption of each candidate service combination scheme by using the backup QoS metadata of each alternative atomic microservice; Determining a candidate service combination scheme meeting the minimizing total execution time, maximizing overall reliability and minimizing total resource consumption as the optimal service combination scheme by a multi-objective optimization algorithm in combination with the total execution time, overall reliability and total resource consumption of each candidate service combination scheme.
6. The method of claim 1, wherein, According to the real-time perceived QoS indicators and resource information, it is detected whether there is service performance degradation or resource bottleneck, including: Real-time collection of QoS indicators and resource information of each microservice instance, the QoS indicators including response time, success rate, and the resource information including CPU usage, memory usage, and network bandwidth; Comparison of the response time and success rate of each microservice instance with the preset QoS threshold; In the case where the comparison result shows that the response time exceeds the preset QoS threshold or the success rate is lower than the preset QoS threshold, it is determined that there is service performance degradation; Comparison of the CPU usage, memory usage, and network bandwidth of each microservice instance with the preset resource threshold; In the case where the comparison result shows that the CPU usage exceeds the preset resource threshold or the memory usage exceeds the preset resource threshold or the network bandwidth is lower than the preset resource threshold, it is determined that there is resource bottleneck.
7. The method of claim 1, wherein, The optimization of the optimal service combination scheme includes: Locating an abnormal atomic microservice with service performance degradation or resource bottleneck; Determining an abnormal subtask corresponding to the abnormal atomic microservice; the abnormal subtask is determined from a subtask sequence that the robot executes in time sequence, and the subtask sequence is divided according to the specific target and requirement of the task in the task demand information; According to the task description information of the abnormal subtask, the final node that meets the abnormal subtask except the node corresponding to the abnormal atomic microservice is traversed from the preset skill dependency graph; Using the atomic microservice corresponding to the final node to replace the abnormal atomic microservice in the optimal service combination scheme to obtain a rearranged service combination scheme; Verifying the rearranged service combination scheme to obtain an optimized optimal service combination scheme.
8. The method of claim 7, wherein, The verification of the rearranged service combination scheme to obtain an optimized optimal service combination scheme includes: Judging whether the rearranged service combination scheme meets the resource constraints of the preset multi-objective optimization model; If yes, the rearranged service combination scheme is taken as the optimized optimal service combination scheme; If no, the step of traversing the final node that meets the abnormal subtask except the node corresponding to the abnormal atomic microservice is continuously executed until the rearranged service combination scheme meets the resource constraints of the preset multi-objective optimization model.
9. A service adaptation device based on skill dependency graph and QoS awareness, implemented using the method of any one of claims 1-8, characterized in that, The device includes: An atomic microservice retrieval module for retrieving a plurality of candidate atomic microservices according to the task demand information carried by the task execution request sent by the client and the preset skill dependency graph in response to the task execution request; the preset skill dependency graph is composed of a plurality of nodes and edges between the nodes, each node is an atomic microservice corresponding to each basic skill of the robot, and the edge is used to represent the dependency relationship between the atomic microservices; An optimal service combination scheme determination module for determining an optimal service combination scheme from the plurality of candidate atomic microservices under the resource constraints of the preset multi-objective optimization model; A containerization deployment module is configured to containerize and deploy each atomic microservice in the optimal service combination scheme to obtain a deployed microservice instance for task execution. A service combination optimization module is configured to optimize the optimal service combination scheme and continue the containerization deployment step when detecting, according to real-time sensed QoS indicators and resource information, that there is service performance degradation or resource bottleneck during execution.
Citation Information
Patent Citations
Service evaluation and selection method based on environment real-time perceiving
CN105119751A
Robot behavior scheduling method and device combined with modular skills and medium
CN119260747A
Task processing method, task platform, computing device and computer readable storage medium
CN120297322A