A Context-Aware Service Fault Tolerance Method and System

By collecting and analyzing context and historical data in edge computing environments in real time and dynamically adjusting resource allocation and priorities, the problem that traditional methods are difficult to adapt to changing environments is solved, and efficient resource utilization and stable guarantees for key services are achieved.

CN119902899BActive Publication Date: 2025-06-24JIANGXI NORMAL UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510386257.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-06-24
Estimated Expiration
2045-03-31

AI Technical Summary

Technical Problem

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.

Method used

By collecting context and historical data in real time, dynamically calculate service priorities, and dynamically adjust resource allocation based on priority and resource requirements. Design fault tolerance mechanisms to ensure that critical services are given priority in the event of resource tightness or failure.

Benefits of technology

It improves the efficiency of resource allocation and the response capability of edge computing systems, ensures the stability of key services and task execution efficiency, and enhances the adaptability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902899B_ABST
    Figure CN119902899B_ABST
Patent Text Reader

Abstract

The present invention discloses a context-aware service fault tolerance method and system, which relates to the fields of service fault tolerance and resource allocation. By collecting the environmental data of the system and the historical service performance data in real time, designing context-aware functions and historical data analysis functions, dynamically calculating the user service priority in combination with the current MEC system state and historical performance, and adjusting resource allocation accordingly; by updating the weight coefficients in real-time feedback, the system can prioritize critical services when resources are scarce and rely more on historical data for optimization decisions when resources are sufficient; in addition, the reliability of high-priority services is ensured through a redundant backup strategy. The service fault tolerance method of the present invention can not only effectively guarantee the service stability in a low-reliability mobile edge computing environment, but also improve the service and task execution efficiency, and can effectively enhance the adaptive ability and reliability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of service fault tolerance and resource allocation, and particularly 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 Mobile Edge Computing (MEC) platforms, resources are limited and vulnerable to various factors, including network fluctuations, hardware failures, load changes, etc. Therefore, how to effectively manage resources, ensure the continuous operation of high-priority services, and perform effective fault tolerance and service dependency adjustment during resource shortages has become an urgent challenge. In a complex environment with multiple services and tasks, resource allocation is not just a simple scheduling problem but also involves multiple aspects such as dynamic calculation of task priorities, reasonable management of priority relationships between services, and design of fault tolerance mechanisms. These factors are intertwined, making it difficult for traditional resource allocation methods to adapt to the changing requirements in modern edge computing systems.

[0003] At the same time, with the popularization of edge computing, many critical 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. Therefore, how to reasonably allocate and schedule these resources to meet service requirements, especially in a dynamically changing network environment and under high-concurrency task requests, becomes particularly important.

[0004] CN109783257A, titled: Selective Replacement Method and System for Passive Fault Tolerance of Batch Web Services. The method includes: obtaining Web service running instances that fail during the operation of the Web service system, and initially selecting a set of backup Web service resource collections that meet the functional requirements of the failed service running instances; constructing a service instance fault tolerance request vector, a service resource capability support vector, and a service batch fault tolerance selection matrix based on the running instances and backup resources, and generating a Web service batch fault tolerance decision target; generating a batch replacement optimization plan that meets the fault tolerance constraint conditions based on the fault tolerance decision target and the fault tolerance requests of the running instances using a batch optimization selection method based on an improved genetic algorithm; and replacing multiple failed service running instances and backup service resources according to the optimization plan. This method can be used for passive fault tolerance when batch Web services fail to effectively control 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 make dynamic adjustments. It mainly relies on pre-constructed process communities and static checkpoint and message logging strategies, and it is difficult to flexibly cope with resource fluctuations and dynamic changes in service dependencies in a mobile edge computing environment with low reliability. Therefore, when resources are scarce or service demands change, it may not be able to most effectively ensure service stability and task execution efficiency.

[0005] CN109074550A, titled: Context-Aware Scheduling Exception. 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 criteria and / or goals, such as the preferences of service providers or customers. The technology disclosed herein prioritizes customers based on the 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, depending on one or more priorities associated with the customer, a scheduling exception can be made for some customers and a scheduling conflict can be made for other customers. This method can use context data from multiple resources to determine the execution order through priority sorting, but it does not consider the impact of historical data on priorities and the impact of resource sufficiency in a dynamic environment, resulting in insufficient basis for task priority sorting and being unable to handle the problems brought by complex and changing dynamic environments. Summary of the Invention

