Multi-core processor fault diagnosis and exception handling method, main control board and equipment
By configuring the hash value of the memory partition that is backed up by each other and monitoring the hash value of the program pointer in a multi-core processor environment, the equipment failure caused by memory displacement is solved, and the stability and reliability of the high-voltage DC transmission control protection device is improved.
Patent Information
- Application Number
- CN202311708813.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-13
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-12-13
AI Technical Summary
In the multi-core processor environment, when memory displacement causes device failure, the system failure signal cannot be effectively issued, resulting in system calculation errors and serious consequences.
By configuring the first and second partitions in the target memory area, storing the code of the target application as a backup method, monitoring the hash value of the partition where the program pointer is located, judging and switching to the normal partition, ensuring that the program pointer points to the correct one Partition, perform alarm operations and record fault logs, register fault activity events with the onboard FPGA, and actively stop scheduling tasks.
It reduces the possibility of equipment failure caused by memory displacement, improves the operating stability and reliability of high-voltage DC transmission control and protection equipment, and ensures that the system can accurately diagnose and exit operation in a timely manner during failure.
Smart Images

Figure CN117743008B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and more specifically, relates to a multi-core processor fault diagnosis and exception handling method, a main control board and equipment. Background Art
[0002] The control and protection system is the brain of the HVDC transmission project. It is the core and key to realizing and ensuring the safe and stable operation of DC transmission. Its system configuration is complex and needs to comprehensively consider AC and DC fields, station information, etc., and be configured into a variety of protection systems and control systems. Each system has redundant configuration, so there are many functions to be realized, many communication objects, and a larger amount of data to be processed. Therefore, a multi-core and multi-processor architecture is generally adopted, and multiple processors calculate in parallel and collaborate with each other to complete the control and protection tasks.
[0003] The DC transmission project has a high voltage level and a large transmission capacity. When a fault occurs, it has a great impact on the AC system. Therefore, it has extremely high requirements for the stability and reliability of equipment operation. On the one hand, the equipment needs to operate as reliably as possible, without faults or abnormalities. On the other hand, in the event of an abnormality, the cause of the fault should be accurately diagnosed and recorded to facilitate subsequent rectification and improvement. At the same time, it should be reliably shut down and put back into operation by the operation and maintenance personnel to eliminate the fault in time.
[0004] Figure 1 It is a schematic diagram of a multi-core parallel computing environment provided by the prior art. Figure 1 As shown in the figure, it is a typical multi-core parallel computing environment with multiple main processors. Multiple main control boards can directly access the communication and input / output (IO) boards of peripherals through the backplane. The functional definitions of different main control boards on the backplane are consistent, and the "slave" boards of the backplane can be managed and used; multiple main control boards realize data interaction and communication through shared memory boards, and a certain mechanism is used to ensure data consistency, thus forming a parallel computing environment with multiple main control boards. Each main control board uses a multi-core processor, which runs in asymmetric multi-processing (AMP) mode. The resources of each core are isolated from each other and become independent computing units. Multiple cores exchange data and communicate through inter-core shared memory, thus forming a multi-core parallel computing environment inside a single chip.
[0005] Currently, the commonly used chip fault diagnosis and processing method is to use the Error Correcting Code (ECC) function, which is generally implemented by the processor chip hardware. It can realize the discovery and real-time correction of single-bit errors, and timely detection and alarm of multi-bit errors, but it cannot realize the correction of multi-bit errors because it will cause the system to stop running.
[0006] The fault diagnosis function is generally completed by the processor hardware and the embedded operating system. The fault location is located through the processor's abnormal information, and an abnormal interrupt is given. The operating system and application decide whether to stop the business logic and whether to stop running. There is no more information to trace the cause of the fault.
[0007] In terms of multi-core and multi-processor fault monitoring, generally when multiple main control boards or computing cores fail during self-test, a system fault (sysfail) signal is sent through the backplane to notify other main control boards or computing cores to actively stop running, so that the system can reliably exit operation. However, in complex situations, such as equipment failures caused by memory displacement, a single main control board or computing core may enter an interrupt exception due to instruction runaway, resulting in the inability to effectively send a sysfail signal. The main control board in the same chassis will use the unupdated erroneous data in the shared memory for calculation, causing the system to have calculation errors and send out erroneous instructions, resulting in serious consequences. Summary of the invention
[0008] The present invention provides a multi-core processor fault diagnosis and exception handling method, a main control board and equipment, which are used to solve the defect of memory displacement causing equipment failure in the prior art and improve the stability of high-voltage direct current transmission control and protection equipment operation.
[0009] In a first aspect, the present invention provides a multi-core processor fault diagnosis and exception handling method, comprising:
[0010] Monitoring a target memory area to determine a hash value of a partition where a program pointer of a target application is located, the target memory area comprising a first partition and a second partition, the first partition and the second partition storing the code of the target application in a mutually backed-up manner, and the partition where the program pointer is located is the first partition or the second partition;
[0011] Based on the original hash value of the target application and the hash value of the partition where the program pointer is located, it is determined that the program pointer points to the first partition or the second partition.
[0012] Optionally, determining that the program pointer points to the first partition or the second partition based on the original hash value of the target application and the hash value of the partition where the program pointer is located includes:
[0013] Determine whether the original hash value is the same as the hash value of the partition where the program pointer is located;
[0014] If it is determined that the original hash value is different from the hash value of the partition where the program pointer is located, then the hash value of the backup partition corresponding to the partition where the program pointer is located is calculated, the backup partition corresponding to the first partition is the second partition, and the backup partition corresponding to the second partition is the first partition;
[0015] Determine whether the original hash value is the same as the hash value of the backup partition;
[0016] If it is determined that the original hash value is the same as the hash value of the backup partition, then it is determined that the program pointer points to the backup partition.
[0017] Optionally, after determining that the original hash value is the same as the hash value of the backup partition, the method further includes:
[0018] Based on the code of the target application stored in the backup partition, the code of the partition with abnormal hash value is restored.
[0019] Optionally, after determining whether the original hash value is the same as the hash value of the backup partition, the method further includes:
[0020] If it is determined that the original hash value is different from the hash value of the backup partition, an alarm operation is performed.
[0021] Optionally, the alarm operation includes:
[0022] Save the fault log and register the fault activity event to the onboard FPGA on the main control board where the multi-core processor is located, wherein the fault activity event is used to indicate the working fault of the multi-core processor, and the multi-core processor actively stops the execution of the scheduling task, so that the multi-core processor stops the execution of the application program itself;
[0023] The fault log includes one or more of the following information: stack information at the time of the fault, function call relationship at the time of the fault, register backup at the time of the fault, and application program execution location.
[0024] Optionally, after determining whether the original hash value is the same as the hash value of the partition where the program pointer is located, the method further includes:
[0025] If it is determined that the original hash value is the same as the hash value of the partition where the program pointer is located, the program pointer of the target application is kept unchanged.
[0026] Optionally, before monitoring the target memory area and determining the hash value of the partition where the program pointer of the target application is located, the method further includes:
[0027] Loading the target application code to the first partition and the second partition;
[0028] Determine whether the initial hash value of the first partition is the same as the initial hash value of the second partition;
[0029] If it is determined that the initial Hash value of the first partition is the same as the initial Hash value of the second partition, determining the initial Hash value as the original Hash value;
[0030] Based on a default program entry configuration, it is determined that a program pointer of the target application program points to a code start position of the first partition or a code start position of the second partition.
[0031] In a second aspect, the present invention further provides a main control board, comprising: an onboard FPGA and a multi-core processor applying any one of the multi-core processor fault diagnosis and exception handling methods described above.
[0032] Optionally, the multi-core processor is used to periodically register activity events with the onboard FPGA;
[0033] The onboard FPGA is specifically used for:
[0034] Monitoring activity events registered by the multi-core processor;
[0035] Determining whether the multi-core processor fails based on a preset time threshold and an activity event registered by the multi-core processor;
[0036] If it is determined that the multi-core processor fails, a system failure signal is sent to the backplane where the main control board is located.
[0037] In a third aspect, the present invention further provides a high-voltage direct current transmission control and protection device, comprising: a backplane and a plurality of any one of the above-mentioned main control boards, wherein the backplane is used to carry the plurality of main control boards, and the plurality of main control boards are communicatively connected with each other.
[0038] It can be understood that the beneficial effects of the second to third aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0039] In general, the above technical solution conceived by the present invention has the following beneficial effects compared with the prior art:
[0040] By configuring a first partition and a second partition in a target memory area, and the two partitions store the code of the target application in a mutually backed-up manner, the first partition serves as a backup partition of the second partition, and the second partition serves as a backup partition of the first partition, and then in the process of executing the target application, the target memory area can be monitored to determine the hash value of the partition where the program pointer of the target application is located. If the partition where the program pointer is located is the first partition, the hash value of the first partition is determined; if the partition where the program pointer is located is the second partition, the hash value of the second partition is determined. Then, the original hash value of the target application and the hash value of the partition where the program pointer is located can be compared to determine whether there is an abnormality in the partition where the program pointer is located, so as to ensure that the program pointer points to a normal partition of the first partition and the second partition, that is, if the first partition is abnormal and the second partition is normal, the program pointer points to the second partition; if the second partition is abnormal and the first partition is normal, the program pointer points to the first partition, which can reduce the possibility of equipment failure caused by memory displacement. As the multi-core processor is the core of the high-voltage direct current transmission control and protection device, as the failure rate of the multi-core processor is reduced, the operation stability of the high-voltage direct current transmission control and protection device can be correspondingly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the present invention or 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 creative work.
[0042] Figure 1 It is a schematic diagram of a multi-core parallel computing environment of multiple main processors provided by the prior art;
[0043] Figure 2 It is a flowchart of a multi-core processor fault diagnosis and exception handling method provided by the present invention;
[0044] Figure 3 It is a flow chart of the main task logic provided by the present invention;
[0045] Figure 4 It is a flowchart of the CRAM scanning task provided by the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0047] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of objects. For example, a first partition and a second partition are used to distinguish different partitions rather than to describe a specific order of partitions.
[0048] In the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0049] In the description of the embodiments of the present invention, unless otherwise specified, “multiple” means two or more than two. For example, multiple processing units means two or more processing units, etc.; multiple elements means two or more elements, etc.
[0050] Next, the technical solution provided in the embodiments of the present invention is introduced.
[0051] Figure 2 FIG. 1 is a flow chart of a multi-core processor fault diagnosis and exception handling method provided by the present invention, such as Figure 2 As shown, the execution subject of the multi-core processor fault diagnosis and exception handling method can be a multi-core processor, and the method includes:
[0052] Step 101 , monitor the target memory area and determine the hash value of the partition where the program pointer of the target application is located.
[0053] Specifically, the target memory area may be a target RAM area, the target RAM area includes a first partition and a second partition, and the first partition and the second partition store the code of the target application in a mutually backed-up manner. By configuring the first partition and the second partition in the target memory area, and the two partitions store the code of the target application in a mutually backed-up manner, the first partition serves as a backup partition of the second partition, and the second partition serves as a backup partition of the first partition.
[0054] Step 102: Determine whether the program pointer points to the first partition or the second partition based on the original hash value of the target application and the hash value of the partition where the program pointer is located.
[0055] Specifically, during the execution of the target application, the target memory area is monitored to determine the hash value of the partition where the program pointer of the target application is located. If the partition where the program pointer is located is the first partition, the hash value of the first partition is determined; if the partition where the program pointer is located is the second partition, the hash value of the second partition is determined. Then, the original hash value of the target application and the hash value of the partition where the program pointer is located can be compared to determine whether there is an abnormality in the partition where the program pointer is located, so as to ensure that the program pointer points to a normal partition between the first partition and the second partition.
[0056] Therefore, if the first partition is abnormal and the second partition is normal, the program pointer points to the second partition. If the second partition is abnormal and the first partition is normal, the program pointer points to the first partition. This can reduce the possibility of equipment failure caused by memory displacement. The multi-core processor is the core of the high-voltage direct current transmission control and protection equipment. As the failure rate of the multi-core processor decreases, the stability of the operation of the high-voltage direct current transmission control and protection equipment can be improved accordingly.
[0057] Optionally, according to a multi-core processor fault diagnosis and exception handling method provided by the present invention, based on the original hash value of the target application and the hash value of the partition where the program pointer is located, determining whether the program pointer points to the first partition or the second partition includes:
[0058] Determine whether the original hash value is the same as the hash value of the partition where the program pointer is located;
[0059] If it is determined that the original hash value is different from the hash value of the partition where the program pointer is located, the hash value of the backup partition corresponding to the partition where the program pointer is located is calculated, the backup partition corresponding to the first partition is the second partition, and the backup partition corresponding to the second partition is the first partition;
[0060] Determine whether the original hash value is the same as the hash value of the backup partition;
[0061] If it is determined that the original hash value is the same as the hash value of the backup partition, then it is determined that the program pointer points to the backup partition.
[0062] Specifically, if the partition where the program pointer is located is the first partition, then the backup partition is the second partition. If it is determined that the original hash value is different from the hash value of the partition where the program pointer is located (that is, the first partition), then the hash value of the backup partition (that is, the second partition) corresponding to the partition where the program pointer is located is calculated, and it is determined whether the original hash value is the same as the hash value of the second partition. If it is determined that the original hash value is the same as the hash value of the second partition, it is determined that the program pointer points to the second partition.
[0063] Specifically, if the partition where the program pointer is located is the second partition, then the backup partition is the first partition. If it is determined that the original hash value is different from the hash value of the partition where the program pointer is located (that is, the second partition), then the hash value of the backup partition (that is, the first partition) corresponding to the partition where the program pointer is located is calculated, and it is determined whether the original hash value is the same as the hash value of the first partition. If it is determined that the original hash value is the same as the hash value of the first partition, it is determined that the program pointer points to the first partition.
[0064] Optionally, according to a multi-core processor fault diagnosis and exception handling method provided by the present invention, after determining that the original hash value is the same as the hash value of the backup partition, the method further includes:
[0065] Based on the code of the target application stored in the backup partition, the code of the partition with abnormal hash value is restored.
[0066] Specifically, if the partition where the program pointer is located is the first partition, then the backup partition is the second partition. If it is determined that the original hash value is different from the hash value of the partition where the program pointer is located (that is, the first partition), it indicates that the first partition is the hash value of the backup partition corresponding to the partition where the program pointer is located (that is, the second partition is the hash value abnormal partition). It is judged whether the original hash value is the same as the hash value of the second partition. After determining that the original hash value is the same as the hash value of the backup partition, the code of the hash value abnormal partition (that is, the first partition) can be restored based on the code of the target application stored in the second partition.
[0067] Specifically, if the partition where the program pointer is located is the second partition, then the backup partition is the first partition. If it is determined that the original hash value is different from the hash value of the partition where the program pointer is located (that is, the second partition), it indicates that the second partition is the backup partition corresponding to the partition where the program pointer is located (that is, the first partition is the hash value abnormal partition). The hash value of the original hash value is judged to be the same as the hash value of the first partition. After determining that the original hash value is the same as the hash value of the backup partition, the code of the hash value abnormal partition (that is, the second partition) can be restored based on the code of the target application stored in the first partition.
[0068] Optionally, according to a multi-core processor fault diagnosis and exception handling method provided by the present invention, after determining whether the original hash value is the same as the hash value of the backup partition, the method further includes:
[0069] If it is determined that the original hash value is different from the hash value of the backup partition, an alarm operation is performed.
[0070] Specifically, the alarm operations include:
[0071] Save the fault log and register the fault activity event to the Field-Programmable Gate Array (FPGA) on the main control board where the multi-core processor is located. The fault activity event is used to indicate the multi-core processor working failure. At the same time, the multi-core processor actively stops the execution of the scheduling task and stops the execution of the application program itself.
[0072] The fault log includes one or more of the following information: stack information at the time of the fault, function call relationship at the time of the fault, register backup at the time of the fault, and application program execution location.
[0073] Exemplarily, the fault activity event may carry a fault log, and the fault activity event may be used to trigger the onboard FPGA to send a sysfail signal to notify other main control boards and peripheral boards to stop running.
[0074] Optionally, according to a multi-core processor fault diagnosis and exception handling method provided by the present invention, after determining whether the original hash value is the same as the hash value of the partition where the program pointer is located, the method further includes:
[0075] If it is determined that the original hash value is the same as the hash value of the partition where the program pointer is located, the program pointer of the target application is kept unchanged.
[0076] Specifically, if the partition where the program pointer is located is the first partition, after determining whether the original hash value is the same as the hash value of the partition where the program pointer is located, if it is determined that the original hash value is the same as the hash value of the partition where the program pointer is located, it indicates that there is no abnormality in the code stored in the first partition, and the program pointer of the target application can be kept unchanged, that is, kept pointing to the first partition.
[0077] Specifically, if the partition where the program pointer is located is the second partition, after determining whether the original hash value is the same as the hash value of the partition where the program pointer is located, if it is determined that the original hash value is the same as the hash value of the partition where the program pointer is located, it indicates that there is no abnormality in the code stored in the second partition, and the program pointer of the target application can be kept unchanged, that is, it can be kept pointing to the second partition.
[0078] Optionally, according to a multi-core processor fault diagnosis and exception handling method provided by the present invention, before monitoring the target memory area and determining the hash value of the partition where the program pointer of the target application is located, the method further includes:
[0079] Loading the target application code into the first partition and the second partition;
[0080] Determine whether the initial hash value of the first partition is the same as the initial hash value of the second partition;
[0081] If it is determined that the initial hash value of the first partition is the same as the initial hash value of the second partition, the initial hash value is determined as the original hash value;
[0082] Based on the default program entry configuration, it is determined that the program pointer of the target application program points to the code start position of the first partition or the code start position of the second partition.
[0083] Exemplarily, the abnormal diagnosis and processing function of a single processor (a single processor refers to a processor on a single main control board, and a single processor may include multiple cores):
[0084] (1) The main control board can use a processor with ECC function to implement hardware-level self-checking and exception handling.
[0085] (2) The main control board uses the AMP mode, and the processor uses an embedded operating system in each core. The embedded operating system provides the application with complete hardware resources, memory, and file system management methods, as well as arbitration strategies for multi-tasking and multi-core application environments, thus making the device more secure, reliable, and stable.
[0086] (3) For each business computing node in AMP, set the code segment and page table to write protection.
[0087] (4) When an exception occurs in each business computing node in AMP, the operating system exception handling is triggered (that is, the above-mentioned alarm operation is executed). In the callback function of the exception handling, the stack is traced back to the exception location, the function call relationship at the time of the exception is traced, the current register backup and application execution location are recorded, the current stack information is collected, and a fault log is formed and stored in the flash, which is convenient for users to locate the underlying fault cause and further improve the reliability of equipment operation.
[0088] (5) The core application logic of each business computing node in AMP is written by the host computer configuration programming software and the generated program instructions are stored in the opened RAM area, called the CRAM area. To ensure that the user application code segment is not damaged, the following abnormal diagnosis methods can be performed:
[0089] 1) The CRAM is divided into an upper half area and a lower half area (wherein the first partition may be the upper half area, and the second partition may be the lower half area), and the upper and lower areas are of the same size and serve as backup for each other;
[0090] 2) Define the task executed by the application as the main task. In the main task, when the application is downloaded for the first time, the application is downloaded to the upper and lower areas of CRAM, and the hash values of the two areas are calculated at the same time. If they are consistent, the original hash value is recorded and the execution starts from the upper area as the application entry by default. Figure 3It is a flow chart of the main task logic provided by the present invention, such as Figure 3 As shown, CRAM_H represents the upper area, CRAM_L represents the lower area, F_H is used to indicate whether there is an abnormality in the code stored in the upper area, if F_H = TRUE, it means that there is no abnormality in the code stored in the upper area, otherwise it means that there is an abnormality in the code stored in the upper area; F_L is used to indicate whether there is an abnormality in the code stored in the lower area, if F_L = TRUE, it means that there is no abnormality in the code stored in the lower area, otherwise it means that there is an abnormality in the code stored in the lower area; F_SW is used to indicate whether to point the program pointer to the backup partition (the backup partition corresponding to the upper area is the lower area, and the backup partition corresponding to the lower area is the upper area), F_SW = TRUE indicates that the program pointer is to be pointed to the backup partition;
[0091] 3) Initiate a CRAM scanning task based on the embedded operating system. It is executed as a background task when a single cycle of the application is completed and the next execution cycle has not arrived. It is mainly responsible for calculating the hash value of the CRAM area where the program pointer is located in real time and comparing it with the saved original value. Once an inconsistency is detected, the hash value of the other half of the CRAM area is calculated in the high-priority task. If the value is consistent with the original value, the program pointer is quickly switched to the same offset address of the other half of the CRAM area. At the same time, in the background task (background tasks are usually some auxiliary tasks used to handle system management, monitoring, maintenance, etc. They are executed in the background without interfering with or blocking the execution of the main task), the CRAM area with the correct hash value is copied to the erroneous CRAM area. Figure 4 : is a flow chart of the CRAM scanning task provided by the present invention, such as Figure 4 As shown, if F_SW = FALSE, it means that the program pointer remains unchanged;
[0092] 4) During the execution of the main task of the system, as long as the hash values of the upper and lower areas of CRAM are consistent with the original values, the system can always run correctly without failure and stop, and the error area can be automatically repaired;
[0093] 5) Only when the hash values of the upper and lower areas of CRAM are inconsistent with the original values, the alarm operation will be triggered, the fault information will be saved and the operation will be exited;
[0094] 6) Optionally, in a multi-core processor scenario, the CRAM scanning task and the main task can be on different cores, thereby further improving the real-time performance of the scanning task and discovering operating faults more promptly.
[0095] (6) When a multi-core single processor detects a system abnormality and cannot complete automatic error correction, it will actively trigger an alarm to ensure reliable operation of the system, save the fault information, and send a sysfail signal through the backplane to notify other main control boards and peripheral boards to stop running.
[0096] The present invention also provides a main control board, comprising: an onboard FPGA and a multi-core processor using any one of the multi-core processor fault diagnosis and exception handling methods described above.
[0097] Exemplarily, the multi-core processor is used to periodically register activity events with the onboard FPGA;
[0098] The onboard FPGA is specifically used for:
[0099] Monitor activity events registered by multi-core processors;
[0100] Determine whether the multi-core processor fails based on a preset time threshold and an activity event registered by the multi-core processor;
[0101] If it is determined that the multi-core processor fails, a system failure signal is sent to the backplane where the main control board is located.
[0102] It is understandable that a single-board power failure will cause the processor to stop working and will also result in the inability to effectively send a sysfail signal. For this scenario, the present invention monitors the activity events registered by the multi-core processor through the onboard FPGA. After the most recent activity event registered by the multi-core processor is received, the timer can be configured based on a preset time threshold. If the timer times out and no new activity event registered by the multi-core processor is received, it indicates that the multi-core processor has a fault, and then the onboard FPGA can send a sysfail signal to the backplane where the main control board is located to notify other main control boards and peripheral boards to stop running. Through an internal self-check mechanism that does not rely on other external devices or modules, the main control board operation failure can be discovered in extreme cases, and the operation can be actively exited to avoid affecting the reliable operation of the system.
[0103] The present invention also provides a high-voltage direct current transmission control and protection device, comprising: a backplane and a plurality of the above-mentioned main control boards, wherein the backplane is used to carry the plurality of main control boards, and the plurality of main control boards are communicatively connected with each other.
[0104] Exemplarily, the multi-core processor of the present invention refers to a multi-core computing environment running in AMP mode, where each core uses hardware resources isolated from each other;
[0105] Multiple cores of a single processor periodically register activity events with the onboard FPGA, including heartbeat and operating status. The onboard FPGA monitors each processor core based on the registration content to determine whether its operation is normal. When a core fails to register an activity event with the onboard FPGA within the threshold time, or the registered activity event is abnormal (that is, the above-mentioned fault activity event), the core is judged to be operating abnormally and has failed to actively and reliably shut down. The onboard FPGA will actively send a sysfail signal on the backplane to notify other main control boards and peripheral boards to stop running.
[0106] Optionally, a time threshold for the onboard FPGA to determine that the processor core is operating abnormally can be set, which is generally 5 times the fastest running task.
[0107] Optionally, a high-speed communication bus is used to connect the onboard FPGA and the processor.
[0108] The present invention proposes a multi-core processor fault diagnosis and exception handling method, which can be applied to the multi-core multi-master processor parallel computing environment in high-voltage direct current transmission engineering equipment. The method can reduce the possibility of equipment failure caused by memory displacement and improve the stability and reliability of the operation of high-voltage direct current transmission control and protection equipment.
[0109] The present invention also proposes a main control board, which can detect operating failures of the main control board in extreme cases through an internal self-check mechanism that does not rely on other external devices or modules, and actively exit operation to avoid affecting the reliable operation of the system.
[0110] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0111] Based on the method in the above embodiment, an embodiment of the present invention provides an electronic device. The device may include: at least one memory for storing programs and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the above embodiment.
[0112] Based on the method in the above embodiment, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0113] It is understandable that the processor in the embodiment of the present invention may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0114] The method steps in the embodiments of the present invention can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0115] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0116] It should be understood that the various numerical numbers involved in the embodiments of the present invention are only used for the convenience of description and are not used to limit the scope of the embodiments of the present invention.
[0117] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A multi-core processor fault diagnosis and exception handling method, It is characterized in that include: Monitor the target memory area in real time to determine the hash value of the partition where the program pointer of the target application is located, the target memory area includes a first partition and a second partition, the first partition and the second partition store the code of the target application in a mutually backed-up manner, and the partition where the program pointer is located is the first partition or the second partition; Determining, based on the original hash value of the target application and the hash value of the partition where the program pointer is located, that the program pointer points to the first partition or the second partition; The determining, based on the original hash value of the target application and the hash value of the partition where the program pointer is located, that the program pointer points to the first partition or the second partition includes: Determine whether the original hash value is the same as the hash value of the partition where the program pointer is located; If it is determined that the original hash value is different from the hash value of the partition where the program pointer is located, then the hash value of the backup partition corresponding to the partition where the program pointer is located is calculated, the backup partition corresponding to the first partition is the second partition, and the backup partition corresponding to the second partition is the first partition; Determine whether the original hash value is the same as the hash value of the backup partition; If it is determined that the original hash value is the same as the hash value of the backup partition, determining that the program pointer points to the same offset address of the backup partition; Before monitoring the target memory area and determining the hash value of the partition where the program pointer of the target application is located, it also includes: Loading the target application code to the first partition and the second partition; Determine whether the initial hash value of the first partition is the same as the initial hash value of the second partition; If it is determined that the initial Hash value of the first partition is the same as the initial Hash value of the second partition, determining the initial Hash value as the original Hash value; Based on a default program entry configuration, determining that a program pointer of the target application program points to a code start position of the first partition or a code start position of the second partition; After determining that the original hash value is the same as the hash value of the backup partition, the method further includes: Based on the code of the target application stored in the backup partition, restore the code of the partition with abnormal hash value; After determining whether the original hash value is the same as the hash value of the backup partition, the method further includes: If it is determined that the original hash value is different from the hash value of the backup partition, an alarm operation is performed; The alarm operation includes: The fault log is saved and the fault activity event is registered to the onboard FPGA on the main control board where the multi-core processor is located. The fault activity event is used to indicate the working failure of the multi-core processor so that the onboard FPGA sends a system fault signal on the backplane. At the same time, the multi-core processor actively stops the execution of the scheduling task and stops the execution of the application program itself.
2. According to the multi-core processor fault diagnosis and exception handling method of claim 1, It is characterized in that The fault log includes one or more of the following information: stack information at the time of the fault, function call relationship at the time of the fault, register backup at the time of the fault, and application program execution location.
3. According to the multi-core processor fault diagnosis and exception handling method of claim 1, It is characterized in that After determining whether the original hash value is the same as the hash value of the partition where the program pointer is located, the method further includes: If it is determined that the original hash value is the same as the hash value of the partition where the program pointer is located, the program pointer of the target application is kept unchanged.
4. A main control board, It is characterized in that include: An onboard FPGA and a multi-core processor using the multi-core processor fault diagnosis and exception handling method as described in any one of claims 1 to 3.
5. According to the main control board of claim 4, It is characterized in that The multi-core processor is used to periodically register activity events with the onboard FPGA; The onboard FPGA is specifically used for: Monitoring activity events registered by the multi-core processor; Determining whether the multi-core processor fails based on a preset time threshold and an activity event registered by the multi-core processor; If it is determined that the multi-core processor fails, a system failure signal is sent to the backplane where the main control board is located.
6. A high voltage direct current transmission control and protection device, It is characterized in that include: A backplane and multiple main control boards as described in claim 4 or 5, wherein the backplane is used to carry the multiple main control boards, and the multiple main control boards are communicatively connected with each other.
