Operating system abnormity diagnosis method and system, electronic equipment and medium

By monitoring the log cache area to obtain incremental log information for abnormal analysis and reporting, it solves the problem that operation and maintenance personnel have difficulty in identifying abnormal information in a timely manner, realizes automatic diagnosis and processing of the operating system, and improves system stability and availability.

CN119088653APending Publication Date: 2024-12-06谢文韬
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311736549.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the prior art, operation and maintenance personnel can only diagnose operating system abnormalities afterwards, making it difficult to identify abnormal information in a timely manner. The excessive content of log files leads to low diagnostic efficiency and may affect real-time sensitive services.

Method used

By monitoring the log cache area, obtaining incremental log information for abnormal analysis, and reporting abnormal logs in a timely manner, automatic diagnosis and processing of operating system abnormalities is realized to avoid jitter interference in the operating system.

Benefits of technology

It improves the efficiency and accuracy of operating system abnormal diagnosis, improves system stability and availability, reduces data processing overhead, and avoids jitter interference in operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088653A_ABST
    Figure CN119088653A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of cloud computing, and aims to provide an operating system abnormality diagnosis method and system, electronic equipment and a medium. According to the method, whether the log information exists in the log cache region or not is monitored in real time, when the log information exists, the incremental log information of the log cache region is obtained, and the read incremental log information is subjected to anomaly analysis so as to obtain the abnormal log in the incremental log information, so that the anomaly diagnosis of the operating system is realized, and the operation efficiency is improved. And finally, the abnormal condition of the operating system is timely processed by actively reporting the abnormal log. According to the method and the device, the abnormal condition of the operating system can be automatically diagnosed, the abnormal condition of the operating system can be timely processed, the diagnosis and processing efficiency is high, meanwhile, the operating system can be prevented from generating jitter interference, and the stability of the operating system during operation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cloud computing, and in particular relates to an operating system abnormality diagnosis method, system, electronic equipment and medium. Background Art

[0002] Since the operating system is the infrastructure of all upper-level applications, its stability directly affects the stability of upper-level applications. Therefore, effectively discovering and diagnosing stability risks in the operating system, providing efficient diagnostic conclusions on risk issues, and having operation and maintenance personnel perform relevant operation and maintenance operations are very important for ensuring the stability of upper-level businesses.

[0003] The Linux operating system involves many modules, including the memory management module, file system, network protocol stack, process and scheduling management module, hardware driver and other core modules. Each module will also interact with various peripheral resources. If any module fails, it may cause the entire operating system to crash and other serious problems, making the upper-layer applications unable to run stably. Based on this, the Linux operating system is usually designed with its own log system so that the operation and maintenance personnel can access the system log files when there is a problem with the operating system, and make relevant abnormal diagnosis based on the log files.

[0004] However, in the process of using the prior art, the inventors found that the prior art has at least the following problems:

[0005] 1) Operation and maintenance personnel can only conduct post-event troubleshooting when business abnormalities occur, that is, check log files and conduct abnormality analysis, which often misses the best time to handle abnormal events;

[0006] 2) Operation and maintenance personnel need to view the entire log file to diagnose system anomalies. However, there is too much content in the log file, and manual viewing is difficult to efficiently and accurately identify abnormal information. At the same time, the method of viewing log files for abnormal diagnosis requires a high level of technical reserve capabilities of operation and maintenance personnel. In addition, due to the differences in the technical stacks of each operation and maintenance personnel, the information and focus they pay attention to are different, which may lead to the omission of key information in the log file, which significantly reduces the efficiency of diagnosis.

[0007] 3) Viewing the entire log file may cause operating system jitter, affecting some real-time sensitive businesses. Summary of the invention

[0008] The present invention aims to solve the above technical problems at least to a certain extent, and provides an operating system abnormality diagnosis method, system, electronic device and medium.

[0009] In order to achieve the above object, the present invention adopts the following technical solutions:

[0010] In a first aspect, the present invention provides a method for diagnosing an abnormality of an operating system, comprising:

[0011] Monitor the log buffer area and determine whether there is log information in the log buffer area. If yes, proceed to the next step; wherein the log buffer area is used to receive log information written by the operating system and can write the received log information into the log file;

