An event scheduling method, device and medium for synchronizing redundant software units

CN116414535BActive Publication Date: 2026-10-27NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211488252.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-25
Publication Date
2026-10-27
Estimated Expiration
2042-11-25

Smart Images

  • Figure CN116414535B_ABST
    Figure CN116414535B_ABST
Patent Text Reader

Abstract

The application discloses a kind of event scheduling methods, equipment and medium of redundant software unit synchronization, belong to software system redundancy mechanism design field, including steps: to event registration framework increase synchronous related event state information, event identifier and decision callback function;Event state information is used to set event synchronization mode, event identifier is used to determine event uniqueness, as the keyword of decision, decision callback function provides decision message sending interface;Synchronous decision process is used to event processing framework to realize event synchronization.The application realizes the synchronous operation of redundant software unit, provides the possibility for the implementation of quasiparticle defense function;It can also be used for hot standby mechanism, when main software unit is abnormal, seamlessly switch to the standby software unit of synchronous operation, reduce the session reconstruction and packet loss possibly caused by main / standby switching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software system redundancy mechanism design, and more specifically, to an event scheduling method, device and medium for synchronizing redundant software units. Background Technology

[0002] Redundancy technology enables system operation to be unaffected by partial failures, significantly improving system reliability and availability, and effectively avoiding economic losses caused by production stoppages or equipment damage due to random failures. Network devices employ redundancy mechanisms to provide hot standby capabilities, thereby enhancing reliability. Mimicry defense systems utilize a heterogeneous redundant architecture to defend against unknown vulnerabilities and security threats.

[0003] Synchronizing software units within redundancy mechanisms presents a significant technical challenge. Traditional redundancy technologies typically send software data to backup redundant units periodically, performing a switchover in case of anomalies. However, factors such as system time, protocol random numbers, and CPU scheduling can cause time differences in event occurrence between redundant units. When these time differences reach milliseconds or more, inconsistencies in data packet output, data loss, and redundant protocol sessions can occur, impacting the accuracy of adjudication outputs in mimicry defense and resulting in prolonged switchover times. Therefore, a highly reliable software unit synchronization scheme is urgently needed to address the issue of software discrepancies between redundant units. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide an event scheduling method, device, and medium for synchronizing redundant software units, enabling the synchronous operation of redundant software units and providing a possibility for the realization of mimicry defense functions; it can also be used in hot standby mechanisms, seamlessly switching to a synchronously running backup software unit when the primary software unit fails, reducing session reconstruction and packet loss that may occur during primary-backup switching, and improving reliability; it can avoid the situation of missing timer callbacks and gradual accumulation of time deviations caused by operating system scheduling, avoid a large number of internal communication messages caused by the adjudication method, and reduce overhead, etc.

[0005] The objective of this invention is achieved through the following approach:

[0006] An event scheduling method for synchronizing redundant software units includes the following steps:

[0007] The event registration framework is enhanced with synchronization-related event status information, event identifiers, and adjudication callback functions. The event status information is used to set the event synchronization method, the event identifier is used to determine the uniqueness of the event and serves as the keyword for adjudication, and the adjudication callback function provides an interface for sending adjudication messages.

[0008] The event handling framework employs a synchronous adjudication process to achieve event synchronization.

[0009] Furthermore, the synchronous adjudication process includes the following sub-steps:

[0010] S1: When registering events that require adjudication, record synchronization-related information and ensure that the event identifiers are unique among redundant protocol units; set a callback function for sending adjudication messages and record the time status as the initial state;

[0011] S2: When an event requiring adjudication occurs, the event synchronization adjudication callback function is invoked to send an adjudication request; the voter analyzes the sent adjudication request message, compares the event identifiers, and determines success if they arrive simultaneously within a set time range, otherwise it fails, and the judgment result is fed back to the redundant software unit by the negative feedback controller;

