Abnormality monitoring method, device and computer readable storage medium

By acquiring the target monitoring function during the target task's runtime and utilizing time checkpoints and cyclic redundancy checks, the problem of inaccurate monitoring results in high-frequency running programs is solved, achieving higher monitoring accuracy.

CN116302638BActive Publication Date: 2026-03-24GUANGZHOU XIAOPENG MOTORS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-10
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing program flow monitoring methods often result in inaccurate monitoring results due to signature value errors caused by the deviation between the running frequency and the monitoring and identification task time in high-frequency running programs.

Method used

By acquiring the target monitoring function during the target task's runtime, and utilizing time checkpoints and cyclic redundancy checks, the time check results and signature values ​​are obtained to determine whether the task has any runtime anomalies, thereby improving monitoring accuracy.

Benefits of technology

It reduces the impact of time deviation of high-frequency running tasks on signature values ​​and improves the accuracy of program flow monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116302638B_ABST
    Figure CN116302638B_ABST
Patent Text Reader

Abstract

The application discloses an abnormality monitoring method, device and computer readable storage medium. The method comprises the following steps: acquiring a first target monitoring function corresponding to a first target task when the first target task is running, wherein the task period of the first target task is less than or equal to a preset task period, and the first target monitoring function comprises a plurality of monitoring functions with the same task period; acquiring a time checking result corresponding to the first target task and a first signature value based on the first target monitoring function; and determining whether the first target task has a running abnormality based on the time checking result and / or the first signature value. The application can accurately identify the time deviation of the first target task through the time checking result, reduce the influence of the time deviation of the high-frequency running task (target task) less than or equal to the preset task period on the signature value, and improve the accuracy of the high-frequency running task monitoring in the program flow.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to an exception monitoring method and device and a computer readable storage medium. BACKGROUND

[0002] When a function is implemented based on program sequence loop calling, if a subprogram in the program sequence is out of order or not called, the corresponding function will be abnormal or uncontrollable, therefore, the program flow needs to be monitored. Program flow monitoring is a way to monitor the program flow. When an abnormal situation is detected due to unexpected interference during the running of the software, effective measures (such as entering a safe state, watchdog reset, software reset, etc.) can be taken to ensure the robustness of the software, thereby improving the safety of the system.

[0003] At present, the implementation of the program flow monitoring function is to accumulate the input parameters using the cyclic redundancy check (CRC) algorithm, and to distinguish the accumulated value (signature value) from the expected signature value in the fault identification task to determine whether the software is abnormal. However, for programs with high running frequency, the time deviation between the running period of the program and the running of the monitoring identification task is close, which causes the program flow monitoring to have a signature value error problem, resulting in inaccurate program flow monitoring results.

