A software monitoring method, device, equipment and storage medium

By creating the first and second monitoring processes in the embedded computer system, real-time monitoring of the watchdog status is achieved, and the non-high availability problem of watchdog is solved, ensuring the high availability of system software and monitoring recovery capabilities.

CN113672471BActive Publication Date: 2025-05-30CHINA FAW CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110993213.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-27
Publication Date
2025-05-30
Estimated Expiration
2041-08-27

AI Technical Summary

Technical Problem

In the prior art, the watchdog design in embedded computer systems has non-high availability problems, and the watchdog's own status cannot be monitored, resulting in the system being unable to understand whether it works normally, and the problem of high cost and failure probability of hardware chips or secondary watchdog software is high.

Method used

By running the initial monitoring software and performing process replication, the first and second monitoring processes are created. The first process monitors the monitored software, and the second process monitors the first process. When the second process detects the first process exception, a new first process is created to realize real-time monitoring of the system software and ensure high availability of monitoring.

Benefits of technology

Without increasing hardware costs, real-time monitoring of system software is achieved, the non-high availability problem of watchdogs is solved, and the monitoring mechanism is restored in abnormal situations is ensured, and the monitoring effect is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113672471B_ABST
    Figure CN113672471B_ABST
Patent Text Reader

Abstract

The present invention discloses a software monitoring method, device, equipment and storage medium. The method includes: running an initial monitoring software and performing process replication to obtain a first monitoring process and a second monitoring process, where the first monitoring process is used to monitor the software to be monitored and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process; when the second monitoring process monitors that the first monitoring process is abnormal, the second monitoring process monitors the software to be monitored, and at the same time, a new first monitoring process is created based on the initial monitoring software. The present invention solves the problem of non-high availability of current monitoring software, realizes real-time monitoring of the software running on the system without increasing the hardware cost, and achieves the purpose of high availability of the monitoring software through a monitoring recovery mechanism in the case of abnormal monitoring mechanisms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of software design, and in particular, to a software monitoring method, device, equipment and storage medium. Background Art

[0002] In the field of embedded computer software development, a watchdog is commonly used to monitor the running status of a certain software or a group of software.

[0003] The watchdog runs according to a certain rule in the initial state. After reaching specific constraint conditions, the watchdog alarm is activated. For example, if a certain component does not "feed the dog" for a long time, the alarm mechanism of the watchdog is triggered, realizing the function of monitoring and identifying components with abnormal status in the system.

[0004] The watchdog technology is divided into software watchdog and hardware watchdog. In principle, both software and hardware watchdogs periodically reset the watchdog component through a signal, forcing it to return to the initial state before the trigger condition is reached, so that the watchdog can monitor according to the rule again.

[0005] However, if there is a problem with the watchdog itself, it can be regarded as no longer having the ability to continue monitoring other components. But there is no component in the system that can monitor the status of the watchdog, so it is impossible to know whether the watchdog can work properly. The design in this case is called a non-highly available watchdog design.

[0006] To solve the non-highly available problem of the watchdog mechanism, the common solutions are: adding an additional watchdog hardware chip or using a secondary watchdog software to monitor the primary watchdog. Among them, the watchdog hardware chip has a high cost, is at a disadvantage in terms of cost compared to software, and occupies chip pins, increasing the complexity of circuit design. And the secondary watchdog software still has a probability of failure and does not essentially solve the problem of watchdog failure under special working conditions. Summary of the Invention

[0007] The present invention provides a software monitoring method, device, equipment and storage medium to achieve real-time monitoring of the software running in the system.

[0008] In a first aspect, an embodiment of the present invention provides a software monitoring method, including:

[0009] Running the initial monitoring software and performing process replication to obtain a first monitoring process and a second monitoring process. The first monitoring process is used to monitor the software to be monitored and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process.

[0010] When the second monitoring process monitors that the first monitoring process is abnormal, the second monitoring process monitors the software to be monitored, and at the same time, creates a new first monitoring process based on the initial monitoring software.

[0011] Optionally, the method further includes:

[0012] When the first monitoring process monitors that the second monitoring process is abnormal, a new second monitoring process is created based on the initial monitoring software.