[0012] Obtain incremental log information from the log buffer;

[0013] An abnormality analysis is performed on the incremental log information, and when an abnormal log is obtained, an abnormal log is reported.

[0014] The present invention can realize automatic diagnosis of abnormal conditions of the operating system, can realize timely processing of abnormal conditions of the operating system, has high diagnostic and processing efficiency, and can avoid jitter interference of the operating system. Specifically, during the implementation of the present invention, by real-time monitoring whether there is log information in the log buffer area, when there is log information, the incremental log information of the log buffer area is obtained, and the read incremental log information is analyzed abnormally to obtain the abnormal log therein, thereby realizing abnormal diagnosis of the operating system, and finally actively reporting the abnormal log to realize timely processing of abnormal conditions of the operating system. Based on this, the present invention can automatically and efficiently diagnose the abnormal log of the operating system, can effectively improve the analysis efficiency of the abnormal log of the operating system, and can significantly improve the stability and availability of the system, which is conducive to ensuring the stable and safe operation of the upper layer application. In addition, when the present invention determines that there is log information in the log buffer area, by obtaining the incremental log information of the log buffer area and performing subsequent abnormal analysis, instead of reading all the log information in the log file, the overhead cost of data processing can be reduced, and jitter interference will not be generated to the operating system, thereby improving the stability of the operating system during operation.

[0015] In one possible design, the log buffer area is monitored through a preset character device; wherein the character device is used to send a data access request to the log buffer area, and is also used to read log information from the log buffer area when log information exists in the log buffer area.

[0016] In a possible design, obtaining incremental log information of the log buffer area includes:

[0017] Determine whether the incremental log information of the log buffer area is greater than the preset storage capacity, if yes, proceed to the next step, if no, directly obtain the incremental log information of the log buffer area;

[0018] The incremental log information of the log buffer area is cyclically read according to the preset storage capacity until all the incremental log information of the log buffer area is obtained.

[0019] In one possible design, the exception log includes a memory management exception log, a file system exception log, a network protocol stack exception log, a process management exception log and / or a hardware error exception log.

[0020] In a possible design, performing abnormal analysis on the incremental log information includes:

[0021] Determine whether there is a memory management exception log in the incremental log information, and if so, obtain the memory management exception log;

[0022] Determine whether there is a file system exception log in the incremental log information, and if so, obtain the file system exception log;

[0023] Determine whether there is a network protocol stack exception log in the incremental log information, and if so, obtain the network protocol stack exception log;

[0024] Determine whether there is a process management exception log in the incremental log information, and if so, obtain the process management exception log;

[0025] And / or, determining whether there is a hardware error exception log in the incremental log information, and if so, obtaining the hardware error exception log.

[0026] In a possible design, reporting the abnormal log includes:

[0027] Obtain the responsible party information corresponding to the exception log, and report the exception log to the terminal device of the upper layer application matching the responsible party information.

[0028] In a possible design, after the abnormal log is reported, the method further includes:

[0029] Perform an alarm operation based on the abnormal log.

[0030] In a second aspect, the present invention provides an operating system abnormality diagnosis system, which is used to implement any of the operating system abnormality diagnosis methods described above; the operating system abnormality diagnosis system comprises:

[0031] The log information monitoring module is used to monitor the log buffer area and determine whether there is log information in the log buffer area. If yes, proceed to the next step; wherein the log buffer area is used to receive the log information written by the operating system and can write the received log information into the log file;

[0032] A log information acquisition module, which is in communication with the log monitoring module and is used to acquire incremental log information of the log buffer area;

[0033] The abnormality analysis module is connected to the log information acquisition module for performing abnormality analysis on the incremental log information and reporting the abnormality log when the abnormality log is obtained.

[0034] In a third aspect, the present invention provides an electronic device, comprising:

[0035] a memory for storing computer program instructions; and,

[0036] A processor is used to execute the computer program instructions to complete the operation of the operating system abnormality diagnosis method as described in any one of the above items.

[0037] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer program instructions readable by a computer, wherein the computer program instructions are configured to execute the operations of the operating system abnormality diagnosis method as described in any one of the above when running. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a flow chart of a method for diagnosing an abnormality of an operating system in an embodiment;