[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY

[0005] The main purpose of the present application is to provide an exception monitoring method, device, equipment and computer readable storage medium, which aims to solve the technical problem of inaccurate monitoring results of the existing program flow.

[0006] To achieve the above purpose, the present application provides an exception monitoring method, which comprises the following steps:

[0007] When a first target task is running, a first target monitoring function corresponding to the first target task is obtained, wherein the task period of the first target task is less than or equal to a preset task period, and the first target monitoring function comprises a plurality of monitoring functions with the same task period;

[0008] Based on the first target monitoring function, a time check result and a first signature value corresponding to the first target task are obtained;

[0009] Based on the time check result and / or the first signature value, it is determined whether the first target task has a running exception.

[0010] Further, the first target monitoring function comprises a time monitoring function provided with time check points; the step of obtaining the time check result corresponding to the first target task and the first signature value based on the first target monitoring function comprises:

[0011] obtaining the first signature value corresponding to the target first target task based on the first target monitoring function;

[0012] obtaining the time check result based on the time monitoring function.

[0013] Further, each of the first target monitoring functions is provided with at least two first check points, and each of the first check points is sequentially sorted according to the order of each of the first target monitoring functions;

[0014] the step of obtaining the first signature value corresponding to the target first target task based on the first target monitoring function comprises:

[0015] performing cyclic redundancy check based on the first check point value of each of the first check points to obtain the first cyclic redundancy check value corresponding to each of the first check points;

[0016] taking the first cyclic redundancy check value of the last first check point as the first signature value.

[0017] Further, the step of performing cyclic redundancy check based on the first check point value of each of the first check points to obtain the first cyclic redundancy check value corresponding to each of the first check points comprises:

[0018] if the first check point is the first first check point, taking the task ID corresponding to the first target task as the first check point value of the first check point;

[0019] performing cyclic redundancy check based on the first check point value and a preset value to obtain the first cyclic redundancy check value corresponding to the first check point.

[0020] Further, the step of performing cyclic redundancy check based on the first check point value of each of the first check points to obtain the first cyclic redundancy check value corresponding to each of the first check points comprises:

[0021] if the first check point is not the first first check point, obtaining the second cyclic redundancy check value of the previous first check point corresponding to the first check point;

[0022] performing cyclic redundancy check based on the first check point value of the first check point and the second cyclic redundancy check value to obtain the first cyclic redundancy check value corresponding to the first check point.

[0023] Furthermore, the time monitoring function is the first monitoring function among the various first target monitoring functions.

[0024] Furthermore, the step of determining whether the first target task has an operational anomaly based on the time check result and / or the first signature value includes:

[0025] Determine whether the time check result is within a preset time period corresponding to the first target task; wherein, if the time check result is outside the preset time period, it is determined that the first target task has an operational abnormality; and / or,

[0026] Determine whether the first signature value matches the first expected signature value. If the first signature value does not match the first expected signature value, then determine that the first target task has an operational anomaly.

[0027] Furthermore, it also includes:

[0028] When the second target task is running, the second target monitoring function corresponding to the second target task is obtained. The task period of the second target task is longer than the preset task period. The second target monitoring function includes monitoring functions for multiple task periods, and each task period has multiple monitoring functions.

[0029] Based on the second target monitoring function, obtain the second signature value corresponding to the second target task;

[0030] Based on the second signature value, it is determined whether the second target task has any operational abnormalities.

[0031] Furthermore, each of the second target monitoring functions has at least two second checkpoints, and each of the second target monitoring functions is ordered sequentially according to the task cycle, and each of the second checkpoints is ordered sequentially according to the order of each of the second target monitoring functions;

[0032] The step of obtaining the second signature value corresponding to the second target task based on the second target monitoring function includes:

[0033] Cyclic redundancy check is performed based on the second checkpoint values ​​of each second checkpoint to obtain the third cyclic redundancy check value corresponding to each second checkpoint.

[0034] If the second checkpoint is the last second checkpoint, then the third ring redundancy check value of the last second checkpoint is used as the second signature value.

[0035] Further, the step of performing cyclic redundancy check based on the second checkpoint values ​​of each second checkpoint to obtain the third cyclic redundancy check value corresponding to each second checkpoint includes:

[0036] If the second checkpoint is not the first second checkpoint, then obtain the fourth cyclic redundancy check value of the previous second checkpoint corresponding to the second checkpoint;

[0037] Based on the second checkpoint value and the fourth cyclic redundancy check value, a cyclic redundancy check is performed to obtain the third cyclic redundancy check value corresponding to the second checkpoint.

[0038] Further, the step of performing cyclic redundancy check based on the second checkpoint values ​​of each second checkpoint to obtain the third cyclic redundancy check value corresponding to each second checkpoint includes:

[0039] If the second checkpoint is the first second checkpoint, then the task ID corresponding to the second target task is used as the second checkpoint value of the second checkpoint;

[0040] Cyclic redundancy check is performed based on the second checkpoint value and the preset value to obtain the third cyclic redundancy check value corresponding to the second checkpoint.

[0041] Furthermore, the step of determining whether the second target task has any operational anomalies based on the second signature value includes:

[0042] Determine whether the second signature value matches the second expected signature value. If the second signature value does not match the second expected signature value, then determine that the second target task has an operational anomaly.

[0043] Furthermore, to achieve the above objectives, this application also provides an anomaly monitoring device, the anomaly monitoring device comprising:

[0044] The first acquisition module is used to acquire the first target monitoring function corresponding to the first target task when the first target task is running, wherein the task period of the first target task is less than or equal to a preset task period, and the first target monitoring function includes multiple monitoring functions with the same task period.

[0045] The second acquisition module is used to acquire the time check result and the first signature value corresponding to the first target task based on the first target monitoring function;

[0046] The monitoring module is used to determine whether the first target task has any operational abnormalities based on the time check result and / or the first signature value.

[0047] In addition, to achieve the above objectives, this application also provides an anomaly monitoring device, which includes: a memory, a processor, and an anomaly monitoring program stored in the memory and executable on the processor. When the anomaly monitoring program is executed by the processor, it implements the steps of the anomaly monitoring method as described above.

[0048] In addition, to achieve the above objectives, this application also provides a computer-readable storage medium storing an anomaly monitoring program, which, when executed by a processor, implements the steps of the anomaly monitoring method as described above.

[0049] This application obtains a first target monitoring function corresponding to the first target task during the execution of the first target task, wherein the task period of the first target task is less than or equal to a preset task period, and the first target monitoring function includes multiple monitoring functions with the same task period; then, based on the first target monitoring function, it obtains a time check result and a first signature value corresponding to the first target task; and then, based on the time check result and / or the first signature value, it determines whether the first target task has an operational anomaly. It can accurately identify the time deviation of the first target task through the time check result, reduce the impact of the time deviation of high-frequency running tasks (target tasks) with a time period less than or equal to the preset task period on the signature value, and improve the accuracy of monitoring high-frequency running tasks in the program flow. Attached Figure Description

[0050] Figure 1 This is a schematic diagram of the structure of the anomaly monitoring device in the hardware operating environment involved in the embodiments of this application;

[0051] Figure 2 This is a flowchart illustrating the first embodiment of the anomaly monitoring method of this application;

[0052] Figure 3 This is a schematic diagram illustrating a scenario of an embodiment of the anomaly monitoring method.

[0053] Figure 4 This is a functional module diagram of an embodiment of the anomaly monitoring device of this application;

[0054] Figure 5 This is a schematic diagram of a scenario for another embodiment of the anomaly monitoring method.

[0055] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0056] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0057] likeFigure 1 As shown, Figure 1 This is a schematic diagram of the structure of an anomaly monitoring device in the hardware operating environment involved in the embodiments of this application.