[0013] Optionally, after running the initial monitoring software and performing process replication to obtain the first monitoring process and the second monitoring process, the method further includes:

[0014] The first monitoring process forms a registration information table according to the software to be monitored and sends it to the second monitoring process.

[0015] Optionally, after creating a new first monitoring process based on the initial monitoring software, the method further includes:

[0016] The second monitoring process sends the registration information table to the new first monitoring process.

[0017] Optionally, the method further includes:

[0018] When the first monitoring process monitors that the software to be monitored is abnormal, an alarm mechanism is triggered.

[0019] Optionally, the method further includes:

[0020] When the second monitoring process monitors that the software to be monitored is abnormal, an alarm mechanism is triggered.

[0021] In a second aspect, an embodiment of the present invention further provides a software monitoring device, including:

[0022] A monitoring process running module, configured to run an initial monitoring software and perform process replication to obtain a first monitoring process and a second monitoring process, where the first monitoring process is used to monitor the software to be monitored and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process;

[0023] A first exception handling module, configured to, when the second monitoring process monitors that the first monitoring process is abnormal, the second monitoring process monitors the software to be monitored, and at the same time, creates a new first monitoring process based on the initial monitoring software.

[0024] In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the program, the software monitoring method described in any embodiment of the present invention is implemented.

[0025] In a fourth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the software monitoring method as described in any embodiment of the present invention when executed by a computer processor.

[0026] The present invention runs an initial monitoring software and performs process replication to obtain a first monitoring process and a second monitoring process. The first monitoring process is used to monitor the software to be monitored and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process. When the second monitoring process monitors that the first monitoring process is abnormal, the second monitoring process monitors the software to be monitored, and at the same time, a new first monitoring process is created based on the initial monitoring software, which solves the problem of non-high availability of current monitoring software. Without increasing the hardware cost, real-time monitoring of the software running on the system is achieved, and the high availability of the monitoring software is achieved through the monitoring recovery mechanism in the case of abnormal monitoring mechanisms. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a flowchart of a software monitoring method provided by Embodiment 1 of the present invention;

[0028] Figure 2a The first schematic diagram of the principle of a software monitoring method provided by Embodiment 1 of the present invention;

[0029] Figure 2b The second schematic diagram of the principle of a software monitoring method provided by Embodiment 1 of the present invention;

[0030] Figure 2c The third schematic diagram of the principle of a software monitoring method provided by Embodiment 1 of the present invention;

[0031] Figure 2d The fourth schematic diagram of the principle of a software monitoring method provided by Embodiment 1 of the present invention;

[0032] Figure 2e The fifth schematic diagram of the principle of a software monitoring method provided by Embodiment 1 of the present invention;

[0033] Figure 2f The sixth schematic diagram of the principle of a software monitoring method provided by Embodiment 1 of the present invention;

[0034] Figure 3 is a structural block diagram of a software monitoring device provided by Embodiment 2 of the present invention;

[0035] Figure 4 is a structural block diagram of a computer device provided by Embodiment 3 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0036] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that for the convenience of description, only the parts related to the present invention rather than all the structures are shown in the drawings. In addition, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.

[0037] Embodiment 1

[0038] Figure 1 The flowchart of a software monitoring method provided in Embodiment 1 of the present invention is applicable to the situation of real-time monitoring of system-running software. This method can be executed by a software monitoring device, and the device can be implemented by software and / or hardware.

[0039] As Figure 1 shown, the method specifically includes the following steps:

[0040] Step 110: Run the initial monitoring software and perform process replication to obtain a first monitoring process and a second monitoring process.

[0041] Among them, the initial monitoring software can be understood as the initial code program of the monitoring software, that is, the monitoring software that has not yet run.

[0042] Specifically, two processes can be simultaneously started for the initial monitoring software, and different running parameters can be assigned to them, which are used as the first monitoring process and the second monitoring process respectively to achieve different monitoring functions. In this embodiment, the first monitoring process is used to monitor the software to be monitored and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process. The first monitoring process can be understood as a first-level watchdog, and the second monitoring software can be understood as a second-level watchdog. Different from other second-level watchdog software, the first monitoring process and the second monitoring process in this embodiment can monitor each other, that is to say, any one of the monitoring processes is also being monitored when it is working. In this way, when any one of the monitoring processes has an abnormality, it can be detected in time, and corresponding processing can be carried out.

