Service fault tolerance method and system based on context awareness
By collecting and analyzing the context and historical data of the edge computing environment in real time, and dynamically adjusting resource allocation and priorities, it solves the problem that traditional methods are difficult to adapt to variable edge computing environments, and achieves efficient resource management and service reliability.
Patent Information
- Application Number
- CN202510386257.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-03-31
AI Technical Summary
In a changing edge computing environment, traditional resource allocation methods are difficult to effectively manage limited resources, ensure the continuous operation of high-priority services, and make effective fault tolerance and service dependency adjustments when resources are tight.
By collecting context and historical data in real time, dynamically calculate service priorities, and dynamically adjust resource allocation based on priority and resource requirements. At the same time, fault tolerance mechanisms are designed to ensure that critical services are given priority in the event of resource shortage or failure.
It improves the resource allocation efficiency and task execution efficiency of the MEC system, enhances the system's adaptability and reliability, and avoids system crashes or critical service stagnation.
Smart Images

Figure CN119902899A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of service fault tolerance and resource allocation, and in particular to a context-aware service fault tolerance method and system. Background Art
[0002] With the rapid development of emerging technologies such as the Internet of Things (IoT), 5G, edge computing, and cloud computing, modern services and applications are facing increasingly complex and dynamic resource requirements. Especially in distributed environments, such as edge computing (MEC) platforms, resources are limited and easily affected by different factors, including network fluctuations, hardware failures, load changes, etc. Therefore, how to effectively manage resources to ensure the continuous operation of high-priority services, while performing effective fault tolerance and service dependency adjustments when resources are tight, has become a challenge that needs to be solved urgently. In a complex environment with multiple services and multiple tasks, resource allocation is not just a simple scheduling problem, but also involves multiple aspects such as the dynamic calculation of task priorities, the reasonable management of priority relationships between services, and the design of fault-tolerant mechanisms. These factors are intertwined, making it difficult for traditional resource allocation methods to adapt to the changing needs of modern edge computing systems.
[0003] At the same time, with the popularity of edge computing, many key applications need to deploy services on edge servers to reduce latency and improve response speed. However, the resources of these edge servers (such as CPU, memory, bandwidth, etc.) are usually limited, so how to reasonably allocate and schedule these resources to meet service needs, especially in dynamically changing network environments and high-concurrency task requests, becomes particularly important.
[0004] CN109783257A, entitled: Selection replacement method and system for passive fault tolerance of batch Web services, the method includes: obtaining a Web service running instance that fails during the operation of the Web service system, and preliminarily selecting a set of spare Web service resources that meet the functional requirements of the faulty service running instance; constructing a service instance fault tolerance request vector, a service resource capability support vector, and a service batch fault tolerance selection matrix according to the running instance and the spare resources, and generating a Web service batch fault tolerance decision target; generating a batch replacement preferred solution that meets the fault tolerance constraint conditions based on a batch optimization selection method based on an improved genetic algorithm according to the fault tolerance decision target and the fault tolerance request of the running instance; replacing multiple faulty service running instances and spare service resources according to the preferred solution. This method can be used for passive fault tolerance when batch Web services fail, so as to achieve effective control of the reliability of the Web service system and improve the system service quality. However, this method lacks the ability to perceive environmental changes in real time and dynamically adjust. It mainly relies on pre-built process communities and static checkpoint and message log strategies, which makes it difficult to flexibly respond to resource fluctuations and dynamic changes in service dependencies in a low-reliability mobile edge computing environment. As a result, it may not be able to most effectively guarantee service stability and task execution efficiency when resources are tight or service demand changes.
[0005] CN109074550A, entitled: Context-aware scheduling exceptions, includes: In some configurations, when a scheduling conflict is detected, the technology can use context data from multiple resources to determine whether a scheduling exception can be made. The context data can include preferences that define standards and / or goals, such as preferences of service providers or customers. The technology disclosed herein prioritizes customers based on context data and provides different scheduling options for customers and other entities based on the priorities associated with each customer. When there is a conflict between two or more calendar events, scheduling exceptions can be made for some customers and scheduling conflicts can be made for other customers, depending on one or more priorities associated with the customers. This method can prioritize and determine the order of execution using the context data of multiple resources, but does not take into account the impact of historical data on priorities and the impact of whether resources are sufficient or not in a dynamic environment, resulting in insufficient basis for prioritizing its tasks and being unable to cope with the problems brought about by a complex and changing dynamic environment. Summary of the invention
[0006] In view of the above problems, the present invention proposes a context-aware service fault tolerance method and system, which can collect context data in real time and combine historical data in a changing system environment to calculate the priority of the service and dynamically adjust resource allocation according to the priority and resource requirements. At the same time, by designing a fault tolerance mechanism, it is ensured that when resources are tight or failures occur, key services can be given priority to avoid system crashes or stagnation of key services.
[0007] A technical solution of the present invention is: A context-aware service fault tolerance method, the method comprising: Collect contextual data of the MEC system environment and historical data related to the user's service history performance; Based on the collected context data and the historical data, an initial context data weight and an initial historical data weight are calculated by a context data weight function and a historical data analysis function; Calculate the user service priority based on the initial context data weight and the initial historical data weight, and generate a user service priority list; Construct a resource allocation constraint model to dynamically adjust the state of user service operation within the total amount of MEC system resources according to the user service priority; For high-priority services, formulate redundant backup strategies and configure primary and backup instances for key services to prevent single point failures; By monitoring the changes in contextual data and historical data in real time, the weights of the context-aware function are dynamically adjusted and updated; The MEC system is composed of edge servers, routers, switches, gateway devices, and user devices connected under mobile edge computing; The context data refers to CPU usage, network latency, and current request volume; The historical data refers to the number of requests for task completion, the total number of requests, the number of tasks completed, and the amount of resources consumed.
[0008] Further, the initial context data weight and the initial historical data weight are calculated based on the collected context data and the historical data through a context data weight function and a historical data analysis function, including: Performing a preprocessing operation on the context data and the historical data; Acquire historical success rate and historical resource efficiency based on the preprocessed historical data; The initial context data weight and the initial historical data weight are calculated by the context data weight function and the historical data analysis function.
[0009] Furthermore, the calculation formula of the historical success rate is: ; in, User Services The historical success rate User Services The number of requests completed by the task, User Services Total number of requests; The calculation formula of the historical resource efficiency is: ; in, User Services Historical resource efficiency, User Services The number of completed tasks, User Services resource consumption.
[0010] Furthermore, the initial context data weight and the initial historical data weight are calculated by the context data weight function and the historical data analysis function, including: Define a context data weight function, and calculate an initial context data weight based on the context data by using the context data weight function; A historical data analysis function is defined, and initial historical data weights are calculated based on the historical data using the historical data analysis function.
[0011] Furthermore, the calculation formula of the initial context data weight is: ; ; in, refers to the initial context data weight, Refers to the context data set used to calculate the context data weight, refers to the contextual data weight function, It means the moment CPU usage, It means the moment network latency, It means the moment The current request volume, , and They refer to the weight coefficients of adjusting the importance of CPU usage, network latency, and the current request volume on the priority; The calculation formula of the initial historical data weight is: ; ; in, refers to the initial historical data weight, Refers to the historical data set used to calculate the historical data weight. Refers to the historical data analysis function, User Services The historical success rate, that is, the proportion of successfully completed tasks to the total number of tasks, User Services The historical resource efficiency of the service, i.e., the resource usage of the service in completing tasks, and They refer to the weight coefficients of historical success rate and historical resource efficiency respectively.
[0012] Further, the calculating the user service priority based on the initial context data weight and the initial historical data weight and generating the user service priority list includes: Designing a context-aware function based on the initial context data weight and the initial historical data weight; The context data and the historical data are calculated through the context perception function to obtain the user service priority; Generate a user service priority list sorted by priority based on the calculation results; The user services are prioritized according to the user service priority list.
[0013] Furthermore, the context-aware function is expressed as follows: ; in, User Services At the moment The priority of It refers to the initial context data weight, which reflects the impact of the current environment on the user service priority; Refers to the initial historical data weight, reflecting the importance of the long-term performance of user services. and It refers to the influence coefficient of context data and historical data, controlling their weights; The user service priority list is expressed as follows: ; in, Refers to the user service priority list, It refers to User service at the time Priority; Priority classification refers to sorting the top Divided into high priority services, Divided into medium priority services, the rest Classified as low priority services; The high-priority service refers to a critical user service that must be continuously operated; The medium priority service refers to the user service that can be suspended last when resources are tight; The low-priority service refers to a user service that can be suspended when resources are scarce.
[0014] Furthermore, the resource allocation constraint model is constructed to dynamically adjust the state of user service operation within the range of the total amount of MEC system resources according to the user service priority, including: A resource allocation constraint model is constructed based on the total amount of MEC system resources and the user service priority; According to the resource allocation constraint model, the priority status of the running status of the user service is adjusted.
[0015] Furthermore, the resource allocation constraint model is expressed as follows: ; in, User Services The priority of User Services The resources needed, It means that the MEC system is Total resources available; The priority state adjustment means that if the MEC system is in a resource-constrained state, the low-priority services in the user service priority list are suspended to release resources; if the resources are still in a tight state, the medium-priority services in the user service priority list are further suspended; otherwise, if the MEC system is in a resource recovery state, the low-priority services and medium-priority services that were previously suspended due to resource shortages are gradually restored according to the user service priority list; The resource shortage state is expressed as: ; in, It means that the MEC system is Total resources available, It refers to the minimum threshold of resources, indicating that the MEC system is in a state of resource shortage and is insufficient to continue to maintain current user services; The resource recovery status is expressed as: ; in, It means that the MEC system is Total resources available, It refers to the preset recovery threshold. When the available resources of the MEC system are greater than this threshold, the MEC system will determine that the resources have returned to normal levels and can reallocate and resume previously suspended services.
[0016] Furthermore, the weight of the context-aware function is dynamically adjusted and updated by real-time monitoring of changes in context data and historical data, including: Make weight update judgments based on feedback after service execution, and implement the first update of context data weights and historical data weights based on the judgment results; According to the minimum threshold and recovery threshold of MEC system resources, the context data weight and the historical data weight are updated again; The updated context data weights and the historical data weights are used to replace the corresponding weights in the context perception function to update the weights, so that the MEC system can make the best decision based on the current resource status and task requirements, thereby improving the efficiency of resource allocation and the responsiveness of the MEC system.
[0017] Furthermore, the feedback includes feedback on the execution result of the current service, feedback on resource consumption, feedback on real-time network status, and feedback on changes in request volume; The execution result feedback of the current service refers to the success or failure of the task and the execution time of the task; The resource consumption feedback refers to the consumption of CPU, memory, and bandwidth resources; The real-time network status feedback refers to the network delay and packet loss rate; The request amount change feedback refers to the change in the request amount; The weight update judgment is specifically that if the increment of any one of the resource consumption feedback, the real-time network status feedback, and the request volume change feedback exceeds 20%, then the context data weight is increased so that the priority calculation relies more on the current state; otherwise, the historical data weight is increased; The update formula for the first update is: ; ; in, is the number of update iterations, refers to the weight of the context data after the first update, refers to the weight of the context data before the first update, is the adjustment factor, refers to the impact change of contextual data, Refers to the weight of the historical data after the first update, Refers to the weight of the historical data before the first update, It refers to the impact changes of historical data; The minimum threshold of the MEC system resources is expressed as: ; The recovery threshold of the MEC system resources is expressed as: ; The re-updating means that when the MEC system resources are lower than the set minimum threshold, the context data weight is increased, so that the MEC system is more inclined to rely on the current resource status to adjust the user service priority. Otherwise, if the MEC system resources are in sufficient state, the historical data weight is increased, so that the MEC system relies more on past experience.
[0018] Furthermore, the expression for increasing the weight of the context data is: ; in, refers to the context data weight after being updated again, refers to the weight of the context data after the first update, is the number of update iterations, is the amount of weight adjustment, It means that the MEC system is Total resources available, It refers to the minimum threshold of resources; The expression for increasing the weight of the historical data is: ; in, Refers to the weight of the historical data after being updated again, Refers to the weight of the historical data after the first update, is the number of update iterations, is the amount of weight adjustment, It means that the MEC system is Total resources available, Refers to the preset recovery threshold.
[0019] Based on the above-mentioned context-aware service fault tolerance method, the present invention also provides a context-aware service fault tolerance system, the system comprising: A data processing module, used for collecting context data and historical data, and performing preprocessing operations on the context data and historical data to obtain data after the preprocessing operations; A calculation module, configured to calculate the initial context data weight, the initial historical data weight and the user service priority based on the context data weight function, the historical data analysis function and the context perception function, and generate a user service priority list by using the data in the data processing module; A resource adjustment module, which is used to dynamically adjust the service operation status based on the resource allocation constraint model, according to the resource situation of the current MEC system and the user service priority list in the computing module; The weight updating module is used to update the context data weight and the historical data weight based on the initial context data weight in the calculation module, the initial historical data weight and the adjustment result of the resource adjustment module, and use the updated context data weight and the historical data weight to replace the corresponding weight in the context perception function to achieve weight update, so that the MEC system can make the best decision according to the current resource status and task requirements.
[0020] The present invention provides a context-aware service fault tolerance method and system, which collects context information in real time, combines historical data, dynamically calculates the priority of services, and dynamically adjusts resource allocation according to the priority and resource requirements. At the same time, by designing a fault tolerance mechanism, it ensures that when resources are tight or a fault occurs, key services can be given priority to avoid system crashes or stagnation of key services.
[0021] The above invention content is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Various other advantages and benefits will become apparent to those skilled in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0023] Figure 1 A specific flow chart of a context-aware service fault tolerance method provided by an embodiment of the present invention is shown.
[0024] Figure 2 A block diagram of a service fault tolerance system based on context awareness provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0025] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0026] With the popularity of edge computing, many key applications need to deploy services on edge servers to reduce latency and improve response speed. However, the resources of these edge servers are usually limited. Modern services and applications face increasingly complex and dynamic resource requirements. At the same time, resource allocation is not just a simple scheduling problem, but also involves dynamic calculation of task priorities, reasonable management of dependencies between services, design of fault-tolerant mechanisms, and many other aspects. These factors are intertwined, making it difficult for traditional resource allocation methods to adapt to the changing needs of modern edge computing systems. Therefore, how to effectively manage these resources, ensure the continuous operation of high-priority services, and perform effective fault tolerance and service dependency adjustments when resources are tight has become an urgent problem to be solved.
[0027] Based on the above problems, the technical solution of the present invention collects context information in real time, combines historical data, dynamically calculates the priority of services, and dynamically adjusts resource allocation according to the priority and resource requirements. At the same time, by designing a fault-tolerant mechanism, it ensures that when resources are tight or failures occur, key services can be given priority to avoid system crashes or stagnation of key services.
[0028] The specific implementation includes the following:
[0029] Embodiment 1: refer to Figure 1 , this embodiment provides a context-aware service fault tolerance method, the method comprising: Step S1: Collect context data of the MEC system environment and historical data related to user service history performance; Step S2: Based on the collected context data and historical data, initial context data weight and initial historical data weight are calculated by using a context data weight function and a historical data analysis function; Step S3: Calculate the user service priority based on the initial context data weight and the initial history data weight, and generate a user service priority list; Step S4: construct a resource allocation constraint model to dynamically adjust the state of user service operation within the range of the total amount of MEC system resources according to the user service priority; Step S5: For high-priority services, formulate a redundant backup strategy and configure primary and backup instances for key services to prevent single point failures; Step S6: By monitoring the changes of context data and historical data in real time, the weight of the context perception function is dynamically adjusted and updated.
[0030] In step S1, the MEC system is composed of edge servers, routers, switches, gateway devices, and user devices connected under mobile edge computing; the context data refers to CPU usage, network latency, and current request volume; the historical data refers to the number of requests for task completion, the total number of requests, the number of task completions, and resource consumption.
[0031] In the specific implementation, it is necessary to collect the context data of the MEC system environment in real time through sensors and network monitoring tools, and at the same time retrieve and collect historical data related to the historical performance of user services for the calculation of the required data later. The context data reflects the state of the current environment. The system can adjust resource allocation in a timely and dynamic manner according to the current state of the environment to ensure that high-priority services are guaranteed and reduce resource consumption of low-priority and medium-priority services, thereby improving the system response speed and resource utilization efficiency. Historical data reflects the long-term performance of services. The system can predict future service needs and resource usage through historical behavior to avoid relying on overly short-term context data information.
[0032] In step S2, the initial context data weight and the initial historical data weight are calculated based on the collected context data and the historical data through a context data weight function and a historical data analysis function, including: performing preprocessing operations on the context data and the historical data; obtaining the historical success rate and the historical resource efficiency based on the preprocessed historical data; and calculating the initial context data weight and the initial historical data weight through a context data weight function and a historical data analysis function.
[0033] Specifically, the preprocessing operation refers to removing abnormal data and normalizing it to make the data more reliable and easier to analyze.
[0034] The historical success rate and historical resource efficiency are obtained based on the preprocessed historical data, and the calculation formula is: ; ; in, User Services The historical success rate User Services The number of requests completed by the task, User Services The total number of requests, User Services Historical resource efficiency, User Services The number of completed tasks, User Services resource consumption.
[0035] In this step, the initial context data weight and the initial historical data weight are calculated by the context data weight function and the historical data analysis function, including: defining a context data weight function, and calculating the initial context data weight by the context data weight function based on the context data; defining a historical data analysis function, and calculating the initial historical data weight by the historical data analysis function based on the historical data.
[0036] Define the context data weight function and get the initial context data weight, which provides a basis for subsequent priority calculation. By flexibly adjusting the weight coefficient, the system can dynamically adjust the service priority according to the current system status. When the load is high, the system can give priority to low-latency services or reduce resource consumption of services with large request volumes.
[0037] Defining historical data analysis functions and calculating historical data weights enables the system to optimize resource allocation based on the long-term performance of services rather than relying solely on instantaneous environmental changes, thereby enhancing the stability of the system.
[0038] The calculation formula of the initial context data weight is: ; ; in, refers to the initial context data weight, Refers to the context data set used to calculate the context data weight, refers to the contextual data weight function, It means the moment CPU usage, It means the moment network latency, It means the moment The current request volume, , and They are weight coefficients for adjusting the importance of CPU usage, network latency, and the current request volume on priority.
[0039] Among them, the calculation formula for the initial historical data weight is: ; ; in, refers to the initial historical data weight, Refers to the historical data set used to calculate the historical data weight. Refers to the historical data analysis function, User Services The historical success rate, that is, the proportion of successfully completed tasks to the total number of tasks, User Services The task completion rate, that is, the resource usage of the service when completing tasks, and They refer to the weight coefficients of historical success rate and historical resource efficiency respectively.
[0040] In step S3, the user service priority is calculated based on the initial context data weight and the initial historical data weight, and a user service priority list is generated, including: designing a context-aware function based on the initial context data weight and the initial historical data weight; calculating the user service priority by passing the context data and the historical data through the context-aware function; generating a user service priority list sorted by priority based on the calculation results; and prioritizing user services based on the user service priority list.
[0041] Specifically, by combining context data and historical data through context-aware functions, the system can comprehensively consider the current environment and historical performance, dynamically adjust service priorities, and optimize resource allocation; the generation of a service priority list allows the system to clearly understand which services need to be run first and which can be delayed or paused, thereby improving the overall performance and response speed of the system.
[0042] In the above steps, the context-aware function is expressed as: ; in, User Services At the moment The priority of It refers to the initial context data weight, which reflects the impact of the current environment on the user service priority; Refers to the initial historical data weight, reflecting the importance of the long-term performance of user services. and It refers to the influence coefficient of context data and historical data, and controls their weight.
[0043] The user service priority list is expressed as follows: ; in, Refers to the user service priority list, It refers to User service at the time Priority; Priority classification refers to sorting the top Divided into high priority services, Divided into medium priority services, the rest Classified as low priority service.
[0044] Specifically, the is 20%, is 35%, It is 45%.
[0045] The high-priority service refers to a critical user service that must run continuously.
[0046] The medium priority service refers to the user service that can be suspended last when resources are tight.
[0047] The low-priority service refers to a user service that can be suspended when resources are scarce.
[0048] In step S4, the resource allocation constraint model is constructed to dynamically adjust the operating status of the user service within the range of the total amount of MEC system resources according to the user service priority, including: constructing a resource allocation constraint model in combination with the total amount of MEC system resources and the user service priority; and adjusting the priority state of the operating status of the user service according to the resource allocation constraint model.
[0049] In the above steps, the resource allocation constraint model is expressed as: ; in, User Services The priority of User Services The resources needed, It means that the MEC system is Total resources available.
[0050] The priority state adjustment means that if the MEC system is in a resource-constrained state, the low-priority services in the user service priority list are suspended to release resources; if the resources are still in a tight state, the medium-priority services in the user service priority list are further suspended; otherwise, if the MEC system is in a resource recovery state, the low-priority services and medium-priority services that were previously suspended due to resource constraints are gradually restored according to the user service priority list to which they belong.
[0051] The resource shortage state is expressed as: ; in, It means that the MEC system is Total resources available, It refers to the minimum threshold of resources, indicating that the MEC system is in a state of resource shortage and is insufficient to continue to maintain current user services.
[0052] The resource recovery status is expressed as: ; in, It means that the MEC system is Total resources available, It refers to the preset recovery threshold. When the available resources of the MEC system are greater than this threshold, the MEC system will determine that the resources have returned to normal levels and can reallocate and resume previously suspended services.
[0053] In step S5, a redundant backup strategy is formulated for high-priority services, and primary and backup instances are configured for key services to prevent single point failures, including instance redundancy and data redundancy.
[0054] Specifically, the redundant backup strategy is divided into instance redundancy and data redundancy. Data redundancy refers to creating multiple copies of important data and storing them in different physical or logical locations. Instance redundancy refers to using a master-slave structure mode to run multiple instances for high-priority services.
[0055] Furthermore, the master-slave structure mode is specifically that, for the running high-priority service, a master instance is generated to handle all requests, a backup instance is in standby state, and multiple instances run simultaneously and share the workload. The heartbeat mechanism is used to identify instance failures. If If the heartbeat signal is not received for the first time, the instance is considered to be faulty. At this time, the backup instance takes over the tasks of the primary instance, rebalances the task distribution, and other instances bear the load of the failed instance. At the same time, a new backup instance is started to ensure the integrity of the redundant structure.
[0056] Wherein, the heartbeat mechanism is expressed as: ; in, It refers to the heartbeat signal interval. Refers to the number of heartbeat signals received, It refers to the maximum tolerable unresponsiveness time predefined by the MEC system and is used to determine whether an instance fails.
[0057] Furthermore, the data redundancy specifically includes creating copies of key data to ensure that the data is not lost in the event of a failure.
[0058] In step S6, the weight of the context-aware function is dynamically adjusted and updated by real-time monitoring of changes in context data and historical data, including: making weight update judgments based on feedback after service execution, and implementing the first update of the context data weights and historical data weights based on the judgment results; updating the context data weights and historical data weights again based on the minimum threshold and recovery threshold of MEC system resources; replacing the corresponding weights in the context-aware function with the updated context data weights and historical data weights to implement weight update, so that the MEC system makes the best decision based on the current resource status and task requirements, thereby improving the efficiency of resource allocation and the responsiveness of the MEC system.
[0059] The updated context data weights and the historical data weights are used to replace the corresponding weights in the context perception function. The system can dynamically adjust the priority calculation according to real-time feedback to ensure that resource allocation always matches system requirements, dynamically respond to task scheduling and service allocation in different resource environments, and ensure maximum resource utilization.
[0060] In the above steps, the feedback includes feedback on the execution result of the current service, feedback on resource consumption, feedback on real-time network status and feedback on changes in request volume.
[0061] The execution result feedback of the current service refers to the success or failure of the task and the execution time of the task.
[0062] The resource consumption feedback refers to the consumption of CPU, memory, and bandwidth resources.
[0063] The real-time network status feedback refers to network delay and packet loss rate.
[0064] The request amount change feedback refers to the change of the request amount.
[0065] The weight update judgment is specifically that if the incremental change of any one of the indicators among the resource consumption feedback, real-time network status feedback and request volume change feedback exceeds 20%, the context data weight is increased so that the priority calculation relies more on the current state; otherwise, the historical data weight is increased.
[0066] The update formula for the first update is: ; ; in, is the number of update iterations, refers to the weight of the context data after the first update, refers to the weight of the context data before the first update, is the adjustment factor, refers to the impact change of contextual data, Refers to the weight of the historical data after the first update, Refers to the weight of the historical data before the first update, Refers to the impact changes of historical data.
[0067] The minimum threshold of the MEC system resources is expressed as: .
[0068] The recovery threshold of the MEC system resources is expressed as: .
[0069] The re-updating means that when the MEC system resources are lower than the set minimum threshold, the context data weight is increased, so that the MEC system is more inclined to rely on the current resource status to adjust the user service priority. Otherwise, if the MEC system resources are in sufficient state, the historical data weight is increased, so that the MEC system relies more on past experience.
[0070] The expression for increasing the weight of the context data is: ; in, refers to the context data weight after being updated again, refers to the weight of the context data after the first update, is the number of update iterations, is the amount of weight adjustment, It means that the MEC system is Total resources available, It refers to the minimum threshold of resources; The expression for increasing the weight of the historical data is: ; in, Refers to the weight of the historical data after being updated again, Refers to the weight of the historical data after the first update, is the number of update iterations, is the amount of weight adjustment, It means that the MEC system is Total resources available, Refers to the preset recovery threshold.
[0071] Embodiment 2: refer to Figure 2Based on the context-aware service fault tolerance method of the above embodiment 1, the present invention further provides a context-aware service fault tolerance system, the system comprising: A data processing module, used for collecting context data and historical data, and performing preprocessing operations on the context data and historical data to obtain data after the preprocessing operations; A calculation module, configured to calculate the initial context data weight, the initial historical data weight and the user service priority based on the context data weight function, the historical data analysis function and the context perception function, and generate a user service priority list by using the data in the data processing module; A resource adjustment module, which is used to dynamically adjust the service operation status based on the resource allocation constraint model, according to the resource situation of the current MEC system and the user service priority list in the computing module; The weight updating module is used to update the context data weight and the historical data weight based on the initial context data weight in the calculation module, the initial historical data weight and the adjustment result of the resource adjustment module, and use the updated context data weight and the historical data weight to replace the corresponding weight in the context perception function to achieve weight update, so that the MEC system can make the best decision according to the current resource status and task requirements.
[0072] The specific implementation method of this embodiment is the same as that of Embodiment 1, which will not be repeated here. Please refer to the description of Embodiment 1 for details.
[0073] Using the technical solution of the above embodiment, in a context-aware service fault-tolerant method, by collecting the system's environmental data and historical service performance data in real time, designing context-aware functions and historical data analysis functions, dynamically calculating the user service priority based on the current MEC system status and historical performance, and adjusting resource allocation accordingly. By updating the weight coefficient through real-time feedback, the system can give priority to key services when resources are tight, and rely more on historical data for optimization decisions when resources are sufficient. In addition, the reliability of high-priority services is ensured through redundant backup strategies. This method can improve the resource allocation efficiency, task execution efficiency and overall stability of the MEC system, and enhance the system's adaptability and reliability.
[0074] Those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.
[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A context-aware service fault tolerance method, characterized in that: The method comprises: Collect contextual data of the MEC system environment and historical data related to the user's service history performance; Based on the collected context data and the historical data, an initial context data weight and an initial historical data weight are calculated by a context data weight function and a historical data analysis function; Calculate the user service priority based on the initial context data weight and the initial historical data weight, and generate a user service priority list; Construct a resource allocation constraint model to dynamically adjust the state of user service operation within the total amount of MEC system resources according to the user service priority; For high-priority services, formulate redundant backup strategies and configure primary and backup instances for key services to prevent single point failures; By monitoring the changes in contextual data and historical data in real time, the weights of the context-aware function are dynamically adjusted and updated; The MEC system is composed of edge servers, routers, switches, gateway devices, and user devices connected under mobile edge computing; The context data refers to CPU usage, network latency, and current request volume; The historical data refers to the number of requests for task completion, the total number of requests, the number of tasks completed, and the amount of resources consumed.
2. The context-aware service fault tolerance method according to claim 1, characterized in that: The calculating of the initial context data weight and the initial historical data weight based on the collected context data and the historical data by using a context data weight function and a historical data analysis function comprises: Performing a preprocessing operation on the context data and the historical data; Acquire historical success rate and historical resource efficiency based on the preprocessed historical data; The initial context data weight and the initial historical data weight are calculated by the context data weight function and the historical data analysis function.
3. The context-aware service fault tolerance method according to claim 2, characterized in that: The calculation formula of the historical success rate is: ; in, User Services The historical success rate User Services The number of requests completed by the task, User Services Total number of requests; The calculation formula of the historical resource efficiency is: ; in, User Services Historical resource efficiency, User Services The number of completed tasks, User Services resource consumption.
4. The context-aware service fault tolerance method according to claim 2, characterized in that: The initial context data weight and the initial historical data weight are calculated by the context data weight function and the historical data analysis function, including: Define a context data weight function, and calculate an initial context data weight based on the context data by using the context data weight function; A historical data analysis function is defined, and initial historical data weights are calculated based on the historical data using the historical data analysis function.
5. The context-aware service fault tolerance method according to claim 4, characterized in that: The calculation formula of the initial context data weight is: ; ; in, refers to the initial context data weight, Refers to the context data set used to calculate the context data weight, refers to the contextual data weight function, It means the moment CPU usage, It means the moment network latency, It means the moment The current request volume, , and They refer to the weight coefficients of adjusting the importance of CPU usage, network latency, and the current request volume on the priority; The calculation formula of the initial historical data weight is: ; ; in, refers to the initial historical data weight, Refers to the historical data set used to calculate the historical data weight. Refers to the historical data analysis function, User Services The historical success rate, that is, the proportion of successfully completed tasks to the total number of tasks, User Services The historical resource efficiency of the service, i.e., the resource usage of the service in completing tasks, and They refer to the weight coefficients of historical success rate and historical resource efficiency respectively.
6. The context-aware service fault tolerance method according to claim 1, characterized in that: The calculating the user service priority based on the initial context data weight and the initial history data weight and generating the user service priority list includes: Designing a context-aware function based on the initial context data weight and the initial historical data weight; The context data and the historical data are calculated through the context perception function to obtain the user service priority; Generate a user service priority list sorted by priority based on the calculation results; The user services are prioritized according to the user service priority list.
7. The context-aware service fault tolerance method according to claim 6, characterized in that: The context-aware function is expressed as: ; in, User Services At the moment The priority of It refers to the initial context data weight, which reflects the impact of the current environment on the user service priority; Refers to the initial historical data weight, reflecting the importance of the long-term performance of user services. and It refers to the influence coefficient of context data and historical data, controlling their weights; The user service priority list is expressed as follows: ; in, Refers to the user service priority list, It refers to User service at the time Priority; Priority classification refers to sorting the top Divided into high priority services, Divided into medium priority services, the rest Classified as low priority services; The high-priority service refers to a critical user service that must be continuously operated; The medium priority service refers to the user service that can be suspended last when resources are tight; The low-priority service refers to the user service that can be suspended first when resources are tight.
8. The context-aware service fault tolerance method according to claim 1, characterized in that: The resource allocation constraint model is constructed to dynamically adjust the state of user service operation within the range of the total amount of MEC system resources according to the user service priority, including: A resource allocation constraint model is constructed based on the total amount of MEC system resources and the user service priority; According to the resource allocation constraint model, the priority status of the running status of the user service is adjusted.
9. The context-aware service fault tolerance method according to claim 8, characterized in that: The resource allocation constraint model is expressed as follows: ; in, User Services The priority of User Services The resources needed, It means that the MEC system is Total resources available; The priority state adjustment means that if the MEC system is in a resource-constrained state, the low-priority services in the user service priority list are suspended to release resources; if the resources are still in a tight state, the medium-priority services in the user service priority list are further suspended; otherwise, if the MEC system is in a resource recovery state, the low-priority services and medium-priority services that were previously suspended due to resource shortages are gradually restored according to the user service priority list; The resource shortage state is expressed as: ; in, It means that the MEC system is Total resources available, It refers to the minimum threshold of resources, indicating that the MEC system is in a state of resource shortage and is insufficient to continue to maintain current user services; The resource recovery status is expressed as: ; in, It means that the MEC system is Total resources available, It refers to the preset recovery threshold. When the available resources of the MEC system are greater than this threshold, the MEC system will determine that the resources have returned to normal levels and can reallocate and resume previously suspended user services.
10. The context-aware service fault tolerance method according to claim 1, characterized in that: The method of dynamically adjusting and updating the weight of the context-aware function by real-time monitoring of changes in context data and historical data includes: Make weight update judgments based on feedback after service execution, and implement the first update of context data weights and historical data weights based on the judgment results; According to the minimum threshold and recovery threshold of MEC system resources, the context data weight and the historical data weight are updated again; The updated context data weights and the historical data weights are used to replace the corresponding weights in the context perception function to update the weights, so that the MEC system can make the best decision based on the current resource status and task requirements, thereby improving the efficiency of resource allocation and the responsiveness of the MEC system.
11. The context-aware service fault tolerance method according to claim 10, characterized in that: The feedback includes feedback on the execution result of the current service, feedback on resource consumption, feedback on real-time network status, and feedback on changes in request volume; The execution result feedback of the current service refers to the success or failure of the task and the execution time of the task; The resource consumption feedback refers to the consumption of CPU, memory, and bandwidth resources; The real-time network status feedback refers to the network delay and packet loss rate; The request amount change feedback refers to the change in the request amount; The weight update judgment is specifically that if the increment of any one of the resource consumption feedback, the real-time network status feedback, and the request volume change feedback exceeds 20%, then the context data weight is increased so that the priority calculation relies more on the current state; otherwise, the historical data weight is increased; The update formula for the first update is: ; ; in, is the number of update iterations, refers to the weight of the context data after the first update, refers to the weight of the context data before the first update, is the adjustment factor, refers to the impact change of contextual data, Refers to the weight of the historical data after the first update, Refers to the weight of the historical data before the first update, It refers to the impact changes of historical data; The minimum threshold of the MEC system resources is expressed as: ; The recovery threshold of the MEC system resources is expressed as: ; The re-updating means that when the MEC system resources are lower than the set minimum threshold, the context data weight is increased, so that the MEC system is more inclined to rely on the current resource status to adjust the user service priority. Otherwise, if the MEC system resources are in sufficient state, the historical data weight is increased, so that the MEC system relies more on past experience.
12. The context-aware service fault tolerance method according to claim 11, characterized in that: The expression for increasing the weight of the context data is: ; in, refers to the context data weight after being updated again, refers to the weight of the context data after the first update, is the number of update iterations, is the amount of weight adjustment, It means that the MEC system is Total resources available, It refers to the minimum threshold of resources; The expression for increasing the weight of the historical data is: ; in, Refers to the weight of the historical data after being updated again, Refers to the weight of the historical data after the first update, is the number of update iterations, is the amount of weight adjustment, It means that the MEC system is Total resources available, Refers to the preset recovery threshold.
13. A context-aware service fault-tolerant system, characterized in that: Implementing a context-aware service fault tolerance method as described in any one of claims 1 to 12, comprising: A data processing module, used for collecting context data and historical data, and performing preprocessing operations on the context data and historical data to obtain data after the preprocessing operations; A calculation module, configured to calculate the initial context data weight, the initial historical data weight and the user service priority based on the context data weight function, the historical data analysis function and the context perception function, and generate a user service priority list by using the data in the data processing module; A resource adjustment module, which is used to dynamically adjust the service operation status based on the resource allocation constraint model, according to the resource situation of the current MEC system and the user service priority list in the computing module; The weight updating module is used to update the context data weight and the historical data weight based on the initial context data weight in the calculation module, the initial historical data weight and the adjustment result of the resource adjustment module, and use the updated context data weight and the historical data weight to replace the corresponding weight in the context perception function to achieve weight update, so that the MEC system can make the best decision according to the current resource status and task requirements.
Citation Information
Patent Citations
Contextually-aware scheduling exceptions
CN109074550A
Batch Web service passive fault tolerance-oriented selection replacement method and system
CN109783257A
Heterogeneous hardware computing power scheduling method and device, equipment and medium
CN118626263A
Enterprise project management system based on response feedback
CN118735442A
Performance dynamic allocation optimization method and system based on computing power
CN118802801A
Cited By
Content caching and replacing method and system based on context awareness
CN120354972A