[0058] The anomaly monitoring device in this application embodiment can be a vehicle, or a portable terminal device with display function such as a PC, smartphone, tablet computer, e-book reader, MP3 (Moving Picture Experts Group Audio Layer III) player, MP4 (Moving Picture Experts Group Audio Layer IV) player, or portable computer.

[0059] like Figure 1 As shown, the anomaly monitoring device may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to establish communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0060] Optionally, the anomaly detection device may also include a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, a WiFi module, and so on. These sensors may include, for example, light sensors, motion sensors, and other sensors. Of course, the anomaly detection device may also be equipped with other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, which will not be elaborated upon here.

[0061] Those skilled in the art will understand that Figure 1 The terminal structure shown does not constitute a limitation on the anomaly monitoring device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0062] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an anomaly monitoring program.

[0063] exist Figure 1 In the anomaly monitoring device shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the client (user terminal) and communicate data with the client; and the processor 1001 can be used to call the anomaly monitoring program stored in the memory 1005.

[0064] In this embodiment, the anomaly monitoring device includes: a memory 1005, a processor 1001, and an anomaly monitoring program stored in the memory 1005 and executable on the processor 1001. When the processor 1001 calls the anomaly monitoring program stored in the memory 1005, it executes the steps of the anomaly monitoring methods in the following embodiments.

[0065] This application also provides an anomaly monitoring method, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the anomaly monitoring method of this application.

[0066] The anomaly detection method includes:

[0067] Step S101: When the first target task is running, obtain the first target monitoring function corresponding to the first target task, wherein the task period of the first target task is less than or equal to a preset task period, and the first target monitoring function includes multiple monitoring functions with the same task period.

[0068] The first target task is the task (program) that needs to be executed in the program flow. The task cycle of the first target task is less than or equal to the preset task cycle. That is to say, the first target task is executed at least once every preset task cycle. The preset task cycle can be reasonably set, for example, the preset task cycle is 100us, 200us, etc.

[0069] When the first target task is running, the first target monitoring function corresponding to the first target task is obtained. The first target monitoring function includes multiple monitoring functions in the same task cycle. The multiple monitoring functions in the same task cycle are ordered in sequence. Each monitoring function has at least two checkpoints. For example, each monitoring function has two checkpoints, namely an entry checkpoint and an exit checkpoint. The input parameters of the exit checkpoint include the result of the entry checkpoint. The input parameters of the entry checkpoint include the result of the exit checkpoint of the previous monitoring function.

[0070] Step S102: Based on the first target monitoring function, obtain the time check result and the first signature value corresponding to the first target task;

[0071] When the first target monitoring function is obtained, the operation process of the first target task is monitored through each first target monitoring function, so as to obtain the time check result and the first signature value corresponding to the first target task through the first target monitoring function. Among them, one or more time monitoring functions with time check points can be set in the first target monitoring function, the time check result is obtained through the time monitoring function, and the first signature value is obtained through the check points of each first target monitoring function.

[0072] Step S103: Based on the time check result and / or the first signature value, determine whether the first target task has any operational abnormalities.

[0073] When the first signature value and the time check result are obtained, it is determined whether the first target task has any operational abnormality based on the time check result and / or the first signature value. Specifically, it can be determined whether the first target task has any operational abnormality based on the time check result and / or based on the first signature value. The time check result can accurately identify the time deviation of the first target task, reduce the impact of the time deviation of the target task on the signature value, and improve the accuracy of program flow monitoring.

[0074] Furthermore, in one possible implementation, step S103 includes:

[0075] Step a: Determine whether the time check result is within a preset time period corresponding to the first target task; wherein, if the time check result is outside the preset time period, it is determined that the first target task has an operational abnormality; and / or,