[0043] Optionally, after running the initial monitoring software and performing process replication to obtain a first monitoring process and a second monitoring process, the first monitoring process forms a registration information table according to the software to be monitored and sends it to the second monitoring process.

[0044] Exemplarily, Figure 2a The first principle schematic diagram of a software monitoring method provided in Embodiment 1 of the present invention. As Figure 2aAs shown, after running the initial monitoring software and performing process replication to obtain the first monitoring process and the second monitoring process, the first monitoring process can determine the software to be monitored in the system, form a registration information table, and send it to the second monitoring process. At the same time, the first monitoring process also monitors the running status of the second monitoring process. When the first monitoring process is running normally, the second monitoring process can be used only to monitor the first monitoring process.

[0045] Optionally, when the first monitoring process monitors that the software to be monitored is abnormal, an alarm mechanism is triggered.

[0046] Exemplarily, Figure 2b The second schematic diagram of the principle of a software monitoring method provided in the first embodiment of the present invention. As Figure 2b shown, when the first monitoring process is running normally, it will perform real-time monitoring on each software to be monitored in the system. At this time, if the software to be monitored 2 is running abnormally, the alarm mechanism of the first monitoring process can be triggered.

[0047] Step 120: When the second monitoring process monitors that the first monitoring process is abnormal, the second monitoring process monitors the software to be monitored, and at the same time creates a new first monitoring process based on the initial monitoring software.

[0048] Specifically, when the first monitoring process is abnormal, it can be monitored by the second monitoring process. At this time, the second monitoring process can take over the first monitoring process to monitor each software to be monitored. At the same time, a new first monitoring process can be created based on the initial monitoring software to replace the first monitoring process that is running abnormally. In practical applications, the fork instruction can be used to implement the creation operation of the monitoring new process.

[0049] Exemplarily, Figure 2c The third schematic diagram of the principle of a software monitoring method provided in the first embodiment of the present invention, Figure 2d The fourth schematic diagram of the principle of a software monitoring method provided in the first embodiment of the present invention. As Figure 2c shown, when the first monitoring process is abnormal, it can be monitored by the second monitoring process. At this time, the following operations will be implemented. The second monitoring process takes over the first monitoring process to monitor each software to be monitored. At the same time, a new first monitoring process can be created based on the initial monitoring software to replace the process where the first monitoring process is running abnormally. In practical applications, the fork instruction can be used to implement the creation operation of the new first monitoring process. After the new first monitoring process can run normally, the new first monitoring process will continue to monitor each software to be monitored and the second monitoring process, and the second monitoring process only monitors the new first monitoring process, that is, Figure 2d the state shown. Figure 2a shown.

[0050] Optionally, when the second monitoring process monitors that the software to be monitored is abnormal, an alarm mechanism is triggered.

[0051] Exemplarily, such as Figure 2d the monitored status shown. At this time, the second monitoring process performs real-time monitoring on each monitored software in the system. When a certain monitored software runs abnormally, the alarm mechanism of the second monitoring process will be triggered to give an abnormal alarm.

[0052] In the technical solution of this embodiment, by running the initial monitoring software and performing process replication, the first monitoring process and the second monitoring process are obtained. The first monitoring process is used to monitor the monitored software and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process. When the second monitoring process monitors that the first monitoring process is abnormal, the second monitoring process monitors the monitored software, and at the same time, a new first monitoring process is created based on the initial monitoring software, which solves the problem of non-high availability of the current monitoring software. Without increasing the hardware cost, real-time monitoring of the software running in the system is achieved. Through the monitoring recovery mechanism in the case of abnormal monitoring mechanism, the purpose of high availability of the monitoring software is achieved.

[0053] Based on the above technical solution, the software monitoring method provided in this embodiment may further include the following steps:

[0054] Step 140: The second monitoring process sends the registration information table to the new first monitoring process.