[0039] Figure 2 is a module block diagram of an operating system abnormality diagnosis system in an embodiment;

[0040] Figure 3 It is a module block diagram of an electronic device in an embodiment. DETAILED DESCRIPTION

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.

[0042] It should be noted that all actions of acquiring signals, information or data in the embodiments of the present invention are performed in compliance with the local data protection laws and policies and with authorization from the corresponding device owner.

[0043] Embodiment 1:

[0044] This embodiment discloses a method for diagnosing an operating system anomaly, which can be executed by, but is not limited to, a computer device or a virtual machine with certain computing resources, such as a personal computer, a smart phone, a personal digital assistant, or a wearable device, or by a virtual machine.

[0045] like Figure 1 As shown, a method for diagnosing an operating system abnormality may include but is not limited to the following steps:

[0046] S1. Monitor the log buffer area and determine whether there is log information in the log buffer area. If yes, proceed to the next step; wherein the log buffer area is used to receive log information written by the operating system and can write the received log information into a log file; specifically, during the implementation of this embodiment, the log buffer area is determined to have log information at a specified frequency. The size of the specified frequency can be determined according to the workload of the operating system and other conditions, and is not limited here. When determining whether there is log information in the log buffer area, if no, wait for a corresponding period of time at the specified frequency and then re-determine whether there is log information in the log buffer area.

[0047] Specifically, in this embodiment, when the log buffer area is monitored, it is performed through a preset character device, that is, the log buffer area is monitored through the character device; wherein the character device is used to send a data access request to the log buffer area, and is also used to read log information from the log buffer area when there is log information in the log buffer area. Specifically, when the character device can read log information from the log buffer area, it is determined that there is log information in the log buffer area.

[0048] It should be noted that character devices can be used to manage the log information of the operating system, which can realize data transmission between the identification system and the log buffer. During the implementation process, the character device can read the log information from the log buffer and send it to the identification system, or receive the data access request from the identification system and send it to the log buffer. The identification system interacts with the memory buffer through the character device, which can facilitate the identification system to access the memory buffer in a standard read and write manner, thereby reducing the cost of data interaction.

[0049] S2. Obtain incremental log information from the log buffer.

[0050] Specifically, in this embodiment, obtaining the incremental log information of the log buffer area includes:

[0051] Determine whether the incremental log information of the log buffer area is greater than the preset storage capacity, if yes, proceed to the next step, if no, directly obtain the incremental log information of the log buffer area;

[0052] The incremental log information of the log buffer area is cyclically read according to the preset storage capacity until all the incremental log information of the log buffer area is obtained.

[0053] It should be noted that by setting a preset storage capacity and reading incremental log information of a maximum size of the preset storage capacity each time, when the incremental log information is larger than the preset storage capacity, the incremental log information of the log cache area is cyclically read according to the preset storage capacity to achieve segmented reading of the incremental log information, thereby reducing the memory overhead of the identification system cache space and avoiding the problem of insufficient memory caused by reading a large amount of log information at one time.

[0054] S3. Perform an abnormality analysis on the incremental log information, and report the abnormal log when an abnormal log is obtained.

[0055] Specifically, in this embodiment, the exception log includes a memory management exception log, a file system exception log, a network protocol stack exception log, a process management exception log and / or a hardware error exception log.

[0056] Correspondingly, in this embodiment, performing abnormal analysis on the incremental log information includes:

[0057] Determine whether there is a memory management exception log in the incremental log information, and if so, obtain the memory management exception log; specifically, the memory management exception log is an exception log such as an OOM (Out Of Memory) error.

[0058] Determine whether there is a file system abnormality log in the incremental log information, and if so, obtain the file system abnormality log; specifically, the file system abnormality log is an abnormality log such as a file system read-only error, a file system damage error, etc.

[0059] Determine whether there is a network protocol stack exception log in the incremental log information. If so, obtain the network protocol stack exception log; specifically, the network protocol stack exception log is an exception log such as a socket semi-connection queue overflow, a socket full-connection queue overflow, and a protocol stack packet loss.

[0060] Determine whether there is a process management exception log in the incremental log information, and if so, obtain the process management exception log; specifically, the process management exception log is an exception log such as a file handle overflow.

