An intelligent method and device for operating system to handle hardware anomalies
Through intelligent learning of abnormal feature codes and feature pools, accurate positioning and segmented processing of hardware anomalies are achieved, solving the system instability problem caused by simple classification of hardware anomalies in traditional Linux operating systems and improving system stability and availability.
Patent Information
- Application Number
- CN202411466119.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-10-21
AI Technical Summary
Traditional Linux operating systems simply classify hardware exceptions into recoverable and unrecoverable situations, resulting in the inability to differentiate between different types of hardware exceptions, increasing system instability and the probability of downtime, which is especially unsuitable in communication systems.
Through accurate positioning and segmentation through anomaly feature codes (AFC), and using intelligent learning of the anomaly feature pool (STL), we train and evolve exception handling strategies, generate exception handling strategies, synchronize and store them, and achieve refined identification and processing of hardware anomalies.
It improves the stability and availability of the system, reduces the damage caused by hardware failures to system stability, enhances the resistance to hardware failures and software errors, and reduces operating system downtime problems.
Smart Images

Figure CN119415298B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of embedded systems, and in particular relates to an intelligent method and device for an operating system to handle hardware anomalies. Background Art
[0002] As the foundation of all application software, the basic software operating system has become a focus of domestic research, and system stability is of paramount importance. System stability is mainly reflected in the operating system's ability to self-heal when hardware or software errors occur.
[0003] In a multi-core environment, the entire process is more complex. For example, if an error occurs on a bus node, the bus controller reports this error to the CPU via the AXI interface as an interrupt. The interrupt is then reported to the interrupt-handling CPU via the interrupt subsystem. Before the interrupt report is processed, the error result may have already been received and processed by another CPU. This error propagation and processing occur asynchronously, inevitably resulting in an unknown system state. To prevent the spread of errors, the hardware implements a complex error classification based on the scope of the error report. Since the Linux system is developed for community enthusiasts and not for commercial purposes, it simplifies error handling by classifying errors into two categories: CE (correctable error) and UE (uncorrectable error). If the Linux kernel detects a CE error, it can be proactively corrected, generally without affecting system stability. However, if the system detects an error other than UE, it is problematic and will cause the system to crash.
[0004] Traditional Linux operating systems simplistically categorize hardware anomalies into recoverable and unrecoverable. This broad classification hinders differentiated fault handling and increases system instability. In reality, unrecoverable system errors also vary. Some hardware anomalies are rare and have no impact on system stability. These errors may occur once a month or once a year. Clearly, applying a uniform approach to all unrecoverable system errors is detrimental to system stability. From the kernel's perspective, system errors are caused by hardware failures. The kernel is unaware of the specific cause and how to fix them, and the operating system itself is unable to perform appropriate remedial actions for hardware errors. However, simplistic categorization and crude handling can significantly amplify hardware failures, significantly increasing the probability of operating system downtime. This approach is clearly unsuitable for applications requiring stringent system stability, particularly communications systems. Summary of the Invention
[0005] In response to the shortcomings of the existing technology, the embodiments of the present invention provide an intelligent method and device for operating system processing hardware exceptions. By utilizing the diversity of operating system hardware exceptions, the method and device are accurately located and segmented by abnormal feature codes (AFCs). By using the intelligent learning of the abnormal feature pool (STL), an evolutionary abnormality processing strategy is trained. This solves the problem in the existing technology of simply and roughly classifying hardware exceptions in the operating system and roughly handling abnormal problems, which leads to infinite amplification of hardware failures and a significant increase in the probability of operating system crashes, thereby achieving the effect of improving system stability and availability.
[0006] An aspect of an embodiment of the present invention is to provide an intelligent method for an operating system to handle hardware exceptions, the method comprising:
[0007] An intelligent exception processing device is deployed on the operating system. When the operating system starts, the intelligent exception processing device is automatically deployed on each service board and obtains the exception signature code from each service board.
[0008] Initialize the operating system's reserved memory, build an abnormal feature pool for each service board in the reserved memory, and create a receiving thread and a sending thread in the built abnormal feature pool;
[0009] The acquired abnormal feature codes of individual service boards are aggregated into the corresponding abnormal feature pool. The intelligent processing device automatically trains and learns the abnormal feature pool to generate the abnormal processing strategy and abnormal status of the current abnormal feature code.
[0010] The current exception is handled through the exception handling strategy. At the same time, the abnormal feature pool after training and learning is synchronized with the abnormal feature pool after training and learning of the adjacent business board through the sending and receiving threads. The abnormal feature code, exception handling strategy and abnormal status are stored in the non-volatile storage medium as a static resource;
[0011] After training and learning, the abnormal feature pool of each business board periodically polls the system through the receiving thread and the sending thread to detect whether there is any abnormality. Based on the detection results, the sharing of the abnormal feature pool of adjacent business boards, abnormality processing and static resource update operations are completed.
[0012] Another aspect of the present invention is to provide a device for an operating system to handle hardware exceptions, the device comprising: an exception handling module and an exception intelligent learning module, wherein:
[0013] The exception handling module further includes an exception feature code calculation unit, an exception handling strategy unit and an exception error feature pool unit, which are used to perform exception handling when an exception occurs in the system;
[0014] Furthermore, the abnormal feature code calculation unit is used to calculate the abnormal feature code based on the acquired system abnormality information; the abnormal handling strategy unit is used to perform abnormal handling according to the abnormal handling strategy of the abnormal feature pool corresponding to the abnormal feature code; the abnormal error feature pool unit is used to update the abnormal feature code in real time according to the abnormal information occurring in the system and incorporate it into the abnormal feature pool, and expand the abnormal feature pool space.
[0015] The abnormal intelligent learning module is used to send and receive abnormal feature codes, and automatically train and learn the abnormal feature pool to generate abnormal handling strategies;
[0016] Furthermore, the abnormal feature pool is automatically trained and learned, specifically by periodically polling the sending thread to detect whether an abnormality occurs in the abnormal feature pool. If an abnormality occurs, it means that the abnormal feature pool has been updated, and the local abnormal feature pool is refreshed and the static feature code and processing strategy in the non-volatile storage medium are synchronously refreshed.
[0017] Compared with the prior art, the present invention has the following advantages:
[0018] 1. This invention utilizes the diversity of hardware and system anomalies to accurately locate and segment hardware system anomalies through anomaly signature codes. Through intelligent learning of anomaly signature pools, it trains and evolves anomaly handling strategies, thereby improving system stability and availability. This solves the problem of the traditional kernel's crude classification and rough handling of unrecoverable hardware errors.
[0019] 2. The present invention locks hardware faults through abnormal feature codes, and continuously improves the abnormal feature pool through training and automatic learning, thereby achieving more refined identification and processing of hardware faults. At the same time, the abnormal feature codes are used to divert hardware errors and divert errors, thereby minimizing the damage caused by hardware faults to system stability. The system's resistance to hardware faults and software errors is significantly enhanced, and the problem of abnormal downtime of the operating system can be effectively reduced.
[0020] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 The present invention is a flowchart of an intelligent method for an operating system to handle hardware anomalies.
[0023] Figure 2 Schematic diagram of the composition of the abnormal feature code quadruple of the present invention.
[0024] Figure 3 It is a schematic diagram of the system deployment work of the abnormal intelligent processing device of the present invention.
[0025] Figure 4 It is a schematic diagram of the abnormal feature pool abnormal processing strategy training of the present invention.
[0026] Figure 5 It is a structural diagram of the abnormal intelligent processing device of the present invention.
[0027] Figure 6 It is a flow chart of the exception handling module of the present invention.
[0028] Figure 7 It is a flow chart of the abnormal intelligent learning module of the present invention. DETAILED DESCRIPTION
[0029] To make the purpose and advantages of the technical solutions in the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. The present invention will be described in detail below in conjunction with the drawings using another embodiment.
[0030] Example 1:
[0031] See also Figure 1 , Figure 1 This is a flow chart of an intelligent method for an operating system to handle hardware anomalies according to the present invention, the method comprising:
[0032] Step S1: deploying an abnormality intelligent processing device on the operating system. When the operating system starts, the abnormality intelligent processing device is automatically deployed on each service board and obtains abnormality feature codes from each service board;
[0033] Furthermore, the abnormal feature code is obtained from each business card of the operating system, specifically: the current operating system processor type and operating system version information are obtained in the abnormal information context, the processor hardware status information and the running task information when the fault occurs are collected, and the current abnormal feature code is calculated based on this information.
[0034] For further information, see Figure 2 , Figure 2 This is a schematic diagram of the composition of the abnormal feature code quadruple of the present invention. The abnormal feature code is composed of the processor type, operating system type, hardware status and abnormal task quadruple, a total of 240 bits; wherein:
[0035] The processor type is 8-bit coded and supports common processor types;
[0036] The operating system type is a 32-bit code that records the operating system kernel version information when the exception occurs;
[0037] The hardware status is a 32-bit code used to obtain the hardware error status code directly from the processor exception when a hardware failure occurs;
[0038] The abnormal task uses 21 bytes of space, i.e. 168 bits of encoding, to store the name of the abnormal task;
[0039] The abnormal feature code associates the processor type, operating system kernel version information, hardware error status code and abnormal task name together.
[0040] Step S2: Initialize the operating system reserved memory, build an abnormal feature pool for each service board in the reserved memory, and create a receiving thread and a sending thread in the built abnormal feature pool;
[0041] For further information, see Figure 3 , Figure 3 It is a schematic diagram of the system deployment work of the abnormal intelligent processing device of the present invention. In this embodiment, a set of abnormal intelligent processing devices is deployed on the operating system. When the operating system is started, the abnormal intelligent processing devices are automatically deployed in various business boards of the operating system. The various business boards specifically include the main control disk, business disk and line card; the abnormal intelligent processing devices automatically deployed in various business boards of the operating system can realize the synchronization of abnormal feature pool information of the abnormal intelligent processing devices in adjacent business boards through the sending and receiving threads in the abnormal feature pool in the device.
[0042] Furthermore, the abnormal feature pool is an array composed of triplets as members, each item of the array is a triple consisting of an abnormal feature code, a processing strategy and an abnormal state, and each triple consists of 256 bits, wherein: the processing strategy is 8 bits encoded, the abnormal state is 8 bits encoded, and the processing strategies are divided into strategy 1 to strategy 5, strategy 1 is the lowest processing strategy, and strategy 5 is the highest processing strategy.
[0043] Step S3: The acquired abnormal feature code of a single service board is aggregated into a corresponding abnormal feature pool. The intelligent processing device automatically trains and learns the abnormal feature pool to generate an abnormal processing strategy and abnormal status for the current abnormal feature code.
[0044] Furthermore, in step S3, the intelligent processing device automatically trains and learns the abnormal feature pool to generate the abnormal handling strategy and abnormal status of the current abnormal feature code; it also includes: detecting the working status of the current processor of the system, analyzing the system peripherals and the occurrence of abnormal interrupts, dividing the abnormal handling strategy of the abnormal feature code and marking the abnormal status.
[0045] Further, in this embodiment, please refer to Figure 4 , Figure 4 This is a diagram of the abnormal feature pool exception handling strategy training of the present invention. The exception handling strategy is divided into five strategies, specifically:
[0046] If the processor scheduling is normal, the exception handling strategy of the current exception code is automatically learned and trained as strategy one; if the processor has a scheduling exception, but the system can basically run normally, the exception handling strategy of the current exception code is automatically learned and trained as strategy two; if the processor has a scheduling exception, the hardware error interrupt is strongly associated with the abnormal task, and the abnormal task is the source of the system abnormality, then the exception handling strategy of the current exception code is automatically learned and trained as strategy three; if the processor has a scheduling exception and the hardware error interrupt is frequent, then the exception handling strategy of the current exception code is automatically learned and trained as strategy four; if the processor scheduling is extremely difficult, then the exception handling strategy of the current exception code is automatically learned and trained as strategy five.
[0047] Furthermore, strategies one to five respectively perform the following operations:
[0048] If it is strategy 1, the execution operation is: directly exit the exception and the system is normal;
[0049] If it is strategy 2, the execution operation is: log and exit abnormally, the system can automatically recover;
[0050] If it is strategy three, the execution operation is: kill the problem process and exit the exception to eliminate the system instability factor;
[0051] If it is strategy 4, the execution operation is: after closing the abnormal interrupt, exit the exception;
[0052] If it is strategy five, the execution operation is: PANIC system fatal failure, enter the PANIC process.
[0053] Furthermore, the abnormal status marking of the abnormal feature code is specifically: the abnormal status indicates the occurrence of the current abnormal feature code, "0" indicates no abnormality occurs, "1" indicates an abnormality occurs, and "x" indicates a mixed state, which means that multiple abnormalities occur; when multiple abnormal feature codes occur at the same time, the abnormal state is a mixed state.
[0054] Step S4: Process the current exception through the exception handling strategy. At the same time, synchronize the exception feature code, exception handling strategy and exception status of the abnormal feature pool after training and learning with the abnormal feature pool after training and learning of the adjacent business board through the transceiver thread, and store them in the non-volatile storage medium as a static resource;
[0055] Step S5: After training and learning, the abnormal feature pool of each service board periodically polls the operating system through the receiving thread and the sending thread to detect whether there is an abnormality. Based on the detection results, the sharing of the abnormal feature pool of adjacent service boards, abnormality processing and static resource update operations are completed.
[0056] Furthermore, when the operating system is periodically polled and detected without abnormalities, it means that the automatic training and learning of the abnormal feature pool is completed, and the trained abnormal feature pool and abnormal handling strategy and other results are obtained. The completion results are shared with the abnormal feature pool of the adjacent business board, and polling continues; when the system is periodically polled and detected with abnormalities, it means that the automatic training and learning of the abnormal feature pool is not completed, and it is necessary to wait for the automatic training and learning of the abnormal feature pool to be completed before continuing polling. At the same time, the completion results are shared with the abnormal feature pool of the adjacent business board, and the shared abnormal feature pool is compared with the abnormal feature pool in the static resource, and the abnormality handling and static resource update operations are performed based on the comparison results.
[0057] Furthermore, the shared abnormal feature pool is compared with the abnormal feature pool in the static resource, and abnormal processing and static resource update operations are performed based on the comparison results. Specifically, the following steps are included:
[0058] Step S501: Obtain a read-write lock of the abnormal feature pool in the memory, generate a key based on the abnormal feature code and abnormal handling strategy in the read-write lock, and compress the abnormal feature code pool;
[0059] Step S502: Generate an exception pool frame based on the secret key and the compressed exception feature code pool, and release the read-write lock after the exception pool frame is generated;
[0060] Step S503: Send the exception pool frame to the exception feature pool in the static resource through the sending thread in the form of a broadcast frame;
[0061] Step S504: The abnormal feature pool in the static resource receives the abnormal pool frame through the receiving thread, and based on the key in the abnormal pool frame, determines whether it is consistent with the key in the abnormal feature pool in the static resource, and performs abnormal processing and static resource update operations according to the judgment result.
[0062] Furthermore, in step S504, based on the key in the abnormal pool frame, it is determined whether it is consistent with the key in the abnormal feature pool in the static resource, which also includes:
[0063] Step S5031: If the key in the exception pool frame matches the key of the static resource, it means that the received exception feature pool is consistent with the local static resource and does not need to be updated. The current exception is handled based on the existing exception handling strategy in the static resource;
[0064] Step S5032: If the key in the exception pool frame does not match the key of the static resource, it means that there is a new exception in the exception feature pool, and the exception feature pool and exception handling strategy in the static resource need to be updated.
[0065] Furthermore, in step S5032, when there is a new anomaly in the anomaly feature pool, it is necessary to update the anomaly feature pool and the anomaly handling strategy in the static resource. First, it is necessary to determine the anomaly state of the anomaly feature code. If the anomaly state is "x", that is, when multiple anomalies occur, the anomaly state is a mixed state. In this state, the anomaly feature pool of the static resource is not updated. If the anomaly state is "0" or "1", that is, it is not in the "x" state, the following steps are performed:
[0066] Step S5032a: decompress the abnormal feature code pool through the receiving thread in the abnormal feature pool in the static resource, and obtain the read-write lock of the abnormal feature pool in the static resource;
[0067] Step S5032b: Based on the acquired read-write lock of the abnormal feature pool in the static resource, the decompressed abnormal feature code pool and the generated new abnormal handling strategy are read and written into the abnormal feature pool of the static resource, and the static abnormal feature code and abnormal handling strategy in the non-volatile storage medium are simultaneously refreshed;
[0068] Step S5032c: Release the read-write lock of the abnormal feature pool in the static resource, enter the blocked receiving state, and complete the update operation of the static resource.
[0069] Furthermore, after the update operation is completed, that is, after the new abnormality feature code pool and the generated new abnormality handling strategy are updated and stored in the non-volatile storage medium, the abnormality status of the abnormality feature code in the abnormality feature pool is reset to "0".
[0070] Example 2:
[0071] See also Figure 5 , Figure 5 This is a structural diagram of the abnormal intelligent processing device of the present invention, which includes: an abnormal processing module and an abnormal intelligent learning module; wherein:
[0072] The exception handling module also includes an exception feature code calculation unit, an exception handling strategy unit and an exception error feature pool unit, which are mainly used to perform exception handling when an exception occurs in the system;
[0073] Furthermore, the abnormal feature code calculation unit is used to calculate the abnormal feature code based on the acquired system abnormality information; the abnormal handling strategy unit is used to perform abnormal handling according to the abnormal handling strategy of the abnormal feature pool corresponding to the abnormal feature code; the abnormal error feature pool unit is used to update the abnormal feature code in real time according to the abnormal information occurring in the system and incorporate it into the abnormal feature pool, and expand the abnormal feature pool space.
[0074] The abnormal intelligent learning module is used to send and receive abnormal feature codes, automatically train and learn the abnormal feature pool to generate abnormal handling strategies, and update and store the abnormal feature pool and the abnormal handling strategies;
[0075] Furthermore, the abnormal feature pool is automatically trained and learned, specifically by periodically polling the sending thread to detect whether an abnormality occurs in the abnormal feature pool. If an abnormality occurs, it means that the abnormal feature pool has been updated, and the local abnormal feature pool is refreshed and the static feature code and processing strategy in the non-volatile storage medium are synchronously refreshed.
[0076] Further, in this embodiment, please refer to Figure 6 , Figure 6 1 is a flow chart of an exception handling module in an embodiment of the present invention. In the exception handling module, when an exception occurs, the current system processor type and operating system version information are obtained in the exception context, the processor hardware status information and the running task information when the fault occurs are collected, and the current AFC (anomaly feature code) is calculated based on this information; the AFC is matched with each AFC in the abnormal feature pool. If the current abnormal feature code does not match all the abnormal feature codes in the abnormal feature pool, it indicates that a new abnormal feature code has been discovered and a new AFC has been learned. It is necessary to expand the abnormal feature pool, include the abnormal feature code in the abnormal feature pool, and set the default lowest level processing strategy one to prepare for abnormal feature code training; if the abnormal feature code matches an abnormal feature code in the abnormal feature pool, the exception is handled according to the abnormal handling strategy of the abnormal feature pool corresponding to the AFC;
[0077] If the error is Strategy 1, the hardware failure has minimal impact on the system, and the exception handling module can simply clear the exception. If the error is Strategy 2, the hardware failure has some impact on the system, but the system is generally operating normally. The exception handling module will log the exception and restore the situation. If the error is Strategy 3, the abnormal task has affected the normal operation of the current system. The exception handling module will send an abort signal to the abnormal task and restore the situation. If the error is Strategy 4, the hardware failure is severe, and the exception handling module will disable the corresponding hardware interrupt and restore the situation. If the error is Strategy 5, the hardware failure is so severe that fault diversion cannot be performed, and the exception handler module will control the system to enter the PANIC process. The exception handling module runs in the exception context of kernel space.
[0078] Furthermore, in this embodiment, the abnormal intelligent learning module will be described in two forms:
[0079] First, see Figure 7 , Figure 7 This is a flow chart of the abnormal intelligent learning module in the embodiment of the present invention. When the abnormal intelligent learning module is powered on and started, it obtains static abnormal feature codes from the non-volatile storage medium of the operating system, initializes the system reserved memory, builds an abnormal feature pool in the reserved memory, creates a receiving thread and a sending thread to synchronize information with the adjacent abnormal feature pool; after the initialization is completed, it periodically obtains local abnormal information. If no abnormality occurs, it performs periodic polling; if an abnormality occurs, it detects the working status of the current processor (CPU) of the system, analyzes the system peripherals and the occurrence of abnormal interrupts, and adjusts the abnormality handling strategy according to the detection situation. Specifically, if the processor is adjusted, If the degree is normal, the exception handling strategy for the current exception code is automatically learned and trained as strategy one; if the processor has a scheduling exception, but the system can basically operate normally, the exception handling strategy for the current exception code is automatically learned and trained as strategy two; if the processor has a scheduling exception, the hardware error interrupt is strongly associated with the abnormal task, and the abnormal task is the source of the system abnormality, the exception handling strategy for the current exception code is automatically learned and trained as strategy three; if the processor has a scheduling exception and the hardware error interrupt is frequent, the exception handling strategy for the current exception code is automatically learned and trained as strategy four; if the processor scheduling is extremely difficult, the exception handling strategy for the current exception code is automatically learned and trained as strategy five. After completing the training of the abnormal feature pool, the abnormal intelligent learning module stores the abnormal feature code in the non-volatile storage medium and resets the abnormal status of the abnormal feature code in the abnormal pool to "0".
[0080] Furthermore, the abnormal intelligent learning module runs in the user state, and the receiving thread and the sending thread periodically poll the system to detect whether there is any abnormality. If there is no abnormality, it means that the automatic training and learning of the abnormal feature pool is completed, and the trained abnormal feature pool and abnormal handling strategy and other results are obtained. The completed results are shared with the adjacent abnormal feature pool and polling continues; when the system is periodically polled to detect an abnormality, it means that the automatic training and learning of the abnormal feature pool is not completed, and it is necessary to wait for the automatic training and learning of the abnormal feature pool to be completed before continuing to poll. At the same time, the completed results are shared with the adjacent abnormal feature pool, and the shared abnormal feature pool is compared with the abnormal feature pool in the static resource, and the abnormality is handled based on the comparison results. And the update operation of static resources, specifically: first, obtain the read-write lock of the exception feature pool in the memory, generate a secret key based on the exception feature code and exception handling strategy in the read-write lock, and compress the exception feature code pool; secondly, generate an exception pool frame based on the secret key and the compressed exception feature code pool, and release the read-write lock after the exception pool frame is generated; thirdly, send the exception pool frame to the exception feature pool in the static resource through the sending thread in the form of a broadcast frame; finally, the exception feature pool in the static resource receives the exception pool frame through the receiving thread, and based on the secret key in the exception pool frame, determines whether it is consistent with the secret key in the exception feature pool in the static resource, and performs exception handling and static resource update operations according to the judgment result.
[0081] Furthermore, determine whether it matches the key in the exception feature pool in the static resource. Specifically: if the key in the exception pool frame matches the key in the static resource, it means that the received exception feature pool is consistent with the local static resource and does not need to be updated. The current exception is handled based on the existing exception handling strategy in the static resource; if the key in the exception pool frame does not match the key in the static resource, it means that there is a new exception in the exception feature pool, and the exception feature pool and exception handling strategy in the static resource need to be updated.
[0082] Furthermore, it is necessary to update the exception feature pool and exception handling strategy in the static resource, specifically: decompress the exception feature code pool through the receiving thread in the exception feature pool in the static resource, and obtain the read-write lock of the exception feature pool in the static resource at the same time; based on the obtained read-write lock of the exception feature pool in the static resource, read and write the decompressed exception feature code pool and the generated new exception handling strategy into the exception feature pool of the static resource, and synchronously refresh the static exception feature code and exception handling strategy in the non-volatile storage medium; release the read-write lock of the exception feature pool in the static resource, enter the blocked receiving state, and complete the update operation of the static resource.
[0083] Secondly, when the abnormal intelligent learning module is started when the system is not powered on, it means that the system is soft restarting. In this case, the system may have had an abnormal startup problem last time, that is, there may be a hardware error that caused the system to restart. In this case, before the abnormal intelligent learning module initializes the abnormal feature pool, it first compares the abnormal feature pool in the memory with the abnormal feature pool in the non-volatile storage medium. If the abnormal feature code in the abnormal feature pool in the memory does not have an abnormality, the abnormal feature pool in the non-volatile storage medium is directly used to initialize the retained memory; if the abnormal feature code in the abnormal feature pool in the memory has an abnormality and no mixed state occurs, it means that the system has previously encountered a hardware abnormality that caused the system to restart, and the corresponding abnormal handling strategy needs to be upgraded. When initializing the abnormal feature pool, the abnormal handling strategy for the abnormal feature code corresponding to the abnormality is upgraded, raising the abnormal handling level by one, and synchronously writing the latest abnormal pool and handling strategy to the non-volatile storage medium.
[0084] Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An intelligent method for handling hardware anomalies in an operating system, characterized by: An intelligent exception processing device is deployed on the operating system. When the operating system starts, the intelligent exception processing device is automatically deployed on each service board and obtains the exception signature code from each service board. Initialize the operating system's reserved memory, build an abnormal feature pool for each service board in the reserved memory, and create a receiving thread and a sending thread in the built abnormal feature pool; The acquired abnormal feature codes of individual service boards are aggregated into the corresponding abnormal feature pool. The intelligent processing device automatically trains and learns the abnormal feature pool to generate the abnormal processing strategy and abnormal status of the current abnormal feature code. The current exception is handled through the exception handling strategy. At the same time, the abnormal feature pool after training and learning is synchronized with the abnormal feature pool after training and learning of the adjacent business board through the receiving and sending threads. The abnormal feature code, exception handling strategy and abnormal status are stored in the non-volatile storage medium as a static resource; After training and learning, the abnormal feature pool of each business board periodically polls the operating system through the receiving thread and the sending thread to detect whether there is any abnormality. Based on the detection results, the sharing of the abnormal feature pool of adjacent business boards, abnormality processing and static resource update operations are completed.
2. The intelligent method for handling hardware anomalies in an operating system according to claim 1, wherein: The abnormal feature code is composed of a quadruple of processor type, operating system type, hardware status, and abnormal task, with a total of 240 bits described, where: The processor type is 8-bit coded and supports common processor types; The operating system type is a 32-bit code that records the operating system kernel version information when the exception occurs; The hardware status is a 32-bit code used to obtain the hardware error status code directly from the processor exception when a hardware failure occurs; The abnormal task uses 21 bytes of space to store the name of the abnormal task.
3. The intelligent method for handling hardware anomalies in an operating system according to claim 1, wherein: The abnormal feature pool is an array, each item of which is a triple consisting of an abnormal feature code, an abnormal handling strategy, and an abnormal state. Each triple consists of 256 bits, where: The exception handling strategy is 8-bit coded, the exception status is 8-bit coded, and the handling strategies include strategy 1 to strategy 5; The abnormal state indicates the occurrence of the current abnormal feature code, "0" indicates no abnormality occurs, "1" indicates an abnormality occurs, and "x" indicates a mixed state, which means that multiple abnormalities occur. When multiple abnormal feature codes occur at the same time, the abnormal state is a mixed state.
4. The intelligent method for handling hardware anomalies in an operating system according to claim 3, wherein: The processing strategies include strategy 1 to strategy 5, specifically: If the processor scheduling is normal, the exception handling strategy of the current exception code is automatically learned and trained as strategy one; if the processor has a scheduling exception, but the system can basically run normally, the exception handling strategy of the current exception code is automatically learned and trained as strategy two; if the processor has a scheduling exception, the hardware error interrupt is strongly associated with the abnormal task, and the abnormal task is the source of the system abnormality, then the exception handling strategy of the current exception code is automatically learned and trained as strategy three; if the processor has a scheduling exception and the hardware error interrupt is frequent, then the exception handling strategy of the current exception code is automatically learned and trained as strategy four; if the processor scheduling is extremely difficult, then the exception handling strategy of the current exception code is automatically learned and trained as strategy five.
5. The intelligent method for handling hardware anomalies in an operating system according to claim 1, wherein: The abnormal feature pool after training and learning of each business board performs periodic polling of the operating system through the receiving thread and the sending thread to detect whether an abnormality occurs, and completes the sharing of the abnormal feature pool of adjacent business boards, abnormality processing and static resource update operations based on the detection results, wherein: When the detection result is no abnormality, it means that the abnormal feature pool has completed automatic training and learning. The completed result is shared with the abnormal feature pool of the adjacent business card and continues to poll; When the detection result is abnormal, it means that the automatic training and learning of the abnormal feature pool is not completed. It is necessary to wait for the automatic training and learning of the abnormal feature pool to be completed before continuing to poll. At the same time, the automatic training and learning completion results are shared with the abnormal feature pool of the adjacent business board, and the shared abnormal feature pool is compared with the abnormal feature pool in the static resource. Based on the comparison results, the abnormality processing and static resource update operations are performed.
6. The intelligent method for handling hardware anomalies in an operating system according to claim 5, characterized in that: The shared abnormal feature pool is compared with the abnormal feature pool in the static resource, and the abnormality processing and static resource update operation are performed based on the comparison result, specifically: Obtain the read-write lock of the exception feature pool in memory, generate a key based on the exception feature code and exception handling strategy in the read-write lock, and compress the exception feature code pool; Generate an exception pool frame based on the secret key and the compressed exception signature pool, and release the read-write lock after the exception pool frame is generated; Send the exception pool frame to the exception feature pool in the static resource through the sending thread in the form of a broadcast frame; The abnormal feature pool in the static resource receives the abnormal pool frame through the receiving thread, and based on the key in the abnormal pool frame, determines whether it is consistent with the key in the abnormal feature pool in the static resource, and performs abnormal processing and static resource update operations according to the judgment result.
7. The intelligent method for handling hardware anomalies in an operating system according to claim 6, wherein: The method further includes: judging whether the key in the exception pool frame is consistent with the key in the exception feature pool in the static resource, and performing exception processing and updating the static resource according to the judgment result; If the key in the exception pool frame matches the key in the static resource, it means that the received exception feature pool is consistent with the local static resource and does not need to be updated. The current exception is handled based on the existing exception handling strategy in the static resource; If the key in the exception pool frame does not match the key in the static resource, it means that there is a new exception in the exception feature pool, and the exception feature pool and exception handling strategy in the static resource need to be updated.
8. The intelligent method for handling hardware anomalies in an operating system according to claim 7, wherein: If there is a new anomaly in the anomaly feature pool, it is necessary to update the anomaly feature pool and the anomaly handling strategy in the static resource. Before the update operation, it is also necessary to determine the abnormal state of the anomaly feature code, where: If the exception status is "x", the exception feature pool of static resources will not be updated; If the abnormal status is "0" or "1", the abnormal feature pool of the static resource is updated, specifically: Decompress the abnormal feature code pool through the receiving thread in the abnormal feature pool in the static resource, and obtain the read-write lock of the abnormal feature pool in the static resource at the same time; Based on the read-write lock of the abnormal feature pool in the static resource, the decompressed abnormal feature code pool and the generated new abnormal handling strategy are read and written to the abnormal feature pool of the static resource, and the abnormal feature code and abnormal handling strategy in the non-volatile storage medium are simultaneously refreshed; Release the read-write lock of the abnormal feature pool in the static resource, enter the blocked receiving state, and complete the update operation of the static resource.
9. A device for handling hardware exceptions in an operating system, configured to execute the method according to any one of claims 1 to 8, characterized in that: The device includes an exception handling module and an exception intelligent learning module, wherein: The exception handling module further includes an exception feature code calculation unit, an exception handling strategy unit and an exception error feature pool unit, which are used to perform exception handling when an exception occurs in the system; The abnormal intelligent learning module is used to send and receive abnormal feature codes, automatically train and learn the abnormal feature pool to generate abnormal processing strategies, and update and store the abnormal feature pool and the abnormal processing strategies.
10. The device for handling hardware exceptions in an operating system according to claim 9, wherein: The abnormality feature code calculation unit is used to calculate the abnormality feature code from the acquired system abnormality information; The exception handling strategy unit is used to perform exception handling according to the exception handling strategy of the exception feature pool corresponding to the exception feature code; The abnormal error feature pool unit is used to update the abnormal feature code in real time and incorporate it into the abnormal feature pool according to the abnormal information appearing in the system, and expand the abnormal feature pool space.
Citation Information
Patent Citations
Server fault automatic detection system and detection method based on decision tree
CN109218114A