[0055] Specifically, after creating the new first monitoring process, the new first monitoring process does not have the registration information of each monitored software. Therefore, the second monitoring process can re-send the registration information table to the new first monitoring, so that the new first monitoring process can resume normal monitoring operations.

[0056] Step 150: When the first monitoring process monitors that the second monitoring process is abnormal, a new second monitoring process is created based on the initial monitoring software.

[0057] Exemplarily, Figure 2e The fifth schematic diagram of the principle of a software monitoring method provided in Embodiment 1 of the present invention Figure 2f The sixth schematic diagram of the principle of a software monitoring method provided in Embodiment 1 of the present invention. Such as Figure 2e shown, when the second monitoring process runs abnormally, it can be monitored by the first monitoring process. At this time, the Figure 2f operation shown can be implemented, and a new second monitoring process can be created based on the initial monitoring software to replace the abnormally running second monitoring process.

[0058] Embodiment 2

[0059] The software monitoring device provided in the embodiments of the present invention can execute the software monitoring method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.Figure 3 This is the structural block diagram of a software monitoring device provided in the second embodiment of the present invention. As Figure 3 shown, the device includes: a monitoring process running module 210 and a first exception handling module 220.

[0060] The monitoring process running module 210 is configured to run the initial monitoring software and perform process replication to obtain a first monitoring process and a second monitoring process. The first monitoring process is used to monitor the software to be monitored and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process.

[0061] The first exception handling module 220 is configured to, when the second monitoring process monitors that the first monitoring process is abnormal, monitor the software to be monitored by the second monitoring process, and at the same time create a new first monitoring process based on the initial monitoring software.

[0062] The technical solution of this embodiment runs the initial monitoring software and performs process replication to obtain a first monitoring process and a second monitoring process. The first monitoring process is used to monitor the software to be monitored and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process. When the second monitoring process monitors that the first monitoring process is abnormal, the second monitoring process monitors the software to be monitored, and at the same time creates a new first monitoring process based on the initial monitoring software, which solves the problem of non-high availability of the current monitoring software. Without increasing the hardware cost, it realizes the real-time monitoring of the software running on the system, and achieves the purpose of high availability of the monitoring software through the monitoring recovery mechanism in the case of abnormal monitoring mechanisms.

[0063] Optionally, the device further includes:

[0064] A second exception handling module, configured to create a new second monitoring process based on the initial monitoring software when the first monitoring process monitors that the second monitoring process is abnormal.

[0065] Optionally, the device further includes:

[0066] A first registration information replication module, configured to, after running the initial monitoring software and performing process replication to obtain a first monitoring process and a second monitoring process, the first monitoring process forms a registration information table according to the software to be monitored and sends it to the second monitoring process.

[0067] Optionally, the device further includes:

[0068] A second registration information replication module, configured to, after creating a new first monitoring process based on the initial monitoring software, the second monitoring process resends the registration information table to the first monitoring process.

[0069] Optionally, the device further includes:

[0070] The first alarm module is used to trigger an alarm mechanism when the first monitoring process monitors that the software to be monitored is abnormal.

[0071] Optionally, the device further includes:

[0072] The second alarm module is used to trigger an alarm mechanism when the second monitoring process monitors that the software to be monitored is abnormal.

[0073] Embodiment III

[0074] Figure 4 The following is a structural block diagram of a computer device provided in Embodiment III of the present invention. As Figure 4 shown, the computer device includes a processor 310, a memory 320, an input device 330, and an output device 340. The number of processors 310 in the computer device may be one or more. Figure 4 In this example, one processor 310 is taken as an example. The processor 310, the memory 320, the input device 330, and the output device 340 in the computer device may be connected by a bus or other means. Figure 4 In this example, connection by a bus is taken as an example.

[0075] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the software monitoring method in the embodiments of the present invention (for example, the monitoring process running module 210 and the first exception handling module 220 in the software monitoring device). The processor 310 executes various functional applications and data processing of the computer device by running the software programs, instructions, and modules stored in the memory 320, that is, implements the above-mentioned software monitoring method.

[0076] The memory 320 may mainly include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function. The data storage area can store data created according to the use of the terminal, etc. In addition, the memory 320 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 320 may further include a memory remotely set relative to the processor 310, and these remote memories can be connected to the computer device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise internal network, a local area network, a mobile communication network, and combinations thereof.

