Soft error protection method and device, equipment and storage medium
By independently processing input data on multiple redundant nodes, the problem of system unavailability caused by physical host failure in the prior art is solved, and the reliability and fault tolerance of the system are improved.
Patent Information
- Application Number
- CN202310715223.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2024-12-17
AI Technical Summary
In the fault-tolerant method of OS-level redundant execution in the prior art, once the shared components of the physical host fail, the entire system will be unavailable, reducing the reliability of the system.
By obtaining input data of the target service and transmitting it to multiple redundant nodes, each node includes at least one redundant virtual machine and redundant process, the initial processing result is independently processed and determined, and the final result is determined based on the multiple initial processing results. Improve system reliability.
When multiple redundant nodes are processed independently, the failure of one node only affects the initial processing results of the node and does not affect other nodes, improving the reliability and fault tolerance of the system.
Smart Images

Figure CN119149272A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method, device, equipment and storage medium for soft error protection. Background Art
[0002] In recent years, human beings have been conducting more and more research on the space field, and the satellite Internet industry has developed rapidly. There are high-energy particles such as protons, alpha particles, electrons, and heavy ions in the space radiation environment. When a single high-energy particle hits the sensitive part of a microelectronic device, it generates additional charge due to ionization, which changes the logical state of the device, interferes with or fails the function, etc., which is called a single-particle effect. Faults caused by single-particle effects include hard errors and soft errors. Hard errors caused by single-particle lock, single-particle burnout, and single-particle gate penetration will cause the transistors in the device to fail completely, resulting in irreversible failures in the circuit. Fault recovery is generally performed by hardware reconstruction or hardware replacement. Soft errors directly cause the data bits of the storage device to flip, which not only damages the data, but also may cause loss of function and serious system failures. Soft errors are transient faults that are reversible and can restore the affected device to normal operation by rewriting or resetting.
[0003] The soft error protection methods currently used in the industry are mainly based on hardware implementation. The most common method is to use radiation-resistant devices and customized redundant hardware to ensure system reliability. However, this method is costly, has a long design and manufacturing cycle, and is inflexible in deployment and expansion. It is not suitable for soft error protection in cost-sensitive scenarios.
[0004] The soft error protection method implemented by software can take into account fault tolerance cost, scalability, flexibility, etc. Some technologies propose OS (Operation System) level redundant execution methods to deal with the threat of soft errors. That is, multiple redundant processes are run on a physical host, but the physical host has shared components such as buses. Once the shared components of the physical host fail, the entire system will be unavailable, reducing the reliability of the system. Summary of the invention
[0005] In view of this, the present application provides a soft error protection method, device, equipment and storage medium to help solve the problem in the fault-tolerant method of OS-level redundant execution in the prior art that once the shared components of the physical host fail, the entire system will become unavailable, reducing the reliability of the system.
[0006] In a first aspect, an embodiment of the present application provides a soft error protection method, the method comprising:
[0007] Obtain input data of a target business, and transmit the input data of the target business to n redundant nodes corresponding to the target business; wherein n is an integer greater than 2; each redundant node includes at least one redundant virtual machine, and each redundant virtual machine includes a redundant process;
[0008] The n redundant nodes process the input data of the target service respectively to obtain n initial processing results;
[0009] Based on the n initial processing results, a target result is determined, and the target result is output.
[0010] In a possible implementation manner of the first aspect, the n redundant nodes respectively process the input data of the target service to obtain n initial processing results, including:
[0011] For each of the n redundant nodes, the redundant process of each redundant virtual machine in the redundant node processes the input data of the target service respectively to obtain a redundant processing result of each redundant process;
[0012] The redundant node determines an initial processing result of the redundant node based on the redundant processing result of each redundant process.
[0013] In a possible implementation manner of the first aspect, the redundant node determining, based on the redundant processing result of each redundant process, an initial processing result of the redundant node includes:
[0014] The redundant node determines the type of redundant processing results and the number of each type of redundant processing results based on the redundant processing results of each redundant process;
[0015] Detecting whether there are redundant processing results of different types whose number is greater than a first preset threshold;
[0016] If so, the redundant processing results whose number is greater than the first preset threshold are determined as the initial processing results of the redundant node.
[0017] In a possible implementation manner of the first aspect, the method further includes:
[0018] If it does not exist, the redundant node outputs error identification information;
[0019] Based on the error identification information, updating the error count of the redundant node;
[0020] When the number of errors of the redundant node does not exceed a preset number threshold, a fault recovery process is performed on the redundant node.
[0021] In a possible implementation manner of the first aspect, the method further includes:
[0022] Determine whether there is a faulty redundant process; wherein the faulty redundant process refers to other redundant processes other than the first redundant process that are running in the same redundant virtual machine as the first redundant process; the first redundant process is a redundant process corresponding to the redundant processing results whose number is greater than a first preset threshold;
[0023] If so, the faulty redundant process is restored based on the first redundant process.
[0024] In a possible implementation manner of the first aspect, the method further includes:
[0025] For each of the n redundant nodes, the redundant node obtains synchronization data of the redundant process during the running of the redundant process;
[0026] Based on the synchronization data of the redundant process, determining whether to adjust the priority of the redundant process and the second redundant process; wherein the second redundant process refers to other redundant processes other than the redundant process running in the same redundant virtual machine as the redundant process;
[0027] If it is determined to adjust the priority of the redundant process, then the priority of the redundant process is increased; or,
[0028] If it is determined to adjust the priority of the second redundant process, the priority of the second redundant process is increased.
[0029] In a possible implementation manner of the first aspect, the redundant node acquiring synchronization data of the redundant process during the running of the redundant process includes:
[0030] The redundant node obtains synchronization data of the redundant process during the process of the redundant process calling the target function.
[0031] In a possible implementation of the first aspect, the synchronization data of the redundant process includes the running time of the redundant process and the running time of a second redundant process; wherein the second redundant process refers to other redundant processes other than the redundant process that run in the same redundant virtual machine as the redundant process.
[0032] In a possible implementation manner of the first aspect, determining whether to adjust the priorities of the redundant process and the second redundant process based on the synchronization data of the redundant process includes:
[0033] Based on the synchronization data of the redundant process, determining whether a time difference between an elapsed running time of the redundant process and an elapsed running time of the other target redundant process exceeds a first preset time threshold;
[0034] If it exceeds, and the running time of the redundant process is less than the running time of the second redundant process, then determining to adjust the priority of the redundant process; or,
[0035] If it exceeds, and the running time of the second redundant process is less than the running time of the redundant process, it is determined to adjust the priority of the second redundant process.
[0036] In a possible implementation manner of the first aspect, determining a target result based on the n initial processing results, and outputting the target result includes:
[0037] Based on the n initial processing results, determining the types of the n initial processing results and the number of each type of initial processing results;
[0038] Detecting whether there are initial processing results of different types whose number is greater than a second preset threshold value;
[0039] If so, the initial processing results whose number is greater than the second preset threshold are determined as target results, and the target results are output.
[0040] In a possible implementation manner of the first aspect, the method further includes:
[0041] If there are no initial processing results whose number is greater than the second preset threshold, an error prompt message is output.
[0042] In a possible implementation manner of the first aspect, the method further includes:
[0043] Determine whether there is a faulty redundant node; wherein the faulty redundant node is a redundant node other than the target redundant node; the target redundant node is a redundant node corresponding to the initial processing result whose number is greater than a second preset threshold;
[0044] If so, the failed redundant node is restored based on the target redundant node.
[0045] In a possible implementation manner of the first aspect, the method further includes:
[0046] For each redundant virtual machine of each redundant node among the n redundant nodes, obtaining synchronization data of the redundant virtual machine;
[0047] Determining whether to adjust the priority of the redundant virtual machine based on the synchronization data of the redundant virtual machine;
[0048] If it is determined to adjust the priority of the redundant virtual machine, the priority of the redundant virtual machine is increased.
[0049] In a possible implementation manner of the first aspect, acquiring the synchronization data of the redundant virtual machine includes:
[0050] When an exit event occurs in the redundant virtual machine, synchronization data of the redundant virtual machine is obtained.
[0051] In a possible implementation of the first aspect, the synchronization data of the redundant virtual machine includes the running time of the redundant virtual machine and the running time of other redundant virtual machines; wherein the other redundant virtual machines refer to redundant virtual machines other than the redundant virtual machine that run the same business as the redundant virtual machine.
[0052] In a possible implementation manner of the first aspect, when an exit event occurs in the redundant virtual machine, acquiring synchronization data of the redundant virtual machine includes:
[0053] When an exit event occurs to the redundant virtual machine, synchronization data of the redundant virtual machine is acquired, and the running time of the redundant virtual machine is sent to other redundant nodes.
[0054] In a possible implementation manner of the first aspect, the determining whether to adjust the priority of the redundant virtual machine based on the synchronization data of the redundant virtual machine includes:
[0055] Based on the synchronization data of the redundant virtual machine, determining whether the running time of the redundant virtual machine is less than the running time of other redundant virtual machines;
[0056] If it is less than, determining whether the time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines exceeds a second preset time threshold;
[0057] If it exceeds, it is determined to adjust the priority of the redundant virtual machine.
[0058] In a possible implementation manner of the first aspect, the target service includes an error-sensitive service.
[0059] In a possible implementation manner of the first aspect, the method further includes:
[0060] Acquire input data of a non-target service, and transmit the input data of the non-target service to a redundant node corresponding to the non-target service;
[0061] The redundant node corresponding to the non-target service processes the input data of the non-target service, obtains an initial processing result, and outputs it.
[0062] In a second aspect, an embodiment of the present application provides a soft error protection device, including:
[0063] The second-level voting unit is used to obtain input data of the target business and transmit the input data of the target business to n redundant nodes corresponding to the target business; wherein n is an integer greater than 2;
[0064] A redundant node, used to process the input data of the target business to obtain n initial processing results; each redundant node includes at least one redundant virtual machine, and each redundant virtual machine includes a redundant process;
[0065] The second-level voting unit is further used to determine a target result based on the n initial processing results, and output the target result.
[0066] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute any one of the methods described in the first aspect above.
[0067] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any method described in the first aspect.
[0068] Adopt the scheme provided by the embodiment of the present application, obtain the input data of the target business, and transmit the input data of the target business to the n redundant nodes corresponding to the target business; wherein n is an integer greater than 2; each redundant node contains at least one redundant virtual machine, and each redundant virtual machine contains a redundant process; the n redundant nodes process the input data of the target business respectively to obtain n initial processing results; based on the n initial processing results, determine the target result, and output the target result. In this way, in the embodiment of the present application, based on the n initial processing results, determine the target result, and output the target result, that is, the target result is determined based on at least three initial processing results. The above n initial processing results are obtained after different redundant nodes process the input data of the target business. Different redundant nodes process the input data of the target business on hardware platforms independent of each other, so that the failure of a redundant node only affects the initial processing result of the redundant node, and does not affect the initial processing results of other redundant nodes. The target result is determined based on the initial processing results of n redundant nodes, which improves reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0070] Figure 1 A schematic diagram of the structure of a soft error protection device provided in an embodiment of the present application;
[0071] Figure 2 A schematic diagram of the structure of another soft error protection device provided in an embodiment of the present application;
[0072] Figure 3 A flowchart of a soft error protection method provided in an embodiment of the present application;
[0073] Figure 4 A flowchart of another soft error protection method provided in an embodiment of the present application;
[0074] Figure 5 A flowchart of another soft error protection method provided in an embodiment of the present application;
[0075] Figure 6a A flowchart of another soft error protection method provided in an embodiment of the present application;
[0076] Figure 6b A flowchart of another soft error protection method provided in an embodiment of the present application;
[0077] Figure 7 A flowchart of another soft error protection method provided in an embodiment of the present application;
[0078] Figure 8 A flowchart of another soft error protection method provided in an embodiment of the present application;
[0079] Fig. 9 A schematic diagram of a soft error protection scenario provided in an embodiment of the present application;
[0080] Fig.10 A flowchart of another soft error protection method provided in an embodiment of the present application;
[0081] Fig.11 A flowchart of another soft error protection method provided in an embodiment of the present application;
[0082] Fig.12 A flowchart of another soft error protection method provided in an embodiment of the present application;
[0083] Fig.13 A schematic diagram of another scenario of soft error protection provided in an embodiment of the present application;
[0084] Fig.14 A flowchart of another soft error protection method provided in an embodiment of the present application;
[0085] Fig.15a A schematic diagram of another scenario of soft error protection provided in an embodiment of the present application;
[0086] Fig.15b A flowchart of another soft error protection method provided in an embodiment of the present application;
[0087] Fig.15c A flowchart of another soft error protection method provided in an embodiment of the present application;
[0088] Fig.16 A schematic diagram of another scenario of soft error protection provided in an embodiment of the present application;
[0089] Fig.17 A schematic diagram of the structure of another soft error protection device provided in an embodiment of the present application;
[0090] Fig.18 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0091] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0092] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0093] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0094] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0095] In recent years, human beings have been conducting more and more research on the space field, and the satellite Internet industry has developed rapidly. There are high-energy particles such as protons, alpha particles, electrons, and heavy ions in the space radiation environment. When a single high-energy particle hits the sensitive part of a microelectronic device, it generates additional charge due to ionization, which changes the logical state of the device, interferes with or fails the function, etc., which is called a single-particle effect. Faults caused by single-particle effects include hard errors and soft errors. Hard errors caused by single-particle lock, single-particle burnout, and single-particle gate penetration will cause the transistors in the device to fail completely, resulting in irreversible failures in the circuit. Fault recovery is generally performed by hardware reconstruction or hardware replacement. Soft errors directly cause the data bits of the storage device to flip, which not only damages the data, but also may cause loss of function and serious system failures. Soft errors are transient faults that are reversible and can restore the affected device to normal operation by rewriting or resetting.
[0096] The soft error protection methods currently used in the industry are mainly based on hardware implementation. The most common method is to use radiation-resistant devices and customized redundant hardware to ensure system reliability. However, this method is costly, has a long design and manufacturing cycle, and is inflexible in deployment and expansion. It is not suitable for soft error protection in cost-sensitive scenarios.
[0097] The soft error protection method implemented by software can take into account fault tolerance cost, scalability, flexibility, etc. Some technologies propose OS (Operation System) level redundant execution methods to deal with the threat of soft errors.
[0098] For example, Figure 1 As shown, in some technologies, three redundant virtual machines and one voting virtual machine are run on a host, and information exchange is achieved between the virtual machines through shared memory. The voting virtual machine obtains input data from the IO (Input Output) device and sends it to the three redundant virtual machines through shared memory. The redundant processes of the three redundant virtual machines process the input data respectively, obtain three execution results and send them to the voting virtual machine. The voting module of the voting virtual machine determines the final output result based on the three execution results and submits it to the IO device through VMM (Virtual Machine Monitor). The three redundant virtual machines and one voting virtual machine run on the same physical host. The physical host has shared components such as a bus. Once the shared components of the physical host fail, the entire system will be unavailable, reducing the reliability of the system.
[0099] For example, Figure 2As shown, in some technologies, a master node and a slave node are run on a multi-core CPU, where the SeL4 microkernel is an operating system kernel. Redundant processes are run on the master node and the slave node respectively. The master node obtains input data through an IO device and stores it in a shared memory, and the slave node obtains input data through a shared memory. After the master node and the slave node process the input data respectively, they obtain output data respectively and store them in a shared memory. The master node kernel obtains two output data and determines the final output data based on the two output data.
[0100] That is, the soft error protection method in the prior art is to run multiple redundant processes on a physical host, but the physical host has shared components such as a bus. Once the shared components of the physical host fail, the entire system will be unavailable, reducing the reliability of the system.
[0101] In view of the above problems, the embodiment of the present application provides a vehicle data acquisition method, device, equipment and storage medium, which acquires the input data of the target business and transmits the input data of the target business to n redundant nodes corresponding to the target business; wherein n is an integer greater than 2; each redundant node contains at least one redundant virtual machine, and each redundant virtual machine contains a redundant process; the n redundant nodes process the input data of the target business respectively to obtain n initial processing results; based on the n initial processing results, the target result is determined and the target result is output. In this way, in the embodiment of the present application, the target result is determined based on the n initial processing results, and the target result is output, that is, the target result is determined based on at least three initial processing results. The above n initial processing results are obtained after different redundant nodes process the input data of the target business. Different redundant nodes process the input data of the target business on hardware platforms independent of each other, so that the failure of such a redundant node only affects the initial processing result of the redundant node, and does not affect the initial processing results of other redundant nodes. The target result is determined based on the initial processing results of n redundant nodes, which improves reliability. The following is a detailed description.
[0102] See also Figure 3 , is a flow chart of a soft error protection method provided in an embodiment of the present application. Figure 3 As shown, the method includes:
[0103] Step S301: Acquire input data of a target service, and transmit the input data of the target service to n redundant nodes corresponding to the target service.
[0104] Wherein, n is an integer greater than 2; each redundant node includes at least one redundant virtual machine, and each redundant virtual machine includes a redundant process.
[0105] In the embodiment of the present application, when executing the target service, it is first necessary to obtain the input data of the target service. In some embodiments, the input data of the target service can be obtained through an IO device of an external device.
[0106] Each of the n redundant nodes corresponding to the target service needs to run the target service, so each redundant node needs the input data of the target service. Therefore, after obtaining the input data of the target service, the input data of the target service can be transmitted to the n redundant nodes corresponding to the target service.
[0107] n is an integer greater than 2, that is, the target service corresponds to at least 3 redundant nodes. In some embodiments, in order to facilitate the determination of the final processing result based on the processing results of n redundant nodes, the number of redundant nodes corresponding to the target service is an odd number greater than 2, that is, n is an odd number greater than 2. In some embodiments, in order to take into account both reliability and fault tolerance overhead, the target service corresponds to 3 redundant nodes, that is, n=3.
[0108] In some embodiments, in order to improve versatility, the redundant nodes may be COTS (Commercial Off-The-Shelf) multi-core CPUs.
[0109] Each redundant node includes at least one redundant virtual machine, so that the target service can be run in at least n redundant virtual machines. Each redundant virtual machine includes a redundant process, so that for each redundant virtual machine, the target service can be run in the redundant process on the redundant virtual machine.
[0110] In some embodiments, in order to improve versatility, the operating system of the redundant node host can be Linux, and the operating system of the redundant virtual machine can also be Linux. Of course, the operating system of the redundant node and the operating system of the redundant virtual machine can also be other operating systems that can execute the embodiments of the present application, and the present application does not limit this. For ease of understanding, the following description is based on the example that the operating system of the redundant node host and the operating system of the redundant virtual machine are both Linux.
[0111] Step S302: n redundant nodes process the input data of the target service respectively to obtain n initial processing results.
[0112] In the embodiment of the present application, the redundant virtual machines corresponding to the target business in each redundant node process the input data of the target business respectively, and each redundant node obtains its own processing result respectively, that is, each redundant node obtains an initial processing result respectively. In this way, n redundant nodes process the input data of the target business respectively and obtain n initial processing results.
[0113] Linux has page cache, block scheduling, block merging and other block device IO optimization mechanisms. The redundant virtual machine kernel caches the initial processing results, and performs block scheduling, block merging, etc. when outputting. This will cause the initial processing results output by the redundant virtual machines in the n redundant nodes to be inconsistent in content and timing, affecting the final processing results determined based on the n initial processing results. In order to avoid this situation, in an embodiment of the present application, for the initial processing results of the redundant virtual machines in the redundant nodes, a direct write request is initiated and the block merging and block scheduling are canceled, and the redundant virtual machine kernel hands the request to the redundant node host for processing. In some embodiments, the block device IO optimization mechanism is shielded by modifying the redundant virtual machine kernel code.
[0114] Step S303: determine the target result based on the n initial processing results, and output the target result.
[0115] In an embodiment of the present application, after obtaining n initial processing results, the target result can be determined based on the n initial processing results, and the target result can be output, that is, the target result is determined based on at least three initial processing results. The above n initial processing results are obtained after different redundant nodes process the input data of the target business. Different redundant nodes process the input data of the target business on hardware platforms independent of each other, so that a failure of a redundant node only affects the initial processing result of the redundant node, and will not affect the initial processing results of other redundant nodes. The target result is determined based on the initial processing results of n redundant nodes, which improves reliability.
[0116] In some embodiments, in order to improve reliability, reliable hardware such as a reliable FPGA (Field Programmable Gate Array) or an FPGA or SoC (System on Chip) with ECC (Error Checking and Correcting) memory determines a target result based on n initial processing results.
[0117] As a possible implementation, Figure 4 As shown, n redundant nodes process the input data of the target business respectively, and obtain n initial processing results including:
[0118] Step S3021: For each of the n redundant nodes, the redundant process of each redundant virtual machine in the redundant node processes the input data of the target service respectively to obtain a redundant processing result of each redundant process.
[0119] In the embodiment of the present application, after the input data of the target business is obtained and transmitted to the n redundant nodes corresponding to the target business, the host of the redundant node receives the input data of the target business, and the IO virtualization component in the VMM of the redundant node provides the input data of the target business to the redundant virtual machine corresponding to the target business in the redundant node. Each redundant process in the redundant virtual machine processes the input data of the target business respectively, and each redundant process obtains a redundant processing result.
[0120] In some embodiments, the redundant virtual machine receives and caches the input data of the target service, and when the redundant process needs the input data of the target service, the redundant virtual machine provides the cached input data of the target service to the redundant process.
[0121] For example, Figure 5 As shown, the input data of the target service is transmitted to n redundant nodes corresponding to the target service, and provided to the redundant processes in the redundant virtual machines corresponding to the target service in the redundant nodes, including:
[0122] Step S501: The redundant process starts.
[0123] Step S502: The redundant process initiates a request to the IO device to read input data of the target service.
[0124] Step S503: FPGA obtains input data of the target service from the IO device.
[0125] Step S504: FPGA executes redundant node input replication.
[0126] In this example, the FPGA transmits the input data of the target service to n redundant nodes corresponding to the target service.
[0127] Step S505: The redundant virtual machine corresponding to the target service in the redundant node executes the redundant process input replication at the middleware layer.
[0128] In this example, the redundant virtual machine corresponding to the target service in the redundant node provides the input data of the target service to the redundant process at the middleware layer.
[0129] Step S3022: The redundant node determines an initial processing result of the redundant node based on the redundant processing result of each redundant process.
[0130] In the embodiment of the present application, after each redundant process in the redundant virtual machine in the redundant node obtains a redundant processing result, the redundant node obtains at least one redundant processing result, and the redundant node can determine the initial processing result of the redundant node based on the at least one redundant processing result. When different redundant processes process the input data of the target business, they occupy different memory spaces of the redundant node host, so that errors that may occur in the redundant processes can be isolated.
[0131] In some embodiments, when a redundant process calls an IO-related function, the redundant processing results of the redundant process enter the first-level voting unit of the middleware layer of the redundant virtual machine. The first-level voting unit is used to determine the initial processing results of the redundant node based on the redundant processing results of each redundant process.
[0132] As a possible implementation, Figure 6a and Figure 6b As shown, the redundant node determines the initial processing result of the redundant node based on the redundant processing result of each redundant process, including:
[0133] Step S601: The redundant node determines the type of redundant processing results and the number of each type of redundant processing results based on the redundant processing results of each redundant process.
[0134] In an embodiment of the present application, the redundant processing results of different redundant processes may be the same or different. The same redundant processing results belong to the same category, and different redundant processing results belong to different categories. The redundant node determines the category of the redundant processing results and the number of each category of redundant processing results in this way. Exemplarily, the redundant virtual machine corresponding to the target business in the redundant node includes 5 redundant processes, and the redundant processing results of these 5 redundant processes are 000, 000, 000, 010, and 001, respectively. Then there are 3 categories of redundant processing results, the number of redundant processing results of the category with redundant processing result 000 is 3, the number of redundant processing results of the category with redundant processing result 010 is 1, and the number of redundant processing results of the category with redundant processing result 001 is 1.
[0135] In some embodiments, checksums of the redundant processing results are calculated respectively, and whether the redundant processing results are the same is determined by comparing the checksums of the redundant processing results.
[0136] Step S602: Detect whether there are redundant processing results of different types whose number is greater than a first preset threshold.
[0137] In an embodiment of the present application, after the redundant node determines the types of redundant processing results and the number of each type of redundant processing results, the number of redundant processing results of each type can be compared with a first preset threshold to determine whether there are redundant processing results whose number is greater than the first preset threshold.
[0138] In some embodiments, the number of redundant processes in the redundant virtual machines corresponding to the target service in the redundant node is M, and the first preset threshold is set to in, is rounded down. That is, check whether there is a number greater than That is, it is detected whether there are redundant processing results whose number is greater than half of the number of redundant processes in the redundant virtual machines corresponding to the target business in the redundant node. For example, if the number of redundant processes in the redundant virtual machines corresponding to the target business in the redundant node is 5, it is detected whether there are redundant processing results whose number is greater than 2.
[0139] It should be noted that the soft error protection device performs the following steps differently according to different detection results. When it is detected that there are redundant processing results with a number greater than the first preset threshold, steps S603-S605 are executed. When it is detected that there are no redundant processing results with a number greater than the first preset threshold, steps S606-S608 are executed.
[0140] Step S603: If there are redundant processing results whose number is greater than the first preset threshold, determine the redundant processing results whose number is greater than the first preset threshold as the initial processing results of the redundant node.
[0141] In an embodiment of the present application, if there are redundant processing results whose number is greater than a first preset threshold, it is considered that the redundant process that obtains the redundant processing result has not failed when processing the input data of the target business, and therefore the redundant processing result is determined as the initial processing result of the redundant node.
[0142] For the example in step S601, it is assumed that the first preset threshold is 2. For the type of redundant processing result of 000, the number of redundant processing results is 3, which is greater than the first preset threshold. That is, if it is detected that there are redundant processing results whose number is greater than the first preset threshold, and the redundant processing result is 000, 000 is determined as the initial processing result of the redundant node.
[0143] Step S604: Determine whether there is a faulty redundant process.
[0144] The faulty redundant process refers to other redundant processes except the first redundant process that are run in the same redundant virtual machine as the first redundant process; the first redundant process is a redundant process corresponding to the redundant processing results whose number is greater than the first preset threshold.
[0145] In the embodiment of the present application, if there are redundant processing results whose number is greater than the first preset threshold, it is considered that the redundant process corresponding to the redundant processing result has not failed, that is, the first redundant process has not failed. For other redundant processes other than the first redundant process running in the same redundant virtual machine as the first redundant process, the redundant processing results of these redundant processes are different from the redundant processing results of the first redundant process, and these redundant processes may have failed, so these redundant processes are regarded as failed redundant processes.
[0146] Step S605: If there is a faulty redundant process, restore the faulty redundant process based on the first redundant process.
[0147] In an embodiment of the present application, if it is determined that there is a faulty redundant process, since the first redundant process has not failed, the faulty redundant process can be recovered based on the first redundant process. In some embodiments, the recovery process of the faulty redundant process is to terminate the faulty redundant process and release the memory occupied by the faulty redundant process, that is, to kill the faulty redundant process and copy the first redundant process.
[0148] It should be noted that the execution order of step S603 and steps S604-S605 is not limited in this application. Steps S604-S605 may be executed first, and then step S603; step S603 may be executed first, and then steps S604-S605; steps S604-S605 and step S603 may also be executed simultaneously. Only one case is illustrated in the figure.
[0149] Step S606: If there are no redundant processing results whose number is greater than the first preset threshold, the redundant node outputs error identification information.
[0150] In the embodiment of the present application, if there are no redundant processing results greater than the first preset threshold, the initial processing result of the redundant node cannot be determined. At this time, the redundant virtual machine corresponding to the target service in the redundant node outputs error identification information.
[0151] Step S607: Based on the error identification information, update the error count of the redundant node.
[0152] In the embodiment of the present application, for different error times of redundant nodes, the subsequent execution steps are also different. Therefore, after the redundant node outputs the error information, the error times of the redundant node are updated.
[0153] Step S608: When the number of errors of the redundant node does not exceed the preset number threshold, perform fault recovery processing on the redundant node.
[0154] In the embodiment of the present application, if there are no redundant processing results whose number is greater than the first preset threshold, the initial processing result of the redundant node cannot be determined, and the redundant process that has not failed cannot be determined, and it is considered that the redundant virtual machine corresponding to the target service in the redundant node may have failed. When the number of errors of the redundant node does not exceed the preset number threshold, it is considered that the redundant virtual machine corresponding to the target service in the redundant node may have a soft error, and therefore the redundant virtual machine corresponding to the target service in the redundant node is subjected to fault recovery processing.
[0155] When the number of errors of a redundant node exceeds a preset number threshold, it is considered that a hard error may have occurred in the redundant virtual machine corresponding to the target service in the redundant node, and thus the redundant virtual machine corresponding to the target service in the redundant node is deactivated.
[0156] As a possible implementation, in order to facilitate the determination of the initial processing result of the redundant node based on the redundant processing result of each redundant process, the time when the redundant processes running the same target business output the redundant processing results is made consistent, so that the running progress of the redundant processes running the same target business is made consistent, such as Figure 7 As shown, the above soft error protection method also includes:
[0157] Step S701: For each of the n redundant nodes, the redundant node obtains synchronization data of the redundant process during the running of the redundant process.
[0158] In the embodiment of the present application, the synchronization data of the redundant process can reflect the running progress of the redundant process. The redundant node obtains the synchronization data of the redundant process during the running of the redundant process without interrupting the running of the redundant process.
[0159] As a possible implementation manner, the redundant node obtaining the synchronization data of the redundant process during the running of the redundant process includes: the redundant node obtaining the synchronization data of the redundant process during the process of the redundant process calling the target function.
[0160] In the embodiment of the present application, the redundant process will call the target function during operation, so the synchronization data of the redundant process can be obtained when the redundant process calls the target function.
[0161] In some embodiments, the target function may be a modified library function, such as a read function and a write function. A statement for calling a function corresponding to obtaining synchronization data of a redundant process is added to the library function, and the redundant process is enabled to preferentially call the modified library function through the LD_PRELOAD environment variable. In this way, when the redundant process calls the modified library function, the function for obtaining synchronization data of the redundant process is called, and at this time, the redundant node obtains the synchronization data of the redundant process.
[0162] As a possible implementation manner, the synchronization data of the redundant process includes the elapsed running time of the redundant process and the elapsed running time of the second redundant process.
[0163] The second redundant process refers to other redundant processes other than the redundant process that are run in the same redundant virtual machine as the redundant process.
[0164] In the embodiment of the present application, the running time of the redundant process can reflect the running progress of the redundant process. The redundant node obtains and stores the running time of the redundant process. Before the redundant node obtains the running time of the redundant process, the running time of the second redundant process has been stored. Therefore, the redundant node can obtain the running time of the redundant process and the running time of the second redundant process.
[0165] In some embodiments, the running time of the redundant process can be obtained by obtaining the sched_entity structure through CFS (Completely Fair Scheduler). For example, the time that the redundant process occupies the CPU can be obtained through the sched_entity structure, thereby obtaining the running time of the redundant process.
[0166] Step S702: Determine whether to adjust the priority of the redundant process and the second redundant process based on the synchronization data of the redundant process.
[0167] In the embodiment of the present application, the synchronization data of the redundant process can reflect the running progress of the redundant process running the same target business, so it can be determined whether to adjust the priority of the redundant process and the second redundant process based on the synchronization data of the redundant process.
[0168] When it is determined to adjust the priority of the redundant process, step S703 is executed; when it is determined to adjust the priority of the second redundant process, step S704 is executed.
[0169] As a possible implementation method, determining whether to adjust the priority of the redundant process and the second redundant process based on the synchronization data of the redundant process includes: determining whether the time difference between the running time of the redundant process and the running time of other target redundant processes exceeds a first preset time threshold based on the synchronization data of the redundant process; if it exceeds, and the running time of the redundant process is less than the running time of the second redundant process, determining to adjust the priority of the redundant process; or, if it exceeds, and the running time of the second redundant process is less than the running time of the redundant process, determining to adjust the priority of the second redundant process.
[0170] In the embodiment of the present application, the time difference between the running time of the redundant process and the running time of the second redundant process is compared with the first preset time threshold. If the time difference between the running time of the redundant process and the running time of the second redundant process exceeds, that is, is greater than, the first preset time threshold, it means that the difference between the running progress of the redundant process and the running progress of the second redundant process is too large, and the priority of the redundant process and the second redundant process is determined to be adjusted. If the running time of the redundant process is less than the running time of the second redundant process, it means that the running progress of the redundant process lags behind the running progress of the second redundant process, and the priority of the redundant process is determined to be adjusted; if the running time of the second redundant process is less than the running time of the redundant process, it means that the running progress of the second redundant process lags behind the running progress of the redundant process, and the priority of the second redundant process is determined to be adjusted.
[0171] If the time difference between the running time of the redundant process and the running time of the second redundant process does not exceed, that is, is not greater than, the first time threshold, it is considered that the redundant processing result of the redundant process and the redundant processing result of the second redundant process can be output synchronously, and it is determined not to adjust the priority of the redundant process and the second redundant process.
[0172] In order to improve the operation efficiency, the comparison between the running time of the redundant process and the running time of the second redundant process is non-blocking. If the synchronization data of the redundant process only includes the running time of the redundant process, but does not include the running time of the second redundant process, it means that the second redundant process has not called the target function. At this time, it is determined not to adjust the priority of the redundant process and the second redundant process.
[0173] Step S703: If it is determined to adjust the priority of the redundant process, the priority of the redundant process is increased.
[0174] In the embodiment of the present application, if it is determined to adjust the priority of the redundant process, it means that the time difference between the running time of the redundant process and the running time of the second redundant process is greater than the first preset time threshold, and the running progress of the redundant process lags behind the running progress of the second redundant process and the gap is too large. At this time, the priority of the redundant process can be increased so that the running progress of the redundant process is consistent with the running progress of the second redundant process.
[0175] In some embodiments, the priority of a redundant process may be increased by adjusting the process priority in a PCB (Process Control Block) of the redundant process.
[0176] Step S704: If it is determined to adjust the priority of the second redundant process, the priority of the second redundant process is increased.
[0177] In the embodiment of the present application, if it is determined to adjust the priority of the second redundant process, it means that the time difference between the running time of the second redundant process and the running time of the redundant process is greater than the first preset time threshold, and the running progress of the second redundant process lags behind the running progress of the redundant process and the gap is too large. At this time, the priority of the second redundant process can be increased so that the running progress of the second redundant process is consistent with the running progress of the redundant process.
[0178] In some embodiments, the priority of the second redundant process can be increased by adjusting the process priority in the PCB of the second redundant process.
[0179] In this way, the embodiment of the present application can compare the running progress of the redundant process and the running progress of the second redundant process with relatively small overhead, and make the running progress of the redundant process and the second redundant process tend to be consistent through simple operations.
[0180] For example, Figure 8 As shown, for each of the n redundant nodes, the redundant node obtains the synchronization data of the redundant process during the operation of the redundant process; based on the synchronization data of the redundant process, determining whether to adjust the priority of the redundant process and the second redundant process; if it is determined to adjust the priority of the redundant process, then increasing the priority of the redundant process; or, if it is determined to adjust the priority of the second redundant process, then increasing the priority of the second redundant process includes:
[0181] Step S801: The redundant process calls the target function.
[0182] Step S802: The redundant process enters the redundant virtual machine middleware layer.
[0183] Step S803: Acquire synchronization data of the redundant process.
[0184] Step S804: Based on the synchronization data of the redundant process, determine whether the time difference between the running time of the redundant process and the running time of the second redundant process exceeds a first preset time threshold.
[0185] Step S805a: If the time difference between the running time of the redundant process and the running time of the second redundant process exceeds the first preset time threshold and the redundant process lags behind, the priority of the redundant process is increased.
[0186] Step S805b: If the time difference between the running time of the redundant process and the running time of the second redundant process exceeds the first preset time threshold and the second redundant process lags behind, the priority of the second redundant process is increased.
[0187] In this example, when the redundant process calls the target function, it enters the redundant virtual machine middleware layer. The redundant virtual machine obtains the synchronization data of the redundant process and compares the running time of the redundant process with the running time of the second redundant process. If the time difference between the running time of the redundant process and the running time of the second redundant process exceeds the first preset time threshold, and the redundant process is lagging, that is, the running time of the redundant process is less than the running time of the second redundant process, the priority of the redundant process is increased. If the time difference between the running time of the redundant process and the running time of the second redundant process exceeds the first preset time threshold, and the second redundant process is lagging, that is, the running time of the second redundant process is less than the running time of the redundant process, the priority of the second redundant process is increased.
[0188] For example, Fig. 9 As shown, when the redundant process calls the target function, it enters the redundant process synchronization module of the redundant virtual machine middleware layer. When the redundant process calls the target function, it returns and continues to run. The redundant process synchronization module wakes up the redundant virtual machine kernel thread and sends the process number of the redundant process to the redundant virtual machine kernel thread. The redundant virtual machine kernel thread obtains the running time of the redundant process through the redundant virtual machine CFS scheduler according to the process number and stores it in the redundant process synchronization buffer. The redundant virtual machine kernel thread compares the running time of the redundant process with the running time of the second redundant process to determine whether to adjust the priority of the redundant process and the second redundant process.
[0189] In some embodiments, according to the device to which the initial processing result of the redundant node is to be sent, that is, the device corresponding to the target service, the initial processing result is associated with a queue of the corresponding device created in advance. After the soft error protection device obtains the initial processing result sent to the same device in the queue, it determines the target result based on the n initial processing results.
[0190] As a possible implementation, Fig.10 and Figure 6b As shown, based on n initial processing results, the target result is determined, and the target result is output including:
[0191] Step S3031: Based on the n initial processing results, determine the types of the n initial processing results and the number of each type of initial processing results.
[0192] In the embodiment of the present application, the initial processing results of different redundant nodes may be the same or different. The same initial processing results belong to the same category, and different initial processing results belong to different categories. The soft error protection device thus determines the category of the initial processing results and the number of initial processing results of each category. Exemplarily, n=5, that is, the soft error protection device includes 5 redundant nodes, and the initial processing results of these 5 redundant nodes are 000, 000, 000, 010, and 001, respectively. Then, there are 3 categories of initial processing results in total, and the number of initial processing results of the category with an initial processing result of 000 is 3, the number of initial processing results of the category with an initial processing result of 010 is 1, and the number of initial processing results of the category with an initial processing result of 001 is 1.
[0193] In some embodiments, the initial processing results of different redundant nodes are compared bit by bit to determine whether the initial processing results of different redundant nodes are the same.
[0194] Step S3032: Detect whether there are initial processing results of different types whose number is greater than a second preset threshold.
[0195] In an embodiment of the present application, after the soft error protection device determines the types of initial processing results and the number of initial processing results of each type, the number of initial processing results of each type can be compared with a second preset threshold to determine whether there are initial processing results whose number is greater than the second preset threshold.
[0196] In some embodiments, the second preset threshold is set to in, is rounded down. That is, check whether there is a number greater than That is, it is detected whether there are initial processing results whose number is greater than half of the number of redundant nodes. For example, n=5, that is, the target business corresponds to 5 redundant nodes, then it is detected whether there are initial processing results whose number is greater than 2.
[0197] It should be noted that the soft error protection device performs the following steps differently according to different detection results. When it is detected that there are initial processing results with a number greater than the second preset threshold, steps S3033-S3035 are executed. When it is detected that there are no initial processing results with the second preset threshold, step S3036 is executed.
[0198] Step S3033: If there are initial processing results whose number is greater than the second preset threshold, the initial processing results whose number is greater than the second preset threshold are determined as target results, and the target results are output.
[0199] In an embodiment of the present application, if there are initial processing results whose number is greater than a second preset threshold, it is considered that the redundant node that obtains the initial processing result has not failed when processing the input data of the target business, so the initial processing result is determined as the target result and the target result is output.
[0200] For the example in step S3031, it is assumed that the second preset threshold is 2. For the category whose initial processing result is 000, the number of initial processing results is 3, which is greater than the second preset threshold. That is, if it is detected that there are initial processing results whose number is greater than the second preset threshold, and the initial processing result is 000, 000 is determined as the target result, and the target result is output.
[0201] Step S3034: Determine whether there is a faulty redundant node.
[0202] The faulty redundant nodes are other redundant nodes except the target redundant nodes; the target redundant nodes are redundant nodes corresponding to the initial processing results whose number is greater than the second preset threshold.
[0203] In the embodiment of the present application, if there are initial processing results whose number is greater than the second preset threshold, it is considered that the redundant virtual machine corresponding to the target service in the redundant node corresponding to the redundant processing result has not failed, that is, the redundant virtual machine corresponding to the target service in the target redundant node has not failed. If the initial processing results of the other redundant nodes except the target redundant node are different from the initial processing results of the target redundant node, it is considered that a soft error has occurred in the redundant virtual machine corresponding to the target service in the other redundant nodes except the target redundant node, and the other redundant nodes except the target redundant node are determined as failed redundant nodes.
[0204] Step S3035: If there is a faulty redundant node, the faulty redundant node is restored based on the target redundant node.
[0205] In an embodiment of the present application, if it is determined that there is a faulty redundant node, since the target redundant node has not failed, the faulty redundant node can be recovered based on the target redundant node. In some embodiments, the recovery of the faulty redundant node based on the target redundant node is to terminate the redundant virtual machine corresponding to the target business in the faulty redundant node and release the memory of the redundant virtual machine, that is, to kill the redundant virtual machine corresponding to the target business in the faulty redundant node. And by real-time migration, the redundant virtual machine corresponding to the target business in the target redundant node is copied to the faulty redundant node.
[0206] In some technologies, only the failed redundant virtual machine processes can be recovered, the recovery granularity is coarse, and the recovery overhead is large.
[0207] In the embodiment of the present application, there are two recovery granularities, and the faulty redundant process can be recovered or the faulty redundant node can be recovered according to different situations, thereby reducing the recovery processing overhead.
[0208] The fault recovery process of the redundant node whose number of errors does not exceed the preset number threshold in step S608 can be performed after determining that the target redundant node exists. For the redundant virtual machine corresponding to the target business in the redundant node, the redundant virtual machine is terminated and the redundant virtual machine memory is released, that is, the redundant virtual machine is killed. And the redundant virtual machine corresponding to the target business in the target redundant node is copied to the redundant node whose number of errors does not exceed the preset number threshold by means of real-time migration.
[0209] It should be noted that the execution order of step S3033 and steps S3034-S3035 is not limited in this application. Steps S3034-S3035 may be executed first, and then step S3033; step S3033 may be executed first, and then steps S3034-S3035; steps S3034-S3035 and step S3033 may also be executed simultaneously. Only one case is illustrated in the figure.
[0210] Step S3036: If there are no initial processing results whose number is greater than the second preset threshold, an error prompt message is output.
[0211] In the embodiment of the present application, if there are no initial processing results whose number is greater than the second preset threshold, the target result cannot be determined. At this time, the soft error protection device outputs an error prompt message.
[0212] In some embodiments, if there are no initial processing results whose number is greater than the second preset threshold, it is impossible to determine that no redundant nodes have failed and the target result cannot be determined, so the soft error protection device reprocesses the input data of the target service.
[0213] As a possible implementation method, since it is generally difficult for redundant virtual machines on different redundant nodes to keep the running timing synchronized, which will affect the running timing of redundant processes in the redundant virtual machines, in order to reduce this impact and facilitate the determination of the target result based on the initial processing result of each redundant node, the time when the redundant nodes corresponding to the target business output the initial processing results is made consistent, so that the running progress of the redundant virtual machines corresponding to the target business in the redundant nodes corresponding to the target business is made consistent, such as Fig.11 As shown, the above soft error protection method also includes:
[0214] Step S1101: for each redundant virtual machine of each redundant node among n redundant nodes, obtain synchronization data of the redundant virtual machine;
[0215] In the embodiment of the present application, the synchronization data of the redundant virtual machine can reflect the running progress of the redundant virtual machine. The redundant node obtains the synchronization data of the redundant virtual machine during the running process of the redundant virtual machine without interrupting the running of the redundant virtual machine.
[0216] As a possible implementation method, obtaining synchronization data of redundant virtual machines includes:
[0217] When an exit event occurs in the redundant virtual machine, synchronization data of the redundant virtual machine is obtained.
[0218] In the embodiment of the present application, the redundant virtual machine can only run in user mode and cannot perform privileged operations. When the redundant virtual machine needs to perform privileged operations, the redundant virtual machine will have an exit event and enter the VMM of the redundant node. The VMM of the redundant node can capture the redundant virtual machine exit event and obtain the synchronization data of the redundant virtual machine.
[0219] As a possible implementation, the synchronization data of the redundant virtual machine includes the running time of the redundant virtual machine and the running time of other redundant virtual machines; wherein the other redundant virtual machines refer to redundant virtual machines other than the redundant virtual machine that run the same service as the redundant virtual machine.
[0220] In the embodiment of the present application, it is necessary to compare the running time of redundant virtual machines running the same service, so the synchronization data of the redundant virtual machines includes the running time of the redundant virtual machine and the running time of other redundant virtual machines.
[0221] In some technologies, the running progress of a redundant virtual machine is compared with other redundant virtual machines by comparing the hash results of the address spaces of the redundant virtual machines and other redundant virtual machines. This will introduce a large overhead in large-scale business system scenarios and reduce the responsiveness of the target business.
[0222] However, the embodiment of the present application can compare the running progress of the redundant process and the running progress of the second redundant process with relatively small overhead.
[0223] As a possible implementation manner, when an exit event occurs in a redundant virtual machine, obtaining synchronization data of the redundant virtual machine includes:
[0224] When an exit event occurs in a redundant virtual machine, synchronization data of the redundant virtual machine is obtained, and the running time of the redundant virtual machine is sent to other redundant nodes.
[0225] In an embodiment of the present application, when a redundant virtual machine exits, synchronization data of the redundant virtual machine is obtained, and the running time of the redundant virtual machine is sent to other redundant nodes. In this way, other redundant nodes can obtain the running time of the redundant virtual machine.
[0226] In some embodiments, different redundant nodes communicate with each other via a bus or a network.
[0227] Step S1102: Determine whether to adjust the priority of the redundant virtual machine based on the synchronization data of the redundant virtual machine.
[0228] In the embodiment of the present application, the synchronization data of the redundant virtual machine can reflect the running progress of the redundant virtual machine corresponding to the target business, so it can be determined whether to adjust the priority of the redundant virtual machine based on the synchronization data of the redundant virtual machine.
[0229] As a possible implementation manner, determining whether to adjust the priority of the redundant virtual machine based on the synchronization data of the redundant virtual machine includes:
[0230] Based on the synchronization data of the redundant virtual machine, determine whether the running time of the redundant virtual machine is less than the running time of other redundant virtual machines; if so, determine whether the time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines exceeds a second preset time threshold; if so, determine to adjust the priority of the redundant virtual machine.
[0231] In the embodiment of the present application, after obtaining the synchronization data of the redundant virtual machine, the running time of the redundant virtual machine is compared with the running time of other processes. If it is determined that the running time of the redundant virtual machine is less than the running time of other redundant virtual machines, it means that the running progress of the redundant virtual machine lags behind the running progress of other redundant virtual machines. The time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines is compared with the second preset time threshold. If the time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines exceeds, that is, is greater than, the second preset time threshold, it means that the gap between the running progress of the redundant virtual machine and the running progress of other redundant virtual machines is too large, and it is determined to adjust the priority of the redundant virtual machine.
[0232] If the time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines does not exceed, that is, is not greater than, the second time threshold, it is considered that the initial processing result of the redundant node where the redundant virtual machine is located and the initial processing results of the redundant nodes where the other redundant virtual machines are located can be output synchronously, and it is determined not to adjust the running time of the redundant virtual machine.
[0233] If the running time of the redundant virtual machine is greater than the running time of other redundant virtual machines, it means that the running progress of the redundant virtual machine is ahead of the running progress of other redundant virtual machines. At this time, it is determined not to adjust the priority of the redundant virtual machine.
[0234] In order to improve the operation efficiency, the comparison between the running time of the redundant virtual machine and the running time of the second redundant virtual machine is non-blocking. If the synchronization data of the redundant virtual machine only includes the running time of the redundant virtual machine, and does not include the running time of other redundant virtual machines, it means that the other redundant virtual machines have not had an exit event. At this time, it is determined not to adjust the priority of the redundant virtual machine and the other redundant virtual machines.
[0235] Step S1103: If it is determined to adjust the priority of the redundant virtual machine, the priority of the redundant virtual machine is increased.
[0236] In an embodiment of the present application, if it is determined to adjust the priority of the redundant virtual machine, it means that the time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines is greater than the second preset time threshold, and the running progress of the redundant virtual machine lags behind the running progress of other redundant virtual machines and the gap is too large. At this time, the priority of the redundant virtual machine can be increased so that the running progress of the redundant virtual machine is consistent with the running progress of other redundant virtual machines.
[0237] In some embodiments, the priority of a redundant virtual machine may be increased by adjusting the process priority in the PCB of the redundant virtual machine.
[0238] It should be noted that if the priorities of the redundant virtual machines in multiple redundant nodes are all determined to be adjusted, then for each of the redundant nodes, the priority of the redundant virtual machine in the redundant node is increased respectively.
[0239] The embodiments of the present application can compare the running progress of the redundant process and the running progress of the second redundant process with relatively small overhead, and make the running progress of the redundant process and the second redundant process tend to be consistent through simple operations.
[0240] For example, Fig.12 As shown, for each redundant virtual machine of each redundant node in the n redundant nodes, the synchronization data of the redundant virtual machine is obtained; based on the synchronization data of the redundant virtual machine, it is determined whether to adjust the priority of the redundant virtual machine; if so, increasing the priority of the redundant virtual machine includes:
[0241] Step 1201: A redundant virtual machine exit event occurs.
[0242] Step 1202: The redundant virtual machine exit event enters the VMM. Step 1203: Acquire the synchronization data of the redundant virtual machine.
[0243] Step 1204: Based on the synchronization data of the redundant virtual machine, determine whether the running time of the redundant virtual machine is less than the running time of other redundant virtual machines.
[0244] Step 1205: If yes, determine whether the time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines exceeds a second preset time threshold.
[0245] Step 1206: If yes, increase the priority of the redundant virtual machine.
[0246] In this example, when the redundant virtual machine exits and enters the VMM, the redundant node obtains the synchronization data of the redundant virtual machine. Based on the synchronization data of the redundant virtual machine, it is determined whether the running time of the redundant virtual machine is less than the running time of other redundant virtual machines. When it is determined that the running time of the redundant virtual machine is less than the running time of other redundant virtual machines, it is determined whether the time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines exceeds a second preset time threshold. If it is determined that the time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines exceeds the second preset time threshold, the priority of the redundant virtual machine is increased.
[0247] For example, Fig.13 As shown, it is assumed that the VMM is a KVM-QEMU (Kernel-based Virtual Machine-Quick Emulator, kernel-based virtual machine-virtual operating system simulator) module. The redundant virtual machine synchronization module of the redundant node host creates a network IO thread and initializes the corresponding resources. The thread runs in the background and is used to send the running time of the redundant virtual machine to other redundant nodes, receive the running time of the redundant virtual machines of other redundant nodes and update it to the redundant virtual machine synchronization buffer. When a redundant virtual machine exit event occurs in the redundant virtual machine, the KVM-QEMU module captures and processes the exit event and notifies the redundant virtual machine synchronization module to process it. At the same time, if the KVM-QEMU module completes the processing of the redundant virtual machine exit event, the redundant virtual machine resumes operation. The redundant virtual machine synchronization module wakes up the host kernel thread and passes the redundant virtual machine identifier. The host kernel thread obtains the running time of the redundant virtual machine from the CFS scheduler according to the redundant virtual machine identifier and stores it in the redundant virtual machine synchronization buffer, and sends the running time of the redundant virtual machine to other redundant nodes through the network IO thread. The host kernel thread compares the running time of the redundant virtual machine with the running time of other redundant virtual machines to determine whether to adjust the priority of the redundant virtual machine.
[0248] As a possible implementation manner, the target service includes an error-sensitive service.
[0249] In the embodiment of the present application, error-sensitive services have high requirements for reliability, so error-sensitive services are run on n redundant nodes to improve reliability. For example, error-sensitive services include data processing, parallel computing and other services.
[0250] As a possible implementation, Fig.14 As shown, the above soft error protection method also includes:
[0251] Step S1401: Acquire input data of a non-target service, and transmit the input data of the non-target service to a redundant node corresponding to the non-target service.
[0252] In the embodiment of the present application, the non-target service includes an error-insensitive service, such as an audio and video service and other services that interact with users. For the non-target service, it only needs to be run on one redundant node. Therefore, after obtaining the input data of the non-target service, the input data of the non-target service is transmitted to a redundant node corresponding to the non-target service.
[0253] Step S1402: The redundant node corresponding to the non-target service processes the input data of the non-target service, obtains an initial processing result, and outputs it.
[0254] In the embodiment of the present application, the host of the redundant node corresponding to the non-target service provides the input data of the non-target service to the corresponding virtual machine in the redundant node. The corresponding virtual machine in the redundant node processes the input data of the non-target service to obtain an initial processing result. The specific steps can be referred to step S302 and will not be repeated here. After a redundant node corresponding to the non-target service obtains the initial processing result, the initial processing result is used as the final result of the non-target service and outputted.
[0255] For example, Fig.15a As shown, assuming n=3, that is, the target business is an error-sensitive business, and the target business corresponds to three redundant nodes, namely redundant node A, redundant node B, and redundant node C. Each of the three redundant nodes contains a redundant virtual machine corresponding to the target business, namely redundant virtual machine A1, redundant virtual machine B1, and redundant virtual machine C1. Each of the three redundant virtual machines contains three redundant processes. The non-target business is a non-sensitive business, corresponding to redundant node A, redundant node A contains a redundant virtual machine corresponding to the non-target business, and redundant virtual machine A2 contains three redundant processes.
[0256] For the target business, the three redundant processes of each of the three redundant virtual machines on the corresponding three redundant nodes respectively process the input data of the target business to obtain three redundant processing results, and the corresponding redundant node determines the initial processing result of the redundant node based on the three redundant processing results. The three redundant nodes obtain three initial processing results, and based on the three initial processing results, determine the target result and output it.
[0257] Assume that the first preset threshold is 1 and the second preset threshold is 1. Fig.15bAs shown, for the target service in this example, the soft error protection method includes:
[0258] Step SB01, create 3 redundant virtual machines and 9 redundant processes.
[0259] In this example, a redundant virtual machine A1 is created on redundant node A, a redundant virtual machine B1 is created on redundant node B, and a redundant virtual machine C1 is created on redundant node C. Three redundant processes are created on redundant virtual machine A1, three redundant processes are created on redundant virtual machine B1, and three redundant processes are created on redundant virtual machine C1.
[0260] Step SB02, 9 redundant processes process the input data of non-target business respectively to obtain redundant processing results of each redundant process.
[0261] Step SB03: The redundant process calls the output function to enter the redundant virtual machine middleware layer.
[0262] Step SB04: The redundant node determines the type of redundant processing results and the number of each type of redundant processing results based on the redundant processing results of each redundant process.
[0263] Step SB05: Detect whether there are redundant processing results of different types with a number greater than 1.
[0264] In this example, it is detected whether there are redundant processing results whose number is greater than or equal to 2.
[0265] Step SB06: If there are redundant processing results whose number is greater than 1, the redundant processing results whose number is greater than 1 are determined as the initial processing results of the redundant node and output.
[0266] In this example, redundant processing results whose number is greater than or equal to 2 are determined as initial processing results of the redundant nodes.
[0267] Step SB07: Determine whether there is a faulty redundant process.
[0268] In this example, the situation where there is a faulty redundant process is that there are two redundant processing results, one of which has a number of 2 and the other has a number of 1. The redundant process corresponding to the redundant processing result having a number of 1 is a faulty redundant process.
[0269] Step SB08: If there is a faulty redundant process, perform fault recovery processing on the faulty redundant process.
[0270] Step SB09: Based on the three initial processing results, determine the types of the three initial processing results and the number of each type of initial processing results.
[0271] Step SB10: Detect whether there are initial processing results of different types whose number is greater than 1.
[0272] In this example, it is detected whether there are initial processing results whose number is greater than or equal to 2.
[0273] Step SB11: If there are initial processing results greater than 1 in number, determine the initial processing results greater than 1 as target results, and output the target results.
[0274] Step SB12: Determine whether there is a faulty redundant node.
[0275] In this example, the situation where there is a faulty redundant node is that there are two initial processing results, one of which has a number of 2 and the other has a number of 1. The redundant node corresponding to the initial processing result having a number of 1 is the faulty redundant node.
[0276] Step SB13: If there is a faulty redundant node, restore the faulty redundant node based on the target redundant node.
[0277] In this example, the redundant virtual machine corresponding to the target service in the failed redundant node is restored.
[0278] For non-target services, three redundant processes in the redundant virtual machines on the corresponding redundant nodes process the input data of the non-target services respectively to obtain three redundant processing results. The redundant node determines and outputs the initial processing result of the redundant node based on the three redundant processing results.
[0279] Assume that the first preset threshold is 1, such as Fig.15c As shown, for the non-target service in this example, the soft error protection method includes:
[0280] Step SC1: Create one redundant virtual machine and three redundant processes.
[0281] In this example, a redundant virtual machine A2 is created on the redundant node A, and three redundant processes are created on the redundant virtual machine A2.
[0282] Step SC2: The three redundant processes process the input data of the non-target business respectively to obtain the redundant processing results of each redundant process.
[0283] Step SC3: The redundant process calls the output function to enter the redundant virtual machine middleware layer.
[0284] Step SC4: The redundant node determines the type of redundant processing results and the number of each type of redundant processing results based on the redundant processing results of each redundant process.
[0285] Step SC5: Detect whether there are redundant processing results of different types whose number is greater than 1.
[0286] In this example, it is detected whether there are redundant processing results whose number is greater than or equal to 2.
[0287] Step SC6: If there are redundant processing results whose number is greater than 1, determine the redundant processing results whose number is greater than 1 as the initial processing results of the redundant node and output them.
[0288] In this example, redundant processing results whose number is greater than or equal to 2 are determined as initial processing results of redundant nodes and output.
[0289] Step SC7: Determine whether there is a faulty redundant process.
[0290] In this example, the situation where there is a faulty redundant process is that there are two redundant processing results, one of which has a number of 2 and the other has a number of 1. The redundant process corresponding to the redundant processing result having a number of 1 is a faulty redundant process.
[0291] Step SC8: If there is a faulty redundant process, perform fault recovery processing on the faulty redundant process.
[0292] For example, Fig.16 As shown, assuming n=3, that is, the target business corresponds to three redundant nodes, namely redundant node D, redundant node E, and redundant node F. Each of the three redundant nodes contains a redundant virtual machine corresponding to the target business, namely redundant virtual machine D1, redundant virtual machine E1, and redundant virtual machine F1. Each of the three redundant virtual machines contains two redundant processes. Compared with the previous example, this example reduces resource consumption by one third. However, if the redundant processing results of the two redundant processes contained in the redundant virtual machines of a redundant node are inconsistent, the initial processing result cannot be determined, and the redundant process that has failed cannot be determined. Assuming that the redundant processing results of the two failed redundant processes contained in the redundant virtual machine D1 are inconsistent, at this time, based on the n initial processing results, determining the target result, and outputting the target result includes: based on the two redundant processing results of the redundant virtual machine D1, the initial processing result of the redundant virtual machine E1, and the initial processing result of the redundant virtual machine F1, determining the target result and outputting it. Compare the two redundant processing results of the redundant virtual machine D1 with the target result, and perform fault recovery processing on the redundant process whose redundant processing result is inconsistent with the target result.
[0293] Similarly, if the redundant processing results of the two redundant processes included in the redundant virtual machines of the two redundant nodes are inconsistent, the initial processing result cannot be determined, and the redundant process that has failed cannot be determined. In this case, determining the target result based on the n initial processing results and outputting the target result includes: determining and outputting the target result based on four redundant processing results and one initial processing result. Comparing the above two redundant processing results with the target result, and performing fault recovery processing on the redundant process whose redundant processing result is inconsistent with the target result.
[0294] If, for each of the redundant virtual machines of the three redundant nodes, the redundant processing results of the two redundant processes included in the redundant virtual machines are inconsistent, then the target result cannot be determined and an error message is prompted.
[0295] refer to Fig.17 , is a schematic diagram of the structure of a soft error protection device provided in an embodiment of the present application. Figure 8 As shown, the device comprises:
[0296] The redundant node 10 is used to process the input data of the target service to obtain an initial processing result.
[0297] The second-level voting unit 20 is used to obtain the input data of the target business and transmit the input data of the target business to n redundant nodes corresponding to the target business; wherein n is an integer greater than 2; each redundant node contains at least one redundant virtual machine, and each redundant virtual machine contains a redundant process.
[0298] The second-level voting unit 20 is further used to determine the target result based on the n initial processing results and output the target result.
[0299] As a possible implementation method, the second-level voting unit 20 is specifically used to determine the types of n initial processing results and the number of each type of initial processing results based on the n initial processing results; detect whether there are initial processing results of different types whose number is greater than a second preset threshold; if so, determine the initial processing results whose number is greater than the second preset threshold as the target result, and output the target result.
[0300] As a possible implementation, the second-level voting unit 20 is specifically configured to output an error prompt message if there are no initial processing results whose number is greater than the second preset threshold.
[0301] As a possible implementation method, the redundant node 10 is specifically used for the redundant processes of each redundant virtual machine in the redundant node to process the input data of the target business respectively to obtain the redundant processing results of each redundant process; the redundant node determines the initial processing result of the redundant node based on the redundant processing results of each redundant process.
[0302] like Fig.17 As shown, the redundant node 10 includes:
[0303] The redundant virtual machine 101 is used for the redundant processes of the redundant virtual machine to process the input data of the target service respectively to obtain the redundant processing results of each redundant process.
[0304] The second-level voting management unit 102 is located at the user layer of the redundant node host and is used to redirect the initial processing results from the redundant virtual machines and output the initial processing results to the second-level voting unit 20 .
[0305] As a possible implementation, the second-level voting management unit 102 is specifically configured to associate the initial processing result of the redundant node with a pre-created queue of the corresponding device according to the device to which the initial processing result of the redundant node is to be sent, ie, the device corresponding to the target service.
[0306] As a possible implementation method, the second-level voting management unit 102 is specifically used to determine whether there is a faulty redundant node; wherein the faulty redundant node is a redundant node other than the target redundant node; the target redundant node is a redundant node corresponding to the initial processing result whose number is greater than a second preset threshold; if it exists, the faulty redundant node is recovered based on the target redundant node.
[0307] The redundant virtual machine synchronization unit 103 is located in the kernel layer of the redundant node host and is used to obtain the synchronization data of the redundant virtual machine; based on the synchronization data of the redundant virtual machine, determine whether to adjust the priority of the redundant virtual machine; if it is determined to adjust the priority of the redundant virtual machine, then increase the priority of the redundant virtual machine.
[0308] As a possible implementation method, the redundant virtual machine synchronization unit 103 is specifically used to obtain the synchronization data of the redundant virtual machine when an exit event occurs in the redundant virtual machine; determine whether to adjust the priority of the redundant virtual machine based on the synchronization data of the redundant virtual machine; if it is determined to adjust the priority of the redundant virtual machine, then increase the priority of the redundant virtual machine.
[0309] As a possible implementation, the synchronization data of the redundant virtual machine includes the running time of the redundant virtual machine and the running time of other redundant virtual machines; wherein other redundant virtual machines refer to redundant virtual machines other than the redundant virtual machine that run the same business as the redundant virtual machine.
[0310] As a possible implementation manner, the redundant virtual machine synchronization unit 103 is specifically configured to obtain synchronization data of the redundant virtual machine and send the running time of the redundant virtual machine to other redundant nodes when an exit event occurs in the redundant virtual machine.
[0311] Based on the synchronization data of the redundant virtual machine, determine whether the running time of the redundant virtual machine is less than the running time of other redundant virtual machines; if so, determine whether the time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines exceeds a second preset time threshold; if so, determine to adjust the priority of the redundant virtual machine.
[0312] like Fig.17 As shown, the redundant virtual machine 101 includes:
[0313] The redundant process 1011 is located in the user layer of the redundant virtual machine and is used to process the input data of the target business respectively to obtain the redundant processing results of the redundant process.
[0314] The first-level voting unit 1012 is located in the middleware layer of the redundant virtual machine and is used to determine the initial processing result of the redundant node based on the redundant processing result of each redundant process.
[0315] As a possible implementation method, the first-level voting unit 1012 is specifically used to determine the type of redundant processing results and the number of each type of redundant processing results based on the redundant processing results of each redundant process; detect whether there are redundant processing results of different types whose number is greater than a first preset threshold; if so, determine the redundant processing results whose number is greater than the first preset threshold as the initial processing results of the redundant node.
[0316] As a possible implementation method, the first-level voting unit 1012 is specifically used to output error identification information if the redundant node does not exist; based on the error identification information, update the number of errors of the redundant node; when the number of errors of the redundant node does not exceed the preset number threshold, perform fault recovery processing on the redundant node.
[0317] As a possible implementation manner, the first-level voting unit 1012 is specifically used to determine whether there is a faulty redundant process; wherein the faulty redundant process refers to other redundant processes other than the first redundant process running in the same redundant virtual machine as the first redundant process; the first redundant process is a redundant process corresponding to the redundant processing results whose number is greater than a first preset threshold; if it exists, the faulty redundant process is recovered based on the first redundant process.
[0318] The redundant process synchronization unit 1013 is located in the kernel layer of the redundant virtual machine and is used to obtain the synchronization data of the redundant process during the operation of the redundant process; based on the synchronization data of the redundant process, determine whether to adjust the priority of the redundant process and the second redundant process; wherein the second redundant process refers to other redundant processes other than the redundant process that run in the same redundant virtual machine as the redundant process; if it is determined to adjust the priority of the redundant process, then the priority of the redundant process is increased; or, if it is determined to adjust the priority of the second redundant process, then the priority of the second redundant process is increased.
[0319] As a possible implementation manner, the redundant process synchronization unit 1013 is specifically configured to obtain synchronization data of the redundant process during the process of the redundant process calling the target function.
[0320] As a possible implementation, the synchronization data of the redundant process includes the running time of the redundant process and the running time of the second redundant process; wherein the second redundant process refers to other redundant processes other than the redundant process that run in the same redundant virtual machine as the redundant process.
[0321] As a possible implementation manner, the redundant process synchronization unit 1013 is specifically used to determine, based on the synchronization data of the redundant process, whether the time difference between the running time of the redundant process and the running time of other target redundant processes exceeds a first preset time threshold; if it exceeds, and the running time of the redundant process is less than the running time of the second redundant process, determine to adjust the priority of the redundant process; or, if it exceeds, and the running time of the second redundant process is less than the running time of the redundant process, determine to adjust the priority of the second redundant process.
[0322] As a possible implementation manner, the target service includes an error-sensitive service.
[0323] As a possible implementation manner, the second-level voting unit 20 is specifically configured to obtain input data of non-target services, and transmit the input data of the non-target services to a redundant node corresponding to the non-target services.
[0324] The redundant node 10 is specifically used to process the input data of the non-target service, obtain the initial processing result, and output it.
[0325] Corresponding to the above embodiments, the present application also provides an electronic device. Fig.18A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, the electronic device 1800 may include: a processor 1801, a memory 1802 and a communication unit 1803. These components communicate through one or more buses, and those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiment of the present invention, it can be a bus structure or a star structure, and can also include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0326] The communication unit 1803 is used to establish a communication channel so that the electronic device can communicate with other devices, receive user data sent by other devices or send user data to other devices.
[0327] The processor 1801 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It runs or executes software programs and / or modules stored in the memory 1802, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 1801 can include only a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0328] The memory 1802 is used to store the execution instructions of the processor 1801. The memory 1802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0329] When the execution instructions in the memory 1802 are executed by the processor 1801, the electronic device 1800 can execute Figure 3 Some or all of the steps in the illustrated embodiments.
[0330] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the soft error protection method provided by the present invention. The storage medium may be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0331] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention or some parts of the embodiments.
[0332] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
Claims
1. A soft error protection method, It is characterized in that include: Obtain input data of a target business, and transmit the input data of the target business to n redundant nodes corresponding to the target business; wherein n is an integer greater than 2; each redundant node includes at least one redundant virtual machine, and each redundant virtual machine includes a redundant process; The n redundant nodes process the input data of the target service respectively to obtain n initial processing results; Based on the n initial processing results, a target result is determined, and the target result is output.
2. The method according to claim 1, It is characterized in that The n redundant nodes process the input data of the target service respectively, and obtain n initial processing results including: For each of the n redundant nodes, the redundant process of each redundant virtual machine in the redundant node processes the input data of the target service respectively to obtain a redundant processing result of each redundant process; The redundant node determines an initial processing result of the redundant node based on the redundant processing result of each redundant process.
3. The method according to claim 2, It is characterized in that The redundant node determines the initial processing result of the redundant node based on the redundant processing result of each redundant process, including: The redundant node determines the type of redundant processing results and the number of each type of redundant processing results based on the redundant processing results of each redundant process; Detecting whether there are redundant processing results of different types whose number is greater than a first preset threshold; If so, the redundant processing results whose number is greater than the first preset threshold are determined as the initial processing results of the redundant node.
4. The method according to claim 3, It is characterized in that Also includes: If it does not exist, the redundant node outputs error identification information; Based on the error identification information, updating the error count of the redundant node; When the number of errors of the redundant node does not exceed a preset number threshold, a fault recovery process is performed on the redundant node.
5. The method according to claim 3, It is characterized in that Also includes: Determine whether there is a faulty redundant process; wherein the faulty redundant process refers to other redundant processes other than the first redundant process that are running in the same redundant virtual machine as the first redundant process; the first redundant process is a redundant process corresponding to the redundant processing results whose number is greater than a first preset threshold; If so, the faulty redundant process is restored based on the first redundant process.
6. The method according to any one of claims 1 to 5, It is characterized in that Also includes: For each of the n redundant nodes, the redundant node obtains synchronization data of the redundant process during the running of the redundant process; Based on the synchronization data of the redundant process, determining whether to adjust the priority of the redundant process and the second redundant process; wherein the second redundant process refers to other redundant processes other than the redundant process running in the same redundant virtual machine as the redundant process; If it is determined to adjust the priority of the redundant process, then the priority of the redundant process is increased; or, If it is determined to adjust the priority of the second redundant process, the priority of the second redundant process is increased.
7. The method according to claim 6, It is characterized in that The redundant node acquiring synchronization data of the redundant process during the running of the redundant process includes: The redundant node obtains synchronization data of the redundant process during the process of the redundant process calling the target function.
8. The method according to claim 6 or 7, It is characterized in that The synchronization data of the redundant process includes the running time of the redundant process and the running time of the second redundant process; wherein the second redundant process refers to other redundant processes other than the redundant process that run in the same redundant virtual machine as the redundant process.
9. The method according to claim 8, It is characterized in that The determining whether to adjust the priority of the redundant process and the second redundant process based on the synchronization data of the redundant process includes: Based on the synchronization data of the redundant process, determining whether a time difference between an elapsed running time of the redundant process and an elapsed running time of the other target redundant process exceeds a first preset time threshold; If it exceeds, and the running time of the redundant process is less than the running time of the second redundant process, then determining to adjust the priority of the redundant process; or, If it exceeds, and the running time of the second redundant process is less than the running time of the redundant process, it is determined to adjust the priority of the second redundant process.
10. The method according to any one of claims 1 to 9, It is characterized in that The determining a target result based on the n initial processing results and outputting the target result comprises: Based on the n initial processing results, determining the types of the n initial processing results and the number of each type of initial processing results; Detecting whether there are initial processing results of different types whose number is greater than a second preset threshold value; If so, the initial processing results whose number is greater than the second preset threshold are determined as target results, and the target results are output.
11. The method according to claim 10, It is characterized in that Also includes: If there are no initial processing results whose number is greater than the second preset threshold, an error prompt message is output.
12. The method according to claim 10, It is characterized in that Also includes: Determine whether there is a faulty redundant node; wherein the faulty redundant node is a redundant node other than the target redundant node; the target redundant node is a redundant node corresponding to the initial processing result whose number is greater than a second preset threshold; If so, the failed redundant node is restored based on the target redundant node.
13. The method according to any one of claims 1 to 12, It is characterized in that Also includes: For each redundant virtual machine of each redundant node among the n redundant nodes, obtaining synchronization data of the redundant virtual machine; Determining whether to adjust the priority of the redundant virtual machine based on the synchronization data of the redundant virtual machine; If it is determined to adjust the priority of the redundant virtual machine, the priority of the redundant virtual machine is increased.
14. The method according to claim 13, It is characterized in that The acquiring synchronization data of the redundant virtual machine comprises: When an exit event occurs in the redundant virtual machine, synchronization data of the redundant virtual machine is obtained.
15. The method according to claim 13 or 14, It is characterized in that The synchronization data of the redundant virtual machine includes the running time of the redundant virtual machine and the running time of other redundant virtual machines; wherein other redundant virtual machines refer to redundant virtual machines other than the redundant virtual machine that run the same service as the redundant virtual machine.
16. The method according to claim 15, It is characterized in that When an exit event occurs in the redundant virtual machine, obtaining synchronization data of the redundant virtual machine includes: When an exit event occurs to the redundant virtual machine, synchronization data of the redundant virtual machine is acquired, and the running time of the redundant virtual machine is sent to other redundant nodes.
17. The method according to claim 15 or 16, It is characterized in that The determining whether to adjust the priority of the redundant virtual machine based on the synchronization data of the redundant virtual machine includes: Based on the synchronization data of the redundant virtual machine, determining whether the running time of the redundant virtual machine is less than the running time of other redundant virtual machines; If it is less than, determining whether the time difference between the running time of the redundant virtual machine and the running time of other redundant virtual machines exceeds a second preset time threshold; If it exceeds, it is determined to adjust the priority of the redundant virtual machine.
18. The method according to any one of claims 1 to 17, It is characterized in that The target service includes an error-sensitive service.
19. The method according to claim 18, It is characterized in that Also includes: Acquire input data of a non-target service, and transmit the input data of the non-target service to a redundant node corresponding to the non-target service; The redundant node corresponding to the non-target service processes the input data of the non-target service, obtains an initial processing result, and outputs it.
20. A soft error protection device, It is characterized in that include: The second-level voting unit is used to obtain input data of the target business and transmit the input data of the target business to n redundant nodes corresponding to the target business; wherein n is an integer greater than 2; A redundant node, used to process the input data of the target business to obtain n initial processing results; each redundant node includes at least one redundant virtual machine, and each redundant virtual machine includes a redundant process; The second-level voting unit is further used to determine a target result based on the n initial processing results, and output the target result.
21. An electronic device, It is characterized in that It comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method according to any one of claims 1 to 19.
22. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 19.