[0006] In view of the above problems, the present invention proposes a context-aware service fault tolerance method and system. This method can, in a changing system environment, calculate the priority of services by collecting context data in real time, combining historical data, 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 critical services can be preferentially guaranteed in case of resource shortage or failure, avoiding system crashes or stagnation of critical services.

[0007] One technical solution of the present invention is:

[0008] A context-aware service fault tolerance method, the method comprising:

[0009] Collect context data of the MEC system environment and historical data related to the historical performance of user services;

[0010] Based on the collected context data and historical data, calculate the initial context data weight and the initial historical data weight through a context data weight function and a historical data analysis function;

[0011] Based on the initial context data weight and the initial historical data weight, calculate the user service priority and generate a user service priority list;

[0012] Construct a resource allocation constraint model, and dynamically adjust the running state of user services within the total amount of MEC system resources according to the user service priority;

[0013] For high-priority services, formulate a redundant backup strategy, configure primary and backup instances for critical services, and prevent single-point failures;

[0014] By monitoring the changes of context data and historical data in real time, dynamically adjust and update the weights of context-aware functions;

[0015] The MEC system is composed of edge servers, routers, switches, gateway devices, and user devices accessed under mobile edge computing;

[0016] The context data refers to CPU usage, network latency, and current request volume;

[0017] The historical data refers to the number of requests completed for tasks, the total number of requests, the number of tasks completed, and the resource consumption.

[0018] Further, the calculating the initial context data weight and the initial historical data weight based on the collected context data and historical data through a context data weight function and a historical data analysis function includes:

[0019] Perform preprocessing operations on the context data and the historical data;

[0020] Obtain the historical success rate and historical resource efficiency based on the preprocessed historical data;

[0021] Calculate the initial context data weight and the initial historical data weight through the context data weight function and the historical data analysis function.

[0022] Further, the calculation formula for the historical success rate is:

[0023] ;

[0024] where refers to the historical success rate of the user service , refers to the number of requests for task completion of the user service , refers to the total number of requests of the user service ;

[0025] The calculation formula for the historical resource efficiency is:

[0026] ;

[0027] where refers to the historical resource efficiency of the user service , refers to the number of completed tasks of the user service , refers to the resource consumption of the user service .

[0028] Further, calculating the initial context data weight and the initial historical data weight through the context data weight function and the historical data analysis function includes:

[0029] Define the context data weight function, and calculate the initial context data weight based on the context data through the context data weight function;

[0030] Define the historical data analysis function, and calculate the initial historical data weight based on the historical data through the historical data analysis function.

[0031] Further, the calculation formula for the initial context data weight is:

[0032] ;

[0033] ;

[0034] where refers to the initial context data weight, Refers to the set of context data used to calculate the weights of context data, Refers to the context data weight function, Refers to the moment CPU utilization rate, Refers to the moment Network latency, Refers to the moment Current request volume, 、 And Respectively refer to the weight coefficients that adjust the importance of the impact of CPU utilization rate, network latency, and current request volume on the priority;

[0035] The calculation formula for the initial historical data weight is:

[0036] ;

[0037] ;

[0038] Among them, Refers to the initial historical data weight, Refers to the set of historical data used to calculate the historical data weight, Refers to the historical data analysis function, Refers to the user service Historical success rate, that is, the proportion of successfully completed tasks to the total number of tasks, Refers to the user service Historical resource efficiency, that is, the resource usage situation of the service when completing tasks, And Respectively refer to the weight coefficients of the historical success rate and the historical resource efficiency.

[0039] Furthermore, 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:

[0040] Design a context awareness function based on the initial context data weight and the initial historical data weight;

[0041] Calculate the user service priority by passing the context data and the historical data through the context awareness function;

[0042] Generate a user service priority list sorted by priority size according to the calculation result;

[0043] Classify the user services according to the user service priority list.

[0044] Furthermore, the context awareness function, its expression is:

[0045] ;

[0046] Among them, refers to the user service at time priority, refers to the initial context data weight, reflecting 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 the user service, and refer to the influence coefficients of the context data and historical data, controlling their weights;