[0076] Step b: Determine whether the first signature value matches the first expected signature value. If the first signature value does not match the first expected signature value, then it is determined that the first target task has an operational anomaly.

[0077] When the first signature value and time check result are obtained, the preset time period corresponding to the first target task is obtained. The preset time period can be set according to the task cycle of the first target task, the initial time of the first run of the first target task, the time difference between the time check point in the first target task and the current run time of the first target task, and the number of times the first target task runs in the current loop. For example, if the cycle range is 80us, the initial time is 10 o'clock, the time difference is 10us, and the number of runs is 6, then under normal circumstances, the check result of the time check point is 10.0410((6-1)*80+10)us. The preset time period can be 10.0400us~10.0420us, 10.0390us~10.0430us, etc.

[0078] When a preset time period is obtained, it is determined whether the time check result is within the preset time period corresponding to the first target task. If the time check result is outside the preset time period, it is determined that the first target task has an operational abnormality. This is so that the time deviation of the first target task can be accurately identified through the time check result, thereby reducing the impact of the time deviation of the target task on the signature value and improving the accuracy of program flow monitoring.

[0079] Simultaneously, it is determined whether the first signature value matches the first expected signature value. For example, whether the first signature value and the first expected signature value are consistent. If the first signature value and the first expected signature value do not match, that is, the first target task is determined to have an operational anomaly. This allows for accurate determination of whether the first target task has an anomaly through the first signature value, improving the accuracy of program flow monitoring.

[0080] By obtaining the first target monitoring function corresponding to the first target task during its execution, wherein the task period of the first target task is less than or equal to a preset task period, and the first target monitoring function includes multiple monitoring functions with the same task period; then, based on the first target monitoring function, obtaining the time check result and the first signature value corresponding to the first target task; and then, based on the time check result and / or the first signature value, determining whether the first target task has an operational anomaly, the time deviation of the first target task can be accurately identified through the time check result, reducing the impact of the time deviation of high-frequency running tasks (target tasks) with a task period less than or equal to the preset task period on the signature value, and improving the accuracy of monitoring high-frequency running tasks in the program flow.

[0081] Based on the first embodiment, a second embodiment of the anomaly monitoring method of this application is proposed, wherein the first target monitoring function includes a time monitoring function with time checkpoints; step S102 includes:

[0082] Step S201: Based on the first target monitoring function, obtain the first signature value corresponding to the first target task of the target;

[0083] Step S202: Obtain the time check result based on the time monitoring function.

[0084] Specifically, one or more time monitoring functions with time checkpoints can be set in the first target monitoring function to obtain time check results. That is to say, the first target monitoring function includes time monitoring functions with time checkpoints, wherein the time monitoring function can be the first monitoring function among the various first target monitoring functions.

[0085] When the first target monitoring function is obtained, the operation process of the first target task is monitored through each first target monitoring function. The time check result corresponding to the first target task is obtained through the first target monitoring function, and the time check result is obtained through the time monitoring function, thereby improving the accuracy of obtaining the time check result.

[0086] By using the first target monitoring function, the first signature value corresponding to the first target task is obtained; then, based on the time monitoring function, the time check result is obtained. The time check result can be accurately obtained through the time monitoring function, so that the time deviation of the first target task can be accurately identified through the time check result, thereby further improving the accuracy of monitoring high-frequency running tasks in the program flow.

[0087] Based on the second embodiment, a third embodiment of the anomaly monitoring method of this application is proposed, wherein each of the first target monitoring functions has at least two first checkpoints, and the first checkpoints are sequentially ordered according to the order of the first target monitoring functions; step S201 includes:

[0088] Step S301: Perform cyclic redundancy check based on the first checkpoint value of each first checkpoint to obtain the first cyclic redundancy check value corresponding to each first checkpoint.

[0089] Step S302: Use the first cyclic redundancy check value of the last first checkpoint as the first signature value.

[0090] The first target monitoring function includes multiple monitoring functions within the same task cycle. These monitoring functions are sequentially ordered, and each monitoring function has at least two checkpoints. The first checkpoints are sequentially ordered according to the order of the respective first target monitoring functions. For example, each monitoring function has two checkpoints: an entry checkpoint and an exit checkpoint. The input parameters for the exit checkpoint include the result of the entry checkpoint, and the input parameters for the entry checkpoint include the result of the exit checkpoint of the previous monitoring function. Figure 3 , Figure 3 In this context, for each task cycle of the first target task, the first target monitoring functions are first target monitoring function 1 (time monitoring function), first target monitoring function 2, ..., first target monitoring function n, and the first checkpoints are first checkpoint 1, first checkpoint 2, first checkpoint 3, first checkpoint 4, ..., first checkpoint 2n-1, and first checkpoint 2n (the last checkpoint). The first target monitoring function 1 has a time checkpoint.

