Software system fault monitoring system and method based on operation state perception
By constructing a time-series mapping relationship for thread-level execution behavior and dynamically adjusting scheduling priorities, the problem of lagging thread pool state anomaly monitoring in existing technologies is solved, enabling early fault identification and assessment of the thread pool system and improving the accuracy and adaptability of monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN ZHONGRUIWEISHI PHOTOELECTRONICS CO LTD
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-19
AI Technical Summary
Existing fault monitoring technologies struggle to promptly identify system response time degradation caused by thread pools not yet reaching saturation, resulting in monitoring lag.
By constructing a temporal mapping relationship of thread-level execution behavior, extracting composite running feature sequences that represent changes in processing rhythm, combining them with the state reference structure of historical stable running intervals, quantifying the degree of deviation, identifying abnormal states, and dynamically adjusting the monitoring granularity and scheduling priority.
It enables early identification and accurate assessment of potential faults, enhances the foresight and adaptability of monitoring, avoids the spread and diffusion of the impact of a single anomaly identification, and has higher practical value.
Smart Images

Figure CN122064572A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software system fault monitoring, specifically to a software system fault monitoring system and method based on operational status awareness. Background Technology
[0002] In the operation of existing software systems, for application scenarios that use thread pool mechanisms to handle concurrent requests, existing fault monitoring technologies typically rely on whether the maximum number of threads in the thread pool, the number of currently active threads, or the queue length has reached a threshold as the main monitoring basis. In actual operation, when the thread pool has not yet reached saturation and the request queue length is still within the normal range, changes in thread scheduling order, task execution sequence, or upstream and downstream dependencies may lead to threads occupying the system for a long time, abnormal task switching frequency, or an imbalance in request processing rhythm, thereby causing the system response time to gradually deteriorate. Since the above-mentioned changes in operating status are not directly reflected in the explicit abnormality of the number of threads or the queue length, existing fault monitoring methods based on indicator thresholds are difficult to identify such abnormal states in a timely manner. Fault risks are often only detected after the system response performance has significantly deteriorated or even after request failures occur, resulting in a lag in fault monitoring. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention provides a software system fault monitoring system and method based on operational status awareness, which has the advantage of improving the accuracy of fault monitoring and solves the problems mentioned in the background technology.
[0004] To achieve the aforementioned goal of improving the accuracy of fault monitoring, this invention provides the following technical solution: a software system fault monitoring method based on operational status awareness, comprising the following steps: Continuously observe the execution environment of threads that carry concurrent requests, construct a temporal mapping relationship of thread-level execution behavior, and form a basic state description set that reflects the thread's running activity and blocking tendency; Based on the basic state description set, the execution segments of different threads in continuous time slices are recombined and analyzed. By comparing the changes in task switching frequency, the degree of execution interval stretching and the evolution trend of waiting ratio, composite running feature sequences that characterize the changes in processing rhythm are extracted. Based on the composite operating characteristic sequence, a state reference structure corresponding to the historical stable operating interval is introduced. The deviation between the current operating characteristics and the reference structure is quantitatively evaluated to identify abnormal state candidates that have not yet triggered the number of threads but have already shown signs of processing efficiency degradation. The abnormal state candidates are associated with the corresponding thread set and the call path they depend on. The occupancy behavior and coordination relationship of the thread set in different time windows are cross-analyzed to determine the internal impact level of the abnormal state. Based on the impact level, the runtime status perception parameters and monitoring granularity are dynamically adjusted. Based on the coupling relationship between the thread occupancy mode and the call path corresponding to the abnormal state, runtime status constraint rules are constructed to impose restrictions on the scheduling priority and concurrent access of relevant threads, and output status warning results indicating potential fault risks.
[0005] Preferably, the process of forming a set of basic state descriptions that reflect the activity level and blocking tendency of threads is as follows: Inside the running node, the states of the thread scheduler, run queue, and synchronization lock are periodically sampled to obtain the state events of thread creation, ready, running, blocked, and awakened. A unified timestamp is appended to the sampled thread state events, and they are aggregated according to the thread identifier to form a sequence of thread state events arranged in chronological order. Based on the thread state event sequence, calculate the active duration, blocking duration and waiting percentage of each thread within a unit time window, and construct the temporal mapping relationship of thread-level execution behavior; The timing mapping relationship is standardized and encoded to form a set of basic state descriptions that reflect the thread's running activity and blocking tendency.
[0006] Preferably, the process of recombining and analyzing the execution segments of different threads within a consecutive time slice is as follows: According to the preset time slice length, the thread state description in the basic state description set is segmented by sliding window, and a unified time index is attached to each time slice to obtain the thread execution segments corresponding to multiple consecutive time slices. The execution segments within adjacent time slices are correlated temporally to identify the transition relationships between thread states in ready, running, blocked, and awakened states, and to construct a sequence of execution segments that reflects the continuous changes in thread states. The number of state transitions, duration distribution, and transition direction in the execution segment sequence are statistically analyzed to form an intermediate feature set describing the changes in thread execution rhythm.
[0007] Preferably, the process of extracting the composite operational feature sequence representing the rhythm changes is as follows: Based on the intermediate feature set, the number of state transitions of each thread in a continuous time slice is counted, the number of task switching is extracted, and a task switching frequency change curve is formed. Based on the duration distribution of execution segments recorded in the intermediate feature set, the time interval between adjacent execution segments of a thread is calculated, and the magnitude of the interval change is normalized to obtain the execution interval stretching index. Based on the proportion of each state in the intermediate feature set within the time slice, the proportion of waiting states of the thread in each time slice is calculated, and the proportion of waiting states is accumulated and smoothed to generate the evolution trend of the waiting proportion. By splicing together the task switching frequency change curve, execution interval stretching index, and waiting ratio evolution trend in multiple dimensions, a composite operational feature sequence representing the changes in processing rhythm is constructed.
[0008] Preferably, the process of introducing a state reference structure corresponding to the historical stable operating range is as follows: Filter time periods from historical operation logs that are under stable load and have not experienced failures, and extract the corresponding composite operation feature sequences as stable samples. Stable samples were grouped according to their processing rhythm characteristics, and statistical analysis was performed on the composite operational characteristic sequences within each group. Based on the analysis results, a state reference structure is constructed that includes the boundary of running feature values, feature coupling constraint relationships, and rhythm consistency conditions.
[0009] Preferably, the process for identifying candidate abnormal states that have not yet triggered a decrease in thread count but have already shown signs of processing efficiency degradation is as follows: The real-time acquired composite operational feature sequence is mapped to the feature distribution space corresponding to the state reference structure; Calculate the deviation of the current running feature from the central interval of the reference structure in each dimension to form a multidimensional deviation vector; By weighting and summing the multidimensional deviation vectors, a comprehensive deviation index representing the degree of change in the overall processing rhythm is obtained; When the overall deviation index exceeds the preset threshold and the total number of threads does not change significantly, the corresponding running state will be marked as an abnormal state candidate.
[0010] Preferably, the process of determining the internal impact level of an abnormal state is as follows: Based on the time interval in which the abnormal state candidates appear, locate the set of threads that are in an active or blocked state within the time interval. Analyze the function call relationships involved in the execution of the thread and generate the corresponding call path structure; Within multiple different time windows, the changes in resource consumption of the thread set and the synchronization and waiting relationships between threads are statistically analyzed to form a description of the changes in thread cooperative behavior; Perform path expansion analysis on the call path structure, count the number of call nodes associated with abnormal states and the span of call levels, and obtain the call path coverage depth index. By combining the description of changes in thread cooperative behavior with the call path coverage depth metric, abnormal states are mapped to preset impact level judgment rules to determine the internal impact level of abnormal states.
[0011] Preferably, the process of constructing runtime state constraint rules is as follows: Based on the impact level corresponding to the abnormal state, the thread state sampling frequency, time slice length, and number of threads participating in monitoring are dynamically adjusted to form a runtime state awareness configuration that matches the impact level. Under the runtime status awareness configuration, the scope of runtime status awareness is expanded and the monitoring granularity is refined for abnormal states with higher impact levels, and fine-grained change characteristics of thread execution behavior and call relationship under abnormal states are collected. Based on fine-grained variation characteristics, the correlation between thread occupancy patterns and call paths is analyzed, and the characteristics of runtime behavior under abnormal states are summarized and the structure is abstracted to form runtime state constraint rules for concurrent access.
[0012] Preferably, the process for outputting a status warning result indicating potential failure risk is as follows: Based on the runtime state constraint rules, the scheduling priority of the affected threads is reduced. Limit new concurrent requests to call paths associated with abnormal states to control load growth; While imposing scheduling and concurrency limits, state warning results representing the severity of anomalies and the level of impact are generated.
[0013] A software system fault monitoring system based on operational status awareness, comprising: Thread observation module: continuously observes the execution environment of threads that carry concurrent requests, and generates a set of basic state descriptions that reflect the thread's running activity and blocking tendency; Rhythm Analysis Module: Reorganizes and analyzes the execution segments of a thread within a continuous time slice to extract composite runtime feature sequences that characterize changes in processing rhythm; Anomaly identification module: compares and evaluates the composite operating feature sequence with historical stable operating states to identify candidate anomalies where processing efficiency shows signs of degradation; Hierarchical determination module: Based on the thread set and call path characteristics associated with abnormal state candidates, determine the internal impact level of the abnormal state; Rule Response Module: Adjusts the operation status perception parameters and constructs operation status constraint rules according to the impact level of abnormal states, so as to apply concurrent access and scheduling control and output status warning results.
[0014] Compared with the prior art, the present invention provides a software system fault monitoring system and method based on operational status awareness, which has the following beneficial effects: This invention continuously observes the thread execution environment carrying concurrent requests, constructs a temporal mapping relationship of thread-level execution behavior, and introduces multi-dimensional processing rhythm features such as task switching frequency, execution interval stretching, and waiting ratio evolution. This achieves fine-grained characterization of changes in the running state. Compared with existing fault monitoring methods based solely on the number of threads, resource utilization, or instantaneous indicators, it can identify potential risk states that have not yet caused explicit anomalies but have shown a trend of processing efficiency degradation earlier. By quantifying the deviation between the current running characteristics and the state reference structure corresponding to the historical stable running interval, anomaly identification no longer relies on fixed thresholds or static rules, improving adaptability to different load scenarios and running modes. Furthermore, it defines abnormal states... By performing correlation analysis with thread sets and their call paths, and combining thread occupancy behavior and coordination relationships within different time windows to determine the impact level, the problem of ignoring the propagation and diffusion impact of only locating a single abnormal thread is avoided. Based on this, the runtime status perception parameters and monitoring granularity are dynamically adjusted according to the impact level, and runtime status constraint rules are constructed by combining the coupling relationship between thread occupancy patterns and call paths. This enables hierarchical control of scheduling priority and concurrency access, allowing monitoring results to be directly transformed into executable runtime regulation and early warning output. Therefore, it has significantly improved the foresight of anomaly identification, the accuracy of impact assessment, and the ability of monitoring results to link to runtime control and risk warning, and has higher practical value and engineering applicability. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the method of the present invention; Figure 2 This is a schematic diagram of the structure of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Example 1: Please refer to Figure 1 As shown in the embodiment of the present invention, a software system fault monitoring method based on runtime status awareness includes the following steps: S1: Continuously observe the execution environment of threads that carry concurrent requests, construct a temporal mapping relationship of thread-level execution behavior, and form a basic state description set that reflects the thread's running activity and blocking tendency.
[0018] The process of forming the basic state description set reflecting the thread's activity level and blocking tendency in S1 is as follows: Inside the running node, the states of the thread scheduler, run queue, and synchronization lock are periodically sampled to obtain the state events of thread creation, ready, running, blocked, and awakened. A thread running status acquisition module is deployed inside the running node. This module establishes a data interaction interface with the operating system thread scheduler, run queue management module, and synchronization lock management mechanism to periodically sample the thread running status. The sampling period can be configured according to the system load level or monitoring accuracy requirements, preferably a fixed period that matches the thread scheduling time slice. In each sampling period, the thread status identification information recorded in the thread scheduler is read, and combined with the run queue length, queue position changes, and the occupancy status of mutex locks, read-write locks, or condition variables, the status events of the thread at the corresponding time, such as creation, ready, running, blocked, or awakened, are obtained, thereby forming an original set of thread status events.
[0019] A unified timestamp is appended to the sampled thread state events, and they are aggregated according to the thread identifier to form a sequence of thread state events arranged in chronological order. High-precision timestamps are uniformly added to the sampled thread state events. The timestamps can be generated based on the system monotonic clock or high-resolution timer to ensure the time comparability of events within different sampling periods. The thread identifier is used as the aggregation basis to integrate the state events belonging to the same thread and sort them according to the order of the timestamps to form a sequence of thread state events arranged in chronological order. For thread state events that maintain the same state in consecutive sampling periods, they can be merged through state continuation identifiers to reduce redundant data and maintain the continuity of the thread state evolution process.
[0020] Based on the thread state event sequence, calculate the active duration, blocking duration and waiting percentage of each thread within a unit time window, and construct the temporal mapping relationship of thread-level execution behavior; Based on the formed thread state event sequence, a fixed or sliding time window mechanism is introduced to perform statistical analysis on thread execution behavior. The length of the time window can be set according to the analysis granularity requirements, and the sliding step can be set to be equal to or less than the time window length to achieve continuous coverage of thread execution behavior. Within each time window, the cumulative duration of the thread in the running state is counted as a thread activity duration indicator, and the continuous or cumulative time of the thread in the blocked state is counted as a blocking duration indicator. At the same time, the proportion of time the thread is in the ready or waiting state is calculated to characterize the degree of thread participation in scheduling competition. Through the above statistical results, a temporal mapping relationship of thread-level execution behavior in the time dimension is constructed.
[0021] The timing mapping relationship is standardized and encoded to form a set of basic state descriptions that reflect the thread's running activity and blocking tendency; The obtained thread-level execution behavior time sequence mapping relationship is standardized and encoded to eliminate the impact of differences in runtime, load conditions and sampling frequency of different threads. The statistical indicators such as the active duration, blocking duration and waiting ratio of threads in each time window are normalized or interval quantized and encoded. The structured state description vector is generated by combining the preset field order. The state description vectors together constitute the basic state description set reflecting the thread running activity and blocking tendency, providing a unified data foundation for thread anomaly identification, running status evaluation or scheduling strategy optimization.
[0022] S2: Based on the basic state description set, the execution segments of different threads in continuous time slices are recombined and analyzed. By comparing the changes in task switching frequency, the degree of execution interval stretching and the evolution trend of waiting ratio, composite running feature sequences that represent changes in processing rhythm are extracted.
[0023] The process of recombining and analyzing the execution segments of different threads within a consecutive time slice in S2 is as follows: According to the preset time slice length, the thread state description in the basic state description set is segmented by sliding window, and a unified time index is attached to each time slice to obtain the thread execution segments corresponding to multiple consecutive time slices. According to the preset time slice length, the thread state descriptions in the basic state description set are segmented using a sliding window method. The time slice length can be set according to the system scheduling cycle or analysis accuracy requirements, preferably an integer multiple of one or more scheduling time slices. The sliding step size can be set to be equal to the time slice length or a fraction thereof to achieve continuous coverage of thread states. During the segmentation process, thread state descriptions falling within the same time slice are aggregated, and a unified time index is attached to each time slice to indicate its position in the overall runtime timeline. In this way, thread execution segments corresponding to multiple consecutive time slices are obtained, where each execution segment is used to characterize the distribution of the thread's running state and the dominant state within the corresponding time slice.
[0024] The execution segments within adjacent time slices are correlated temporally to identify the transition relationships between thread states in ready, running, blocked, and awakened states, and to construct a sequence of execution segments that reflects the continuous changes in thread states. Using threads as the basic unit of analysis, temporal correlation analysis is performed on the execution segments of the same thread within adjacent time slices. By comparing the changes in the dominant state or state proportion of the thread in adjacent time slices, the transition relationship between the thread state and the ready, running, blocked, and awakened states is identified, and the starting time slice, target time slice, and transition type of each state transition are recorded. For threads that maintain the same state in multiple consecutive time slices, the corresponding execution segments are merged into a single continuous execution segment, and its duration is recorded. For threads that undergo multiple state transitions, the corresponding execution segment sequence is generated in chronological order, thereby constructing an execution segment sequence that reflects the continuous change process of the thread state.
[0025] The number of state transitions, duration distribution, and transition direction in the execution segment sequence are statistically analyzed to form an intermediate feature set describing the changes in thread execution rhythm; For the generated thread execution segment sequences, statistical analysis is performed on the state transition behaviors to extract an intermediate feature set describing changes in thread execution rhythm. During the statistical analysis, the number of state transitions occurring within the analysis period is counted to reflect the stability of the thread scheduling process. Secondly, the duration distribution of threads in different states is analyzed to characterize the time occupancy of threads in running, blocked, or waiting states. Simultaneously, the direction of state transitions is categorized and statistically analyzed, including the proportions of transitions from ready to running, running to blocked, and blocked to awakened, to identify the main execution paths of threads and their limiting links. The statistical results are then structured according to preset feature dimensions to form a structured feature vector, thus constituting an intermediate feature set describing changes in thread execution rhythm. This provides a feature foundation for anomaly identification, scheduling strategy adjustment, or runtime state evaluation. The process of extracting the composite running feature sequence representing the rhythm changes in S2 is as follows: Based on the intermediate feature set, the number of state transitions of each thread in a continuous time slice is counted, the number of task switching is extracted, and a task switching frequency change curve is formed. Based on the formed intermediate feature set, the number of state transitions of each thread within consecutive time slices is statistically analyzed. Within each time slice, the number of transitions from the running state to the ready, blocked, or awakened state is counted, and this number of transitions is taken as the task switching number of the thread within the corresponding time slice. The task switching numbers within multiple consecutive time slices are arranged in chronological order to form a task switching frequency sequence that changes over time. This sequence can be further smoothed using moving average or exponential smoothing to reduce the impact of instantaneous jitter on the analysis results, thereby obtaining a task switching frequency change curve to reflect the changing trend of thread processing rhythm.
[0026] Based on the duration distribution of execution segments recorded in the intermediate feature set, the time interval between adjacent execution segments of a thread is calculated, and the magnitude of the interval change is normalized to obtain the execution interval stretching index. Based on the distribution information of thread execution segment durations recorded in the intermediate feature set, the time interval between adjacent thread execution segments is calculated. The time interval can be obtained by the difference between the end time of the adjacent execution segment and the start time of the next execution segment. It is used to characterize the intermittent situation of the thread during continuous execution. On this basis, the time intervals obtained in different time slices are normalized to eliminate the influence of differences in thread execution duration. Based on the change of the time interval relative to the historical baseline value, an execution interval stretching index is generated. The execution interval stretching index is used to characterize whether the thread execution rhythm has lengthened or contracted.
[0027] Based on the proportion of each state in the intermediate feature set within the time slice, the proportion of waiting states of the thread in each time slice is calculated, and the proportion of waiting states is accumulated and smoothed to generate the evolution trend of the waiting proportion. The proportion of waiting states within each time slice is cumulatively analyzed in chronological order, and the proportion sequence is smoothed using a sliding window averaging or weighted smoothing method to generate an evolution trend reflecting the changes in thread waiting states over time, which is used to characterize the continuous changes in the waiting degree of threads during scheduling.
[0028] By splicing together the task switching frequency change curve, execution interval stretching index, and waiting ratio evolution trend in multiple dimensions, a composite operational feature sequence representing the change in processing rhythm is constructed. The task switching frequency change curve, execution interval stretching index, and waiting ratio evolution trend are aligned according to the time slice index and multi-dimensional splicing processing is performed to form a unified feature representation. The multi-dimensional feature sequence obtained by the above splicing constitutes a composite running feature sequence that characterizes the changes in thread processing rhythm. It serves as the input feature for the identification model, running status evaluation module, or scheduling strategy adjustment mechanism to support the comprehensive analysis of changes in thread processing rhythm.
[0029] S3: Based on the composite operating characteristic sequence, introduce a state reference structure corresponding to the historical stable operating interval, quantify the deviation between the current operating characteristics and the reference structure, and identify abnormal state candidates that have not yet triggered the number of threads but have shown signs of processing efficiency degradation.
[0030] The process of introducing a state reference structure corresponding to the historical stable operating range in S3 is as follows: Filter time periods from historical operation logs that are under stable load and have not experienced failures, and extract the corresponding composite operation feature sequences as stable samples. The system selects time segments from historical operation logs that are under stable load and have not experienced failures, as the source of stable operation samples. Stable load status can be determined by indicators such as system resource utilization, thread number fluctuation range, and task completion delay. Time segments without failures can be confirmed based on fault logs, abnormal alarm records, or manually labeled information. Within the selected stable time segments, the composite operation feature sequence of each thread within the corresponding time range is extracted and stored as a stable sample for use in the construction of the state reference structure.
[0031] Stable samples were grouped according to their processing rhythm characteristics, and statistical analysis was performed on the composite operational characteristic sequences within each group. The stable samples formed are grouped according to their processing rhythm characteristics. These characteristics may include task switching frequency, execution interval stretching index range, and waiting ratio evolution trend. During the grouping process, threshold-based rule division or cluster analysis can be used to group composite operation feature sequences with similar processing rhythm characteristics into the same group. Statistical analysis is performed on the composite operation feature sequences in each group to calculate the mean, variance, quantile interval, and correlation index of each feature within the group, so as to characterize the typical distribution characteristics of each processing rhythm feature under stable operation conditions.
[0032] Based on the analysis results, a state reference structure is constructed that includes the boundary of running feature values, feature coupling constraint relationships, and rhythm consistency conditions. Based on the statistical distribution range of each processing rhythm feature in stable samples, the value boundaries of each running feature are determined to limit the reasonable feature range of the thread in a stable running state. Based on the correlation analysis results between different running features, the coupling constraint relationship between features is established to describe the stability conditions when multiple features change collaboratively. At the same time, combined with the consistency performance of stable samples in the time dimension, the consistency condition of processing rhythm is formed to characterize the stability requirements of feature changes over time in a stable running state. The value boundaries of running features, the feature coupling constraint relationship, and the rhythm consistency condition together constitute a state reference structure, which is used as a reference benchmark for determining the running state, identifying anomalies, or adjusting scheduling strategies.
[0033] The process in S3 for identifying candidate abnormal states that have not yet triggered thread counts but have already shown signs of processing efficiency degradation is as follows: The real-time acquired composite operational feature sequence is mapped to the feature distribution space corresponding to the state reference structure; The real-time acquired composite running feature sequence is input into the state mapping module, and the composite running feature sequence is mapped to the feature distribution space corresponding to the state reference structure according to the feature dimension order consistent with the state reference structure. During the mapping process, the real-time features are normalized and aligned in the same way as the reference structure to ensure that the real-time running features and historical stable running samples are compared on the same feature scale, so that the real-time running state can obtain the corresponding spatial position representation in the state reference structure.
[0034] Calculate the deviation of the current running feature from the central interval of the reference structure in each dimension to form a multidimensional deviation vector; After completing the state space mapping, for the values of the composite running feature sequence in each feature dimension, the deviation magnitude of its value relative to the central interval of the state reference structure is calculated. The central interval can be determined by the mean interval or quantile interval of the stable samples. The deviation magnitude can be quantified by the distance between the feature value and the boundary or central value of the central interval, and normalized according to the fluctuation range of each feature in the reference structure. Through the above calculation, corresponding deviation components are formed in each feature dimension, and then a multi-dimensional deviation vector is constructed to characterize the overall deviation of the current running feature in the multi-dimensional feature space.
[0035] By weighting and summing the multidimensional deviation vectors, a comprehensive deviation index representing the degree of change in the overall processing rhythm is obtained; The resulting multidimensional deviation vector is weighted and summarized to obtain a comprehensive deviation index that characterizes the degree of change in the overall processing rhythm. The weights corresponding to each feature dimension can be set according to the importance, stability, or historical sensitivity of the feature in the state reference structure. The weight configuration can adopt a fixed weight scheme or be dynamically adjusted based on historical statistical results. During the weighted summation process, the components in the multidimensional deviation vector are weighted and summed or weighted norms are calculated to obtain a single comprehensive deviation index, which is used to reflect the overall degree of deviation of the current operating state from the historical stable operating range.
[0036] When the overall deviation index exceeds the preset threshold and the total number of threads does not change significantly, the corresponding running state will be marked as an abnormal state candidate. The calculated comprehensive deviation index is compared with a preset threshold. The threshold can be set based on the deviation distribution of historical stable samples or system operation experience to distinguish between normal fluctuations and abnormal trends. When the comprehensive deviation index exceeds the preset threshold, and the thread management module confirms that the total number of threads in the current running node has not changed significantly, it is determined that the current running state has not yet shown abnormal thread count, but has shown early signs of processing efficiency degradation. At this time, the corresponding running state is marked as an abnormal state candidate to trigger key monitoring, risk assessment, or pre-adjustment of scheduling strategies.
[0037] S4: Associate the candidate abnormal state with the corresponding thread set and the call path it depends on, perform cross-analysis on the occupancy behavior and coordination relationship of the thread set in different time windows, and determine the internal impact level of the abnormal state.
[0038] The process for determining the internal impact hierarchy of an abnormal state in S4 is as follows: Based on the time interval in which the abnormal state candidates appear, locate the set of threads that are in an active or blocked state within the time interval. Based on the time period corresponding to the candidate abnormal state, the internal thread operation is traced back and located. Within the time period, threads in the running, ready, or blocked states are uniformly scanned and filtered to form a set of threads that are temporally correlated with the candidate abnormal state. This set of threads is used to characterize the distribution of the main execution units within the system during the occurrence of the abnormal state, providing a basic support for analyzing the propagation range and impact of the abnormal state among different threads.
[0039] Analyze the function call relationships involved in the execution of the thread and generate the corresponding call path structure; After obtaining the set of threads, the execution process of each thread within the time period is analyzed, and the function call relationships involved in the thread execution process are extracted. By organizing the thread call stack, function entry and exit order, and call dependencies, a call path structure that reflects the internal execution logic of the thread is constructed. The call path structure is used to describe the propagation path of abnormal state candidates at the function level and the execution modules they may be involved in, providing a structured basis for analyzing the depth and scope of the effect of abnormal states.
[0040] Within multiple different time windows, the changes in resource consumption of the thread set and the synchronization and waiting relationships between threads are statistically analyzed to form a description of the changes in thread cooperative behavior; The running behavior of the thread set is compared and analyzed within multiple different time windows. This includes statistically analyzing the trend of resource consumption changes of threads in different time windows, as well as the changes in the interaction relationships between threads in terms of synchronization, mutual exclusion, and waiting. By comprehensively organizing the information, a description of changes in thread cooperation behavior that can reflect the characteristics of changes in thread cooperation mode is formed, which is used to reveal whether abnormal states have triggered abnormal evolution of the cooperation relationship between threads.
[0041] Perform path expansion analysis on the call path structure, count the number of call nodes associated with abnormal states and the span of call levels, and obtain the call path coverage depth index. Based on the generated call path structure, the call paths related to the candidate abnormal states are analyzed. The number of call nodes associated with the abnormal state and the distribution of the call paths in the hierarchical structure are counted. By analyzing the coverage of the call paths in the vertical hierarchy and horizontal branches, a call path coverage depth index is obtained, which represents the depth and breadth of the propagation of the abnormal state at the function call level. This index is used to reflect whether the abnormal state is limited to local call nodes or has been extended to a deeper level of execution structure.
[0042] By combining the description of changes in thread cooperative behavior with the call path coverage depth metric, abnormal states are mapped to preset impact level judgment rules to determine the internal impact level of abnormal states. After obtaining the description of changes in thread collaboration behavior and the call path coverage depth index, the two are jointly analyzed and mapped to the preset impact level judgment rules to distinguish the impact level of abnormal states within the system, such as whether it is limited to a single thread, whether it affects the collaboration of multiple threads, or whether it involves cross-module execution paths. Based on the mapping results, the impact level of the abnormal state within the system is determined, providing a basis for abnormal response strategies, scheduling adjustments, or operation control.
[0043] S5: Based on the impact level, dynamically adjust the runtime status perception parameters and monitoring granularity, and construct runtime status constraint rules based on the coupling relationship between the thread occupancy mode and the call path corresponding to the abnormal status. Impose restrictions on the scheduling priority and concurrent access of related threads, and output status warning results indicating potential fault risks.
[0044] The process of constructing runtime state constraint rules in S5 is as follows: Based on the impact level corresponding to the abnormal state, the thread state sampling frequency, time slice length, and number of threads participating in monitoring are dynamically adjusted to form a runtime state awareness configuration that matches the impact level. Based on the established impact level of abnormal states within the system, the system's operational status perception method is dynamically adjusted. According to the size and depth of the impact of the abnormal state, the sampling frequency of thread states, the scheduling granularity of thread execution time slices, and the number of threads participating in operational status monitoring are coordinated and configured to ensure that the operational status perception capability matches the impact level of the abnormal state. In this way, a relatively stable perception overhead is maintained when the impact range of the abnormal state is small, while the perception accuracy and coverage of the operational status are enhanced when the impact range of the abnormal state expands, thus forming an operational status perception configuration corresponding to the impact level.
[0045] Under the runtime status awareness configuration, the scope of runtime status awareness is expanded and the monitoring granularity is refined for abnormal states with higher impact levels, and fine-grained change characteristics of thread execution behavior and call relationship under abnormal states are collected. After establishing the runtime status awareness configuration, the execution status of threads corresponding to abnormal states is monitored under the configuration conditions. For abnormal states with a higher impact level, the scope of runtime status awareness is expanded and the monitoring granularity is refined. The execution behavior, scheduling changes, and function call relationships of threads during the occurrence of abnormal states are collected and recorded more precisely. The collected fine-grained change features are used to reflect the dynamic impact of abnormal states on thread execution rhythm, call path structure, and inter-thread cooperation relationships, providing basic data support for runtime behavior analysis.
[0046] Based on fine-grained variation characteristics, the relationship between thread occupancy patterns and call paths is analyzed, and the characteristics of runtime behavior under abnormal states are summarized and the structure is abstracted to form runtime state constraint rules for concurrent access. Based on the collected fine-grained variation characteristics, the correlation between thread occupancy patterns and call paths under abnormal conditions is analyzed. By summarizing the thread resource occupancy behavior, call path distribution characteristics, and their coordinated change trends, the common constraint characteristics of the running behavior under abnormal conditions are summarized. The above characteristics are then structured and abstracted to form running state constraint rules that can constrain the concurrent execution and scheduling behavior of threads. These rules are used to limit the concurrent admission conditions, execution sequence, or scheduling strategy of threads, thereby guiding the system running behavior towards a controlled and stable direction under abnormal conditions.
[0047] The process of outputting status warning results indicating potential fault risks in S5 is as follows: Based on the runtime state constraint rules, the scheduling priority of the affected threads is reduced. Based on pre-built runtime constraint rules, the correlation between abnormal states and system threads is matched and analyzed to identify the set of threads that are directly or indirectly affected by the abnormality. The runtime constraint rules comprehensively consider the functional role, resource consumption characteristics, and position in the current call chain of the threads to constrain the scheduling behavior of threads under abnormal conditions. On this basis, the scheduling priority of the identified affected threads is downgraded, which reduces their execution weight in the operating system or runtime scheduling queue. This limits the continuous occupation of critical resources such as CPU and memory by abnormal threads, prevents the abnormal state from being further amplified and spread to other normal threads, and creates conditions for the stable recovery of the overall system operation.
[0048] Limit new concurrent requests to call paths associated with abnormal states to control load growth; After adjusting thread scheduling priorities, the call paths corresponding to abnormal states are further analyzed. Combining thread occupancy patterns and function call relationships, call chains or service interfaces highly related to abnormal states are identified. For the identified call paths, new concurrent requests are restricted through a concurrency admission control mechanism, including delayed entry, rejection of entry, or transfer to alternative paths. This suppresses the disorderly growth of load under abnormal states from the source. By limiting concurrency at the call path level, resource congestion caused by the continuous accumulation of abnormal requests can be effectively blocked, preventing local anomalies from evolving into system-level performance degradation or service failure. This achieves proactive constraints and risk isolation of system operating load.
[0049] While imposing scheduling and concurrency limits, it generates state warning results that characterize the severity of anomalies and the level of impact; During the process of limiting thread scheduling and concurrent call paths, the evolution characteristics of abnormal states are comprehensively evaluated simultaneously. Combining information such as the frequency of abnormal triggers, the number of affected threads, the coverage of call paths, and the trend of resource consumption changes, a quantitative representation of abnormal states is constructed. Based on the evaluation results, a status warning result is generated to indicate potential fault risks, which is used to characterize the severity of the anomaly and its impact level within the system. This result is output to the monitoring module or operation and maintenance interface in a structured form. Through this status warning result, a clear basis is provided for manual intervention, automatic recovery, or strategy adjustment, enabling early perception and graded alerts of potential fault risks.
[0050] Example 2: Please refer to Figure 2 As shown, a software system fault monitoring system based on operational status awareness includes: Thread observation module: continuously observes the execution environment of threads that carry concurrent requests, and generates a set of basic state descriptions that reflect the thread's running activity and blocking tendency; Rhythm Analysis Module: Reorganizes and analyzes the execution segments of a thread within a continuous time slice to extract composite runtime feature sequences that characterize changes in processing rhythm; Anomaly identification module: compares and evaluates the composite operating feature sequence with historical stable operating states to identify candidate anomalies where processing efficiency shows signs of degradation; Hierarchical determination module: Based on the thread set and call path characteristics associated with abnormal state candidates, determine the internal impact level of the abnormal state; Rule Response Module: Adjusts the operation status perception parameters and constructs operation status constraint rules according to the impact level of abnormal states, so as to apply concurrent access and scheduling control and output status warning results.
[0051] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0052] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A software system fault monitoring method based on runtime status awareness, characterized in that, Includes the following steps: Continuously observe the execution environment of threads that carry concurrent requests, construct a temporal mapping relationship of thread-level execution behavior, and form a basic state description set that reflects the thread's running activity and blocking tendency; Based on the basic state description set, the execution segments of different threads in continuous time slices are recombined and analyzed. By comparing the changes in task switching frequency, the degree of execution interval stretching and the evolution trend of waiting ratio, composite running feature sequences that characterize the changes in processing rhythm are extracted. Based on the composite operating characteristic sequence, a state reference structure corresponding to the historical stable operating interval is introduced. The deviation between the current operating characteristics and the reference structure is quantitatively evaluated to identify abnormal state candidates that have not yet triggered the number of threads but have already shown signs of processing efficiency degradation. The abnormal state candidates are associated with the corresponding thread set and the call path they depend on. The occupancy behavior and coordination relationship of the thread set in different time windows are cross-analyzed to determine the internal impact level of the abnormal state. Based on the impact level, the runtime status perception parameters and monitoring granularity are dynamically adjusted. Based on the coupling relationship between the thread occupancy mode and the call path corresponding to the abnormal state, runtime status constraint rules are constructed to impose restrictions on the scheduling priority and concurrent access of relevant threads, and output status warning results indicating potential fault risks.
2. The software system fault monitoring method based on operational status awareness according to claim 1, characterized in that, The process of forming a set of basic state descriptions that reflect the activity level and blocking tendency of threads is as follows: Inside the running node, the states of the thread scheduler, run queue, and synchronization lock are periodically sampled to obtain the state events of thread creation, ready, running, blocked, and awakened. A unified timestamp is appended to the sampled thread state events, and they are aggregated according to the thread identifier to form a sequence of thread state events arranged in chronological order. Based on the thread state event sequence, calculate the active duration, blocking duration and waiting percentage of each thread within a unit time window, and construct the temporal mapping relationship of thread-level execution behavior; The timing mapping relationship is standardized and encoded to form a set of basic state descriptions that reflect the thread's running activity and blocking tendency.
3. The software system fault monitoring method based on operational status awareness according to claim 2, characterized in that, The process of recombining and analyzing the execution segments of different threads within a consecutive time slice is as follows: According to the preset time slice length, the thread state description in the basic state description set is segmented by sliding window, and a unified time index is attached to each time slice to obtain the thread execution segments corresponding to multiple consecutive time slices. The execution segments within adjacent time slices are correlated temporally to identify the transition relationships between thread states in ready, running, blocked, and awakened states, and to construct a sequence of execution segments that reflects the continuous changes in thread states. The number of state transitions, duration distribution, and transition direction in the execution segment sequence are statistically analyzed to form an intermediate feature set describing the changes in thread execution rhythm.
4. The software system fault monitoring method based on operational status awareness according to claim 3, characterized in that, The process of extracting composite operational feature sequences that represent rhythmic changes is as follows: Based on the intermediate feature set, the number of state transitions of each thread in a continuous time slice is counted, the number of task switching is extracted, and a task switching frequency change curve is formed. Based on the duration distribution of execution segments recorded in the intermediate feature set, the time interval between adjacent execution segments of a thread is calculated, and the magnitude of the interval change is normalized to obtain the execution interval stretching index. Based on the proportion of each state in the intermediate feature set within the time slice, the proportion of waiting states of the thread in each time slice is calculated, and the proportion of waiting states is accumulated and smoothed to generate the evolution trend of the waiting proportion. By splicing together the task switching frequency change curve, execution interval stretching index, and waiting ratio evolution trend in multiple dimensions, a composite operational feature sequence representing the changes in processing rhythm is constructed.
5. A software system fault monitoring method based on operational status awareness according to claim 4, characterized in that, The process of introducing a state reference structure corresponding to the historical stable operating range is as follows: Filter time periods from historical operation logs that are under stable load and have not experienced failures, and extract the corresponding composite operation feature sequences as stable samples. Stable samples were grouped according to their processing rhythm characteristics, and statistical analysis was performed on the composite operational characteristic sequences within each group. Based on the analysis results, a state reference structure is constructed that includes the boundary of running feature values, feature coupling constraint relationships, and rhythm consistency conditions.
6. The software system fault monitoring method based on operational status awareness according to claim 5, characterized in that, The process of identifying candidate abnormal states that have not yet triggered thread counts but are already showing signs of processing efficiency degradation is as follows: The real-time acquired composite operational feature sequence is mapped to the feature distribution space corresponding to the state reference structure; Calculate the deviation of the current running feature from the central interval of the reference structure in each dimension to form a multidimensional deviation vector; By weighting and summing the multidimensional deviation vectors, a comprehensive deviation index representing the degree of change in the overall processing rhythm is obtained; When the overall deviation index exceeds the preset threshold and the total number of threads does not change significantly, the corresponding running state will be marked as an abnormal state candidate.
7. A software system fault monitoring method based on operational status awareness according to claim 6, characterized in that, The process of determining the internal impact level of an abnormal state is as follows: Based on the time interval in which the abnormal state candidates appear, locate the set of threads that are in an active or blocked state within the time interval. Analyze the function call relationships involved in the execution of the thread and generate the corresponding call path structure; Within multiple different time windows, the changes in resource consumption of the thread set and the synchronization and waiting relationships between threads are statistically analyzed to form a description of the changes in thread cooperative behavior; Perform path expansion analysis on the call path structure, count the number of call nodes associated with abnormal states and the span of call levels, and obtain the call path coverage depth index. By combining the description of changes in thread cooperative behavior with the call path coverage depth metric, abnormal states are mapped to preset impact level judgment rules to determine the internal impact level of abnormal states.
8. A software system fault monitoring method based on operational status awareness according to claim 7, characterized in that, The process of constructing runtime state constraint rules is as follows: Based on the impact level corresponding to the abnormal state, the thread state sampling frequency, time slice length, and number of threads participating in monitoring are dynamically adjusted to form a runtime state awareness configuration that matches the impact level. Under the runtime status awareness configuration, the scope of runtime status awareness is expanded and the monitoring granularity is refined for abnormal states with higher impact levels, and fine-grained change characteristics of thread execution behavior and call relationship under abnormal states are collected. Based on fine-grained variation characteristics, the correlation between thread occupancy patterns and call paths is analyzed, and the characteristics of runtime behavior under abnormal states are summarized and the structure is abstracted to form runtime state constraint rules for concurrent access.
9. A software system fault monitoring method based on operational status awareness according to claim 8, characterized in that, The process of outputting status warning results indicating potential fault risks is as follows: Based on the runtime state constraint rules, the scheduling priority of the affected threads is reduced. Limit new concurrent requests to call paths associated with abnormal states to control load growth; While imposing scheduling and concurrency limits, state warning results representing the severity of anomalies and the level of impact are generated.
10. A software system fault monitoring system based on operational status awareness, applied to the method described in any one of claims 1-9, characterized in that, include: Thread observation module: continuously observes the execution environment of threads that carry concurrent requests, and generates a set of basic state descriptions that reflect the thread's running activity and blocking tendency; Rhythm Analysis Module: Reorganizes and analyzes the execution segments of a thread within a continuous time slice to extract composite runtime feature sequences that characterize changes in processing rhythm; Anomaly identification module: compares and evaluates the composite operating feature sequence with historical stable operating states to identify candidate anomalies where processing efficiency shows signs of degradation; Hierarchical determination module: Based on the thread set and call path characteristics associated with abnormal state candidates, determine the internal impact level of the abnormal state; Rule Response Module: Adjusts the operation status perception parameters and constructs operation status constraint rules according to the impact level of abnormal states, so as to apply concurrent access and scheduling control and output status warning results.