[0061] And / or, determine whether there is a hardware error exception log in the incremental log information, and if so, obtain the hardware error exception log. Specifically, the hardware error exception log is an exception log such as hang-task, soft-lockup, hard-lockup, memory card exception, disk exception, etc.

[0062] In addition, in this embodiment, the reporting operation on the abnormal log includes:

[0063] Obtain the responsible party information corresponding to the exception log, and report the exception log to the terminal device of the upper layer application matching the responsible party information.

[0064] This setting can achieve differentiated and accurate reporting of exception logs, making it easier for different responsible parties to quickly process the operating system based on the corresponding exception logs, thereby improving the maintenance efficiency of the operating system.

[0065] For example, for the debug log exception information of the business itself, the corresponding exception log can be reported to the corresponding business party to inform them to make business corrections; for some situations where the usage of system resources exceeds the system configuration settings, the corresponding exception log can be reported to the system administrator or performance analyst to inform them to tune the parameters; for some hardware exception information and system exception information, it can be determined whether it can be repaired online. If it can be repaired online, the corresponding exception log will be reported to the system operation and maintenance engineer to inform him to repair the system exception in time; the system bugs existing in the exception log can also be checked, and the system bug exception information can be reported to the system engineer or operation and maintenance engineer.

[0066] In this embodiment, after the abnormal log is reported, the method further includes:

[0067] S4. Perform an alarm operation according to the abnormal log.

[0068] This embodiment can realize automatic diagnosis of abnormal conditions of the operating system, can realize timely processing of abnormal conditions of the operating system, has high diagnostic and processing efficiency, and can avoid jitter interference of the operating system. Specifically, in the implementation process of this embodiment, by real-time monitoring whether there is log information in the log buffer area, when there is log information, the incremental log information of the log buffer area is obtained, and the read incremental log information is analyzed abnormally to obtain the abnormal log therein, thereby realizing abnormal diagnosis of the operating system, and finally actively reporting the abnormal log to realize timely processing of abnormal conditions of the operating system. Based on this, this embodiment can automatically and efficiently diagnose the abnormal log of the operating system, can effectively improve the analysis efficiency of the abnormal log of the operating system, and can significantly improve the stability and availability of the system, which is conducive to ensuring the stable and safe operation of the upper layer application. In addition, when determining that there is log information in the log buffer area, this embodiment obtains the incremental log information of the log buffer area and performs subsequent abnormal analysis, instead of reading all the log information in the log file, which can reduce the overhead cost of data processing, and will not cause jitter interference to the operating system, thereby improving the stability of the operating system during operation.

[0069] Embodiment 2:

[0070] This embodiment discloses an operating system abnormality diagnosis system, which is used to implement the operating system abnormality diagnosis method in Embodiment 1; Figure 2 As shown, the operating system abnormality diagnosis system includes:

[0071] The log information monitoring module is used to monitor the log buffer area and determine whether there is log information in the log buffer area. If yes, proceed to the next step; wherein the log buffer area is used to receive the log information written by the operating system and can write the received log information into the log file;

[0072] A log information acquisition module, which is in communication with the log monitoring module and is used to acquire incremental log information of the log buffer area;

[0073] The abnormality analysis module is connected to the log information acquisition module for performing abnormality analysis on the incremental log information and reporting the abnormality log when the abnormality log is obtained.

[0074] It should be noted that the working process, working details and technical effects of the operating system abnormality diagnosis system provided in this embodiment 2 can be found in embodiment 1 and will not be repeated here.

[0075] Embodiment 3:

[0076] Based on Embodiment 1 or 2, this embodiment discloses an electronic device, which may be a smart phone, a tablet computer, a laptop computer, or a desktop computer. The electronic device may be referred to as a user terminal, a portable terminal, a desktop terminal, etc. Figure 3 As shown, the electronic equipment includes:

[0077] a memory for storing computer program instructions; and,

[0078] The processor is used to execute the computer program instructions to complete the operation of the operating system abnormality diagnosis method as described in any one of Example 1.

[0079] Specifically, the processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen.

[0080] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, which is used to be executed by the processor 301 to implement the operating system abnormality diagnosis method provided in Example 1 of the present application.