[0091] Upon obtaining the first target monitoring function, a cyclic redundancy check (CRC) is performed based on the first checkpoint values ​​of each first target monitoring function to obtain the first CRC value corresponding to each first checkpoint. That is, for each first checkpoint, a CRC check is performed using its checkpoint value and the CRC value of the previous checkpoint to obtain the CRC value of the current first checkpoint. It is then determined whether this first checkpoint is the last first checkpoint, i.e., whether it is the exit checkpoint in the last first target monitoring function. If so, the CRC value of the last first checkpoint is used as the first signature value to accurately obtain the first signature value, thereby improving the accuracy of the first target task's monitoring. Figure 3 The cyclic redundancy check value of the last checkpoint is used as the first signature value.

[0092] Furthermore, in one possible implementation, step S301 includes:

[0093] Step S3011: If the first checkpoint is the first first checkpoint, then the task ID corresponding to the first target task is used as the first checkpoint value of the first checkpoint.

[0094] Step S3012: Perform cyclic redundancy check based on the first checkpoint value and the preset value to obtain the first cyclic redundancy check value corresponding to the first checkpoint.

[0095] If the first checkpoint is the very first checkpoint, for example Figure 3 The first checkpoint in the process uses the task ID corresponding to the first target task as the first checkpoint value and obtains a preset value, which is usually 0. Then, a cyclic redundancy check is performed based on the first checkpoint value and the preset value to obtain the first cyclic redundancy check value corresponding to the first checkpoint. In this way, the first cyclic redundancy check value of the first checkpoint can be accurately obtained through the cyclic redundancy check, so as to accurately obtain the first signature value and improve the accuracy of monitoring the first target task.

[0096] Furthermore, in another possible implementation, step S301 includes:

[0097] Step S3013: If the first checkpoint is not the first first checkpoint, then obtain the second cyclic redundancy check value of the previous first checkpoint corresponding to the first checkpoint.

[0098] Step S3014: Perform cyclic redundancy check based on the first checkpoint value and the second cyclic redundancy check value of the first checkpoint to obtain the first cyclic redundancy check value corresponding to the first checkpoint.

[0099] If the first checkpoint is not the first checkpoint, for example, Figure 3 If any checkpoint from the second checkpoint to the last checkpoint is selected, the second cyclic redundancy check value of the previous first checkpoint corresponding to the first checkpoint is obtained. This second cyclic redundancy check value is the first cyclic redundancy check value of the previous first checkpoint. At the same time, the first checkpoint value of the first checkpoint is obtained.

[0100] Next, a cyclic redundancy check is performed based on the first checkpoint value and the second cyclic redundancy check value to obtain the first cyclic redundancy check value corresponding to the first checkpoint. This allows for the accurate acquisition of the first cyclic redundancy check values ​​for all first checkpoints after the first checkpoint, thus facilitating the accurate acquisition of the first signature value and improving the accuracy of monitoring the first target task.

[0101] By performing cyclic redundancy check based on the first checkpoint values ​​of each first checkpoint, the first cyclic redundancy check value corresponding to each first checkpoint is obtained; then, the first cyclic redundancy check value of the last first checkpoint is used as the first signature value. The first signature value can be accurately obtained based on the cyclic redundancy check values ​​of each first checkpoint, thereby further improving the accuracy of monitoring high-frequency running tasks.

[0102] Based on the above embodiments, a fourth embodiment of the anomaly monitoring method of this application is proposed, wherein the anomaly monitoring method further includes:

[0103] Step S401: When the second target task is running, obtain the second target monitoring function corresponding to the second target task. The task cycle of the second target task is longer than the preset task cycle. The second target monitoring function includes monitoring functions for multiple task cycles, and each task cycle has multiple monitoring functions.

[0104] Step S402: Based on the second target monitoring function, obtain the second signature value corresponding to the second target task;

[0105] Step S403: Based on the second signature value, determine whether the second target task has any operational abnormalities.

[0106] The second target task is the task (program) that needs to be executed in the program flow, and the task cycle of the second target task is longer than the preset task cycle.

[0107] When the second target task is running, the first target monitoring function corresponding to the first target task is obtained. The second target monitoring function includes monitoring functions for multiple task cycles. Each task cycle has multiple monitoring functions. Each monitoring function has at least two checkpoints. For example, each monitoring function has two checkpoints, namely an entry checkpoint and an exit checkpoint. The input parameters of the exit checkpoint include the result of the entry checkpoint. The input parameters of the entry checkpoint include the result of the exit checkpoint of the previous monitoring function.