[0012] S3: After receiving the judgment result, the redundant software unit finds the corresponding event thread through the event identifier and calls the event callback function to complete the event processing; events that do not receive a successful response to the event judgment are judged as unsynchronized events and are deleted or timed out according to the event type.

[0013] Furthermore, following the steps of the synchronization decision process, the method further includes the step of adjusting the periodic timer for minor deviations caused by processor performance and scheduling, based on the time consistency of the redundant software unit system.

[0014] Furthermore, in step S2, the redundant software unit does not have any form of interactive communication link or connection method.

[0015] Furthermore, the adjustment of the periodic timer due to minor deviations caused by processor performance and scheduling specifically involves: adjusting the event processing framework using a periodic timer, recording the time of occurrence and the last timer time, comparing it with the local time to calculate the relative time, and using the relative time to determine whether the event occurrence condition has been met.

[0016] Furthermore, the relative time is on the order of microseconds.

[0017] Furthermore, the application steps include: when the primary software unit fails, the event scheduling method for synchronizing redundant software units is used to switch to the synchronously running backup software unit for hot standby mechanism.

[0018] Furthermore, the application steps include: in a network device containing redundant software units, the event scheduling method for synchronizing the redundant software units is used to achieve synchronous operation of the redundant software units, thereby realizing the mimicry defense function.

[0019] A computer device includes a processor and a memory, wherein program instructions are stored in the memory, and when the program instructions are loaded and run by the processor, an event scheduling method for synchronizing redundant software units as described above is executed.

[0020] A computer-readable storage medium includes a memory storing program instructions that, when loaded and executed by a processor, perform an event scheduling method for synchronizing redundant software units as described above.

[0021] The beneficial effects of this invention include:

[0022] The technical solution of this invention can realize the synchronous operation of redundant software units in network devices containing redundant software units, providing the possibility for the realization of mimicry defense function; the technical solution of this invention can also be used in hot standby mechanism, seamlessly switching to the synchronously running backup software unit when the primary software unit fails, reducing session reconstruction and packet loss that may be caused by primary-backup switching, and the reliability is very high.

[0023] The periodic timer adjustment method of the present invention is suitable for periodic timers with short time intervals, avoiding the situation of missing timer callbacks and gradual accumulation of time deviations caused by operating system scheduling, avoiding a large number of internal communication messages caused by the arbitration method, and reducing overhead. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 A diagram of redundant software architecture;

[0026] Figure 2 For traditional event scheduling frameworks;

[0027] Figure 3 This invention provides an event scheduling framework for synchronizing redundant software units.

[0028] Figure 4 This is a flowchart of the synchronous adjudication method according to an embodiment of the present invention. Detailed Implementation

[0029] All features disclosed in all embodiments of this specification, or steps in all methods or processes implied in the disclosure, may be combined and / or extended or replaced in any way, except for mutually exclusive features and / or steps.

[0030] In the process of considering how to solve the problems mentioned in the background, the inventors of this invention discovered the following technical problem: Redundancy mechanisms are methods that increase system resources to improve system reliability, enabling the system to continue performing its designated functions even in the event of a fault or failure, thereby achieving varying degrees of fault tolerance. Redundancy mechanisms are typically used in scenarios with high requirements for equipment reliability and security, such as data communication equipment and security protection equipment employing mimicry defense mechanisms.

[0031] Mimicry redundant software architecture, such as Figure 1 As shown, a device with a mimicry redundancy architecture contains multiple sets of redundant software units. Each set contains the necessary management and control software. As redundant executors, these software units must achieve a high degree of operational synchronization to ensure consistent output vectors (protocol messages, forwarding tables, etc.) for correctness determination through an adjudication mechanism, thus obtaining real-time and accurate output from the device. The main factors affecting software operation and output are events, including external events, internal events, and timer events. External events are synchronized by the dispatcher, while internal events and timer events are affected by processor performance, operating system scheduling, and system time, leading to discrepancies that require synchronization modifications. Typically, a device contains dozens of different software programs, each with varying implementation principles and methods. Synchronizing each software unit individually would be extremely labor-intensive, and extensive software modifications could also affect the correctness of the individual software units.