[0081] In some embodiments, the terminal may further optionally include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302 and the communication interface 303 may be connected via a bus or a signal line. Each peripheral device may be connected to the communication interface 303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 304, a display screen 305 and a power supply 306.

[0082] The communication interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0083] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with a communication network and other communication devices through electromagnetic signals.

[0084] The display screen 305 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof.

[0085] The power supply 306 is used to supply power to various components in the electronic device.

[0086] Embodiment 4:

[0087] Based on any one of embodiments 1 to 3, this embodiment discloses a computer-readable storage medium for storing computer-readable computer program instructions, wherein the computer program instructions are configured to execute the operations of the operating system abnormality diagnosis method described in embodiment 1 when running.

[0088] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for diagnosing an abnormality of an operating system, characterized by: include: Monitor the log buffer area and determine whether there is log information in the log buffer area. If yes, proceed to the next step; wherein the log buffer area is used to receive log information written by the operating system and can write the received log information into the log file; Obtain incremental log information from the log buffer; An abnormality analysis is performed on the incremental log information, and when an abnormal log is obtained, an abnormal log is reported.

2. The method for diagnosing an abnormality of an operating system according to claim 1, characterized in that: When the log buffer area is monitored, it is performed through a preset character device; wherein the character device is used to send a data access request to the log buffer area, and is also used to read log information from the log buffer area when there is log information in the log buffer area.

3. The method for diagnosing an abnormality of an operating system according to claim 1, characterized in that: Obtaining incremental log information of the log buffer area includes: Determine whether the incremental log information of the log buffer area is greater than the preset storage capacity, if yes, proceed to the next step, if no, directly obtain the incremental log information of the log buffer area; The incremental log information of the log buffer area is cyclically read according to the preset storage capacity until all the incremental log information of the log buffer area is obtained.

4. The method for diagnosing an abnormality of an operating system according to claim 1, characterized in that: The exception logs include memory management exception logs, file system exception logs, network protocol stack exception logs, process management exception logs and / or hardware error exception logs.

5. The method for diagnosing an abnormality of an operating system according to claim 4, characterized in that: Performing abnormal analysis on the incremental log information includes: Determine whether there is a memory management exception log in the incremental log information, and if so, obtain the memory management exception log; Determine whether there is a file system exception log in the incremental log information, and if so, obtain the file system exception log; Determine whether there is a network protocol stack exception log in the incremental log information, and if so, obtain the network protocol stack exception log; Determine whether there is a process management exception log in the incremental log information, and if so, obtain the process management exception log; And / or, determining whether there is a hardware error exception log in the incremental log information, and if so, obtaining the hardware error exception log.

6. The method for diagnosing an abnormality of an operating system according to claim 1, characterized in that: The abnormal log is reported, including: Obtain the responsible party information corresponding to the exception log, and report the exception log to the terminal device of the upper layer application matching the responsible party information.

7. The method for diagnosing an abnormality of an operating system according to claim 1, characterized in that: After reporting the abnormal log, the method further includes: Perform an alarm operation based on the abnormal log.

8. An operating system abnormality diagnosis system, characterized by: Used to implement the operating system abnormality diagnosis method as described in any one of claims 1 to 7; The operating system abnormality diagnosis system comprises: The log information monitoring module is used to monitor the log buffer area and determine whether there is log information in the log buffer area. If yes, proceed to the next step; wherein the log buffer area is used to receive the log information written by the operating system and can write the received log information into the log file; A log information acquisition module, which is in communication with the log monitoring module and is used to acquire incremental log information of the log buffer area; The abnormality analysis module is connected to the log information acquisition module for performing abnormality analysis on the incremental log information and reporting the abnormality log when the abnormality log is obtained.

9. An electronic device, characterized in that: include: a memory for storing computer program instructions; as well as, A processor is used to execute the computer program instructions to complete the operation of the operating system abnormality diagnosis method as described in any one of claims 1 to 7.

10. A computer-readable storage medium for storing computer program instructions readable by a computer, characterized in that: The computer program instructions are configured to execute the operations of the operating system abnormality diagnosis method according to any one of claims 1 to 7 when executed.