[0108] When the second target monitoring function is obtained, the operation process of the second target task is monitored through each second target monitoring function, so as to obtain the second signature value corresponding to the second target task through the second target monitoring function. Among them, one or more time monitoring functions with time checkpoints can be set in the second target monitoring function, the time check results are obtained through the time monitoring function, and the second signature value is obtained through the checkpoints of each second target monitoring function.

[0109] After obtaining the second signature value, based on the second signature value, it is determined whether the second target task has any operational abnormalities. Specifically, in one possible implementation, step S403 includes:

[0110] Step c: Determine whether the second signature value matches the second expected signature value. If the second signature value does not match the second expected signature value, it is determined that the second target task has an operational anomaly.

[0111] The system determines whether the second signature value matches the second expected signature value. For example, it checks whether the second signature value and the second expected signature value are identical. If the second signature value and the second expected signature value do not match, that is, the second signature value is inconsistent with the first expected signature value, then it is determined that the second target task has an operational anomaly. This allows for accurate determination of whether the second target task has an anomaly through the second signature value, improving the accuracy of program flow monitoring.

[0112] By obtaining the second target monitoring function corresponding to the second target task during its execution, wherein the task period of the second target task is longer than the preset task period, and the second target monitoring function includes monitoring functions for multiple task periods, with each task period having multiple monitoring functions; then, based on the second target monitoring function, obtaining the second signature value corresponding to the second target task; and then, based on the second signature value, determining whether the second target task has any operational abnormalities. This allows for accurate determination of whether the second target task has any operational abnormalities through the second signature value of the second target monitoring function, further improving the accuracy of monitoring low-frequency running tasks (the second target task) in the program flow.

[0113] Based on the fourth embodiment, a fifth embodiment of the anomaly monitoring method of this application is proposed, wherein each of the second target monitoring functions has at least two second checkpoints, the second target monitoring functions are sequentially ordered according to the task cycle, and the second checkpoints are sequentially ordered according to the order of the second target monitoring functions; step S402 includes:

[0114] Step S501: Perform cyclic redundancy check based on the second checkpoint value of each second checkpoint to obtain the third cyclic redundancy check value corresponding to each second checkpoint.

[0115] Step S502: If the second checkpoint is the last second checkpoint, then the third ring redundancy check value of the last second checkpoint is used as the second signature value.

[0116] The second target monitoring functions are ordered sequentially according to the task cycle, and the second checkpoints are ordered sequentially according to the order of the second target monitoring functions. Each monitoring function has at least two checkpoints, and the second checkpoints are ordered sequentially according to the order of the second target monitoring functions. For example, each monitoring function has two checkpoints, namely an entry checkpoint and an exit checkpoint. The input parameters of the exit checkpoint include the result of the entry checkpoint, and the input parameters of the entry checkpoint include the result of the exit checkpoint of the previous monitoring function.

[0117] When the second target monitoring function is obtained, a cyclic redundancy check is performed based on the second checkpoint value of each second target monitoring function to obtain the second cyclic redundancy check value (CRC) corresponding to each second checkpoint. That is, for each second checkpoint, a cyclic redundancy check is performed using its checkpoint value and the CRC value of the previous checkpoint to obtain the CRC value of the current second checkpoint. It is then determined whether the second checkpoint is the last second checkpoint, i.e., whether it is the exit checkpoint in the last second target monitoring function. If so, the CRC value of the last second checkpoint is used as the second signature value to accurately obtain the second signature value and improve the accuracy of monitoring the second target task.

[0118] Furthermore, in one possible implementation, step S501 includes:

[0119] Step S5011: If the second checkpoint is not the first second checkpoint, then obtain the fourth cyclic redundancy check value of the previous second checkpoint corresponding to the second checkpoint.

[0120] Step S5012: Perform cyclic redundancy check based on the second checkpoint value and the fourth cyclic redundancy check value to obtain the third cyclic redundancy check value corresponding to the second checkpoint.

[0121] If the second checkpoint is not the first second checkpoint, then obtain the fourth cyclic redundancy check value of the previous second checkpoint corresponding to the second checkpoint. This fourth cyclic redundancy check value is the second cyclic redundancy check value of the previous first checkpoint. At the same time, obtain the second checkpoint value of the second checkpoint.

[0122] Next, a cyclic redundancy check is performed based on the second checkpoint value and the fourth cyclic redundancy check value to obtain the third cyclic redundancy check value corresponding to the second checkpoint. This allows for the accurate acquisition of the third cyclic redundancy check values ​​for all second checkpoints after the first second checkpoint, thus facilitating the accurate acquisition of the second signature value and improving the accuracy of monitoring the second target task.

[0123] Furthermore, in another possible implementation, step S501 includes:

[0124] Step S5013: If the second checkpoint is the first second checkpoint, then the task ID corresponding to the second target task is used as the second checkpoint value of the second checkpoint.