[0032] In view of the aforementioned technical problems, the inventors of this invention, after creative thinking, proposed a new solution, including the inventive concept of modifying the common module of the software unit—the "event scheduling framework"—to achieve synchronized operation of redundant software. Its advantages are that the software framework remains unchanged, code modifications are minimal, synchronization is high, and the correctness of the software unit's operation is not affected. The specific implementation includes improvements to both the event scheduling framework and the event handling framework.

[0033] An event scheduling framework refers to the methods for handling read / write events, timer events, etc., in software implementation. It typically provides time management functions and a listening mechanism, as well as priority control for unexpected events and high-level handling of such events. A good event management framework uses a reflection pattern (i.e., a callback function mechanism) for event listening and management, such as... Figure 2 As shown. To support the synchronous operation of redundant software, the technical solution of this invention modifies the traditional event scheduling framework, as follows: Figure 3As shown (in the event registration framework on the left side of the figure, the darkest parts, such as event status, event identifier, and adjudication callback function, are all new additions to the technical solution of this invention). Synchronization-related event information is added during event registration. Event status information is used to set the event synchronization method; the event identifier is used to determine the uniqueness of the event and serves as the keyword for adjudication; the adjudication callback function provides an interface for sending adjudication messages; an event scheduling method for synchronizing redundant software units is added, and the event processing framework flow is modified, using synchronous adjudication and periodic timer local time adjustment methods to achieve event synchronization.

[0034] Improvements to event scheduling methods include the addition of a synchronous adjudication process and adjustments to the periodic timer, such as... Figure 3 As shown (the darkest part in the event handling framework on the right of the figure, such as the synchronous adjudication and periodic timer event adjustment, are all new additions to the technical solution of this invention), are described in detail below;

[0035] (1) Simultaneous adjudication method

[0036] Event synchronization is a prerequisite for ensuring state machine synchronization and output synchronization. Events include external events such as input protocol messages, internal events such as changes in device hardware and software states, and internal timers within software units. Although the distributor basically guarantees the synchronization of external input protocol message events, due to differences in processor performance and operating system scheduling, the timers and internal events of redundant software units may occur at different times and in different orders, leading to output differences. Synchronization arbitration can achieve a greater degree of event synchronization. The synchronization arbitration process designed in this invention is as follows: Figure 4 As shown, the specific steps include the following:

[0037] Step a: When registering an event that needs to be adjudicated, record the synchronization-related information to ensure that the event identifier is unique among redundant protocol units, which can be used for event identification during synchronization adjudication; set the callback function for sending adjudication messages; and record the time status as the initial state.

[0038] Step b: When an event requiring adjudication occurs, instead of directly calling the event callback function, call the event synchronous adjudication callback function to send an adjudication request.

[0039] Step c: The redundant software unit does not have any form of interactive communication link or connection method. The adjudication work is completed by the voter. The voter analyzes the adjudication request message sent by the redundant protocol unit, compares the event identifiers, and determines success when they arrive simultaneously within a certain time range. The adjudication result is fed back to the redundant software unit by the negative feedback controller.

[0040] Step d: After receiving the ruling, the software unit finds the corresponding event thread through the event identifier and calls the event callback function to complete the event processing.

[0041] Step e: Events for which no successful event adjudication response is received are classified as out-of-synchronization events and are either deleted or timed out based on the event type.

[0042] (2) Periodic timer time adjustment method

[0043] The synchronous adjudication method achieves event synchronization by sending adjudication request messages and receiving adjudication response messages. This method introduces internal communication overhead, which can become excessive when there are many periodic timers. To address this, a method for adjusting the local time of periodic timers is introduced. This method uses the system time (which is consistent with the system time of redundant software units) as a benchmark to adjust for minor deviations caused by processor performance and scheduling. This prevents the accumulation of deviations in periodic timers from resulting in large deviations and thus causing inconsistent outputs.