[0047] The user service priority list, its expression is:

[0048] ;

[0049] Among them, refers to the user service priority list, refers to the th user service at time priority;

[0050] The priority classification refers to dividing the first in the user service priority list into high-priority services, and the latter into medium-priority services, and the remaining into low-priority services;

[0051] The high-priority services refer to the key user services that must run continuously;

[0052] The medium-priority services refer to the user services that can be paused last when resources are scarce;

[0053] The low-priority services refer to the user services that can be paused when resources are scarce.

[0054] Furthermore, the resource allocation constraint model is constructed to dynamically adjust the running state of the user service within the range of the total MEC system resources, including:

[0055] Combining the total MEC system resources and the user service priority, construct a resource allocation constraint model;

[0056] According to the resource allocation constraint model, adjust the priority status of the running state of the user service.

[0057] Furthermore, the resource allocation constraint model, its expression is:

[0058] ;

[0059] Among them, refers to the priority of user services ; refers to the resources required by user services ; refers to the total resources available to the MEC system at time ;

[0060] The adjustment of the priority status means that when 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 constrained state, the medium-priority services in the user service priority list are further suspended; otherwise, when 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 resumed according to the user service priority list;

[0061] The resource-constrained state is expressed as:

[0062] ;

[0063] Among them, refers to the total resources available to the MEC system at time ; refers to the minimum threshold of resources, indicating that the MEC system is in a resource-constrained state and is not sufficient to continue maintaining the current user services;

[0064] The resource recovery state is expressed as:

[0065] ;

[0066] Among them, refers to the total resources available to the MEC system at time ; refers to a 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 the normal level and can reallocate and resume the previously suspended services.

[0067] Furthermore, the dynamic adjustment and update of the weights of the context-aware function by real-time monitoring of the changes in context data and historical data include:

[0068] Judging the weight update according to the feedback after service execution, and realizing the first update of the context data weight and the historical data weight based on the judgment result;

[0069] Re-updating the context data weight and the historical data weight according to the minimum threshold and the recovery threshold of the MEC system resources;

[0070] Replace the corresponding weights in the context-aware function with the updated context data weights and the historical data weights to achieve weight update, enabling the MEC system to make optimal decisions based on the current resource status and task requirements, and improving the efficiency of resource allocation and the response ability of the MEC system.

[0071] Furthermore, the feedback includes the execution result feedback of the current service, resource consumption feedback, real-time network status feedback, and request volume change feedback.

[0072] The execution result feedback of the current service refers to the success and failure of the task and the task execution duration.

[0073] The resource consumption feedback refers to the consumption of CPU, memory, and bandwidth resources.

[0074] The real-time network status feedback refers to the network latency and packet loss rate.

[0075] The request volume change feedback refers to the change in the request volume.

[0076] The weight update judgment is specifically that if the change increment of any one of the resource consumption feedback, real-time network status feedback, and request volume change feedback exceeds 20%, then increase the context data weight to make the priority calculation more dependent on the current state; otherwise, increase the historical data weight.

[0077] For the first update, its update formula is:

[0078] ;

[0079] ;

[0080] where refers to the number of update iterations, refers to the context data weight after the first update, refers to the context data weight before the first update, refers to the adjustment coefficient, refers to the influence change of the context data, refers to the historical data weight after the first update, refers to the historical data weight before the first update, refers to the influence change of the historical data;

[0081] The minimum threshold of the MEC system resources is expressed as: ;

[0082] The recovery threshold of the MEC system resources is expressed as: ;

[0083] The aforesaid re - update means that when the MEC system resources are lower than the set minimum threshold, the weight of the context data is increased, so that the MEC system is more inclined to rely on the current resource state to adjust the user service priority. Otherwise, when the MEC system resources are in a sufficient state, the weight of the historical data is increased, making the MEC system rely more on past experience.

[0084] Furthermore, the expression for increasing the weight of the context data is:

[0085] ;

[0086] Wherein, refers to the weight of the context data after re - update, refers to the weight of the context data after the first update, refers to the iteration number of updates, refers to the adjustment amount of the weight, refers to the total resources available to the MEC system at time ; refers to the minimum threshold of the resources;