[0125] Step S5014: Perform cyclic redundancy check based on the second checkpoint value and the preset value to obtain the third cyclic redundancy check value corresponding to the second checkpoint.

[0126] If the second checkpoint is the first second checkpoint, then the task ID corresponding to the second target task is used as the second checkpoint value of the second checkpoint, and a preset value is obtained. Generally, the preset value is 0. Then, cyclic redundancy check is performed based on the second checkpoint value and the preset value to obtain the third cyclic redundancy check value corresponding to the second checkpoint. In this way, the third cyclic redundancy check value of the first second checkpoint can be accurately obtained through cyclic redundancy check, so as to accurately obtain the second signature value and improve the accuracy of monitoring the second target task.

[0127] Reference Figure 5 , Figure 5 In the second target monitoring function, there are second target monitoring function 1 (time monitoring function), second target monitoring function 2, ..., second target monitoring function n. The second checkpoints of each second target monitoring function include second checkpoint 1, second checkpoint 2, second checkpoint 3, second checkpoint 4, ..., second checkpoint 2n-1 and second checkpoint 2n.

[0128] Cyclic redundancy check is performed based on the second checkpoint values ​​of each second checkpoint to obtain the third cyclic redundancy check value corresponding to each second checkpoint. Then, if the second checkpoint is the last second checkpoint, the third cyclic redundancy check value of the last second checkpoint is used as the second signature value. The second signature value can be accurately obtained based on the cyclic redundancy check values ​​of each second checkpoint, further improving the accuracy of monitoring low-frequency operation tasks.

[0129] In addition, this application also proposes an anomaly monitoring device, referring to Figure 4 The anomaly monitoring device includes:

[0130] The first acquisition module 10 is used to acquire the first target monitoring function corresponding to the first target task when the first target task is running, wherein the task period of the first target task is less than or equal to a preset task period, and the first target monitoring function includes multiple monitoring functions with the same task period.

[0131] The second acquisition module 20 is used to acquire the time check result and the first signature value corresponding to the first target task based on the first target monitoring function;

[0132] Monitoring module 30 is used to determine whether the first target task has any operational abnormalities based on the time check result and / or the first signature value.

[0133] The methods executed by the above-mentioned program units can be referred to in the various embodiments of the anomaly monitoring method of this application, and will not be repeated here.

[0134] Furthermore, this application also proposes a computer-readable storage medium storing an anomaly monitoring program, which, when executed by a processor, implements the steps of the anomaly monitoring method described above.

[0135] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0136] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0137] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0138] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. An anomaly monitoring method, characterized in that, The anomaly monitoring method includes the following steps: When the first target task is running, the first target monitoring function corresponding to the first target task is obtained, wherein the task period of the first target task is less than or equal to a preset task period, the first target monitoring function includes multiple monitoring functions with the same task period, wherein each monitoring function has an entry checkpoint and an exit checkpoint, the input parameter of the exit checkpoint is the result of the entry checkpoint, and the input parameter of the entry checkpoint is the result of the exit checkpoint of the previous monitoring function; Based on the first target monitoring function, obtain the time check result and the first signature value corresponding to the first target task; Based on the time check result and / or the first signature value, determine whether the first target task has any operational abnormalities; The step of determining whether the first target task has an operational anomaly based on the time check result and / or the first signature value includes: Determine whether the time check result is within a preset time period corresponding to the first target task; wherein, if the time check result is outside the preset time period, it is determined that the first target task has an operational abnormality; and / or, Determine whether the first signature value matches the first expected signature value. If the first signature value does not match the first expected signature value, then determine that the first target task has an operational anomaly.

2. The anomaly monitoring method as described in claim 1, characterized in that, The first target monitoring function includes a time monitoring function with time checkpoints; the step of obtaining the time check result and the first signature value corresponding to the first target task based on the first target monitoring function includes: Based on the first target monitoring function, obtain the first signature value corresponding to the first target task; The time check result is obtained based on the time monitoring function.

3. The anomaly monitoring method as described in claim 2, characterized in that, Each of the first target monitoring functions has at least two first checkpoints, and each of the first checkpoints is ordered sequentially according to the order of the first target monitoring functions; The step of obtaining the first signature value corresponding to the first target task based on the first target monitoring function includes: Cyclic redundancy check is performed based on the first checkpoint value of each first checkpoint to obtain the first cyclic redundancy check value corresponding to each first checkpoint. Use the first cyclic redundancy check value of the last first checkpoint as the first signature value.