[0044] The periodic timer adjustment method precisely records the occurrence time and the last timer time, compares it with the local time to calculate the relative time, and uses the microsecond-level relative time to determine whether the event occurrence condition has been met, thereby more accurately ensuring the synchronous operation of heterogeneous executors. In a specific implementation, the process is as follows:

[0045]

[0046]

[0047] The periodic timer adjustment method is suitable for periodic timers with short time intervals. It avoids the situation where timer callbacks are missing and time deviations gradually accumulate due to operating system scheduling, and avoids a large number of internal communication messages caused by the arbitration method.

[0048] In summary, the event scheduling technology solution for redundant software unit synchronization provided by the embodiments of the present invention can realize the synchronous operation of redundant software units in network devices containing redundant software units, providing a possibility for the realization of mimicry defense function; the technical solution of the embodiments of the present invention can also be used in hot standby mechanisms, seamlessly switching to the synchronously running backup software unit when the primary software unit fails, reducing session reconstruction and packet loss that may be caused by primary-backup switching.

[0049] Example 1

[0050] An event scheduling method for synchronizing redundant software units includes the following steps:

[0051] The event registration framework is enhanced with synchronization-related event status information, event identifiers, and adjudication callback functions. The event status information is used to set the event synchronization method, the event identifier is used to determine the uniqueness of the event and serves as the keyword for adjudication, and the adjudication callback function provides an interface for sending adjudication messages.

[0052] The event handling framework employs a synchronous adjudication process to achieve event synchronization.

[0053] Example 2

[0054] Based on Example 1, the synchronous adjudication process includes the following sub-steps:

[0055] S1: When registering events that require adjudication, record synchronization-related information and ensure that the event identifiers are unique among redundant protocol units; set a callback function for sending adjudication messages and record the time status as the initial state;

[0056] S2: When an event requiring adjudication occurs, the event synchronization adjudication callback function is invoked to send an adjudication request; the voter analyzes the sent adjudication request message, compares the event identifiers, and determines success if they arrive simultaneously within a set time range, otherwise it fails, and the judgment result is fed back to the redundant software unit by the negative feedback controller;

[0057] S3: After receiving the judgment result, the redundant software unit finds the corresponding event thread through the event identifier and calls the event callback function to complete the event processing; events that do not receive a successful response to the event judgment are judged as unsynchronized events and are deleted or timed out according to the event type.

[0058] Example 3

[0059] Based on Example 1, after the steps of the synchronization decision process, the following step is also included: adjusting the periodic timer for minor deviations caused by processor performance and scheduling, based on the time consistency of the redundant software unit system.

[0060] Example 4

[0061] Based on Example 2, in step S2, the redundant software unit does not have any form of interactive communication link and connection method.

[0062] Example 5

[0063] Based on Example 2, the adjustment of the periodic timer due to minor deviations caused by processor performance and scheduling is specifically as follows: the event processing framework is adjusted using a periodic timer. The relative time is calculated by recording the time of occurrence and the last timer time and comparing it with the local time. The relative time is used to determine whether the event occurrence condition has been met.

[0064] Example 6

[0065] Based on Example 5, the relative time is in the microsecond range.

[0066] Example 7

[0067] Based on Example 1, the following application steps are included: when the primary software unit fails, the event scheduling method for synchronizing redundant software units is used to switch to the synchronously running backup software unit for hot standby mechanism.

[0068] Example 8

[0069] Based on Example 1, the following application steps are included: In a network device containing redundant software units, the event scheduling method for synchronizing the redundant software units is used to realize the synchronous operation of the redundant software units, thereby achieving the mimicry defense function.

[0070] Example 9

[0071] A computer device includes a processor and a memory, in which program instructions are stored. When the program instructions are loaded and run by the processor, an event scheduling method for synchronizing redundant software units as described in any of Embodiments 1 to 8 is executed.

[0072] Example 10