[0087] The expression for increasing the weight of the historical data is:

[0088] ;

[0089] Wherein, refers to the weight of the historical data after re - update, refers to the weight of the historical data after the first update, refers to the iteration number of updates, refers to the adjustment amount of the weight, refers to the total resources available to the MEC system at time ; refers to the preset recovery threshold.

[0090] Based on the above - mentioned service fault - tolerance method based on context awareness, the present invention also provides a service fault - tolerance system based on context awareness. The system includes:

[0091] A data processing module, configured to collect context data and historical data, perform pre - processing operations on the context data and historical data, and obtain the data after pre - processing operations;

[0092] A computing module, configured to calculate an initial context data weight, an initial historical data weight, and a user service priority based on a context data weight function, a historical data analysis function, and a context awareness function, and generate a user service priority list by using the data in the data processing module;

[0093] A resource adjustment module, configured to dynamically adjust the service running status based on a resource allocation constraint model according to the resource situation of the current MEC system and the user service priority list in the computing module;

[0094] A weight update module, configured to update the context data weight and the historical data weight based on the initial context data weight, the initial historical data weight in the computing module, and the adjustment result of the resource adjustment module, and replace the corresponding weights in the context awareness function with the updated context data weight and historical data weight to implement weight update, so that the MEC system can make an optimal decision according to the current resource status and task requirements.

[0095] A service fault tolerance method and system based on context awareness provided by an embodiment of the present invention collect context information in real time, combine historical data, dynamically calculate the priority of services, 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 critical services can be preferentially guaranteed in case of resource tension or failures, avoiding system crashes or stagnation of critical services.

[0096] The above invention content is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the present invention more obvious and understandable, the specific embodiments of the present invention are specifically given below. Brief Description of the Drawings

[0097] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those skilled in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0098] Figure 1 Shows a specific flowchart of a service fault tolerance method based on context awareness provided by an embodiment of the present invention.

[0099] Figure 2 Shows a block diagram of a service fault tolerance system based on context awareness provided by an embodiment of the present invention. Detailed Description of the Embodiments

[0100] 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 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 so that the present invention can be more thoroughly understood and the scope of the present invention can be fully conveyed to those skilled in the art.

[0101] With the popularization 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 multiple aspects such as dynamic calculation of task priorities, reasonable management of service dependencies, and design of fault tolerance mechanisms. These factors are intertwined, making it difficult for traditional resource allocation methods to adapt to the changing requirements in 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 adjustment when resources are scarce has become an urgent problem to be solved.

[0102] Based on the above problems, the technical solution of the present invention dynamically calculates the priority of services by collecting context information in real time, combining historical data, and dynamically adjusts resource allocation according to the priority and resource requirements. At the same time, by designing a fault tolerance mechanism, it is ensured that critical services can be preferentially guaranteed when resources are scarce or a failure occurs, avoiding system crashes or the stagnation of critical services.

[0103] The specific implementation includes the following content:

[0104] Embodiment 1:

[0105] Reference Figure 1 , a context-aware service fault tolerance method provided in this embodiment, the method includes:

[0106] Step S1: Collect context data of the MEC system environment and historical data related to the historical performance of user services;

[0107] Step S2: Calculate the initial context data weight and the initial historical data weight based on the collected context data and historical data through a context data weight function and a historical data analysis function;

[0108] Step S3: 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;

[0109] Step S4: Construct a resource allocation constraint model and dynamically adjust the running status of user services within the total amount of MEC system resources according to the user service priorities;

[0110] Step S5: For high-priority services, formulate a redundant backup strategy, configure primary and backup instances for critical services, and prevent single-point failures;

[0111] Step S6: Dynamically adjust the weights of the context awareness function and update it by monitoring the changes in context data and historical data in real time.

[0112] In step S1, the MEC system is composed of edge servers, routers, switches, gateway devices, and user devices accessed 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 completed for tasks, total requests, number of tasks completed, and resource consumption.

[0113] In specific implementation, it is necessary to collect context data of the MEC system environment in real time through sensors and network monitoring tools, and at the same time retrieve historical data on the historical performance of user services for subsequent data calculations. The context data reflects the current environmental state. The system can dynamically adjust resource allocation in a timely manner according to the current environmental state to ensure that high-priority services are guaranteed, reduce the resource consumption of low-priority and medium-priority services, and thus improve the system response speed and resource utilization efficiency. The historical data reflects the long-term performance of services. The system can predict future service demands and resource usage through historical behaviors, avoiding relying on overly short-term context data information.

