Service degradation processing method and apparatus
Patent Information
- Application Number
- CN202610259297.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-04
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2046-03-04
AI Technical Summary
缺乏对节点状态的深入分析,难以通过状态同步实现一致的降级控制,影响系统稳定性
[0017]由上述技术方案可知,本申请提供一种服务降级处理方法及装置,通过创新性地设计注解配置体系,通过规则管理和资源监控,实现灵活的降级控制。构建拦截处理机制,结合状态跟踪和效果评估,建立可靠的决策模型。引入集群协同,通过状态同步和队列优化,确保降级的一致性。该方法有效解决了传统技术在规则配置、状态监控和集群协同等方面的不足,为服务治理提供了技术保障。
Smart Images

Figure CN122412250B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, specifically to a service degradation processing method and apparatus. Background Technology
[0002] Existing service degradation handling methods have significant shortcomings. Traditional systems perform poorly in rule configuration and resource monitoring, failing to effectively adapt to changes in system load and thus affecting degradation effectiveness.
[0003] Furthermore, existing technologies suffer from bottlenecks in state tracking and performance evaluation. Most systems lack robust monitoring mechanisms and evaluation strategies, leading to inaccurate degradation decisions.
[0004] The existing system has technical shortcomings in cluster collaboration. It lacks in-depth analysis of node states, making it difficult to achieve consistent degradation control through state synchronization, thus impacting system stability. Solving these problems is crucial for improving service reliability. Summary of the Invention
[0005] To address the problems in existing technologies, this application provides a service degradation processing method and apparatus, which can effectively solve the shortcomings of traditional technologies in rule configuration, status monitoring and cluster collaboration, and provide technical support for service governance.
[0006] To solve at least one of the above problems, this application provides the following technical solution: Firstly, this application provides a service degradation processing method, including: A degradation annotation system is constructed. Exception type rules, timeout threshold rules, and return value verification rules are configured in method-level annotations, and parameter verification rules are configured in parameter-level annotations. The method-level annotations and parameter-level annotations are deployed to the target business method. System resource data is collected, and a resource monitoring matrix including processor load, memory usage, and thread status is constructed. Degradation processing threads are dynamically allocated according to the resource monitoring matrix, and a service tag matrix including call identifier, annotation configuration, and resource status is generated. Deploy an interception and processing system to monitor the running status of the target business method based on the service tag matrix, collect execution time, abnormal information and return data, input the execution time, abnormal information and return data into the rule verification module, record historical degradation data, extract degradation success rate and business impact indicators, construct a degradation effect evaluation model, dynamically adjust the priority of degradation rules according to the degradation effect evaluation model, and generate a status tracking matrix containing execution status, verification results and degradation priority; A cluster node communication network is established, the status tracking matrix is broadcast to the cluster nodes, degradation status data from other nodes is received, degradation decision results are merged, degradation process is initiated based on the degradation decision results, degradation queue processing rate is adjusted based on the resource monitoring matrix, business call parameters are passed to the degradation method, degradation processing results are collected, a result evaluation table containing degradation reasons, processing results, and node status is constructed, the result evaluation table is synchronized to the cluster nodes, and the processing status in the service tag matrix is updated.
[0007] Furthermore, it also includes: constructing a method-level degradation annotation framework, defining an annotation attribute description table containing exception type identifiers, timeout threshold parameters, and return value verification conditions, writing the annotation attribute description table into type metadata, generating annotation parsing rules containing attribute mapping relationships and default configurations, and loading the annotation parsing rules into the annotation processor; A parameter-level degradation annotation framework is constructed, defining a parameter processing table that includes parameter location identifiers, type conversion rules, and data validation conditions. The parameter processing table is written into the parameter parsing chain to generate parameter processing rules that include parameter mapping relationships and validation logic. The method-level degradation annotation and the parameter-level degradation annotation are then deployed to the business methods.
[0008] Furthermore, it also includes: collecting system processor utilization and memory usage data, recording thread running status and blocking time, constructing a resource status table containing resource usage, thread distribution and blocking probability, organizing the resource status table according to time series, generating a resource monitoring matrix, and writing the resource monitoring matrix into the monitoring center; Calculate thread load weights based on the resource monitoring matrix, allocate the number of degraded processing threads, write degraded tasks into the processing queue, generate a task allocation table containing thread identifiers, processing weights, and scheduling parameters, and write the task allocation table and annotation configurations into the service tag matrix.
[0009] Furthermore, it also includes: deploying an aspect interception framework, loading a service tag matrix, constructing an interception configuration table containing pointcut expressions, interception order, and processing priority, registering the interception configuration table to the application context, generating an interception processor, and monitoring the invocation process of the target business method; Collect execution time data and exception stack information of the target business method, record the method return value, write the execution time data, the exception stack information and the method return value into the data buffer, construct a rule verification table containing verification rules, matching conditions and trigger thresholds, and deploy the rule verification table to the rule verification module.
[0010] Furthermore, it also includes: recording the number of degradation triggers and degradation execution results of business methods, extracting a degradation data table containing response time, success status, and business metrics, aggregating the degradation data table by time window, calculating the degradation success probability and service availability metrics, constructing a degradation effect evaluation model, and writing the degradation effect evaluation model into a model repository. The degradation effect evaluation model is read, the execution weight of the degradation rules is calculated, the degradation rules are prioritized, and a rule adjustment table containing rule identifiers, weight coefficients, and priority levels is generated. The rule adjustment table is combined with the verification results to generate a state tracking matrix, and the state tracking matrix is synchronized to the cluster nodes.
[0011] Furthermore, it also includes: constructing communication links between cluster nodes, writing the state tracking matrix into a message queue, establishing a node registry containing node identifiers, connection status, and data versions, receiving degradation status data returned by cluster nodes, generating a global decision matrix containing the decision results and processing status of each node, and broadcasting the global decision matrix to the nodes in the node registry. Read the resource monitoring matrix, calculate the system load level, adjust the number of processing threads in the degradation queue, construct a queue control table containing queue capacity, processing rate, and task priority, assemble business call parameters into a degradation request, write the degradation request into the degradation processing queue, and allocate processing resources according to the queue control table.
[0012] Furthermore, it also includes: collecting the execution results of the degradation method, recording the degradation triggering reason, constructing a processing result table containing exception type, execution time and return status, combining the processing result table with the node running status to generate a result evaluation table containing degradation details, processing status and node information, and writing the result evaluation table into the distributed cache; Read the result evaluation table in the distributed cache, broadcast the result data to the cluster nodes, receive node confirmation information, update the service tag matrix containing degradation flags, processing progress, and synchronization status, and write the updated result of the service tag matrix into the state manager.
[0013] Secondly, this application provides a service degradation processing apparatus, comprising: The degradation annotation module is used to build a degradation annotation system. It configures exception type rules, timeout threshold rules, and return value verification rules in method-level annotations and parameter verification rules in parameter-level annotations. It deploys the method-level annotations and parameter-level annotations to the target business methods, collects system resource data, builds a resource monitoring matrix including processor load, memory usage, and thread status, dynamically allocates degradation processing threads according to the resource monitoring matrix, and generates a service tag matrix including call identifier, annotation configuration, and resource status. The interception and processing module is used to deploy the interception and processing system, monitor the running status of the target business method based on the service tag matrix, collect execution time, abnormal information and return data, input the execution time, abnormal information and return data into the rule verification module, record historical degradation data, extract degradation success rate and business impact indicators, construct a degradation effect evaluation model, dynamically adjust the priority of degradation rules according to the degradation effect evaluation model, and generate a status tracking matrix containing execution status, verification results and degradation priority. The degradation handling module is used to establish a cluster node communication network, broadcast the status tracking matrix to the cluster nodes, receive degradation status data from other nodes, merge degradation decision results, initiate a degradation process based on the degradation decision results, adjust the degradation queue processing rate based on the resource monitoring matrix, pass business call parameters to the degradation method, collect degradation processing results, construct a result evaluation table containing degradation reasons, processing results, and node status, synchronize the result evaluation table to the cluster nodes, and update the processing status in the service tag matrix.
[0014] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the service degradation processing method described above.
[0015] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the service degradation processing method described above.
[0016] Fifthly, this application provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the service degradation processing method described above.
[0017] As can be seen from the above technical solution, this application provides a service degradation processing method and apparatus. Through an innovative design of an annotation configuration system, and by implementing rule management and resource monitoring, it achieves flexible degradation control. An interception processing mechanism is constructed, combined with state tracking and effect evaluation, to establish a reliable decision-making model. Cluster collaboration is introduced, and through state synchronization and queue optimization, the consistency of degradation is ensured. This method effectively solves the shortcomings of traditional technologies in rule configuration, state monitoring, and cluster collaboration, providing technical support for service governance. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the service degradation processing method in the embodiments of this application; Figure 2 This is a structural diagram of the service degradation processing device in the embodiments of this application; Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0021] The acquisition, storage, use, and processing of data in this application comply with relevant laws and regulations.
[0022] To address the problems existing in current technologies, this application provides a service degradation handling method and apparatus. Through an innovative annotation-based configuration system, and by implementing rule management and resource monitoring, it achieves flexible degradation control. An interception and processing mechanism is constructed, combined with state tracking and effect evaluation, to establish a reliable decision-making model. Cluster collaboration is introduced, and through state synchronization and queue optimization, the consistency of degradation is ensured. This method effectively solves the shortcomings of traditional technologies in rule configuration, state monitoring, and cluster collaboration, providing technical support for service governance.
[0023] To effectively address the shortcomings of traditional technologies in rule configuration, state monitoring, and cluster collaboration, and to provide technical support for service governance, this application provides an embodiment of a service degradation handling method, see [link to embodiment]. Figure 1 The service degradation processing method specifically includes the following: Step S101: Construct a degradation annotation system, configure exception type rules, timeout threshold rules, and return value verification rules in method-level annotations, configure parameter verification rules in parameter-level annotations, deploy the method-level annotations and parameter-level annotations to the target business method, collect system resource data, construct a resource monitoring matrix including processor load, memory usage, and thread status, dynamically allocate degradation processing threads according to the resource monitoring matrix, and generate a service tag matrix including call identifier, annotation configuration, and resource status. This embodiment builds a degradation annotation system during the application startup phase, creating method-level annotations and defining their attribute structure. The construction process declares exception type rule attributes to specify the set of exception types that trigger degradation, timeout threshold rule attributes to set the maximum execution time of the business method, and return value validation rule attributes to configure the conditional expression for triggering degradation based on the return value. This embodiment writes these three types of rule attributes into the metadata structure of the method-level annotations.
[0024] After the method-level annotations are constructed, this embodiment creates parameter-level annotations to support parameter-level validation control. The creation process defines parameter position identifier attributes, type conversion rule attributes, and data validation condition attributes. The parameter position identifier attribute points to the index position of the target parameter in the formal parameter list, the type conversion rule attribute specifies the format conversion logic for the parameter value, and the data validation condition attribute configures the validation rules for the parameter validity.
[0025] Accordingly, this embodiment deploys the method-level annotations and parameter-level annotations to the target business method. The deployment process involves adding method-level annotation markers to the business method declaration and configuring specific values for exception type rules, timeout threshold rules, and return value validation rules. In this embodiment, parameter-level annotation markers are added to the parameter list of the business method for the parameters that need validation. Taking the order creation scenario as an example, method-level annotations are deployed on the order creation method and timeout thresholds are configured, while parameter-level annotations are deployed on the order parameters and non-empty validation conditions are configured.
[0026] After the annotation deployment is completed, this embodiment collects system resource data to monitor runtime status. The collection process calls the system monitoring interface to read the utilization data of each processor core, the number of bytes occupied in heap memory and non-heap memory, and records the number of active threads and blocked threads in the thread pool. This embodiment organizes resource data from multiple collection periods according to time sequence to construct a resource monitoring matrix. The resource monitoring matrix uses rows to represent the collection time and columns to represent three dimensions: processor load, memory usage, and thread status.
[0027] Based on the resource monitoring matrix, this embodiment dynamically allocates degradation processing threads to adapt to the current system load. The allocation process follows the formula E=j C+k(1-M) Calculate the thread allocation weight, where E represents the thread allocation weight value, C represents the processor idle rate (ranging from zero to one), M represents the memory utilization rate (ranging from zero to one), j represents the processor weight coefficient, and k represents the memory weight coefficient. A higher thread allocation weight E value allocates more degraded processing threads, while a lower weight value reduces the number of threads.
[0028] This embodiment generates a service tag matrix based on the thread allocation weight E to integrate annotation configuration and resource status. The generation process uses the call identifier of the business method as the first column, the configuration information of method-level annotations and parameter-level annotations as the second column, and the current resource status and thread allocation result as the third column. This embodiment writes the tag data of each business method line by line into the service tag matrix, establishing a mapping relationship between the call identifier and the degradation configuration. The service tag matrix is written to a distributed cache for subsequent reading and calling during the deployment of the interception processing system in step S102.
[0029] Step S102: Deploy the interception and processing system, monitor the running status of the target business method based on the service tag matrix, collect execution time, abnormal information and return data, input the execution time, abnormal information and return data into the rule verification module, record historical degradation data, extract degradation success rate and business impact indicators, construct a degradation effect evaluation model, dynamically adjust the priority of degradation rules according to the degradation effect evaluation model, and generate a status tracking matrix containing execution status, verification results and degradation priority; This embodiment deploys an interception processing system during the application runtime phase, configuring the pointcut expression and around advice type for aspect components. During deployment, the pointcut expression is configured to match all business methods annotated with method-level annotations, enabling the interception processing system to automatically intercept call requests to the target method. This embodiment loads the service tag matrix written to the distributed cache in step S101 above, extracting the call identifier, annotation configuration, and resource status information of each business method.
[0030] After the interception and processing system is deployed, this embodiment monitors the running status of the target business method based on the service tag matrix. The monitoring process records the start timestamp before the method call, captures thrown exception objects during method execution, and records the end timestamp and return value after the method call. This embodiment calculates the execution duration by the difference between the end timestamp and the start timestamp, converts the captured exception objects into exception stack information, and encapsulates the method return value into a return data structure.
[0031] Accordingly, this embodiment inputs the execution time, the exception information, and the returned data into the rule verification module. The input process reads the annotation configuration information of the current method from the service tag matrix, extracts the exception type rules, timeout threshold rules, and return value verification rules. This embodiment compares the execution time with the timeout threshold rules, matches the exception information with the exception type rules, and substitutes the returned data into the conditional expression of the return value verification rule for evaluation. The rule verification module outputs the verification result identifier for each rule.
[0032] After the rule verification is completed, this embodiment records historical degradation data to support effect evaluation and analysis. The recording process writes the timestamp, trigger reason, and processing result of each degradation trigger into a degradation log table, and aggregates and statistically analyzes the degradation log table by time window. This embodiment extracts a degradation success rate indicator, calculating the proportion of successful degradation executions to the total number of degradation triggers. This embodiment also extracts a business impact indicator, calculating the difference between the average response time of degradation processing and the average response time of normal processing.
[0033] Based on the downgrade success rate and the business impact index, this embodiment constructs a downgrade effect evaluation model to quantify the execution effect of downgrade rules. The construction process uses the downgrade success rate as a positive evaluation factor and the business impact index as a negative evaluation factor, establishing a mapping relationship between the evaluation score and the two types of factors. The downgrade effect evaluation model receives historical downgrade data as input and outputs the effect evaluation score for each downgrade rule.
[0034] This embodiment dynamically adjusts the priority of degradation rules based on the degradation effect evaluation model. The adjustment process reads the effect evaluation score of each rule and sorts the rules according to their scores. Rules with higher evaluation scores receive higher execution priority, and when multiple rules are triggered simultaneously, the higher-priority rules are executed first. This embodiment writes the adjusted priority values back to the annotation configuration column of the service tag matrix.
[0035] Accordingly, this embodiment generates a state tracking matrix to integrate runtime monitoring data and verification results. The generation process uses the business method call identifier as the first column, the current execution state as the second column, the verification result output by the rule verification module as the third column, and the adjusted downgrade priority as the fourth column. This embodiment writes the tracking data of each method line by line into the state tracking matrix. The state tracking matrix is written to a message queue for broadcast to the cluster nodes in subsequent step S103 when establishing the cluster node communication network.
[0036] Step S103: Establish a cluster node communication network, broadcast the status tracking matrix to the cluster nodes, receive degradation status data from other nodes, merge degradation decision results, start the degradation process according to the degradation decision results, adjust the degradation queue processing rate based on the resource monitoring matrix, pass the business call parameters to the degradation method, collect degradation processing results, construct a result evaluation table containing degradation reasons, processing results, and node status, synchronize the result evaluation table to the cluster nodes, and update the processing status in the service tag matrix.
[0037] This embodiment establishes a cluster node communication network in an application cluster environment and configures a node discovery service and heartbeat detection mechanism. The establishment process involves building long-lived connection channels between each application node and registering node identifiers and connection addresses in the node registry. This embodiment loads the state tracking matrix written to the message queue in step S102 above, preparing to broadcast the data content of the state tracking matrix to the cluster nodes.
[0038] After the communication network is established, this embodiment broadcasts the state tracking matrix to the cluster nodes. The broadcast process serializes the state tracking matrix into a transmission format and sends it to all nodes in the node registry via the communication link. This embodiment also listens to the receiving port of the communication link to receive degradation status data broadcast by other nodes. The degradation status data includes the execution status, verification results, and degradation priority information of each node.
[0039] Accordingly, this embodiment merges the degradation decision results of each node to form a globally consistent degradation judgment. The merging process traverses the local state tracking matrix and the received remote degradation state data, and aligns them by business method call identifier. This embodiment performs voting aggregation on the verification results of multiple nodes with the same call identifier, and confirms the execution of the degradation operation when a majority of nodes determine that degradation has been triggered. The merged degradation decision result is written to the global decision cache.
[0040] After the degradation decision is confirmed, this embodiment initiates the degradation process based on the decision result. The initiation process reads the service call records marked as triggering degradation from the global decision cache and extracts the corresponding annotation configuration information from the service tag matrix. This embodiment locates the execution entry point of the degradation method based on the degradation method identifier and degradation class identifier in the annotation configuration.
[0041] Based on the resource monitoring matrix generated in step S101, this embodiment adjusts the processing rate of the degradation queue to adapt to the current system load. The adjustment process reads the processor load and memory usage data from the resource monitoring matrix at the most recent moment and calculates the available resource reserves of the current system. When resource reserves are sufficient, the number of concurrent processing threads in the degradation queue is increased; when resource reserves are scarce, the number of concurrent threads is reduced to avoid system overload.
[0042] This embodiment passes the business call parameters to the degradation method to execute the degradation processing logic. The passing process extracts the actual parameter group of the original business method from the interception context and determines whether the parameter list of the degradation method contains an exception type parameter. If the degradation method contains an exception type parameter, the exception object thrown by the business method is appended to the end of the actual parameter group. This embodiment calls the degradation method and receives its return value as the final response result of the business call.
[0043] Accordingly, this embodiment collects the degradation processing results to construct a result evaluation table. The collection process records the type of reason for degradation triggering, which includes three categories: exception triggering, timeout triggering, and return value triggering. This embodiment records the execution result and execution time of the degradation method, and records the current node's running status information. The result evaluation table uses the degradation reason as the first column, the processing result as the second column, and the node status as the third column.
[0044] This embodiment synchronizes the result evaluation table to the cluster nodes to achieve global visibility of the degradation results. The synchronization process writes the result evaluation table to a distributed cache and sends data update notifications to each node via the communication network. Upon receiving the notification, each node reads the latest result evaluation table content from the distributed cache. This embodiment updates the processing status column in the service tag matrix according to the result evaluation table, marking service calls that have completed degradation processing as processed.
[0045] As described above, the service degradation handling method provided in this application embodiment can achieve flexible degradation control through innovative annotation configuration system design, rule management, and resource monitoring. It constructs an interception handling mechanism, combines state tracking and effect evaluation, and establishes a reliable decision-making model. By introducing cluster collaboration and optimizing queues through state synchronization, it ensures the consistency of degradation. This method effectively solves the shortcomings of traditional technologies in rule configuration, state monitoring, and cluster collaboration, providing technical support for service governance.
[0046] In one embodiment of the service degradation processing method of this application, it may further include the following: Step S201: Construct a method-level degradation annotation framework, define an annotation attribute description table containing exception type identifiers, timeout threshold parameters, and return value verification conditions, write the annotation attribute description table into type metadata, generate annotation parsing rules containing attribute mapping relationships and default configurations, and load the annotation parsing rules into the annotation processor; Step S202: Construct a parameter-level degradation annotation framework, define a parameter processing table containing parameter location identifiers, type conversion rules, and data validation conditions, write the parameter processing table into the parameter parsing chain, generate parameter processing rules containing parameter mapping relationships and validation logic, and deploy the method-level degradation annotation and the parameter-level degradation annotation to the business method.
[0047] This embodiment constructs a method-level degradation annotation framework during the application initialization phase, declaring the annotation retention strategy as runtime visible and specifying that the annotation's target is method-level elements. The construction process defines an exception type identifier attribute to configure the set of exception classes that trigger degradation, a timeout threshold parameter attribute to set the maximum allowed execution time of the business method, and a return value validation condition attribute to configure the expression for determining degradation based on the return value. This embodiment organizes these three types of attributes into an annotation attribute description table.
[0048] After the annotation attribute description table is constructed, this embodiment writes it into the type metadata to support runtime parsing. During the writing process, the exception type identifier attribute is set to a default value of an empty array, indicating that degradation is not triggered based on exceptions by default. The timeout threshold parameter attribute is set to a default value of the baseline timeout duration in the global configuration file. The return value validation condition attribute is set to a default value of an empty string, indicating that degradation is not triggered based on the return value by default. The annotation attribute description table is embedded in the annotation information area of the bytecode file after compilation.
[0049] Accordingly, this embodiment generates annotation parsing rules to standardize the extraction and conversion logic of attribute values. The generation process establishes a mapping relationship between attribute names and attribute types, and configures value constraints for each attribute. This embodiment configures type validation rules for the exception type identifier attribute, requiring that each element in the attribute value be a subtype of the exception class. Numerical range constraints are configured for the timeout threshold parameter attribute, requiring that the attribute value be a positive integer. The annotation parsing rules include two parts: attribute mapping relationships and default configurations.
[0050] In this embodiment, the annotation parsing rules are loaded into the annotation processor for runtime invocation. The loading process registers the annotation parsing rules as an internal data source for the annotation processor and configures the data source's caching strategy and refresh mechanism. When the annotation processor receives a method interception request, it extracts the attribute configuration values annotated on the target method according to the annotation parsing rules. These annotation parsing rules are then read and invoked in subsequent step S202 when associating parameter-level annotations.
[0051] After the method-level annotation framework is constructed, this embodiment constructs a parameter-level degradation annotation framework to support parameter-level validation control. The construction process declares that the retention strategy for parameter-level annotations is runtime-visible, and specifies that the annotations target method parameter-level elements. This embodiment defines a parameter position identifier attribute to specify the index position of the target parameter in the parameter list, a type conversion rule attribute to configure the parameter value format conversion logic, and a data validation condition attribute to set the validation expression for parameter validity.
[0052] Accordingly, this embodiment organizes the three types of attributes into a parameter processing table and writes it into the parameter parsing chain. During the writing process, the parameter location identifier attribute, type conversion rule attribute, and data validation condition attribute are arranged sequentially as processing chain nodes. This embodiment receives the original parameter value at the entry point of the parameter parsing chain, sequentially passes through the location positioning, type conversion, and data validation stages, and outputs the validation result identifier at the exit point. The parameter processing table is associated with the aforementioned annotation processor for unified management.
[0053] This embodiment generates parameter processing rules to standardize the execution logic of parameter validation. The generation process establishes a mapping relationship between parameter indexes and parameter annotation configurations, and configures the handling strategy when validation fails. This embodiment combines the parameter processing rules with the aforementioned annotation parsing rules to form a complete degradation annotation processing system.
[0054] This embodiment deploys the method-level degradation annotation and the parameter-level degradation annotation to the business method. The deployment process involves adding a method-level degradation annotation marker to the business method declaration, configuring the specific values for the exception type identifier, timeout threshold parameter, and return value verification conditions. In the formal parameter list of the business method, parameter-level degradation annotation markers are added to the parameters that need verification, configuring the parameter position identifier, type conversion rules, and data verification conditions. The deployment result is used by subsequent step S301 to read the annotation configuration information when collecting system resource data.
[0055] In one embodiment of the service degradation processing method of this application, it may further include the following: Step S301: Collect system processor utilization and memory usage data, record thread running status and blocking time, construct a resource status table containing resource usage, thread distribution and blocking probability, organize the resource status table according to time series, generate a resource monitoring matrix, and write the resource monitoring matrix into the monitoring center. Step S302: Calculate thread load weights based on the resource monitoring matrix, allocate the number of degraded processing threads, write the degraded tasks into the processing queue, generate a task allocation table containing thread identifiers, processing weights, and scheduling parameters, and write the task allocation table and annotation configuration into the service tag matrix.
[0056] This embodiment collects system processor utilization and memory usage data during the application runtime phase, and calls the resource monitoring interface provided by the operating system to read the load percentage of each processor core. The collection process simultaneously reads the used bytes and total capacity of both heap memory and non-heap memory to calculate memory usage. This embodiment performs the collection operation periodically at fixed time intervals, appending a timestamp to each collected data point before writing it to the collection buffer.
[0057] After the processor and memory data acquisition is completed, this embodiment records the thread running status and blocking time. The recording process traverses all thread instances in the thread pool, reading the current status identifier of each thread. The status identifier includes three categories: running, waiting, and blocked. This embodiment counts the number of threads in the blocked state and records the cumulative blocking time of each blocked thread. The thread status data and the aforementioned processor and memory data together constitute a runtime snapshot of system resources.
[0058] Accordingly, this embodiment constructs a resource status table to organize multi-dimensional resource monitoring data. The construction process uses resource usage as the first column, recording the values of processor utilization and memory usage. Thread distribution is used as the second column, recording the percentage of threads in each state. Blocking probability is used as the third column, calculating the ratio of blocked threads to the total number of threads. In this embodiment, resource status data from each collection period is written row by row into the resource status table.
[0059] In this embodiment, the resource status table is organized according to a time series to generate a resource monitoring matrix. The organization process uses rows to represent the collection time and columns to represent three dimensions: resource usage, thread distribution, and blocking probability. The records in each row of the resource status table are arranged in ascending order of timestamp and filled into the matrix structure. The resource monitoring matrix retains data from the most recent collection periods, and historical data exceeding the retention range is discarded according to a first-in, first-out (FIFO) rule. In this embodiment, the resource monitoring matrix is written to the monitoring center for subsequent steps, such as S302, to read and call when calculating thread load weights.
[0060] Based on the aforementioned resource monitoring matrix written to the monitoring center, this embodiment calculates thread load weights to quantify the current system's thread scheduling capability. The calculation process reads the resource usage and blocking probability columns from the resource monitoring matrix at the most recent moment, using processor idle rate, memory idle rate, and thread availability rate as input factors for weight calculation. This embodiment weights and sums these three factors to obtain the thread load weight value; a higher weight value indicates that the system has sufficient thread scheduling space.
[0061] After the thread load weight calculation is completed, this embodiment allocates the number of degradation processing threads and writes the degradation tasks into the processing queue. The allocation process determines the target capacity of the degradation processing thread pool based on the thread load weight value; when the weight value is in the high range, the number of threads is increased; when the weight value is in the low range, the number of threads is decreased. In this embodiment, the degradation tasks to be executed are written into the processing queue in priority order, and the processing queue uses a priority sorting structure to organize the task entries.
[0062] Accordingly, this embodiment generates a task allocation table to record the scheduling relationship between threads and tasks. The generation process uses the thread identifier as the first column, the thread's processing weight as the second column, and scheduling parameters as the third column. These scheduling parameters include task timeout limits and retry count configurations. This embodiment combines the task allocation table with the annotation configuration deployed in step S202 and writes it into a service tag matrix, appending a thread scheduling information column to the service tag matrix. The service tag matrix is then read and called by the subsequent step S401 when deploying the aspect-oriented interception framework.
[0063] In one embodiment of the service degradation processing method of this application, it may further include the following: Step S401: Deploy the aspect interception framework, load the service tag matrix, construct an interception configuration table containing pointcut expressions, interception order, and processing priority, register the interception configuration table to the application context, generate an interception processor, and monitor the calling process of the target business method; Step S402: Collect the execution time data and exception stack information of the target business method, record the method return value, write the execution time data, the exception stack information and the method return value into the data buffer, construct a rule verification table containing verification rules, matching conditions and trigger thresholds, and deploy the rule verification table to the rule verification module.
[0064] This embodiment deploys the aspect interception framework during the application runtime phase and configures the basic runtime environment for aspect components. The deployment process loads the service tag matrix written in step S302 above, extracting the call identifiers, annotation configurations, and thread scheduling information for each business method. This embodiment identifies all business methods annotated with method-level degradation annotations based on the annotation configurations in the service tag matrix.
[0065] After the service tag matrix is loaded, this embodiment constructs an interception configuration table to standardize the execution rules of aspect interception. The construction process defines a pointcut expression attribute to match target methods annotated with degradation annotations, an interception order attribute to specify the execution order in multi-aspect scenarios, and a processing priority attribute to determine the triggering order of degradation rules. This embodiment writes these three types of attributes line by line into the interception configuration table according to business methods, establishing a mapping relationship between method identifiers and interception rules.
[0066] Accordingly, this embodiment registers the interception configuration table to the application context to activate the aspect-oriented interception function. The registration process encapsulates the interception configuration table as a managed object of the application context, and the configuration object's lifecycle follows a singleton pattern. This embodiment generates an interceptor processor instance, which wraps the call process of the target business method with an around-the-before-the-before approach. The interceptor processor automatically executes degradation judgment logic before and after the business method call.
[0067] This embodiment monitors the invocation process of the target business method through the interception processor. The monitoring process records the start timestamp and initializes the exception capture container before the method call; intercepts thrown exception objects during method execution and writes them into the exception capture container; and records the end timestamp and return value object after the method call. The monitoring data is temporarily stored in the interception processing context for subsequent step S402 to collect and process.
[0068] After the monitoring process is completed, this embodiment collects the execution time data and exception stack information of the target business method. The collection process calculates the difference between the end timestamp and the start timestamp to obtain the execution time data, extracts the exception object from the exception capture container, and converts it into an exception stack information string. This embodiment also records the method return value and serializes the return value object into a storable format.
[0069] Accordingly, this embodiment writes the execution duration data, the exception stack information, and the method return value into a data buffer. The writing process uses the business method call identifier as the buffer partition key, writing data from multiple calls to the same method into the same partition. This embodiment configures a capacity limit and eviction policy for the data buffer; when the partition data volume exceeds the limit, the record with the earliest timestamp is evicted.
[0070] This embodiment constructs a rule verification table to organize the judgment rules for degradation triggering. The construction process uses verification rules as the first column, recording exception type matching rules, timeout judgment rules, and return value verification rules. The matching conditions are used as the second column, recording the specific judgment expressions for each rule. The trigger threshold is used as the third column, recording the timeout threshold value and the boundary conditions for return value verification. In this embodiment, the rule verification table is deployed to the rule verification module, which reads monitoring data from the data buffer and performs rule matching operations. The rule verification table is used in subsequent step S501 to read verification results when recording degradation trigger data.
[0071] In one embodiment of the service degradation processing method of this application, it may further include the following: Step S501: Record the number of degradation triggers and degradation execution results of business methods, extract degradation data tables containing response time, success status, and business indicators, aggregate the degradation data tables by time window, calculate the degradation success probability and service availability indicators, construct a degradation effect evaluation model, and write the degradation effect evaluation model into the model repository. Step S502: Read the degradation effect evaluation model, calculate the execution weight of the degradation rules, prioritize the degradation rules, generate a rule adjustment table containing rule identifiers, weight coefficients, and priority levels, combine the rule adjustment table with the verification results to generate a state tracking matrix, and synchronize the state tracking matrix to the cluster nodes.
[0072] This embodiment records the number of downgrade triggers and the downgrade execution results of business methods during the downgrade process. The recording process reads the rule verification table deployed to the rule verification module in step S402 above, and obtains the rule matching results for each business method. This embodiment increments the trigger counter for the corresponding business method each time a downgrade is triggered, and records the execution result status identifier after the downgrade method is executed. The status identifier distinguishes between successful and failed execution.
[0073] After the degradation trigger data recording is completed, this embodiment extracts a degradation data table to organize detailed information about the degradation process. The extraction process uses response time as the first column, recording the time elapsed from the invocation to the return of the degradation method. Success status is used as the second column, recording the result identifier of the degradation execution. Business metrics are used as the third column, recording the business effectiveness score of the degradation return value. This embodiment writes the data from each degradation process row by row into the degradation data table.
[0074] Accordingly, this embodiment aggregates the degradation data table by time window to support statistical analysis. The aggregation process divides the records in the degradation data table into corresponding time window intervals according to their timestamps, and performs grouped statistics on the records within each interval. This embodiment calculates the probability of successful degradation by dividing the number of successful degradations within each time window by the total number of degradations within that window. This embodiment calculates the service availability metric, using the percentage of times the degradation response time meets the threshold requirement as the availability value.
[0075] Based on the downgrade success probability and the service availability metric, this embodiment constructs a downgrade effect evaluation model to quantify the execution effect of downgrade rules. The construction process uses the downgrade success probability as a positive evaluation input and the service availability metric as a stability evaluation input, establishing a mapping function between the evaluation score and the two types of inputs. The downgrade effect evaluation model receives aggregated statistical data within a time window and outputs the effect evaluation score for each downgrade rule. In this embodiment, the downgrade effect evaluation model is written into a model repository for subsequent steps S502 to read and call.
[0076] This embodiment reads the degradation effect evaluation model previously written to the model repository and calculates the execution weight of each degradation rule. The calculation process inputs aggregated data from several recent time windows into the degradation effect evaluation model to obtain the effect evaluation score for each rule. This embodiment normalizes the effect evaluation scores to obtain execution weight values; rules with higher weight values receive priority execution opportunities in scenarios with multiple rules coexisting.
[0077] After the execution weight calculation is completed, this embodiment prioritizes the degradation rules. The sorting process arranges the rules from highest to lowest execution weight value, assigning a priority level number to each rule in the ranking result. This embodiment generates a rule adjustment table to record the ranking results. The rule adjustment table uses the rule identifier as the first column, the weight coefficient as the second column, and the priority level as the third column.
[0078] Accordingly, this embodiment combines the rule adjustment table with the verification results output by the aforementioned rule verification module to generate a state tracking matrix. The combination process uses the business method call identifier as the primary key, associating the priority information in the rule adjustment table with the matching status in the verification results to the same data row. This embodiment appends an execution status column, a verification result column, and a degradation priority column to the state tracking matrix. The state tracking matrix is synchronized to each cluster node through the cluster node communication network, and is read by subsequent steps in S601 when establishing the communication link to achieve global degradation state consistency.
[0079] In one embodiment of the service degradation processing method of this application, it may further include the following: Step S601: Construct communication links between cluster nodes, write the state tracking matrix into the message queue, establish a node registry containing node identifiers, connection status, and data versions, receive degradation status data returned by cluster nodes, generate a global decision matrix containing the decision results and processing status of each node, and broadcast the global decision matrix to the nodes in the node registry. Step S602: Read the resource monitoring matrix, calculate the system load level, adjust the number of processing threads in the degradation queue, construct a queue control table containing queue capacity, processing rate, and task priority, assemble the business call parameters into a degradation request, write the degradation request into the degradation processing queue, and allocate processing resources according to the queue control table.
[0080] This embodiment constructs communication links between cluster nodes in an application cluster environment, configuring node discovery services and long-lived connection channels. The construction process establishes bidirectional communication connections between each application node and registers port addresses for message sending and receiving. This embodiment loads the state tracking matrix generated in step S502 above, preparing to synchronize the data content of the state tracking matrix to the cluster nodes.
[0081] After the communication link is established, this embodiment writes the state tracking matrix into a message queue to support asynchronous transmission. The writing process serializes the state tracking matrix into a message format and writes it to the corresponding topic in the message queue according to the business method call identifier partition. This embodiment adds a version number identifier to each partition message for subsequent receiving nodes to determine the data's age.
[0082] Accordingly, this embodiment establishes a node registry to maintain the connection information of cluster nodes. The establishment process uses the node identifier as the first column, recording the unique number of each node. The connection status is used as the second column, recording the current online and offline status of the node. The data version is used as the third column, recording the version number of the most recently synchronized status tracking matrix for each node. This embodiment periodically updates the connection status in the node registry through a heartbeat detection mechanism.
[0083] This embodiment receives degradation status data returned by cluster nodes to summarize global degradation information. The receiving process listens to the response topics in the message queue and parses the local degradation execution status and rule verification results reported by each node. This embodiment aligns local and remote data according to the business method call identifier to generate a global decision matrix. The global decision matrix includes columns for each node's decision result and processing status. This embodiment broadcasts the global decision matrix to all nodes in the node registry that are online.
[0084] After the global decision matrix is broadcast, this embodiment reads the resource monitoring matrix written to the monitoring center in step S301. The reading process extracts the most recent resource usage, thread distribution, and blocking probability columns from the resource monitoring matrix. This embodiment calculates the system load level by weighted summing of processor utilization, memory usage, and thread blocking rate to obtain a comprehensive load index.
[0085] Based on the system load level, this embodiment adjusts the number of processing threads in the degradation queue to adapt to the current resource situation. The adjustment process determines the direction of thread number adjustment based on the comprehensive load index; when the load index is in the low range, the number of processing threads is increased, and when the load index is in the high range, the number of processing threads is decreased. This embodiment constructs a queue control table to record the adjusted queue parameters. The queue control table uses queue capacity as the first column, processing rate as the second column, and task priority as the third column.
[0086] Accordingly, this embodiment assembles the business call parameters into a degradation request and writes it into the degradation processing queue. The assembly process extracts the actual parameter group and method signature information of the original business method from the interception context, and encapsulates this information into a degradation request data structure. This embodiment writes the degradation request into the degradation processing queue according to task priority, and allocates processing thread resources based on the processing rate parameters in the queue control table. The degradation processing queue is read and processed by subsequent step S701 when collecting degradation execution results.
[0087] In one embodiment of the service degradation processing method of this application, it may further include the following: Step S701: Collect the execution results of the degradation method, record the degradation triggering reason, construct a processing result table containing exception type, execution time and return status, combine the processing result table with the node running status to generate a result evaluation table containing degradation details, processing status and node information, and write the result evaluation table into the distributed cache; Step S702: Read the result evaluation table in the distributed cache, broadcast the result data to the cluster nodes, receive node confirmation information, update the service tag matrix containing degradation flags, processing progress, and synchronization status, and write the update result of the service tag matrix into the status manager.
[0088] This embodiment collects the execution result of the downgrade method after its execution is complete, and reads the processed downgrade requests from the downgrade processing queue written in step S602. The collection process obtains the return value object of the downgrade method and records the execution time from the invocation to the return of the downgrade method. This embodiment determines whether the downgrade method returns normally and marks the execution result as either a success or failure.
[0089] After the execution results are collected, this embodiment records the reason for the downgrade trigger to trace the root cause of the downgrade. The recording process extracts the matching result from the rule verification module from the interception processing context to identify which of the three types of reasons—abnormal trigger, timeout trigger, or return value trigger—triggered the downgrade. This embodiment writes the trigger reason type and the specific parameter value at the time of triggering into the reason record structure.
[0090] Accordingly, this embodiment constructs a processing result table to organize detailed data of the degradation process. The construction process uses exception type as the first column, recording the name of the exception class that triggered the degradation; if not triggered by an exception, it is recorded as an empty value. Execution time is used as the second column, recording the execution time of the degradation method. Return status is used as the third column, recording the success or failure indicator of the degradation execution. In this embodiment, the data from each degradation process is written row by row into the processing result table.
[0091] This embodiment combines the processing result table with the node running status to generate a result evaluation table. The combination process reads the processor load, memory usage, and thread status information of the current node, using the node running status as environment context data. This embodiment uses "degradation details" as the first column, recording the exception type, execution time, and return status from the processing result table. The "processing status" is used as the second column, recording the current processing stage identifier of the degradation request. The "node information" is used as the third column, recording the node identifier and node running status data.
[0092] Accordingly, this embodiment writes the result evaluation table into a distributed cache to support cross-node data sharing. The writing process connects to the distributed cache service, using the business method call identifier as the cache key. This embodiment serializes the result evaluation table into a cache storage format and configures the expiration time and update strategy for cache entries. The result evaluation table is then read by subsequent step S702 to achieve result synchronization between cluster nodes.
[0093] This embodiment reads the result evaluation table previously written to the distributed cache and broadcasts the result data to the cluster nodes. The reading process retrieves the latest result evaluation table content from the distributed cache and encapsulates the content into a broadcast message format. This embodiment sends the broadcast message to all online nodes in the node registry through the communication link established in step S601.
[0094] After the broadcast message is sent, this embodiment receives confirmation information from the receiving nodes to verify successful data synchronization. The receiving process monitors the confirmation messages returned by each node and verifies whether the data version number in the confirmation message matches the version number of the broadcast message. This embodiment counts the number of nodes returning confirmation information, and determines successful synchronization when the number of confirming nodes reaches a preset proportion.
[0095] Accordingly, this embodiment updates the service tag matrix to reflect the latest degradation processing status. The update process locates the data row of the current business method in the service tag matrix, updates the degradation identifier column to "degradation triggered," the processing progress column to "processing completed," and the synchronization status column to "synchronized to cluster." This embodiment writes the update result of the service tag matrix to the status manager, which maintains the persistent storage and version control of the service tag matrix.
[0096] To effectively address the shortcomings of traditional technologies in rule configuration, state monitoring, and cluster collaboration, and to provide technical support for service governance, this application provides an embodiment of a service degradation processing apparatus for implementing all or part of the aforementioned service degradation processing method. See [link to relevant documentation]. Figure 2 The service degradation processing device specifically includes the following components: The degradation annotation module 10 is used to build a degradation annotation system. It configures exception type rules, timeout threshold rules, and return value verification rules in method-level annotations and parameter verification rules in parameter-level annotations. It deploys the method-level annotations and the parameter-level annotations to the target business method, collects system resource data, builds a resource monitoring matrix including processor load, memory usage, and thread status, dynamically allocates degradation processing threads according to the resource monitoring matrix, and generates a service tag matrix including call identifier, annotation configuration, and resource status. The interception and processing module 20 is used to deploy the interception and processing system, monitor the running status of the target business method based on the service tag matrix, collect execution time, abnormal information and return data, input the execution time, abnormal information and return data into the rule verification module, record historical degradation data, extract degradation success rate and business impact indicators, construct a degradation effect evaluation model, dynamically adjust the priority of degradation rules according to the degradation effect evaluation model, and generate a status tracking matrix containing execution status, verification results and degradation priority. The degradation handling module 30 is used to establish a cluster node communication network, broadcast the status tracking matrix to the cluster nodes, receive degradation status data from other nodes, merge degradation decision results, initiate a degradation process based on the degradation decision results, adjust the degradation queue processing rate based on the resource monitoring matrix, pass business call parameters to the degradation method, collect degradation processing results, construct a result evaluation table containing degradation reasons, processing results, and node status, synchronize the result evaluation table to the cluster nodes, and update the processing status in the service tag matrix.
[0097] As described above, the service degradation processing apparatus provided in this application embodiment can achieve flexible degradation control through an innovative annotation configuration system, rule management, and resource monitoring. It constructs an interception processing mechanism, combines state tracking and effect evaluation, and establishes a reliable decision-making model. By introducing cluster collaboration and optimizing queues through state synchronization, it ensures the consistency of degradation. This method effectively addresses the shortcomings of traditional technologies in rule configuration, state monitoring, and cluster collaboration, providing technical support for service governance.
[0098] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor performs the service degradation processing method.
[0099] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned service degradation processing method.
[0100] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described service degradation processing method.
[0101] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0102] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0103] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0104] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0105] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A service degradation handling method, characterized in that, The method includes: A degradation annotation system is constructed. Exception type rules, timeout threshold rules, and return value verification rules are configured in method-level annotations, and parameter verification rules are configured in parameter-level annotations. The method-level annotations and parameter-level annotations are deployed to the target business method. System resource data is collected, and a resource monitoring matrix including processor load, memory usage, and thread status is constructed. Degradation processing threads are dynamically allocated according to the resource monitoring matrix, and a service tag matrix including call identifier, annotation configuration, and resource status is generated. A system for intercepting and processing is deployed to monitor the running status of the target business method based on the service tag matrix. It collects execution time, exception information, and return data. The execution time, exception information, and return data are input into a rule verification module. Historical degradation data is recorded, degradation success rate and business impact indicators are extracted, and a degradation effect evaluation model is constructed. The degradation rule priority is dynamically adjusted according to the degradation effect evaluation model, generating a state tracking matrix containing execution status, verification results, and degradation priority. This includes: recording the number of degradation triggers and degradation execution results of the business method; extracting a degradation data table containing response time, success status, and business indicators; aggregating the degradation data table by time window; calculating the degradation success probability and service availability indicators; constructing a degradation effect evaluation model; and writing the degradation effect evaluation model into a model repository. The system reads the degradation effect evaluation model, calculates the execution weight of the degradation rules, prioritizes the degradation rules, generates a rule adjustment table containing rule identifiers, weight coefficients, and priority levels, combines the rule adjustment table with the verification results to generate a state tracking matrix, and synchronizes the state tracking matrix to the cluster nodes. A cluster node communication network is established, the status tracking matrix is broadcast to the cluster nodes, degradation status data from other nodes is received, degradation decision results are merged, degradation process is initiated based on the degradation decision results, degradation queue processing rate is adjusted based on the resource monitoring matrix, business call parameters are passed to the degradation method, degradation processing results are collected, a result evaluation table containing degradation reasons, processing results, and node status is constructed, the result evaluation table is synchronized to the cluster nodes, and the processing status in the service tag matrix is updated.
2. The service degradation processing method according to claim 1, characterized in that, The aforementioned construction of a degradation annotation system involves configuring exception type rules, timeout threshold rules, and return value validation rules in method-level annotations, configuring parameter validation rules in parameter-level annotations, and deploying the method-level annotations and parameter-level annotations to the target business method, including: A method-level degradation annotation framework is constructed, defining an annotation attribute description table that includes exception type identifiers, timeout threshold parameters, and return value validation conditions. The annotation attribute description table is written into type metadata, generating annotation parsing rules that include attribute mapping relationships and default configurations. The annotation parsing rules are then loaded into the annotation processor. A parameter-level degradation annotation framework is constructed, defining a parameter processing table that includes parameter location identifiers, type conversion rules, and data validation conditions. The parameter processing table is written into the parameter parsing chain to generate parameter processing rules that include parameter mapping relationships and validation logic. The method-level degradation annotation and the parameter-level degradation annotation are then deployed to the business methods.
3. The service degradation processing method according to claim 1, characterized in that, The system collects resource data and constructs a resource monitoring matrix that includes processor load, memory usage, and thread status. Based on this resource monitoring matrix, it dynamically allocates degraded processing threads and generates a service tag matrix that includes call identifiers, annotation configurations, and resource status, including: Collect system processor utilization and memory usage data, record thread running status and blocking time, construct a resource status table containing resource usage, thread distribution and blocking probability, organize the resource status table according to time series, generate a resource monitoring matrix, and write the resource monitoring matrix into the monitoring center. Calculate thread load weights based on the resource monitoring matrix, allocate the number of degraded processing threads, write degraded tasks into the processing queue, generate a task allocation table containing thread identifiers, processing weights, and scheduling parameters, and write the task allocation table and annotation configurations into the service tag matrix.
4. The service degradation processing method according to claim 1, characterized in that, The deployment interception and processing system monitors the running status of the target business method based on the service tag matrix, collects execution time, exception information, and return data, and inputs the execution time, exception information, and return data into a rule verification module, including: Deploy the aspect interception framework, load the service tag matrix, construct an interception configuration table containing pointcut expressions, interception order, and processing priority, register the interception configuration table to the application context, generate an interception processor, and monitor the calling process of the target business method; Collect execution time data and exception stack information of the target business method, record the method return value, write the execution time data, the exception stack information and the method return value into the data buffer, construct a rule verification table containing verification rules, matching conditions and trigger thresholds, and deploy the rule verification table to the rule verification module.
5. The service degradation processing method according to claim 1, characterized in that, The process of establishing a cluster node communication network, broadcasting the status tracking matrix to the cluster nodes, receiving degradation status data from other nodes, merging degradation decision results, initiating a degradation process based on the degradation decision results, adjusting the degradation queue processing rate based on the resource monitoring matrix, and passing business call parameters to the degradation method includes: Establish communication links between cluster nodes, write the state tracking matrix into a message queue, establish a node registry containing node identifiers, connection status, and data versions, receive degradation status data returned by cluster nodes, generate a global decision matrix containing the decision results and processing status of each node, and broadcast the global decision matrix to the nodes in the node registry. Read the resource monitoring matrix, calculate the system load level, adjust the number of processing threads in the degradation queue, construct a queue control table containing queue capacity, processing rate, and task priority, assemble business call parameters into a degradation request, write the degradation request into the degradation processing queue, and allocate processing resources according to the queue control table.
6. The service degradation processing method according to claim 1, characterized in that, The process involves collecting degradation processing results, constructing a result evaluation table that includes degradation reasons, processing results, and node status, synchronizing the result evaluation table to cluster nodes, and updating the processing status in the service tag matrix, including: Collect the execution results of the degradation method, record the degradation triggering reason, construct a processing result table containing exception type, execution time and return status, combine the processing result table with the node running status to generate a result evaluation table containing degradation details, processing status and node information, and write the result evaluation table into the distributed cache; Read the result evaluation table in the distributed cache, broadcast the result data to the cluster nodes, receive node confirmation information, update the service tag matrix containing degradation flags, processing progress, and synchronization status, and write the updated result of the service tag matrix into the state manager.
7. A service degradation processing device, characterized in that, The device includes: The degradation annotation module is used to build a degradation annotation system. It configures exception type rules, timeout threshold rules, and return value verification rules in method-level annotations and parameter verification rules in parameter-level annotations. It deploys the method-level annotations and parameter-level annotations to the target business methods, collects system resource data, builds a resource monitoring matrix including processor load, memory usage, and thread status, dynamically allocates degradation processing threads according to the resource monitoring matrix, and generates a service tag matrix including call identifier, annotation configuration, and resource status. An interception and processing module is used to deploy an interception and processing system. Based on the service tag matrix, it monitors the running status of the target business method, collects execution time, exception information, and return data, inputs the execution time, exception information, and return data into a rule verification module, records historical degradation data, extracts degradation success rate and business impact indicators, constructs a degradation effect evaluation model, dynamically adjusts degradation rule priorities according to the degradation effect evaluation model, and generates a state tracking matrix containing execution status, verification results, and degradation priorities. This includes: recording the number of degradation triggers and degradation execution results of the business method; extracting a degradation data table containing response time, success status, and business indicators; aggregating the degradation data table by time window; calculating the degradation success probability and service availability indicators; constructing a degradation effect evaluation model; and writing the degradation effect evaluation model into a model repository. The module also reads the degradation effect evaluation model, calculates the execution weight of the degradation rules, prioritizes the degradation rules, generates a rule adjustment table containing rule identifiers, weight coefficients, and priority levels, combines the rule adjustment table with the verification results to generate a state tracking matrix, and synchronizes the state tracking matrix to cluster nodes. The degradation handling module is used to establish a cluster node communication network, broadcast the status tracking matrix to the cluster nodes, receive degradation status data from other nodes, merge degradation decision results, initiate a degradation process based on the degradation decision results, adjust the degradation queue processing rate based on the resource monitoring matrix, pass business call parameters to the degradation method, collect degradation processing results, construct a result evaluation table containing degradation reasons, processing results, and node status, synchronize the result evaluation table to the cluster nodes, and update the processing status in the service tag matrix.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the service degradation processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the service degradation processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Service degradation method and device of distributed server, electronic equipment and medium
CN114006907A
Distributed service degradation self-adaption method and system based on annotation driving
CN121000725A