[0073] A computer-readable storage medium includes a memory storing program instructions that, when loaded and run by a processor, execute an event scheduling method for synchronizing redundant software units as described in any of Embodiments 1 to 8.

[0074] The units described in the embodiments of the present invention can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0075] According to one aspect of this invention, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described above.

[0076] In another aspect, embodiments of the present invention also provide a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.

[0077] All parts not covered in this invention are the same as or can be implemented using existing technologies.

[0078] The above technical solution is only one embodiment of the present invention. For those skilled in the art, based on the application methods and principles disclosed in the present invention, it is easy to make various types of improvements or modifications, and not limited to the methods described in the above specific embodiments of the present invention. Therefore, the methods described above are only preferred and are not restrictive.

[0079] In addition to the examples above, other embodiments may be obtained by those skilled in the art based on the above disclosure or by making modifications using knowledge or technology in related fields. The features of each embodiment may be interchanged or replaced. Modifications and changes made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. An event scheduling method for synchronizing redundant software units, characterized in that, Includes the following steps: The event registration framework is enhanced with synchronization-related event status information, event identifiers, and adjudication callback functions. The event status information is used to set the event synchronization method, the event identifier is used to determine the uniqueness of the event and serves as the keyword for adjudication, and the adjudication callback function provides an interface for sending adjudication messages. The event handling framework employs a synchronous adjudication process to achieve event synchronization; The synchronous adjudication process includes the following sub-steps: S1: When registering events that require adjudication, record relevant synchronization information and ensure that the event identifier is unique among redundant software units; set a callback function for sending adjudication messages and record the time status as the initial state; S2: When an event requiring adjudication occurs, the event synchronization adjudication callback function is invoked to send an adjudication request; the voter analyzes the sent adjudication request message, compares the event identifiers, and determines success if they arrive simultaneously within a set time range, otherwise it fails, and the judgment result is fed back to the redundant software unit by the negative feedback controller; S3: After receiving the judgment result, the redundant software unit finds the corresponding event thread through the event identifier and calls the event callback function to complete the event processing; Events for which no successful response to the event adjudication has been received are classified as out-of-synchronization events and will be deleted or timed out depending on the event type. Following the steps of the synchronization decision process, the process further includes the step of adjusting the periodic timer for minor deviations caused by processor performance and scheduling, based on the time consistency of the redundant software unit system. In step S2, the redundant software unit does not have any form of interactive communication link or connection method; The adjustment of the periodic timer due to minor deviations caused by processor performance and scheduling is specifically as follows: the event processing framework is adjusted using a periodic timer. The relative time is calculated by recording the time when the event occurs and the last timer time, and comparing it with the local time. The relative time is then used to determine whether the event occurrence condition has been met.

2. The event scheduling method for synchronizing redundant software units according to claim 1, characterized in that, The relative time is in the microsecond range.

3. The event scheduling method for synchronizing redundant software units according to claim 1, characterized in that, The application steps include: when the primary software unit fails, the event scheduling method for synchronizing redundant software units is used to switch to the synchronously running backup software unit for hot standby mechanism.

4. The event scheduling method for synchronizing redundant software units according to claim 1, characterized in that, The application steps include: in network devices containing redundant software units, the event scheduling method for synchronizing the redundant software units is used to achieve synchronous operation of the redundant software units, thereby realizing the mimicry defense function.

5. A computer device, characterized in that, It includes a processor and a memory, in which program instructions are stored. When the program instructions are loaded and run by the processor, the event scheduling method for synchronizing redundant software units as described in any one of claims 1 to 4 is executed.

6. A computer-readable storage medium, characterized in that, It includes a memory that stores program instructions, and when the program instructions are loaded and run by the processor, the event scheduling method for synchronizing redundant software units as described in any one of claims 1 to 4 is executed.

Citation Information

Patent Citations

  • Event synchronization method, system, client and server

    CN102215243A

  • Heterogeneous executive program synchronization method and device based on relative time

    CN112162866A