4. The anomaly monitoring method as described in claim 3, characterized in that, The step of performing cyclic redundancy check based on the first checkpoint values ​​of each first checkpoint to obtain the first cyclic redundancy check value corresponding to each first checkpoint includes: If the first checkpoint is the first first checkpoint, then the task ID corresponding to the first target task is used as the first checkpoint value of the first checkpoint; Cyclic redundancy check is performed based on the first checkpoint value and a preset value to obtain the first cyclic redundancy check value corresponding to the first checkpoint.

5. The anomaly monitoring method as described in claim 3, characterized in that, The step of performing cyclic redundancy check based on the first checkpoint values ​​of each first checkpoint to obtain the first cyclic redundancy check value corresponding to each first checkpoint includes: If the first checkpoint is not the first first checkpoint, then obtain the second cyclic redundancy check value of the previous first checkpoint corresponding to the first checkpoint; Cyclic redundancy check is performed based on the first checkpoint value and the second cyclic redundancy check value of the first checkpoint to obtain the first cyclic redundancy check value corresponding to the first checkpoint.

6. The anomaly monitoring method as described in claim 2, characterized in that, The time monitoring function is the first monitoring function among the various first target monitoring functions.

7. The anomaly monitoring method according to any one of claims 1 to 6, characterized in that, Also includes: When the second target task is running, the second target monitoring function corresponding to the second target task is obtained. The task period of the second target task is longer than the preset task period. The second target monitoring function includes monitoring functions for multiple task periods, and each task period has multiple monitoring functions. Based on the second target monitoring function, obtain the second signature value corresponding to the second target task; Based on the second signature value, it is determined whether the second target task has any operational abnormalities.

8. The anomaly monitoring method as described in claim 7, characterized in that, Each of the second target monitoring functions has at least two second checkpoints, and each of the second target monitoring functions is ordered sequentially according to the task cycle order, and each of the second checkpoints is ordered sequentially according to the order of each of the second target monitoring functions; The step of obtaining the second signature value corresponding to the second target task based on the second target monitoring function includes: Cyclic redundancy check is performed based on the second checkpoint values ​​of each second checkpoint to obtain the third cyclic redundancy check value corresponding to each second checkpoint. If the second checkpoint is the last second checkpoint, then the third ring redundancy check value of the last second checkpoint is used as the second signature value.

9. The anomaly monitoring method as described in claim 8, characterized in that, The step of performing cyclic redundancy check based on the second checkpoint values ​​of each second checkpoint to obtain the third cyclic redundancy check value corresponding to each second checkpoint includes: If the second checkpoint is not the first second checkpoint, then obtain the fourth cyclic redundancy check value of the previous second checkpoint corresponding to the second checkpoint; Based on the second checkpoint value and the fourth cyclic redundancy check value, a cyclic redundancy check is performed to obtain the third cyclic redundancy check value corresponding to the second checkpoint.

10. The anomaly monitoring method as described in claim 8, characterized in that, The step of performing cyclic redundancy check based on the second checkpoint values ​​of each second checkpoint to obtain the third cyclic redundancy check value corresponding to each second checkpoint includes: If the second checkpoint is the first second checkpoint, then the task ID corresponding to the second target task is used as the second checkpoint value of the second checkpoint; Cyclic redundancy check is performed based on the second checkpoint value and the preset value to obtain the third cyclic redundancy check value corresponding to the second checkpoint.

11. The anomaly monitoring method as described in claim 7, characterized in that, The step of determining whether the second target task has a runtime anomaly based on the second signature value includes: Determine whether the second signature value matches the second expected signature value. If the second signature value does not match the second expected signature value, then determine that the second target task has an operational anomaly.

12. An anomaly monitoring device, characterized in that, The anomaly monitoring device includes: The first acquisition module is used to acquire the first target monitoring function corresponding to the first target task when the first target task is running, wherein the task period of the first target task is less than or equal to a preset task period, the first target monitoring function includes multiple monitoring functions with the same task period, wherein each monitoring function has an entry checkpoint and an exit checkpoint, the input parameter of the exit checkpoint is the result of the entry checkpoint, and the input parameter of the entry checkpoint is the result of the exit checkpoint of the previous monitoring function. The second acquisition module is used to acquire the time check result and the first signature value corresponding to the first target task based on the first target monitoring function; The monitoring module is used to determine whether the first target task has any operational abnormalities based on the time check result and / or the first signature value; The monitoring module is further configured to determine whether the time check result is within a preset time period corresponding to the first target task; wherein, if the time check result is outside the preset time period, it is determined that the first target task has an operational anomaly; and / or, Determine whether the first signature value matches the first expected signature value. If the first signature value does not match the first expected signature value, then determine that the first target task has an operational anomaly.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an anomaly monitoring program, which, when executed by a processor, implements the steps of the anomaly monitoring method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Software execution anomaly detection and protection method, equipment and medium

    CN114238949A

  • Method and device for detecting task execution of controller, storage medium and electronic device

    CN114326670A