[0114] In step S2, the initial context data weight and the initial historical data weight are calculated based on the collected context data and 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 historical success rate and historical resource efficiency based on the preprocessed historical data; calculating the initial context data weight and the initial historical data weight through the context data weight function and the historical data analysis function.

[0115] Specifically, the preprocessing operation refers to removing abnormal data and normalizing the data to make the data more reliable and easier to analyze.

[0116] Obtaining the historical success rate and historical resource efficiency based on the preprocessed historical data, and their calculation formulas are:

[0117] ;

[0118] ;

[0119] Among them, refers to the historical success rate of the user service ; refers to the number of requests for task completion of the user service ; refers to the total number of requests of the user service ; refers to the historical resource efficiency of the user service ; refers to the number of completed tasks of the user service ; refers to the resource consumption of the user service ;

[0120] In this step, the initial context data weight and the initial historical data weight calculated through the context data weight function and the historical data analysis function include: defining the context data weight function, and calculating the initial context data weight based on the context data through the context data weight function; defining the historical data analysis function, and calculating the initial historical data weight based on the historical data through the historical data analysis function.

[0121] Defining the context data weight function to obtain the initial context data weight 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 state. When the load is high, the system can give priority to ensuring low-latency services or reducing the resource consumption of services with a large number of requests.

[0122] Defining the historical data analysis function, the calculation of the historical data weight enables the system to optimize resource allocation based on the long-term performance of the service, rather than relying solely on instantaneous environmental changes, enhancing the stability of the system.

[0123] Among them, the calculation formula for the initial context data weight is:

[0124] ;

[0125] ;

[0126] Among them, refers to the initial context data weight, refers to the set of context data used to calculate the context data weight, refers to the context data weight function, refers to the moment CPU usage rate at, refers to the moment network latency at, refers to the moment The current request volume, 、 and respectively refer to the weight coefficients that adjust the importance of the CPU usage rate, network latency, and current request volume on the priority.

[0127] Among them, the calculation formula for the initial historical data weight is:

[0128] ;

[0129] ;

[0130] Among them, refers to the initial historical data weight, refers to the set of historical data used to calculate the historical data weight, refers to the historical data analysis function, refers to the user service The historical success rate, that is, the proportion of successfully completed tasks to the total number of tasks, refers to the user service The task completion rate, that is, the resource usage situation when the service completes tasks, and respectively refer to the weight coefficients of the historical success rate and historical resource efficiency.

[0131] 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; passing the context data and the historical data through the context-aware function to calculate the user service priority; generating a user service priority list sorted by priority size according to the calculation result; classifying the user services according to the user service priority list.

[0132] Specifically, through the context-aware function, combining the context data and the historical data, the system can comprehensively consider the current environment and historical performance, dynamically adjust the service priority, and optimize the resource allocation; the generation of the service priority list enables the system to clearly understand which services need to be run first, which can be delayed or paused, thereby improving the overall performance and response speed of the system.

[0133] In the above steps, the context-aware function has the following expression:

[0134] ;

[0135] Among them, refers to the user service At the moment The priority of refers to the weight of the initial context data, reflecting the impact of the current environment on the user service priority; refers to the weight of the initial historical data, reflecting the importance of the long-term performance of the user service, and refers to the influence coefficients of the context data and the historical data, controlling their weights.

[0136] The user service priority list has the following expression:

[0137] ;

[0138] Among them, refers to the user service priority list, refers to the th user service at the moment The priority;

[0139] The priority classification means that the first in the user service priority list are classified as high-priority services, and the last are classified as medium-priority services, and the remaining are classified as low-priority services.

[0140] Specifically, the is 20%, the is 35%, and the is 45%.

[0141] The high-priority services refer to the critical user services that must run continuously.

[0142] The medium-priority services refer to the user services that can be paused last when resources are scarce.

[0143] The low-priority services refer to the user services that can be paused when resources are scarce.