[0077] The input device 330 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function control of the computer device. The output device 340 may include a display device such as a display screen.

[0078] Embodiment 4

[0079] Embodiment 4 of the present invention further provides a storage medium containing computer-executable instructions, and when the computer-executable instructions are executed by a computer processor, they are used to execute a software monitoring method, and this method includes:

[0080] Run the initial monitoring software and perform process replication to obtain a first monitoring process and a second monitoring process. The first monitoring process is used to monitor the software to be monitored and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process;

[0081] When the second monitoring process monitors that the first monitoring process is abnormal, the second monitoring process monitors the software to be monitored, and at the same time, a new first monitoring process is created based on the initial monitoring software.

[0082] Certainly, for a storage medium containing computer-executable instructions provided by the embodiments of the present invention, the computer-executable instructions are not limited to the method operations as described above, and can also execute the related operations in the software monitoring methods provided by any embodiments of the present invention.

[0083] Through the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software and necessary general hardware. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, 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 can be stored in a computer-readable storage medium, such as a floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disc of a computer, etc., and includes several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.

[0084] It should be noted that in the embodiments of the above software monitoring device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.

[0085] Note that the above is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A software monitoring method, characterized in that, it includes: Running the initial monitoring software and performing process replication to obtain a first monitoring process and a second monitoring process, where the first monitoring process is used to monitor the software to be monitored and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process; When the second monitoring process monitors that the first monitoring process is abnormal, the second monitoring process monitors the software to be monitored, and at the same time creates a new first monitoring process based on the initial monitoring software, and the creation operation of the new first monitoring process is implemented through the fork instruction; Wherein, after running the initial monitoring software and performing process replication to obtain a first monitoring process and a second monitoring process, it further includes: The first monitoring process forms a registration information table according to the software to be monitored and sends it to the second monitoring process; After creating a new first monitoring process based on the initial monitoring software, it further includes: The second monitoring process sends the registration information table to the new first monitoring process.

2. The software monitoring method according to claim 1, characterized in that, the method further includes: When the first monitoring process monitors that the second monitoring process is abnormal, a new second monitoring process is created based on the initial monitoring software.

3. The software monitoring method according to claim 1, characterized in that, the method further includes: When the first monitoring process monitors that the software to be monitored is abnormal, an alarm mechanism is triggered.

4. The software monitoring method according to claim 1, characterized in that, the method further includes: When the second monitoring process monitors that the software to be monitored is abnormal, an alarm mechanism is triggered.

5. A software monitoring device, characterized in that, it includes: A monitoring process running module, used to run the initial monitoring software and perform process replication to obtain a first monitoring process and a second monitoring process, where the first monitoring process is used to monitor the software to be monitored and the second monitoring process, and the second monitoring process is used to monitor the first monitoring process; A first exception handling module, used to when the second monitoring process monitors that the first monitoring process is abnormal, the second monitoring process monitors the software to be monitored, and at the same time creates a new first monitoring process based on the initial monitoring software, and the creation operation of the new first monitoring process is implemented through the fork instruction; Wherein, the device further includes: A first registration information replication module, used to after running the initial monitoring software and performing process replication to obtain a first monitoring process and a second monitoring process, the first monitoring process forms a registration information table according to the software to be monitored and sends it to the second monitoring process; The device further includes: A second registration information replication module, used to after creating a new first monitoring process based on the initial monitoring software, the second monitoring process sends the registration information table to the new first monitoring process.

6. The software monitoring device according to claim 5, characterized in that, the device further includes: The second exception handling module is used to create a new second monitoring process based on the initial monitoring software when the first monitoring process monitors that the second monitoring process is abnormal.

7. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, when the processor executes the program, the software monitoring method according to any one of claims 1-4 is implemented.

8. A storage medium containing computer-executable instructions, wherein, the computer-executable instructions are used to execute the software monitoring method according to any one of claims 1-4 when executed by a computer processor.

Citation Information

Patent Citations

  • Control method and apparatus of lock

    CN106055397A

  • Method for enhancing robustness of embedded system

    CN110865900A