Terminal crash prevention method
By using a pre-trained crash risk assessment model and a graded response mechanism, the system can identify crash risks of terminal devices in real time and trigger preventive operations, thus solving the problem of crash prevention in existing technologies and improving the operational stability and maintenance efficiency of terminal devices.
Patent Information
- Application Number
- CN202511225903.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-12-05
AI Technical Summary
Existing methods for preventing terminal device crashes lack predictive capabilities and cannot prevent crashes from occurring. Furthermore, software heartbeat detection increases system overhead and cannot detect progressive failures such as resource exhaustion.
A pre-trained crash risk assessment model is used to periodically acquire terminal operating status parameters, calculate crash risk scores, and automatically trigger anti-crash operations based on risk levels. Operation records are generated and uploaded to the main station for aggregation and trend analysis. Based on historical operation data, an analysis of the application terminal equipment is generated, and terminal maintenance suggestions are produced.
It enables terminal devices to identify potential risks before crashing, take preventative measures in advance, avoid data loss and service interruption, improve operational stability, and provide differentiated protection and operational efficiency.
Smart Images

Figure CN121070652A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal device reliability, in particular to a terminal anti-hang-up method. BACKGROUND
[0002] With the rapid development of Internet of Things technology and intelligent acquisition system, various terminal devices have been widely used in power metering, environmental monitoring, industrial control and other fields. These acquisition terminals are usually deployed in distributed environments and are responsible for real-time data acquisition, edge computing and remote communication and other important functions. However, in the actual operation process, the terminal device often causes system hang-up due to various factors, which seriously affects the reliability of data acquisition and the stability of system operation.
[0003] At present, the existing anti-hang-up method of terminal device usually adopts hardware watchdog technology, which monitors the system running state through a timer, and triggers hardware reset when the system does not respond. Although this method is simple and easy to implement, it lacks the ability to predict the risk of hang-up and can only passively recover after hang-up occurs, which cannot prevent the occurrence of hang-up. The second is the software heartbeat detection mechanism, which sends heartbeat signals regularly to confirm the system running state, but this method increases the system overhead and cannot detect progressive failures such as system resource exhaustion. SUMMARY
[0004] To solve the above problems, the present application provides a terminal anti-hang-up method, which comprises: S1, during the running process of the acquisition terminal, periodically acquiring the running state parameters of the acquisition terminal, the running state parameters including process running state, container running state, hardware temperature, memory usage and CPU usage; S2, inputting the running state parameters into a pre-trained hang-up risk assessment model to calculate the hang-up risk score of the acquisition terminal, and automatically triggering the corresponding anti-hang-up operation according to the risk level when the hang-up risk score exceeds the preset risk threshold; S3, when the acquisition terminal completes the anti-hang-up operation, generating a structured operation record and uploading the operation record to the acquisition master station through a remote communication network; the operation record includes terminal identification, operation type, operation time and parameter information triggering the operation; S4, the acquisition master station receives operation records from multiple acquisition terminals, aggregates and analyzes the operation records, and based on the analysis result, pre-warns the area to which the acquisition terminal belongs, and generates terminal maintenance suggestions based on historical operation data.
[0005] Further, in the step S2, the crash risk assessment model is trained by a gradient boosting based decision tree algorithm, and the training data includes running state parameter samples of a plurality of collection terminals in a historical time period and corresponding terminal state labels, the terminal state labels including normal state and crash state.
[0006] Further, in the step S2, the crash risk score of the collection terminal is calculated by the crash risk assessment model, specifically including: S2.1, normalizing the running state parameters, converting the process running state and the container running state into binary feature vectors by one-hot encoding, and mapping the hardware temperature, memory usage and CPU usage to the [0, 1] interval respectively; S2.2, inputting the preprocessed running state parameters into the crash risk assessment model, and calculating the risk score value representing the terminal crash probability by weighted combination of a plurality of decision tree weak classifiers in the crash risk assessment model, the risk score value being a continuous value between 0 and 100; S2.3, according to the risk score value and the preset risk threshold, dividing the crash risk into three levels of high / medium / low, and triggering the corresponding anti-crash operation: When the risk score value is lower than the first risk threshold, it is determined as a low risk level, only recording the running log and increasing the running state monitoring frequency; When the risk score value is between the first risk threshold and the second risk threshold, it is determined as a medium risk level, and the crash risk score is re-evaluated after a predetermined time, and data backup and initialization operation are performed when the risk score is still not reduced; When the risk score value is higher than the second risk threshold, it is determined as a high risk level, and the hardware reset operation is triggered immediately.
[0007] Further, the preset risk threshold is dynamically adjusted based on the power supply importance of the area to which the current collection terminal belongs, and when the area is identified as a key area and an important area, the first risk threshold and the second risk threshold are adaptively reduced.
[0008] Further, in the step S4, the operation records are aggregated and trend analyzed, specifically including: S4.1, obtaining the operation records uploaded by a plurality of collection terminals, and performing data cleaning on the operation records to eliminate duplicate records and invalid fields; S4.2, according to the area to which the collection terminal belongs, performing sliding window statistics on the operation records of the collection terminals in each area in time sequence, and counting the trigger frequency of the anti-crash operation and the risk score average value in each area per unit time; S4.3, when the average risk score continues to rise for multiple windows, calculate the trigger frequency of the anti-hang-up operation in the current time window and the year-on-year change rate of the previous window, when the year-on-year change rate exceeds the preset threshold, generate a substation early warning signal, and extract the collection terminal identification of the high-frequency trigger anti-hang-up operation; S4.4, store the aggregation analysis result, the substation early warning signal and the identification of the related collection terminal, the operation record and the running state parameter to the database, and update the terminal maintenance knowledge base in combination with the historical operation data.
[0009] The beneficial effects of the present application are: The present application can identify potential risks before the terminal actually hangs up by calculating the risk score in real time through the pre-trained hang-up risk assessment model, trigger preventive operations in advance, avoid data loss and service interruption caused by system hang-up, and improve the running stability of the terminal device; different anti-hang-up operations are triggered by classification, avoiding unnecessary business interruption and data loss caused by the traditional single reset strategy; the risk threshold is dynamically adjusted according to the importance of power supply of the terminal belonging to the substation, and differential protection is adopted to ensure the continuous and stable operation of the key equipment; the operation records reported by multiple terminals are aggregated and trend analyzed by the collection master station, the substation risk warning is identified and generated, the maintenance suggestions are generated based on the historical data, and the closed-loop management system from terminal monitoring to master station analysis is formed, which greatly improves the operation and maintenance efficiency and system maintainability. BRIEF DESCRIPTION OF DRAWINGS
[0010] Figure 1 is a general flowchart of a terminal anti-hang-up method provided by the present application. DETAILED DESCRIPTION
[0011] The technical method of the present application will be described below in conjunction with the drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application. EMBODIMENT
[0012] Please refer to Figure 1 A terminal anti-hang-up method, the method comprises: S1, during the running process of the collection terminal, periodically acquire the running state parameters of the collection terminal, the running state parameters comprising process running state, container running state, hardware temperature, memory usage and CPU usage; S2, input the running state parameters into the pre-trained hang-up risk assessment model, calculate the hang-up risk score of the collection terminal, when the hang-up risk score exceeds the preset risk threshold, automatically trigger the corresponding anti-hang-up operation according to the risk level; S3, when the collection terminal completes the anti-hang-up operation, generating a structured operation record and uploading the operation record to the collection master station through a remote communication network; the operation record includes terminal identification, operation type, operation time and parameter information triggering the operation; S4, the collection master station receives operation records from multiple collection terminals, aggregates and analyzes the operation records, and based on the analysis result, pre-warns the area to which the collection terminal belongs, and generates terminal maintenance suggestions based on historical operation data.
[0013] Specifically, the running state parameters of the collection terminal are periodically obtained through the embedded monitoring agent, including: obtaining the process running state and CPU usage through the proc file interface; monitoring the container running state through the cgroups control group; reading the hardware temperature through the hardware sensor driver; obtaining the memory usage data through the memory management unit interface, which realizes the all-round monitoring of the terminal running state and provides accurate and real-time data support for subsequent risk assessment.
[0014] As a preferred mode of the present embodiment: in the step S2, the hang-up risk assessment model is trained by a gradient boosting-based decision tree algorithm, and the training data includes running state parameter samples of multiple collection terminals in a historical period and corresponding terminal state labels, and the terminal state label includes normal state and hang-up state.
[0015] Specifically, the training data collection includes: obtaining the running data of 200 collection terminals in the past 12 months from the terminal management database, including process state, container state, hardware temperature, memory usage and CPU usage data. At the same time, the corresponding state label of the collection terminal is extracted from the operation log, and the state labeling rule is: samples that hang up within one hour after the data collection time point are marked as "hang-up state", otherwise marked as "normal state".
[0016] The gradient boosting decision tree algorithm is used to train the hang-up risk assessment model, and an early stopping mechanism is introduced in the training process. When the validation set loss does not decrease for 10 consecutive rounds, the training is stopped to prevent overfitting. Gradient boosting decision tree algorithm forms a strong classifier by integrating multiple decision tree weak classifiers. Each new tree is committed to correcting the prediction error of the previous tree, can automatically learn the interaction between features, capture the complex relationship between multiple features, improve the prediction accuracy of hang-up, and based on a large amount of historical data, the hang-up risk assessment trained is suitable for different types and different deployment environments of terminal equipment, reducing the need for optimization for specific terminals.
[0017] As a preferred mode of the present embodiment: in the step S2, the hang-up risk score of the collection terminal is calculated by the hang-up risk assessment model, specifically including: S2.1, normalize the running state parameters, convert the process running state and container running state into binary feature vectors through one-hot encoding, and map the hardware temperature, memory usage and CPU usage to the [0, 1] interval respectively; S2.2, input the preprocessed running state parameters into the crash risk assessment model, and calculate the risk score value representing the terminal crash probability through the weighted combination of multiple decision tree weak classifiers in the crash risk assessment model. The risk score value is a continuous value between 0 and 100; S2.3, according to the risk score value and the preset risk threshold, the crash risk is divided into three levels: high / medium / low, and the corresponding anti-crash operation is triggered: When the risk score value is lower than the first risk threshold, it is determined as low risk level, only record running log and improve running state monitoring frequency; When the risk score value is between the first risk threshold and the second risk threshold, it is determined as medium risk level, re-evaluate the crash risk score after a predetermined time, and perform data backup and initialization operation when the risk score is still not reduced; When the risk score value is higher than the second risk threshold, it is determined as high risk level, and hardware reset operation is triggered immediately.
[0018] Specifically, the collected original running state parameters are data cleaned, invalid data points caused by sensor abnormalities are removed, one-hot encoding is used to convert the process running state and container running state into binary feature vectors, such as "running" encoded as [1, 0, 0], "sleep" encoded as [0, 1, 0], and "abnormal" encoded as [0, 0, 1], and the minimum-maximum normalization method is used to map the continuous values of hardware temperature, memory usage and CPU usage to the [0, 1] interval. Through preprocessing operation, different types and dimensions of feature data can be uniformly processed by the model.
[0019] The preprocessed feature vector is input into the trained crash risk assessment model, which is composed of 100 decision tree weak classifiers, each with a depth of 6 layers. In the calculation process, each tree independently judges the input features and outputs a preliminary prediction value. Then, using the weighted combination strategy, the output results of the 100 trees are weighted and summed according to the learning rate to obtain the original prediction score. The original prediction score is converted to a risk score value between 0 and 100 through the sigmoid function.
[0020] According to the calculated risk score value and the preset risk threshold, the risk is divided into three levels: low risk (0-50 points), medium risk (50-70 points), and high risk (70-100 points). Each level triggers different anti-crash operations: Low risk level, only record logs and increase the running state monitoring frequency; Medium risk level, re-evaluate the risk score after 10 minutes of delay, and perform data backup and initialization operation when the risk score is still not reduced; High risk level, trigger hardware reset operation immediately.
[0021] As a preferred mode of the embodiment: the preset risk threshold is dynamically adjusted based on the power supply importance of the current collection terminal belonging to the area, and when the belonging area is identified as a key area and an important area, the first risk threshold and the second risk threshold are adaptively reduced.
[0022] Specifically, the area is divided into three categories, including a key area (such as a hospital, a data center, and a government power supply), an important area (an industrial and commercial centralized power supply area), and a general area (a residential power supply area). When performing the dead machine risk assessment, the importance of the area to which the collection terminal belongs is queried through the collection terminal identifier. For the key area, the first risk threshold is adjusted from the default 50 points to 40 points, and the second risk threshold is adjusted from 70 points to 60 points. For the important area, the first risk threshold is adjusted to 45 points, and the second risk threshold is adjusted to 65 points. The general area remains the default threshold setting. During the adjustment process, threshold change logs are recorded, including adjustment time, pre-adjustment threshold, post-adjustment threshold, adjustment reason and other information, for subsequent audit and analysis.
[0023] The key area bears more important power supply responsibilities, and its terminal equipment needs more stringent protection standards and more cautious operation processes. Reducing the risk threshold means improving the monitoring sensitivity, which can discover potential risks earlier and take preventive measures.
[0024] The application realizes accurate quantitative assessment of the dead machine risk through risk score calculation and grading response mechanism, provides differentiated anti-dead machine strategies, avoids the additional overhead brought by the "one-size-fits-all" processing mode, dynamically adjusts the threshold to ensure the priority protection of key business terminals, and improves the availability and reliability of terminal equipment. Embodiment
[0025] As a preferred mode of the embodiment: in step S4, the operation records are aggregated and trend analyzed, specifically including: S4.1, obtaining operation records uploaded by a plurality of collection terminals, and performing data cleaning on the operation records to eliminate duplicate records and invalid fields; S4.2, according to the area to which the collection terminal belongs, performing sliding window statistics on the operation records of the collection terminals in each area in time sequence, and counting the trigger frequency of the anti-dead machine operation and the risk score average value of each area per unit time; S4.3、When the average risk score continuously rises for multiple windows, calculate the trigger frequency of the anti-hang-up operation in the current time window and the year-on-year change rate of the previous window, and when the year-on-year change rate exceeds a preset threshold, generate a substation early warning signal, and extract the identification of the collection terminal that triggers the anti-hang-up operation frequently; S4.4, store the aggregation analysis result, substation early warning signal and related collection terminal identification, operation record and running state parameter to the database, and update the terminal maintenance knowledge base in combination with historical operation data.
[0026] Specifically, the collection master station receives the operation records uploaded from each collection terminal through the message queue cluster, and detects and removes duplicate records through a unique identifier hash value; then verifies the data integrity through a rule engine, discards records missing key fields (such as terminal identification, operation time, etc.), effectively eliminates noise and errors introduced in the data collection and transmission process, and ensures the reliability of subsequent analysis.
[0027] According to the substation to which the terminal belongs, data is grouped, a sliding time window mechanism is used for statistical analysis, in each window, the key indicators: anti-hang-up operation trigger frequency (times / hour) and risk score weighted average value are calculated, by capturing local patterns and trend changes in the data, the potential risk development trend of the substation is identified.
[0028] When the average risk score continuously rises for 3 consecutive time windows, calculate the trigger frequency of the anti-hang-up operation in the current window and the year-on-year change rate of the previous window, and when the change rate exceeds 50%, generate a substation early warning signal, and extract the identification of the top 10% collection terminals in the current substation that trigger the operation most frequently in the last 24 hours, for locating the problem source and identifying common failure modes.
[0029] Store the aggregation analysis result, substation early warning signal and related collection terminal identification, operation record and running state parameter to the database, and update the terminal maintenance knowledge base in combination with historical operation data, the terminal maintenance knowledge base uses a case-based reasoning mechanism, stores each early warning event and its processing result as a case, including problem phenomenon, root cause, treatment measures and effect evaluation, etc.
[0030] The present application constructs a complete closed loop from operation record collection to knowledge base update by aggregating and trend analyzing the data, establishes a continuously optimized knowledge management system, and realizes self-learning and continuous improvement of substation and terminal device risk prediction and maintenance.
[0031] Those skilled in the art will appreciate that embodiments of the application can be readily used as software, hardware, or a combination of software and hardware. In one embodiment, the application can be implemented in software and / or firmware. In addition, the software implementation can be implemented by one or more computer programs.
[0032] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0033] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0034] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0035] While the preferred embodiments of the application have been described, additional variations and modifications can be employed. Therefore, the terms and expressions
[0036] It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application cover modifications and variations of this application provided they come within the scope of the appended claims and their equivalents.
Claims
1. A terminal anti-hang-up method, characterized by, The method comprises: S1. During the running of the collection terminal, periodically acquire running state parameters of the collection terminal, the running state parameters comprising process running state, container running state, hardware temperature, memory usage and CPU usage; S2. Input the running state parameters into a pre-trained crash risk assessment model to calculate a crash risk score of the collection terminal, and when the crash risk score exceeds a preset risk threshold, automatically trigger a corresponding anti-crash operation according to the risk level; S3. When the collection terminal completes the anti-crash operation, generate a structured operation record and upload the operation record to a collection master station through a remote communication network; the operation record comprises terminal identification, operation type, operation time and parameter information triggering the operation; S4. The collection master station receives operation records from multiple collection terminals, aggregates and analyzes the operation records, and based on the analysis result, pre-warns a district area to which the collection terminal belongs, and generates terminal maintenance suggestions based on historical operation data.
2. The method of claim 1, wherein: In the step S2, the crash risk assessment model is trained by a gradient boosting-based decision tree algorithm, and the training data comprises running state parameter samples of multiple collection terminals in a historical time period and corresponding terminal state labels, the terminal state labels comprising normal state and crash state.
3. The method of claim 1, wherein: In the step S2, the crash risk score of the collection terminal is calculated by the crash risk assessment model, specifically comprising: S2.
1. Normalize the running state parameters, convert the process running state and the container running state into binary feature vectors through one-hot encoding, and map the hardware temperature, the memory usage and the CPU usage to the [0, 1] interval respectively; S2.
2. Input the preprocessed running state parameters into the crash risk assessment model, and through the weighted combination of multiple decision tree weak classifiers in the crash risk assessment model, calculate a risk score value representing the terminal crash probability, the risk score value being a continuous value between 0 and 100; S2.
3. According to the risk score value and the preset risk threshold, divide the crash risk into three levels of high / medium / low, and trigger the corresponding anti-crash operation: When the risk score value is lower than the first risk threshold, it is determined as a low risk level, only record the running log and increase the running state monitoring frequency; When the risk score value is between the first risk threshold and the second risk threshold, it is determined as a medium risk level, re-evaluate the crash risk score after a predetermined time, and when the risk score is still not reduced, perform data backup and initialization operation; When the risk score value is higher than the second risk threshold, it is determined as a high risk level, and a hardware reset operation is immediately triggered.
4. The method of claim 3, wherein: In the step S2, the preset risk threshold is dynamically adjusted based on the power supply importance of the district area to which the current collection terminal belongs, and when the district area is identified as a key district and an important district, the first risk threshold and the second risk threshold are adaptively reduced.
5. The method of claim 1, wherein: In the step S6, in the step S4, the operation records are aggregated and analyzed, specifically comprising: S4.1, acquire operation records uploaded by a plurality of collection terminals, clean data of the operation records, and eliminate repeated records and invalid fields; S4.2, according to a district area to which the collection terminal belongs, perform sliding window statistics on the operation records of the collection terminal in each district area in time sequence, and statistically obtain a triggering frequency of the anti-hanging operation and a risk score average value in a unit time of each district area; S4.3, when the risk score average value continuously and continuously rises in a plurality of windows, calculate a triggering frequency of the anti-hanging operation in a current time window and a year-on-year change rate of a previous window, when the year-on-year change rate exceeds a preset threshold, generate a district area early warning signal, and extract an identification of a collection terminal with a high-frequency triggered anti-hanging operation; S4.4, store the aggregation analysis result, the district area early warning signal, and the identification, operation record and running state parameter of the related collection terminal to a database, and update a terminal maintenance knowledge base in combination with historical operation data.