[0144] In step S4, the resource allocation constraint model is constructed. Within the scope of the total MEC system resources, the running state of the user service is dynamically adjusted, including: combining the total MEC system resources and the user service priority to construct a resource allocation constraint model; according to the resource allocation constraint model, adjusting the running state of the user service to a priority state.

[0145] In the above steps, the resource allocation constraint model has the following expression:

[0146] ;

[0147] Among them, Refers to user services The priority of Refers to user services The resources required by Refers to the total resources available to the MEC system at time The total available resources

[0148] The priority status adjustment means that when the MEC system is in a resource-constrained state, low-priority services in the user service priority list are suspended to release resources; if the resources are still in a tight state, medium-priority services in the user service priority list are further suspended; otherwise, when the MEC system is in a resource recovery state, 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

[0149] The resource-constrained state is expressed as:

[0150] ;

[0151] Wherein Refers to the total resources available to the MEC system at time The total available resources Refers to the minimum threshold of resources, indicating that the MEC system is in a resource-constrained state and is not sufficient to continue to maintain the current user services

[0152] The resource recovery state is expressed as:

[0153] ;

[0154] Wherein Refers to the total resources available to the MEC system at time The total available resources Refers to a 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 the normal level and can reallocate and resume previously suspended services

[0155] In step S5, for high-priority services, a redundant backup strategy is formulated to configure primary and backup instances for critical services to prevent single-point failures, including: instance redundancy and data redundancy

[0156] Specifically, the redundant backup strategy is specifically divided into instance redundancy and data redundancy. Data redundancy means creating multiple copies of important data and storing them in different physical or logical locations. Instance redundancy means adopting a primary-backup structure mode and running multiple instances for high-priority services

[0157] Further, the primary and backup structure mode is specifically as follows: for high-priority services in operation, a primary instance is generated to handle all requests, a backup instance is in a standby state, and multiple instances run simultaneously and share the workload. A heartbeat mechanism is used to identify instance failures. If the heartbeat signal is not received

[0158] times, the instance is determined to have failed. At this time, the backup instance takes over the tasks of the primary instance, rebalances the task distribution, and other instances assume the load of the failed instance. Meanwhile, a new backup instance is started to ensure the integrity of the redundant structure.

[0159] ;

[0160] Wherein, refers to the heartbeat signal interval, refers to the number of received heartbeat signals, refers to the maximum tolerable unresponsive time predefined by the MEC system, which is used to determine whether an instance has failed.

[0161] Further, the data redundancy is specifically as follows: copies of critical data are established to ensure that the data is not lost during a failure.

[0162] In step S6, the dynamic adjustment and update of the weights of the context awareness function by monitoring the changes in context data and historical data in real time include: judging the weight update according to the feedback after service execution, and realizing the first update of the context data weight and the historical data weight based on the judgment result; performing a second update on the context data weight and the historical data weight according to the minimum threshold and recovery threshold of the MEC system resources; replacing the corresponding weights in the context awareness function with the updated context data weight and historical data weight to realize the weight update, so that the MEC system makes the best decision according to the current resource status and task requirements, improving the efficiency of resource allocation and the response ability of the MEC system.

[0163] By replacing the corresponding weights in the context awareness function with the updated context data weight and historical data weight, the system can dynamically adjust the priority calculation according to real-time feedback, ensure that the resource allocation always matches the system requirements, dynamically respond to task scheduling and service allocation in different resource environments, and ensure the maximization of resource utilization.

[0164] In the above steps, the feedback includes the execution result feedback of the current service, resource consumption feedback, real-time network status feedback, and request volume change feedback.

[0165] The execution result feedback of the current service refers to the success and failure of the task and the task execution duration.

[0166] The resource consumption feedback refers to the consumption of CPU, memory, and bandwidth resources.

[0167] The real-time network condition feedback refers to the network latency and packet loss rate.

[0168] The request volume change feedback refers to the change in the request volume.

[0169] The weight update judgment is specifically as follows: if the change increment of any one of the resource consumption feedback, real-time network condition feedback, and request volume change feedback exceeds 20%, then increase the weight of the context data, so that the priority calculation depends more on the current state; otherwise, increase the weight of the historical data.

[0170] For the first update, its update formula is:

[0171] ;

[0172] ;

