Hard real-time implementation method for complex system
Through the microkernel architecture and interrupt processing mechanism, the lack of hard real-time requirements of macro kernel operating systems in complex systems is solved, nanosecond response and efficient processing are achieved, and complex systems have strict requirements for hard real-time.
Patent Information
- Application Number
- CN202410982324.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-15
AI Technical Summary
When traditional macro-kernel operating systems face the demand for hard real-time in complex systems, the interrupt response time is unstable, the context switching overhead is large, and the time slice size affects the hard real-time performance requirements of milliseconds.
It adopts a microkernel architecture, retains only the core functions, provides independent operating space, and achieves rapid response and concurrent execution through interrupt processing mechanisms and thread management, and performs formal verification to ensure hard real-time.
It realizes hard real-time response at the nanosecond level, ensuring that complex systems can handle hard real-time tasks within the expected time, and improving the real-time and reliability of the system.
Smart Images

Figure CN118963940A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hard real-time performance of operating systems, and in particular to a hard real-time implementation method for complex systems. Background Art
[0002] At present, many applications and services have a strong demand for hard real-time performance, such as the airbag ejection function, automatic risk avoidance function and brake control function in the vehicle operating system. These applications require that the system must be able to complete key operations within the specified time, otherwise serious consequences may occur. Traditional macro-kernel operating systems such as Windows and Linux ensure the real-time performance of the system through mechanisms such as interrupt processing, task scheduling and time slice rotation. Task scheduling is performed according to the priority of the task and the time slice rotation. High-priority tasks will be executed first, and the system will try to avoid blocking between tasks to ensure that tasks can be completed on time. At the same time, the macro-kernel will use interrupts to respond to external events, such as timer interrupts, hardware fault interrupts, etc. When an interrupt occurs, the macro-kernel will immediately switch to the interrupt handler to ensure that the corresponding event is processed in time, so that the system can respond to external events in time and meet time constraints.
[0003] However, the hard real-time performance of the macro kernel operating system has some limitations, which are mainly reflected in the following aspects: (1) Unstable interrupt response time: In the macro kernel system, since task scheduling and interrupt processing are performed in the kernel state, there is an unavoidable uncertainty in the interrupt response time. For extremely high hard real-time requirements, even a small interrupt response delay may cause the system to fail to meet the real-time requirements. (2) Large context switching overhead: The macro kernel system supports the concurrent execution of multiple tasks, which requires frequent task switching and scheduling, which will introduce a certain amount of task switching overhead. When faced with hard real-time requirements, these overheads may affect the real-time performance of the system. (3) The time slice size affects hard real-time performance: The scheduling and switching of tasks in the macro kernel system are automatically managed by the system kernel. Task switching usually occurs at the end of the time slice. When the time slice of a task is used up, the system will switch tasks and allocate CPU resources to the next task. The time slice size is usually between a few milliseconds and tens of milliseconds. Some scenarios with strict real-time requirements, such as the airbag ejection function and automatic risk avoidance function in the vehicle operating system, require the system to provide millisecond-level hard real-time performance. It is difficult for a macro kernel operating system to meet the hard real-time requirements of these scenarios, so a solution needs to be found to enable the operating system to meet the growing hard real-time requirements. The reason why most real-time operating systems choose a micro kernel architecture is that the micro kernel divides the system functions into multiple independent modules, leaving only the core minimum functions in the kernel. This modular design can improve the reliability and maintainability of the system while reducing the number of tasks in the kernel, thereby better ensuring hard real-time performance. However, the micro kernel architecture is not perfect, and it still has some defects and deficiencies in ensuring hard real-time performance. For example, message passing and context switching in the micro kernel may introduce certain overhead, affecting the real-time performance of the system. In addition, the performance of the micro kernel may also be limited by hardware resources, such as memory and CPU bandwidth.
[0004] Therefore, a hard real-time implementation method for complex systems is proposed. Summary of the invention
[0005] The purpose of the present invention is to provide a hard real-time implementation method for complex systems, aiming to solve the problem in the above-mentioned background technology that complex systems cannot meet the needs of application scenarios with very strict real-time requirements.
[0006] To achieve the above object, the present invention provides the following technical solution: a hard real-time implementation method for complex systems, comprising the following implementation steps:
[0007] S1: Microkernel architecture: The operating system adopts a microkernel architecture, which greatly simplifies and modularizes the kernel functions, retaining only the core process management, thread management, task scheduling, memory management, interrupt processing, and device driver management functions, and provides a system call interface;
[0008] S2: Kernel continuous running state: The kernel of the microkernel operating system is responsible for handling system events, managing system resources, responding to hardware interrupts and other important tasks;
[0009] S3: Provide independent running space: Provide independent running space for applications and services with hard real-time requirements, ensuring that each hard real-time task runs in an independent virtual address space without interfering with each other;
[0010] S4: Thread management: The system kernel uses the thread management module to achieve concurrent and asynchronous execution of tasks, and fairly schedules threads of the same priority through the time slice round-robin algorithm;
[0011] S5: Interrupt processing mechanism: When an event occurs in a hard real-time task and needs to be processed immediately, a signal is sent to the microkernel system through an interrupt. The interrupt is processed layer by layer by the interrupt handler, redis handler, and CPU interface, and finally responded by the system kernel interrupt handler thread.
[0012] S6: Fast interrupt response: After receiving the interrupt information, the system kernel interrupt processing thread searches and calls the corresponding hard real-time interrupt service thread according to the interrupt vector table to ensure that the interrupt is responded to within nanoseconds.
[0013] S7: Calling the interrupt service routine: The system kernel searches for a suitable processor core to run the hard real-time interrupt processing thread to provide the fastest processing speed;
[0014] S8: Interrupt execution: The processor core starts running the hard real-time interrupt processing thread to process the interrupt;
[0015] S9: Interrupt processing shielding: When processing an interrupt, the processor core shields other interrupts to ensure that the interrupt processing process is not interrupted, and immediately returns to the isolation space where the hard real-time thread is located after the processing is completed;
[0016] S10: Formal Verification: Formal verification is performed on the hard real-time interrupt processing thread. Mathematical and logical reasoning is used to prove that the system behavior complies with the specification, ensuring the correct execution and timely response of the system to hard real-time tasks.
[0017] Furthermore, in S4, the time slice round-robin algorithm is a time-sharing multiplexing algorithm commonly used in operating systems, which is used to automatically switch processes / threads when the time slice is exhausted.
[0018] Furthermore, in S7, the process of the operating system running the processor core to run the hard real-time interrupt processing thread is as follows:
[0019] S701: The system kernel obtains the operating status of each processor core, including the core workload and the priority of the currently executed task;
[0020] S702: the system kernel checks the running status of each core and searches for a core in an idle state, that is, a core that is not executing a task. If an idle core is found, the system kernel selects to assign the hard real-time interrupt processing thread to the idle core for execution.
[0021] S703: When all cores are in a busy state, that is, when there are no idle cores available, the system kernel selects the core with the lowest priority among the currently running tasks to execute the interrupt processing thread, so as to respond to external events as quickly as possible and ensure the real-time performance of the system;
[0022] S704: When the core performances of the multi-core processor are different, a core with higher performance is selected first;
[0023] S705: When the tasks currently running on the processor cores have the same priority level and the core performances are the same, the processing core is selected based on the principle of average distribution.
[0024] Furthermore, in S8, the execution of the hard real-time interrupt processing thread has the highest priority and adopts a preemptive execution mode, that is, when the selected processor core is executing other tasks, the current task is immediately suspended and the hard real-time interrupt processing thread is executed. After the interrupt processing is completed, the execution of the original task is resumed.
[0025] Furthermore, in S9, the specific process of formal verification is as follows:
[0026] 1) Requirements Analysis: First, the requirements of the application need to be analyzed in detail to clarify its functions, inputs and outputs, and boundary conditions;
[0027] 2) Formal modeling: Based on the results of the requirements analysis, use an appropriate formal modeling language to build a formal model of the application;
[0028] 3) Attribute specification and verification method selection: clarify the attributes to be verified, including security, correctness, and liveness; and select appropriate formal verification methods based on the characteristics and requirements of the application;
[0029] 4) Use of verification tools: Use corresponding verification tools to verify the formal model;
[0030] 5) Result analysis: interpret the output of the verification tool to determine whether the application meets the required properties. If errors or non-compliance with the specification are found, further analyze the reasons;
[0031] 6) Error correction: When the verification results are not ideal, the application is repaired or improved.
[0032] Furthermore, the formal model is constructed using at least one of the formal modeling languages of first-order logic, temporal logic and process algebra, and the constructed formal model accurately reflects the structure and behavior of the program.
[0033] Furthermore, the attribute specification is expressed in a formalized manner of a logical formula or a system specification, and methods for formally verifying the attribute specification include model checking, theorem proving, and equivalence checking.
[0034] Furthermore, the verification tool of the formalized model includes a model checking tool and a theorem proving tool, and the verification tool checks whether the formalized model satisfies these specifications according to given attribute specifications.
[0035] Furthermore, in S9, the mathematical and logical reasoning includes two parts: Theorem 1 and Theorem 2. The definition formula of Theorem 1 is as follows:
[0036]
[0037] Among them, F speci is the state transition function of the specification; F impli To implement the code, Θ i F speci The set of symbolic variables Φ i F impli The symbolic variable set of F speci (Θ i ) is to use the symbolic variable set to perform symbolic execution on the state reduction transition function to obtain the state space; F impli (Φ i ) obtains the state space for symbolic execution of the actual code transformation function using a set of symbolic variables.
[0038] Furthermore, in said S9, the definition formula of theorem 2 of mathematical and logical reasoning is as follows:
[0039]
[0040] Among them, SPs is the security policy constraint, and the security policy constraint condition set must meet the state transition function requirements.
[0041] Compared with the prior art, the present invention has the following beneficial effects:
[0042] The present invention proposes a hard real-time implementation method for complex systems, which can provide nanosecond-level hard real-time performance for complex systems and provide effective support for applications with hard real-time requirements. It can not only respond to interrupts generated by hard real-time applications at nanosecond speeds, but also ensure that processing results can be obtained within the expected time. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A timing diagram of the interrupt processing of the present invention;
[0044] Figure 2 It is the architecture diagram of the macro kernel and micro kernel of the present invention;
[0045] Figure 3 This is a flow chart of the CPU processing interrupt when an interrupt occurs in step 5 of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] To solve the problem that complex systems cannot meet the needs of application scenarios with very demanding real-time requirements, please refer to Figure 1-Figure 3 , provide the following preferred technical solutions:
[0048] A hard real-time implementation method for complex systems includes the following implementation steps:
[0049] Step 1: The operating system adopts a microkernel architecture, which greatly simplifies and modularizes the kernel functions, retaining only the most basic and necessary core functions such as process management, thread management, task scheduling, memory management, interrupt processing, and device driver management, and provides a system call interface so that user space programs can call kernel functions; other functions, such as system drivers, file systems, network protocol stacks, etc., are moved out of the kernel and become independent user space services. The core modules of the system kernel are highly decoupled in terms of function and structure. These modules are independent of each other and communicate through well-defined interfaces rather than being tightly integrated. This reduces the dependency between modules and makes the system more flexible and scalable. In this way, when the system kernel completes the specified work, there will be no complex processing process, and it can respond to and complete the processing of events in a very short time. Moreover, the simplified processing process is easier to verify its real-time performance through formal verification;
[0050] Step 2: The kernel of the microkernel operating system is responsible for handling system events, managing system resources, responding to hardware interrupts and other important tasks; regardless of whether the user suspends program execution or whether the system enters low-power mode, the system kernel continues to run, which enables the system to handle various tasks at any time and quickly respond to external events, requests or interrupts, ensuring that the system can effectively manage system resources and provide a computing environment with good real-time performance;
[0051] Step 3: The microkernel system provides independent running spaces for applications and services with hard real-time requirements. These applications usually run multiple hard real-time tasks at the same time. The system uses independent hard real-time threads to process each hard real-time task. Each thread runs in an independent virtual address space to ensure that the data and code between them are isolated from each other and do not interfere with each other. Since hard real-time applications have extremely high requirements on the response time and reliability of the system, any resource occupation or interference may cause the system to fail to complete the task on time, bringing serious consequences. By providing independent running spaces for these applications, the microkernel system can ensure that they can run independently, respond quickly and complete tasks on time. It provides independent running spaces for applications and services with hard real-time requirements, minimizes the shared data between applications, and achieves exclusive resource sharing to avoid tasks being stuck in waiting due to competition for resources, affecting real-time performance, so as to meet hard real-time requirements.
[0052] Step 4. Under normal conditions, the system kernel uses the thread management module to achieve concurrent and asynchronous execution of tasks; it will be responsible for organizing and scheduling the execution order of tasks to ensure that threads with higher priority can be processed first. When threads with the same priority compete for CPU time, the system kernel will use a time slice rotation algorithm for scheduling (the time slice rotation algorithm is a time-sharing multiplexing algorithm used in common operating systems, which is used to automatically switch processes / threads when the time slice is exhausted, and is a prior art). After obtaining the time slice, each thread can execute for a period of time, and then return the CPU control to the kernel. In this way, even if there are multiple threads with the same priority, they can be executed in different time slices, thereby achieving fair scheduling. In this way, the system kernel can effectively manage threads and improve the concurrent performance and responsiveness of the system. When the system runs smoothly, that is, there are no emergencies, the system kernel will schedule tasks according to the priority and time slice rotation method. Tasks with higher priority will be executed first. Through the time slice rotation method, all tasks can obtain execution time, and the phenomenon of low-priority tasks being unable to obtain resources due to continuous resource grabbing by high-priority tasks will not occur, ensuring that each task can be processed in a timely manner;
[0053] Step 5: When an event suddenly occurs in a hard real-time task and needs to be processed immediately, a signal will be sent to the microkernel system in the form of an interrupt. The interrupt will first be sent to the distributor, which will distribute the interrupt to the appropriate redistributor; the redistributor will send the interrupt information to the CPU interface, and the CPU interface will generate an appropriate interrupt exception to the processor; the processor receives the exception, and the processor kernel interrupt processing thread processes the interrupt, and the system kernel will immediately respond to the interrupt;
[0054] Step 6: After obtaining the interrupt information, the system kernel interrupt processing thread finds the corresponding interrupt service program address according to the interrupt vector table to call the corresponding hard real-time interrupt service thread to handle the interrupt. In this way, the interrupt generated by the hard real-time thread will enter the kernel core thread within nanoseconds and be responded to immediately by the kernel core thread.
[0055] Step 7: The operating system kernel searches for a suitable processor core to run the hard real-time interrupt processing thread to provide the fastest processing speed; the process is as follows:
[0056] 1) The system kernel obtains the operating status of each processor core, including the core workload, the priority of the currently executed task, and other information;
[0057] 2) The system kernel checks the running status of each core and looks for a core that is in an idle state, that is, a core that is not executing a task. If there is an idle core, the system kernel will choose to assign the hard real-time interrupt processing thread to the idle core for execution;
[0058] 3) If all cores are busy, that is, there are no idle cores available, the system kernel will select the core with the lowest priority among the currently running tasks to execute the interrupt processing thread to respond to external events as quickly as possible and ensure the real-time performance of the system;
[0059] 4) If the core performances in a multi-core processor are not the same, the core with higher performance is given priority;
[0060] 5) If the tasks currently running on the processor cores have the same priority and the core performance is the same, the processing core is selected based on the principle of average distribution;
[0061] Step 8, interrupt execution: The processor core starts running the hard real-time interrupt processing thread to process the interrupt. The execution of the hard real-time interrupt processing thread has the highest priority and adopts a preemptive execution mode, that is, if the selected processor core is executing other tasks, the current task will be suspended immediately and the hard real-time interrupt processing thread will be executed. After the interrupt processing is completed, the execution of the original task will be resumed;
[0062] Step 9: When the processor core is processing an interrupt, it will shield other interrupts to ensure that the interrupt processing process is not interrupted. This effectively avoids frequent interruptions in interrupt processing. The interrupt processing process is completed once and will not be called repeatedly. Since the kernel of the microkernel system is highly decoupled and its logic is relatively simple, it can complete the interrupt processing in a very short time. After the processing is completed, the next instruction cycle can return to the isolated space where the hard real-time thread is located. Through these measures, it can be ensured that the hard real-time interrupt can be processed quickly and reliably within the expected time, thereby ensuring the hard real-time performance of the system.
[0063] Step 10: Perform formal verification on the hard real-time interrupt processing thread, and use mathematical and logical reasoning to prove that the system's behavior complies with the specification and can complete key tasks within the scheduled time, ensuring the system's correct execution and timely response to hard real-time tasks. When performing formal verification on hard real-time tasks, it is necessary to determine clear real-time requirements and clearly define the real-time requirements of the task, including parameters such as maximum response time and deadline. Model the behavior of the task and system into mathematical formulas or logical rules for formal verification. Use formal verification tools to verify the real-time properties of the system, such as reachability analysis, model checking and other methods. Improve or optimize the system based on the verification results to ensure that the system can meet the real-time requirements.
[0064] The specific process of formal verification is as follows:
[0065] 1) Requirements Analysis: First, the requirements of the application need to be analyzed in detail to clarify its functions, inputs and outputs, boundary conditions, etc. This helps to determine the properties and conditions that need to be verified.
[0066] 2) Formal modeling: Based on the results of the requirements analysis, use an appropriate formal modeling language (such as first-order logic, temporal logic, process algebra, etc.) to build a formal model of the application. The model should accurately reflect the structure and behavior of the program.
[0067] 3) Attribute specification: Specify the attributes to be verified, which can be safety, correctness, liveness, etc. Attribute specifications are usually expressed in a formal way, such as using logical formulas or system specifications.
[0068] Verification method selection: Select an appropriate formal verification method based on the characteristics and requirements of the application. Common methods include model checking, theorem proving, equivalence checking, etc.
[0069] 4) Use of verification tools: Use corresponding verification tools (such as model checking tools, theorem proving tools, etc.) to verify the formal model. The tool will check whether the model meets the given property specifications.
[0070] 5) Result analysis: Interpret the output of the verification tool to determine whether the application meets the required properties. If errors or non-compliance with the specification are found, further analysis is required.
[0071] 6) Error correction: If the verification results are not satisfactory, the application needs to be repaired or improved. This may involve code modification, model adjustment or redesign.
[0072] Mathematical and logical reasoning consists of two parts: Theorem 1 and Theorem 2. The definition formula of Theorem 1 is as follows:
[0073]
[0074] Among them, F speci is the state transition function of the specification; F impli To implement the code, Θ i F speci The set of symbolic variables Φ i F impli The symbolic variable set of F speci (Θ i ) is to use the symbolic variable set to perform symbolic execution on the state reduction transition function to obtain the state space; F impli (Φ i ) obtains the state space for symbolic execution of the actual code transformation function using a set of symbolic variables.
[0075] Theorem 1 states that if the state space of the state transition function and the actual code before execution is consistent, then the state space obtained after completing the symbolic execution operation using their respective sets of symbolic variables should also be consistent.
[0076] The definition formula of Theorem 2 of Mathematical and Logical Reasoning is as follows,
[0077]
[0078] Among them, SPs is the security policy constraint.
[0079] Theorem 2 states that for any state transition function and set of symbolic variables, the set of security policy constraints must satisfy the state transition function requirements.
[0080] Specifically, the operating system based on the microkernel architecture greatly improves the flexibility and scalability of the system by streamlining the kernel functions and modularizing them. The system only retains core functions such as process management, thread management, task scheduling, memory management, interrupt processing, and device driver management, and realizes inter-module communication through clear interfaces, reducing the dependence between modules; the system kernel keeps running continuously, can respond quickly to external events and requests, and provides independent running space for applications with hard real-time requirements to ensure the timely completion of tasks; the system realizes concurrent and asynchronous execution of tasks through the thread management module, improving the concurrent performance and responsiveness of the system. When hard real-time tasks occur, the system adopts an interrupt mechanism, and quickly responds and handles interrupts through modules such as dispatchor, redistributor, and cpuinterface, ensuring that the core thread is entered within nanoseconds to respond; in addition, the system also ensures fast and reliable processing of hard real-time interrupts by optimizing processor selection and shielding other interrupts. Finally, the hard real-time interrupt processing thread is formally verified to ensure the correct execution and timely response of the system to hard real-time tasks. In summary, this microkernel operating system not only improves the real-time performance and reliability of the system, but also meets the diverse requirements of modern complex applications for operating systems through modular design and flexible expansion.
[0081] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0082] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the invention, and the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A hard real-time implementation method for complex systems, characterized in that: The implementation steps include: S1: Microkernel architecture: The operating system adopts a microkernel architecture, which greatly simplifies and modularizes the kernel functions, retaining only the core process management, thread management, task scheduling, memory management, interrupt processing, and device driver management functions, and provides a system call interface; S2: Kernel continuous running state: The kernel of the microkernel operating system is responsible for handling system events, managing system resources, responding to hardware interrupts and other important tasks; S3: Provide independent running space: Provide independent running space for applications and services with hard real-time requirements, ensuring that each hard real-time task runs in an independent virtual address space without interfering with each other; S4: Thread management: The system kernel uses the thread management module to achieve concurrent and asynchronous execution of tasks, and fairly schedules threads of the same priority through the time slice round-robin algorithm; S5: Interrupt processing mechanism: When an event occurs in a hard real-time task and needs to be processed immediately, a signal is sent to the microkernel system through an interrupt. The interrupt is processed layer by layer by the distributor, redistributor, and cpuinterface, and finally responded by the system kernel interrupt processing thread; S6: Fast interrupt response: After receiving the interrupt information, the system kernel interrupt processing thread searches and calls the corresponding hard real-time interrupt service thread according to the interrupt vector table to ensure that the interrupt is responded to within nanoseconds. S7: Calling the interrupt service routine: The system kernel searches for a suitable processor core to run the hard real-time interrupt processing thread to provide the fastest processing speed; S8: Interrupt execution: The processor core starts running the hard real-time interrupt processing thread to process the interrupt; S9: Interrupt processing shielding: When processing an interrupt, the processor core shields other interrupts to ensure that the interrupt processing process is not interrupted, and immediately returns to the isolation space where the hard real-time thread is located after the processing is completed; S10: Formal Verification: Formal verification is performed on the hard real-time interrupt processing thread, and mathematical and logical reasoning are used to prove that the system behavior complies with the specification, ensuring the correct execution and timely response of the system to hard real-time tasks.
2. A hard real-time implementation method for complex systems as claimed in claim 1, characterized in that: In S4, the time slice round-robin algorithm is a time-sharing multiplexing algorithm commonly used in operating systems, which is used to automatically switch processes / threads when the time slice is exhausted.
3. A hard real-time implementation method for complex systems as claimed in claim 1, characterized in that: In S7, the process of the operating system running the processor core to run the hard real-time interrupt processing thread is as follows: S701: The system kernel obtains the operating status of each processor core, including the core workload and the priority of the currently executed task; S702: the system kernel checks the running status of each core and searches for a core in an idle state, that is, a core that is not executing a task. If an idle core is found, the system kernel selects to assign the hard real-time interrupt processing thread to the idle core for execution. S703: When all cores are in a busy state, that is, when there are no idle cores available, the system kernel selects the core with the lowest priority among the currently running tasks to execute the interrupt processing thread, so as to respond to external events as quickly as possible and ensure the real-time performance of the system; S704: When the core performances of the multi-core processor are different, a core with higher performance is selected first; S705: When the tasks currently running on the processor cores have the same priority level and the core performances are the same, the processing core is selected based on the principle of average distribution.
4. A hard real-time implementation method for complex systems as claimed in claim 1, characterized in that: In S8, the execution of the hard real-time interrupt processing thread has the highest priority and adopts a preemptive execution mode, that is, when the selected processor core is executing other tasks, the current task is immediately suspended and the hard real-time interrupt processing thread is executed. After the interrupt processing is completed, the execution of the original task is resumed.
5. A hard real-time implementation method for complex systems as claimed in claim 1, characterized in that: In S9, the specific process of formal verification is as follows: 1) Requirements Analysis: First, the requirements of the application need to be analyzed in detail to clarify its functions, inputs and outputs, and boundary conditions; 2) Formal modeling: Based on the results of the requirements analysis, use an appropriate formal modeling language to build a formal model of the application; 3) Attribute specification and verification method selection: clarify the attributes to be verified, including security, correctness, and liveness; and select appropriate formal verification methods based on the characteristics and requirements of the application; 4) Use of verification tools: Use corresponding verification tools to verify the formal model; 5) Result analysis: interpret the output of the verification tool to determine whether the application meets the required properties. If errors or non-compliance with the specification are found, further analyze the reasons; 6) Error correction: When the verification results are not ideal, repair or improve the application.
6. A hard real-time implementation method for complex systems as claimed in claim 5, characterized in that: The formal model is constructed using at least one formal modeling language among first-order logic, temporal logic and process algebra, and the constructed formal model accurately reflects the structure and behavior of the program.
7. A hard real-time implementation method for complex systems as claimed in claim 5, characterized in that: The attribute specification is expressed in a formalized manner in the form of a logical formula or a system specification, and methods for formally verifying the attribute specification include model checking, theorem proving, and equivalence checking.
8. A hard real-time implementation method for complex systems as claimed in claim 5, characterized in that: The verification tools of the formalized model include model checking tools and theorem proving tools. The verification tools check whether the formalized model satisfies the given property specifications according to the given property specifications.
9. A hard real-time implementation method for complex systems as claimed in claim 1, characterized in that: In S9, the mathematical and logical reasoning includes two parts: Theorem 1 and Theorem 2. The definition formula of Theorem 1 is as follows: Among them, F speci is the state transition function of the specification; F impli To implement the code, Θ i F speci The set of symbolic variables Φ i F impli The symbolic variable set of F speci (Θ i ) is to use the symbolic variable set to perform symbolic execution on the state reduction transition function to obtain the state space; F impli (Φ i ) obtains the state space for symbolic execution of the actual code transformation function using a set of symbolic variables.
10. A hard real-time implementation method for complex systems as claimed in claim 9, characterized in that: In S9, the definition formula of Theorem 2 of mathematical and logical reasoning is as follows: Among them, SPs is the security policy constraint, and the security policy constraint condition set must meet the state transition function requirements.
Citation Information
Cited By
Error detection architecture design method for multi-core safety-critical system
CN119937992A