[0173] Where, refers to 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, refers to the adjustment coefficient, refers to the impact change of the context 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 change of the historical data.

[0174] The minimum threshold of the MEC system resources is expressed as: .

[0175] The recovery threshold of the MEC system resources is expressed as: .

[0176] The re-update means that when the MEC system resources are lower than the set minimum threshold, increase the weight of the context data, so that the MEC system is more inclined to rely on the current resource state to adjust the user service priority; otherwise, when the MEC system resources are in a sufficient state, increase the weight of the historical data, so that the MEC system relies more on past experience.

[0177] The expression for increasing the weight of the context data is:

[0178] ;

[0179] Among them, refers to the context data weight after the second update, refers to the context data weight after the first update, refers to the number of update iterations, refers to the amount of weight adjustment, refers to the MEC system at time the total available resources, refers to the minimum threshold of resources;

[0180] The increase in the historical data weight has the following expression:

[0181] ;

[0182] Among them, refers to the historical data weight after the second update, refers to the historical data weight after the first update, refers to the number of update iterations, refers to the amount of weight adjustment, refers to the MEC system at time the total available resources, refers to the preset recovery threshold.

[0183] Embodiment 2:

[0184] Referring to Figure 2 , based on the context-aware service fault tolerance method in the above Embodiment 1, the present invention further provides a context-aware service fault tolerance system, and the system includes:

[0185] A data processing module, configured to collect context data and historical data, perform preprocessing operations on the context data and historical data, and obtain the data after the preprocessing operations;

[0186] A calculation module, configured to calculate an initial context data weight, an initial historical data weight, and a user service priority based on a context data weight function, a historical data analysis function, and a context awareness function, and use the data in the data processing module to generate a user service priority list;

[0187] A resource adjustment module, configured to dynamically adjust the service running state based on a resource allocation constraint model according to the resource situation of the current MEC system and the user service priority list in the calculation module;

[0188] The weight update module is used to update the context data weight and the historical data weight based on the initial context data weight, the initial historical data weight in the calculation module, and the adjustment result of the resource adjustment module, and use the updated context data weight and historical data weight to replace the corresponding weights in the context awareness function to achieve weight update, so that the MEC system can make the best decision according to the current resource status and task requirements.

[0189] The specific implementation method of this embodiment is the same as that of Embodiment 1 and will not be repeated here. For details, please refer to the description of Embodiment 1.

[0190] Adopting the technical solution of the above embodiment, in a service fault tolerance method based on context awareness, by collecting the environmental data of the system and the historical service performance data in real time, designing a context awareness function and a historical data analysis function, dynamically calculating the user service priority in combination with the current MEC system status and historical performance, and adjusting the resource allocation accordingly. By updating the weight coefficient in real-time feedback, the system can give priority to guaranteeing critical services when resources are scarce, and rely more on historical data for optimal decision-making when resources are sufficient. In addition, the reliability of high-priority services is ensured through a redundant backup strategy. This method can improve the resource allocation efficiency, task execution efficiency and overall stability of the MEC system, and enhance the adaptive ability and reliability of the system.

[0191] Those skilled in the art can understand that although some embodiments herein include certain features included in other embodiments rather than other features, the combination of the features of different embodiments means that it is within the scope of the present invention and forms different embodiments.

[0192] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various 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; 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; Classify user services by priority according to the 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; Dynamically adjust the weight of context-aware functions by monitoring changes in context data and historical data in real time and and update; 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; 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 They refer to the context data weight and historical data weight respectively, representing the influence coefficients of context data and historical data, and controlling their weights.

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 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.

7. 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.

8. The context-aware service fault tolerance method according to claim 7, 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.

9. The context-aware service fault tolerance method according to claim 1, characterized in that: The weight of the context-aware function is dynamically adjusted by monitoring the changes in context data and historical data in real time. and And updated, 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.

10. The context-aware service fault tolerance method according to claim 9, 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.

11. The context-aware service fault tolerance method according to claim 10, 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.

12. A context-aware service fault-tolerant system, characterized in that: Implementing a context-aware service fault tolerance method according to any one of claims 1 to 11, 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; 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

  • Enterprise project management system based on response feedback

    CN118735442A

  • Performance dynamic allocation optimization method and system based on computing power

    CN118802801A