A method for detecting a real-time operating system and a computing device
By adopting a proactive reporting detection method in the real-time runtime system, the system monitors kernel and middleware state changes in real time, thus solving the problem of detection latency in the real-time runtime system and achieving efficient integrity detection and stable operation.
Patent Information
- Application Number
- CN202210540258.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-05-17
AI Technical Summary
In existing technologies, the integrity detection of real-time running systems suffers from detection delays, especially in edge computing scenarios between network terminal devices and cloud centers, leading to instability in the operation of real-time applications.
The detection method adopts a proactive reporting approach. The detection module monitors the status changes and software updates of the kernel, real-time middleware service program, and real-time middleware runtime environment module in real time to ensure the integrity of the real-time running system. This includes proactively detecting and notifying whether the kernel has switched to real-time kernel mode and the integrity of the real-time middleware service program and real-time middleware runtime environment module.
It improves the detection efficiency of the real-time running system, avoids detection delays, ensures the stable operation of real-time applications, and enhances the real-time performance and reliability of the system.
Smart Images

Figure CN114911703B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of operating systems, and particularly relates to a detection method of a real-time running system and a computing device. BACKGROUND
[0002] Cloud computing technology improves the utilization rate of hardware resources by separating the management of resources, greatly reduces the use cost of IT information systems, and also improves the availability of the system. At present, the mainstream large Internet services are provided based on the infrastructure of cloud computing.
[0003] With the development of 5G technology, the Internet develops to a deeper and wider field, and the topological distance between the network terminal and the network center is constantly lengthened, which affects the timeliness of network application response. The network terminal is the dividing line between the digital world and the physical world, and the network terminal device usually has real-time requirements, which needs to complete the calculation task and feedback the calculation result within a limited time.
[0004] In the prior art, due to the consideration of cost and other factors, the computing power of the network terminal device is generally weak, and the core part of the computing task needs to be completed by using the computing resources of the cloud center, and the remaining part of the computing task is completed by the network terminal device. However, due to the long distance between the cloud center and the network terminal, the network transmission process affects the real-time interaction. Therefore, a new computing method needs to be introduced between the cloud center and the network terminal, that is, at the edge of the cloud, to solve the contradiction between computing resources and physical distance.
[0005] Among them, the multi-time characteristic hybrid running system improves and constructs a hybrid running system suitable for application in edge computing application scenarios through multiple levels of kernel, middleware and API to the general operating system. The hybrid running system can run both computing tasks and real-time tasks. From the technical architecture, the multi-time characteristic hybrid running system is a larger extension based on the general operating system, which involves multiple software modules from the bottom kernel to the upper runtime library. These modules cooperate with each other to form a complete real-time running system. However, due to the multiple and complex modules involved, and the multiple operations in the operating system may cause one or more modules to be unexpectedly closed, suspended or updated, thereby destroying the completeness of the real-time running system, and further causing errors in the running process of the real-time application program. Therefore, in order to ensure the completeness of the real-time running system, a scheme for detecting the completeness of the real-time running system is needed.
[0006] In the prior art, for completeness detection of a real-time running system, a passive detection mode is generally adopted, that is, a detection request is initiated by a master control, and a service module responds and performs a detection process. The passive detection mode has a detection delay problem. For a module with active reporting capability, an active reporting detection mode can be adopted to avoid the detection delay problem, improve detection efficiency, and thus ensure stable operation of a real-time application program.
[0007] Therefore, a real-time environment completeness detection method based on active reporting is needed to improve detection efficiency and solve the problems in the above technical solutions. SUMMARY
[0008] Therefore, the present application provides a detection method of a real-time running system and a computing device to solve or at least alleviate the above problems.
[0009] According to one aspect of the present application, a detection method of a real-time running system is provided, which is executed in an operating system including a kernel, a real-time running system, and a detection module deployed above the operating system. The method includes the steps of: detecting completeness of the kernel to determine whether the kernel is switched to a real-time kernel mode; detecting completeness of a real-time middleware service program, wherein when a running state change of the real-time middleware service program is detected, the running state change is actively notified to the detection module; and detecting completeness of a real-time middleware running environment module, wherein when a software package update corresponding to the real-time middleware running environment module is detected, the software package update is actively notified to the detection module.
[0010] Optionally, in the detection method of the real-time running system according to the present application, the step of actively notifying the detection module of the running state change when the running state change of the real-time middleware service program is detected includes: judging whether the running state change causes a completeness state of the real-time running system to change when the running state change of the real-time middleware service program is detected; and actively notifying the detection module of the completeness state if the completeness state of the real-time running system changes. The step of actively notifying the detection module of the software package update when the software package update corresponding to the real-time middleware running environment module is detected includes: judging whether the software package update causes the completeness state of the real-time running system to change when the software package update corresponding to the real-time middleware running environment module is detected; and actively notifying the detection module of the completeness state if the completeness state of the real-time running system changes.
[0011] Optionally, in the detection method of the real-time running system according to the application, the step of actively sending the running state change notification to the detection module comprises: collecting the running state change information of the real-time middleware service program, and sending the running state change information to the detection module; and the step of actively sending the software package update notification to the detection module comprises: collecting the software package update information corresponding to the real-time middleware running environment module, and sending the software package update information to the detection module.
[0012] Optionally, in the detection method of the real-time running system according to the application, the completeness of the kernel is detected in response to the first detection request sent by the detection module; the completeness of the real-time middleware service program is detected in response to the second detection request sent by the detection module; and the completeness of the real-time middleware running environment module is detected in response to the third detection request sent by the detection module.
[0013] Optionally, in the detection method of the real-time running system according to the application, the method further comprises the steps of: after detecting the completeness of the kernel, generating a kernel detection result, and sending the kernel detection result to the detection module; after detecting the completeness of the real-time middleware service program, generating a real-time middleware service program detection result, and sending the real-time middleware service program detection result to the detection module; and after detecting the completeness of the real-time middleware running environment module, generating a real-time middleware running environment module detection result, and sending the real-time middleware running environment module detection result to the detection module.
[0014] Optionally, in the detection method of the real-time running system according to the application, the operating system further comprises a general running system; and the kernel is a fusion kernel formed based on the fusion of a real-time kernel and a general kernel, and is adapted to switch between the real-time kernel mode and the general kernel mode.
[0015] Optionally, in the detection method of the real-time running system according to the application, the completeness of the real-time middleware service program is detected by checking whether the CPU management service and the memory management service provided by the real-time middleware service program are completed.
[0016] Optionally, in the detection method of the real-time running system according to the application, the completeness of the real-time middleware running environment module is detected by checking whether the real-time dependent library corresponding to the real-time middleware is replaced by the general dependent library corresponding to the general middleware.
[0017] Optionally, in the detection method of the real-time running system according to the present application, the real-time middleware service program comprises: a fast interrupt service program adapted to interrupt an executing real-time task and perform an interrupt processing when an interrupt signal is received; a real-time scheduling service program adapted to acquire a real-time task with the highest emergency degree from a real-time task queue by using a real-time scheduling algorithm, so as to immediately execute the real-time task with the highest emergency degree; and a real-time running component adapted to provide a memory management service for the real-time task with the highest emergency degree.
[0018] According to an aspect of the present application, there is provided a computing device comprising: at least one processor; a memory storing program instructions configured to be executed by the at least one processor, the program instructions comprising instructions for performing the detection method of the real-time running system as described above.
[0019] According to an aspect of the present application, there is provided a readable storage medium storing program instructions, which, when read and executed by a computing device, cause the computing device to perform the detection method of the real-time running system as described above.
[0020] According to the technical solution of the present application, the detection method of the real-time running system can detect the completeness of the real-time running system after starting the real-time running system, wherein whether the kernel switches to a real-time kernel mode corresponding to the real-time running system is detected, and the running state of a real-time middleware service program and a software package corresponding to a real-time middleware running environment module are detected, wherein when the running state of the real-time middleware service program is detected to change and / or the software package corresponding to the real-time middleware running environment module is detected to update, a change in the completeness of the real-time running system is actively reported to a detection module of an upper layer. In this way, in the process of detecting the completeness of the real-time running system, the change in the running state and the software package update event detected are actively reported to the detection module of the upper layer, which can improve the efficiency of detecting the completeness of the real-time running system and avoid detection delay, thereby ensuring that a real-time running program running based on the real-time running system can be stably and correctly run.
[0021] Further, in the detection method of the real-time running system according to the present application, when the running state of the real-time middleware service program is detected to change and / or the software package corresponding to the real-time middleware running environment module is detected to update, it is further determined whether the completeness of the real-time running system will change, and only when it is determined that the completeness of the real-time running system will change, a change in the completeness of the real-time running system is actively reported to the detection module. In this way, the change in the completeness of the real-time running system can be accurately reported to the detection module, and unnecessary reporting events can be avoided.
[0022] The above description is only a summary of the technical solutions of the present application. In order to enable a more thorough understanding of the technical means of the present application, the contents of the specification can be implemented, and in order to enable the above and other purposes, features and advantages of the present application to be more apparent and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS
[0023] To achieve the above and related objects and in view of the problems inherent in the prior art, certain illustrative aspects will now be described in connection with the following description and drawings, wherein the principles of the disclosed technology can be implemented and realized. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which like references refer to like elements. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which like references refer to like elements.
[0024] Figure 1 A schematic diagram showing that a hybrid runtime system 120 is deployed in a computing device 100 according to an embodiment of the present application is shown;
[0025] Figure 2 A schematic diagram showing that a detection module 131 is deployed in a computing device 100 according to an embodiment of the present application is shown;
[0026] Figure 3 A flowchart showing a detection method 300 of a real-time runtime system according to an embodiment of the present application is shown;
[0027] Figure 4 A flowchart showing step S320 according to an embodiment of the present application is shown;
[0028] Figure 5 A flowchart showing step S330 according to an embodiment of the present application is shown;
[0029] Figure 6 A schematic diagram showing the hardware structure of a computing device 100 according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0030] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure can be more thoroughly understood, and the scope of the present disclosure can be accurately conveyed to those skilled in the art.
[0031] Figure 1A schematic diagram showing that a hybrid runtime system 120 is deployed in a computing device 100 according to an embodiment of the present application is shown. According to an application example, the computing device 100 can be an edge computing server applied in the field of edge computing.
[0032] As shown in Figure 1 The computing device 100 can include a hardware layer 110, a hybrid runtime system 120, and an application layer 130. In some embodiments, the hybrid runtime system 120 can be a part of an operating system, i.e., the hybrid runtime system 120 is included in the operating system of the computing device 100. In yet some embodiments, the operating system of the computing device 100 can be implemented as the hybrid runtime system 120 of the present application.
[0033] Specifically, the application layer 130 can include one or more applications, runtime libraries, and interfaces provided by the hybrid runtime system. The present application does not limit the types and quantities of the applications. Developers can develop the applications according to actual business requirements. Each application can call the interfaces provided by the hybrid runtime system to request the business runtime system to perform tasks. In an embodiment, the applications include, for example, an application for hybrid environment monitoring, an application for hybrid business debugging, an application for hybrid business analysis, and the like.
[0034] The hardware layer 110 can provide a hardware environment for the hybrid runtime system and the applications. The hardware layer 110 can include a processor (CPU), an internal memory, and can further include a network card, a hard disk, a keyboard, and the like external hardware devices.
[0035] The hybrid runtime system 120 can provide a software running environment for the tasks requested by one or more applications (including real-time tasks and computing tasks).
[0036] According to the hybrid runtime system 120 of the present application, real-time tasks and computing tasks can be run simultaneously. It should be noted that the real-time tasks are tasks that need to be responded in a specified time, for example, a control task of a traffic light signal. The computing tasks are tasks that require high computing power to process a large amount of data, for example, audio and video processing, database applications, and the like.
[0037] The real-time task and the computing task have different requirements in interrupt processing, scheduling processing, memory management, etc. Specifically, in the interrupt processing, the real-time task needs to be executed as soon as possible through the interrupt processing for the most urgent task, and the computing task does not want the currently executed task to be interrupted frequently. In the scheduling processing, the real-time task needs to be scheduled as soon as possible after an event arrives, and the computing task does not want the currently executed task to be scheduled frequently. In the memory management method, the real-time task needs to be stored in the memory, instead of being swapped out by the virtual memory, and the computing task needs to utilize the virtual memory to implement large-scale data computation because a large amount of data needs to be processed.
[0038] In view of the requirements of the real-time task and the computing task in the interrupt processing, the scheduling processing, the memory management, etc., the application provides a hybrid running system 120 capable of scheduling and executing the real-time task and the computing task simultaneously.
[0039] According to an embodiment of the application, as shown in Figure 1 The hybrid running system 120 includes a preemptive kernel 121, an interrupt preprocessing module 122 arranged above the preemptive kernel 121, and a runtime system arranged above the interrupt preprocessing module 122. The runtime system includes a real-time running system 123 and a general running system 124 (non-real-time running system). The real-time running system 123 can provide a real-time running environment for the real-time task, and the general running system 124 can provide a non-real-time running environment for the computing task.
[0040] It should be noted that the preemptive kernel 121 in the application is a complete preemptive kernel, which ensures the basic real-time response capability and the fusion scheduling capability of resources. Each running system uses a complete independent core software stack, so that the two running systems are isolated from each other, thereby ensuring the independence of the real-time task and the computing task with different time characteristics in the running time.
[0041] In one embodiment, as shown in Figure 1As shown, the hybrid running system 120 further comprises an application domain management module 126 above the real-time running system 123 and the general running system 124, which can provide a unified domain control interface for one or more applications in the upper application layer, so that the applications can request to execute tasks by calling the domain control interface. The application domain management module 126 can receive the task execution request sent by one or more applications, and distribute the tasks to the corresponding domains for execution according to the type of the tasks. That is, when the task is a real-time task, the real-time task is distributed to the real-time running system 123 for execution, and the real-time running system 123 can provide a real-time running environment for the running of the real-time task. When the task is a computing task, the computing task is distributed to the general running system 124 for execution, and the general running system 124 can provide a general running environment for the running of the computing task.
[0042] According to an embodiment of the present application, the modules in the real-time running system 123 are used to implement the priority processing of the real-time task with the highest urgency, and the modules in the general running system 124 are used to implement the priority processing of the computing task with the highest priority.
[0043] Specifically, the preemptive kernel 121 can receive a hardware generated interrupt signal, i.e., a hardware interrupt signal. The hardware interrupt signal is automatically generated by a hardware device (such as a network card, a hard disk, a keyboard, etc.) connected in communication with the hybrid running system 120. Then, the preemptive kernel 121 can send the interrupt signal from the hardware to the interrupt pre-processing module 122, so that the interrupt signal is distributed to the corresponding running system for processing by the interrupt pre-processing module 122.
[0044] The interrupt pre-processing module 122 can respond to the hardware generated interrupt signal, determine the interrupt type according to the interrupt signal, and distribute the interrupt signal to the corresponding running system (the real-time running system 123 or the general running system 124) for processing according to the interrupt type. Here, the interrupt signal includes interrupt source information, and the interrupt pre-processing module 122 can obtain the interrupt source information from the interrupt signal and determine the interrupt type according to the interrupt source information. The interrupt type is to determine whether the real-time task with the highest urgency or the computing task with the highest priority needs to be executed immediately.
[0045] In the real-time running system 123, when the interrupt signal is received, the real-time running system 123 first interrupts the running real-time task and performs the interrupt processing, and then acquires the real-time task with the highest emergency level from the real-time task queue of the processor (CPU) by using the real-time scheduling algorithm, so that the processor (CPU) immediately executes the real-time task with the highest emergency level. At this time, the real-time task with the highest emergency level preempts the use right of the processor. It can be understood that, when the interrupt signal is received, the real-time running system 123 first performs the interrupt processing on the running task, and then performs the scheduling processing.
[0046] The general running system 124 first acquires the highest-priority computing task from the computing task queue of the processor when the interrupt signal is received, for example, the highest-priority computing task can be acquired from the computing task queue based on the fair scheduling algorithm. Then, the running low-priority computing task can be interrupted and the interrupt processing is performed, so that the processor immediately executes the highest-priority computing task.
[0047] Further, after the highest-priority computing task is selected from the computing task queue, the general running system 124 needs to determine whether the selected highest-priority computing task is the running computing task. If the highest-priority computing task is not the running computing task, it indicates that the running computing task currently belongs to the low-priority computing task, and then the running low-priority computing task (which is the previous highest-priority computing task) is interrupted and the interrupt processing is performed, so that the processor immediately executes the highest-priority computing task. At this time, the highest-priority computing task preempts the use right of the processor.
[0048] In addition, if the selected highest-priority computing task is the running computing task, the running computing task does not need to be interrupted and the interrupt processing does not need to be performed, so that the situation that the computing task is frequently interrupted is avoided. It can be understood that, when the interrupt signal is received, the general running system 124 first performs the scheduling processing, and then determines whether the interrupt processing needs to be performed.
[0049] According to an embodiment of the present application, the real-time running system 123 includes a fast interrupt service program 1231, a real-time scheduling service program 1232, and a real-time running component 1233. During the running of the real-time task with the highest emergency level, the real-time running component 1233 can provide the memory management service for the running of the real-time task with the highest emergency level.
[0050] The fast interrupt service program 1231 runs on the processor, and the fast interrupt service program 1231 can interrupt the running real-time task and perform the interrupt processing when the interrupt signal is received.
[0051] Further, the fast interrupt service program 1231 can be bound with an interrupt handler. When the fast interrupt service program 1231 receives an interrupt signal, the fast interrupt service program 1231 can send the interrupt signal to the processor, which finds the corresponding interrupt handler (i.e., the interrupt handler bound with the fast interrupt service program 1231) from the fast interrupt vector table and sends the interrupt signal to the interrupt handler, so as to interrupt the execution of the real-time task and perform the interrupt processing by the interrupt handler.
[0052] It should be noted that the interrupt processing refers to that when a new task that needs to be executed in priority appears, the processor temporarily suspends the execution of the current task and executes the new task (e.g., the real-time task with the highest emergency level or the computing task with the highest priority in the above embodiment) in the processing process.
[0053] The real-time scheduling service program 1232 can acquire the real-time task with the highest emergency level from the real-time task queue by using a real-time scheduling algorithm, so as to make the processor execute the real-time task with the highest emergency level immediately.
[0054] In an embodiment, the real-time scheduling algorithm can be implemented as a least slack first scheduling algorithm, i.e., the real-time task with the highest emergency level can be acquired from the real-time task queue by using the least slack first scheduling algorithm. It should be noted that the least slack first scheduling algorithm is to determine the priority of a task according to the degree of emergency (or slack) of the task. For the embodiment of the present application, the higher the emergency level of the real-time task is, the higher the priority given to the real-time task is, so as to execute the real-time task with the highest emergency level in priority. In the real-time task queue, each real-time task is sorted from low to high in slack (i.e., from high to low in emergency level), wherein the real-time task with the lowest slack (i.e., the highest emergency level) is arranged at the front of the real-time task queue and is executed in priority. The calculation method of the slack is as follows: the slack of a real-time task = time to be completed - running time of itself - current time. According to the algorithm, when the least slack of a real-time task is reduced to 0, the real-time scheduling service program 1232 must schedule the real-time task immediately so as to make the real-time task immediately preempt the processor, thereby ensuring that the real-time task is executed according to the requirement of the deadline.
[0055] According to an embodiment of the present application, the general running system 124 includes a general scheduling service program 1242, a threaded interrupt service program 1241, and a general running component 1243. During the running of the computing task with the highest priority, the general running component 1243 can provide the memory management service for the computing task with the highest priority.
[0056] Upon receiving the interrupt signal, the general-purpose scheduling service program 1242 can select and fetch the highest priority computing task from the computing task queue of the processor using a fair scheduling algorithm, so that the processor immediately executes the highest priority computing task. In one implementation, the fair scheduling algorithm can be implemented as the CFS scheduling algorithm. The general-purpose scheduling service program 1242 can select the highest priority computing task from the task queue of the processor using the CFS scheduling algorithm. Specifically, according to the CFS scheduling algorithm, the general-purpose scheduling service program 1242 will always select the slowest running computing task from the computing task queue as the highest priority computing task, so that the slower running computing task can get more running opportunities.
[0057] It should be noted that if the highest priority computing task is the computing task being executed, the computing task being executed is continued to be executed without interrupting the computing task being executed.
[0058] If the highest priority computing task is not the computing task being executed, in other words, the computing task being executed is a low-priority computing task, the computing task being executed is further interrupted and interrupted by the threaded interrupt service program 1241.
[0059] In one embodiment, the threaded interrupt service program 1241 runs on the processor. The threaded interrupt service program 1241 can interrupt and interrupt the computing task being executed according to the following method: the interrupt signal can be sent to the processor, the processor converts the interrupt signal into a corresponding interrupt request (IRQ), and finds one or more interrupt handlers associated with the interrupt request from the interrupt request registration table. And the processor wakes up one or more processing threads corresponding to one or more interrupt handlers in turn, so as to interrupt and interrupt the computing task being executed by the one or more processing threads.
[0060] Specifically, the interrupt handlers associated with the interrupt request can include multiple. In the process of finding the multiple interrupt handlers associated with the interrupt request from the interrupt request registration table, the processor wakes up the processing thread corresponding to each associated interrupt handler to interrupt and interrupt the computing task being executed by the processing thread, waits for the processing thread to execute, and then finds the next associated interrupt handler from the interrupt request registration table, wakes up the next processing thread corresponding to the next interrupt handler, and waits for the next processing thread to execute. In this way, until all processing threads corresponding to all interrupt handlers associated with the interrupt request are executed, the interrupt processing is completed.
[0061] In addition, in one embodiment, as shown in Figure 1 The domain resource management service program 125 is deployed between the real-time running system 123 and the general running system 124, and is used to separate the resources of the real-time running system 123 and the general running system 124, and ensure the isolation of the resources and characteristics between the real-time running system 123 and the general running system 124.
[0062] In an embodiment according to the present application, the computing device 100 is configured to execute the detection method 300 of the real-time running system according to the present application. The computing device 100 contains a plurality of program instructions for executing the detection method 300 of the real-time running system according to the present application, so that the computing device 100 detects the completeness of the real-time running system by executing the detection method 300 of the real-time running system according to the present application and actively reports.
[0063] According to one embodiment of the present application, the application layer 130 of the computing device 100 is further deployed with a detection module 131, so as to control the completeness detection of the real-time running system based on the detection module 131.
[0064] Figure 2 A schematic diagram of the computing device 100 according to one embodiment of the present application is shown, which is deployed with the detection module 131.
[0065] As shown in Figure 2 The computing device 100 includes a hardware layer 110, an operating system, and an application layer 130 arranged above the operating system. The application layer 130 includes a detection module 131, a runtime library, and an interface provided by the operating system. The hardware layer 110 includes a processor and an internal memory.
[0066] In an embodiment according to the present application, the operating system of the computing device 100 can be implemented as the hybrid running system 120 as shown in Figure 1 Specifically, the operating system includes a kernel, a real-time running system 123, and a general running system 124 (non-real-time running system). The kernel (preemptive kernel) in the operating system can be implemented as a fusion kernel based on the fusion of a real-time kernel and a general kernel (non-real-time kernel), and the fusion kernel can be switched between the real-time kernel mode and the general kernel mode. It should be understood that the fusion kernel in the present application is a specific implementation of the preemptive kernel.
[0067] In the computing device 100 of the present application, the operating system is connected with the application through middleware, so that the operating system and the application communicate. The real-time running system corresponds to real-time middleware, and the general running system corresponds to general middleware.
[0068] In one embodiment of the present application, the middleware includes an interface, a runtime library, an application domain management module 126, a domain resource management service program 125, a real-time running component 1233, a real-time scheduling service program 1232, a fast interrupt service program 1231, a general running component 1243, a general scheduling service program 1242, and a threaded interrupt service program 1241.
[0069] In one embodiment of the present application, the middleware is differentiated for the real-time running system and the general running system. Specifically, the real-time middleware corresponding to the real-time running system includes an interface, a runtime library, an application domain management module 126, a domain resource management service program 125, a real-time running component 1233, a real-time scheduling service program 1232, and a fast interrupt service program 1231. The real-time middleware service programs corresponding to the real-time running system include the application domain management module 126, the domain resource management service program 125, the real-time running component 1233, the real-time scheduling service program 1232, and the fast interrupt service program 1231. That is, the real-time middleware includes the interface, the runtime library, and the real-time middleware service programs.
[0070] The general middleware corresponding to the general running system includes an interface, a runtime library, an application domain management module 126, a domain resource management service program 125, a general running component 1243, a general scheduling service program 1242, and a threaded interrupt service program 1241. The general middleware service programs corresponding to the general running system include the application domain management module 126, the domain resource management service program 125, the general running component 1243, the general scheduling service program 1242, and the threaded interrupt service program 1241. That is, the general middleware includes the interface, the runtime library, and the general middleware service programs.
[0071] It can be understood that the common middleware of the real-time middleware and the general middleware includes an interface, a runtime library, an application domain management module 126, and a domain resource management service program 125.
[0072] It should be noted that the specific execution logic of each middleware and middleware service program is described above in the computing device 100, and will not be described here.
[0073] Figure 3 A flow chart of a detection method 300 of a real-time running system according to one embodiment of the present application is shown. The method 300 is suitable for execution in the operating system of the computing device 100.
[0074] It should be noted that the operating system of computing device 100 can switch instantly between a general-purpose operating system and a real-time operating system during operation. For example, in one application scenario, the real-time operating system can be started while the general-purpose operating system is running, i.e., switching from the general-purpose operating system to the real-time operating system, so that the operating system can instantly switch from the general-purpose operating system to the real-time operating system mode. Alternatively, in another application scenario, the real-time operating system can be started directly during the operating system startup phase. After starting the real-time operating system, one or more real-time applications can run on it. Real-time applications are applications that have real-time requirements for the runtime environment.
[0075] After the real-time running system is started, the operating system performs a real-time running system detection method 300 of the present invention to detect the integrity of the real-time running system.
[0076] It should be noted that the kernel mode corresponding to the real-time runtime system is real-time kernel mode, and the middleware service program corresponding to the real-time runtime system is a real-time middleware service program, and the middleware runtime environment module corresponding to the real-time runtime system is a real-time middleware runtime environment module. Correspondingly, the kernel mode corresponding to the general-purpose runtime system is general-purpose kernel mode, and the middleware service program corresponding to the general-purpose runtime system is a general-purpose middleware service program, and the middleware runtime environment module corresponding to the general-purpose runtime system is a general-purpose middleware runtime environment module.
[0077] like Figure 3 As shown, method 300 includes steps S310 to S330.
[0078] In step S310, after starting the real-time running system, the integrity of the kernel is checked to see if the kernel has successfully switched to real-time kernel mode.
[0079] In one embodiment, the detection module 131 first sends a first detection request to the operating system kernel, for example, by calling an interface provided by the operating system to send the first detection request, in order to request a integrity check on the operating system kernel. The kernel responds to the first detection request sent by the detection module and performs a kernel integrity check.
[0080] It should be noted that after starting the real-time runtime system, it is necessary to ensure that the kernel successfully switches to the real-time kernel mode corresponding to the real-time runtime system, that the middleware service program switches to the real-time middleware service program, and that the middleware runtime environment module switches to the real-time middleware runtime environment module. In one implementation, the operating system kernel (fusion kernel) has a debug switch, which allows switching between general kernel mode and real-time kernel mode by controlling the debugging switch to be on or off.
[0081] Based on this, in the process of detecting the completeness of the kernel, it is checked whether the kernel is successfully switched to the real-time kernel mode. Specifically, it is checked whether the kernel is switched from the general kernel mode to the real-time kernel mode. In an implementation, by checking whether the debug switch of the kernel is in the off state, if the debug switch is in the off state, it can be determined that the kernel is switched to the real-time kernel mode, i.e., currently in the real-time kernel mode, in which case it is determined that the kernel meets the completeness, and the detection of the completeness of the kernel is passed. If the debug switch is in the on state, it is determined that the kernel is not switched to the real-time kernel mode, and currently in the general kernel mode, in which case it is determined that the kernel does not meet the completeness.
[0082] In addition, after detecting the completeness of the kernel, a kernel detection result can be generated and sent to the detection module 131.
[0083] Subsequently, in step S320, the completeness of the real-time middleware service program is detected, wherein when the running state change of the real-time middleware service program is detected, the running state change is actively notified to the detection module 131 located in the upper layer of the operating system.
[0084] In one embodiment, the detection module 131 sends a second detection request to the real-time middleware service program, for example, can call the interface provided by the real-time middleware service program to send the second detection request, to request the completeness detection of the real-time middleware service program. The real-time middleware service program detects the completeness of the real-time middleware service program in response to the second detection request sent by the detection module.
[0085] In the process of detecting the completeness of the real-time middleware service program, it is checked whether the real-time middleware service program is switched. For example, it is checked whether the middleware service program is successfully switched from the general middleware service program to the real-time middleware service program.
[0086] As described above, in one embodiment, the real-time middleware service programs include a fast interrupt service program, a real-time scheduling service program, and a real-time running component. The fast interrupt service program interrupts the execution of a real-time task and performs interrupt processing when receiving an interrupt signal. The real-time scheduling service program acquires a real-time task with the highest urgency from a real-time task queue by using a real-time scheduling algorithm, so that the CPU immediately executes the real-time task with the highest urgency. The real-time running component provides memory management services for the real-time task with the highest urgency. In the process of starting the real-time running system, each real-time middleware service program including the fast interrupt service program, the real-time scheduling service program, and the real-time running component needs to be started. Based on these real-time middleware service programs, the corresponding CPU management services and memory management services can be provided for the real-time application programs running based on the real-time running system.
[0087] In the process of detecting the completeness of the real-time middleware service programs, it can be checked whether the fast interrupt service program completes switching, whether the real-time scheduling service program completes switching, and whether the real-time running component completes switching. In other words, it can be checked whether the CPU management services and the memory management services provided by the real-time middleware service programs complete switching and are in a ready state.
[0088] It should be noted that in the process of detecting the completeness of the real-time middleware service programs, if the real-time middleware service programs do not complete switching or the memory pool of the real-time middleware service programs is in a depleted state, the change of the running state of the real-time middleware service programs is detected, and then the change of the running state is actively sent to the detection module 131 located in the upper layer of the operating system.
[0089] Figure 4 A flowchart of step S320 according to one embodiment of the present application is shown.
[0090] As shown in Figure 4 In one embodiment, when the event of detecting the change of the running state of the real-time middleware service programs occurs, the collected running state change information of the real-time middleware service programs is actively sent to the detection module 131, so as to timely notify the detection module 131 that the running state of the real-time middleware service programs changes. Further, the locally stored running state information of the real-time middleware service programs can be updated based on the collected running state change information of the real-time middleware service programs, so as to update the current running state of the real-time middleware service programs.
[0091] In one embodiment, after detecting the change of the running state of the real-time middleware service program, collecting the running state change information of the real-time middleware service program, the real-time middleware service program further checks whether the completeness state of the real-time running system changes. Specifically, by obtaining the current completeness state information of the real-time running system stored locally, the current completeness state of the real-time running system is determined, and then it is judged whether the change of the running state of the real-time middleware service program will cause the completeness state of the real-time running system to change. If it is determined that the completeness state of the real-time running system changes (i.e., the completeness state of the real-time running system after the change of the running state of the real-time middleware service program is inconsistent with the current completeness state), it is determined that the change of the running state of the real-time middleware service program needs to be reported to the detection module, and the change of the completeness state of the real-time running system is actively reported to the detection module. In addition, the completeness state information of the real-time running system stored locally can be updated. In addition, if it is determined that the completeness state of the real-time running system does not change, the change of the completeness state of the real-time running system does not need to be actively reported to the detection module. In this way, the change of the running state of the real-time middleware service program can be actively reported to the detection module 131 only when it is determined that the change of the running state of the real-time middleware service program causes the overall completeness state of the real-time running system to change, which can avoid unnecessary reporting events.
[0092] In addition, in one embodiment, after the completeness of the real-time middleware service program is detected, the corresponding real-time middleware service program detection result can be generated and sent to the detection module 131.
[0093] Finally, in step S330, the completeness of the real-time middleware running environment module is detected. When the software package corresponding to the real-time middleware running environment module is updated, the software package update is actively sent to the detection module 131 located in the upper layer of the operating system.
[0094] In one embodiment, the detection module 131 sends a third detection request to the real-time middleware running environment module to request the completeness detection of the real-time middleware running environment module. The real-time middleware running environment module detects the completeness of the real-time middleware running environment module in response to the third detection request sent by the detection module.
[0095] In the process of detecting the completeness of the real-time middleware running environment module, whether the real-time middleware running environment module completes the switching is checked.
[0096] In one embodiment, the middleware runtime environment module includes underlying dependent libraries (shared libraries), for example, the general middleware runtime environment module includes general dependent libraries (without real-time property) corresponding to the general middleware, and the real-time middleware runtime environment module includes real-time dependent libraries (with real-time property) corresponding to the real-time middleware. The dependent libraries corresponding to the real-time runtime system are the real-time dependent libraries with real-time property, the dependent libraries corresponding to the general runtime system are the general dependent libraries, and the general dependent libraries do not have real-time property.
[0097] When starting the real-time runtime system and switching the general runtime system to the real-time runtime system, in order to meet the real-time property requirement, the general middleware runtime environment module needs to be switched to the real-time middleware runtime environment module accordingly, specifically including: starting the real-time dependent libraries corresponding to the real-time middleware to replace the general dependent libraries corresponding to the general middleware. The dependent libraries include, for example, dependent libraries for memory management, dependent libraries for inter-process communication, dependent libraries for network communication, etc. When starting the real-time runtime system, the real-time dependent libraries are started so as to meet the real-time property requirement of the task running based on the real-time runtime system at runtime, enabling real-time access to memory, real-time inter-process communication, etc.
[0098] Based on this, in the process of detecting the completeness of the real-time middleware runtime environment module, specifically, it can include: checking whether the real-time dependent libraries corresponding to the real-time middleware have replaced the general dependent libraries corresponding to the general middleware.
[0099] It should be noted that, in the process of detecting the completeness of the real-time middleware runtime environment module, if the real-time middleware runtime environment module has not completed the switching (for example, the real-time dependent libraries have not completed the replacement), the software package update corresponding to the real-time middleware runtime environment module will be detected, and then the software package update is actively sent to the detection module 131 located in the upper layer of the operating system.
[0100] Figure 5 A flowchart of step S330 according to one embodiment of the present application is shown.
[0101] As shown in Figure 5 In one embodiment, when the software package update corresponding to the real-time middleware runtime environment module is detected, the software package update information corresponding to the real-time middleware runtime environment module is collected, and the collected software package update information is actively sent to the detection module 131, so as to timely notify the detection module 131 of the software package update corresponding to the real-time middleware runtime environment module.
[0102] Further, the software package information corresponding to the real-time middleware running environment module stored locally can be updated based on the software package update information corresponding to the real-time middleware running environment module collected this time, so as to update the software package information corresponding to the real-time middleware running environment module.
[0103] In one embodiment, after detecting the software package update corresponding to the real-time middleware running environment module and collecting the software package update information corresponding to the real-time middleware running environment module, the real-time middleware running environment module further checks whether the completeness state of the real-time running system has changed. Specifically, the current completeness state of the real-time running system is determined by acquiring the current completeness state information of the real-time running system stored locally, and then it is judged whether the software package update corresponding to the real-time middleware running environment module will cause the completeness state of the real-time running system to change. If it is determined that the completeness state of the real-time running system has changed (i.e., the completeness state of the real-time running system after the software package update corresponding to the real-time middleware running environment module is inconsistent with the current completeness state), it is determined that the completeness state change notification of the real-time running system needs to be reported to the detection module, and the completeness state change notification of the real-time running system is actively sent to the detection module. Moreover, the completeness state information of the real-time running system stored locally can be updated. In addition, if it is determined that the completeness state of the real-time running system has not changed, the completeness state change notification of the real-time running system does not need to be actively reported to the detection module. In this way, the software package update corresponding to the real-time middleware running environment module can be actively reported to the detection module 131 only when it is determined that the software package update corresponding to the real-time middleware running environment module will cause the overall completeness state of the real-time running system to change, which can avoid unnecessary reporting events.
[0104] In addition, in one embodiment, after detecting the completeness of the real-time middleware running environment module, the corresponding real-time middleware running environment module detection result can be generated and sent to the detection module 131.
[0105] In one embodiment, the detection module 131 can aggregate the kernel detection result, the real-time middleware service program detection result, and the real-time middleware running environment module detection result, and judge whether there is at least one detection result of completeness detection failure in the kernel detection result, the real-time middleware service program detection result, and the real-time middleware running environment module detection result.
[0106] If there is at least one detection result of completeness detection failure, it is determined that the real-time running system fails the completeness detection, i.e., it is determined that the completeness detection of the real-time running system as a whole fails. That is, if there is any one or more detection results of completeness detection failure, it is determined that the real-time running system fails the completeness detection, and the completeness detection of the real-time running system as a whole fails. It can be understood that when the completeness detection of the real-time running system as a whole fails, the cause of the change of the real-time running system can be analyzed based on the detection results collected by the detection module, so as to maintain the real-time running system.
[0107] If the kernel detection result, the real-time middleware service program detection result, and the real-time middleware running environment module detection result are all successful, it is determined that the real-time running system passes the completeness detection, i.e., it is determined that the completeness detection of the real-time running system as a whole is successful.
[0108] According to the detection method 300 of the real-time running system of the present application, the completeness of the real-time running system can be detected after the real-time running system is started, wherein whether the kernel switches to the real-time kernel mode corresponding to the real-time running system is detected, and the running state of the real-time middleware service program and the software package corresponding to the real-time middleware running environment module are detected, wherein when the running state of the real-time middleware service program is changed and / or the software package corresponding to the real-time middleware running environment module is updated, a change notification is actively reported to the upper-layer detection module. In this way, in the process of detecting the completeness of the real-time running system, the changed running state and the updated software package are reported to the upper-layer detection module based on the active reporting mode, which can improve the efficiency of the completeness detection of the real-time running system, avoid the problem of detection delay, and thus ensure that the real-time running program running based on the real-time running system can be stably and correctly run.
[0109] Further, according to the detection method of the real-time running system of the present application, when the running state of the real-time middleware service program is changed and / or the software package corresponding to the real-time middleware running environment module is updated, it is further determined whether the completeness state of the real-time running system will be changed, and only when it is determined that the completeness state of the real-time running system will be changed, a completeness state change notification is actively reported to the detection module. In this way, the completeness state change notification of the real-time running system can be accurately reported to the detection module, and unnecessary reporting events can be avoided.
[0110] Figure 6 A hardware structure schematic diagram of a computing device 100 according to an embodiment of the present application is shown. As shown in FIG. 1, the computing device 100 includes a processor 101, a memory 102, a storage 103, a network interface 104, an input device 105, and an output device 106. Figure 6As shown, the computing device 100 can include an input device 90, a processor 91, an output device 92, a memory 93, and at least one communication bus 94. The communication bus 94 is used to realize the communication connection between the elements. The memory 93 can contain a high-speed RAM memory, and can also include a non-volatile storage NVM, such as at least one disk storage. Various program instructions can be stored in the memory 93 for completing various processing functions and realizing the detection method of the real-time running system in the embodiments of the present application.
[0111] Optionally, the processor 91 can be a central processing unit (CPU), an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor, or other electronic elements, which is coupled to the input device 90 and the output device 92 through wired or wireless connection.
[0112] Optionally, the input device 90 can include various input devices, such as at least one of a user interface facing a user, a device interface facing a device, a programmable interface of software, a camera, and a sensor. Optionally, the device interface facing a device can be a wired interface for data transmission between devices, and can also be a hardware insertion interface (such as a USB interface, a serial port, etc.) for data transmission between devices. Optionally, the user interface facing a user can be a control button facing a user, a voice input device for receiving voice input, and a touch sensing device (such as a touch screen with touch sensing function, a touchpad, etc.) for receiving touch input of a user. Optionally, the programmable interface of software can be an entry for editing or modifying a program, such as an input pin interface or an input interface of a chip, etc. Optionally, the transceiver can be a radio frequency transceiver chip, a baseband processing chip, and a transceiving antenna with communication function, etc. The audio input device such as a microphone can receive voice data. The output device 92 can include a display, a sound device, etc.
[0113] In an embodiment of the present application, the computing device 100 includes one or more processors, and one or more readable storage media storing program instructions. When the program instructions are configured to be executed by the one or more processors, the computing device executes the detection method of the real-time running system in the embodiments of the present application.
[0114] The various techniques described herein can be implemented in connection with hardware or software or, where appropriate, with a combination of both. Thus, the methods and apparatus of the present application, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard disks, USB flash drives, optical tapes, CD-ROMs, or any other machine-readable storage medium, wherein, when the program code is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the subject application.
[0115] Where a program code is executed on a programmable computer, the mobile terminal generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute instructions in the program code stored in the memory to perform the detection method of the real-time operating system of the present application.
[0116] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order not to obscure the understanding of this description.
[0117] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order not to obscure the understanding of this description.
[0118] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order not to obscure the understanding of this description.
[0119] Similarly, it is to be understood that the embodiments of the present application can be alternately grouped together in a single embodiment, figure, or description of embodiments, for the purpose of brevity and clarity. However, none of the disclosure should be construed as reflecting an intention that the application of the claimed application is limited to less than all embodiments set forth in each and every claim.
[0120] Those skilled in the art understand that the modules or units or components of the devices in the examples disclosed herein can be arranged in the devices as described in the examples, or alternatively can be located in one or more devices different from the devices in the examples. The modules in the foregoing examples can be combined into one module or further divided into multiple sub-modules.
[0121] Those skilled in the art understand that the modules in the devices in the examples can be adaptively changed and arranged in one or more devices different from the examples. The modules or units or components in the examples can be combined into one module or unit or component, and further divided into multiple sub-modules or sub-units or sub-components. All features disclosed in this specification (including the claims, abstract, and drawings) and all methods disclosed in this specification can be combined in any combination, except where such features and / or processes are mutually exclusive. Each feature disclosed in this specification (including the claims, abstract, and drawings) can be replaced by alternative features providing the same, equivalent, or similar functionality unless otherwise stated.
[0122] Further, those skilled in the art understand that although some of the examples described herein include certain features of other examples but not others, combinations of features of the different examples are contemplated within the scope of the application and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
[0123] Further, some of the examples described herein are described as a combination of methods or method elements implemented by a processor of a computer system or by other means. Accordingly, a processor with the necessary instructions for performing such methods or method elements forms a means for performing the methods or method elements. Further, an element of a method performed by a processor as described herein forms a means for performing the function performed by that element of the method.
[0124] As used herein, unless otherwise indicated, the use of the ordinal adjectives "first", "second", "third", etc., merely to distinguish different instances of a similar object and does not imply a required or a given sequence.
[0125] While the application has been described in terms of several embodiments, those skilled in the art will recognize that the application can be practiced with modifications and alterations limited only by the spirit and scope of the claims. Additionally, although the application has been described above in the context of particular embodiments, the application can be practiced with the elements in other orders and / or used in other variations. Furthermore, unless specifically stated to the contrary, steps described above can be performed in any order. Accordingly, although specific embodiments have been illustrated and described herein, it is the intention that the application be practiced otherwise than as specifically described. Therefore, the scope of the present application is not intended to be limited to the specific form set forth herein, but on the contrary, is intended to cover such and variations and modifications as can come within the scope of the appended claims.
Claims
1. A method for detecting a real-time running system, executed in an operating system, the operating system comprising a kernel, a real-time running system and a general running system, the kernel being a fusion kernel based on a real-time kernel, a general kernel, and being adapted to switch between a real-time kernel mode and a general kernel mode, the real-time running system corresponding to the real-time kernel mode, the general running system corresponding to the general kernel mode, and a real-time middleware service program corresponding to the real-time running system, a real-time middleware runtime environment module corresponding to the real-time running system, and a detection module being deployed above the operating system, the method comprising the steps of: checking whether a debug switch of the kernel is in a closed state, and if the debug switch is in the closed state, determining that the kernel switches to the real-time kernel mode, and the kernel satisfies completeness; if the debug switch is in an open state, determining that the kernel does not switch to the real-time kernel mode, and the kernel does not satisfy completeness; detecting completeness of the real-time middleware service program, wherein when a running state change of the real-time middleware service program is detected, it is judged whether the running state change causes a completeness state of the real-time running system to change, and if the completeness state of the real-time running system changes, running state change information of the real-time middleware service program is collected, and the running state change information is actively sent to the detection module; and detecting completeness of the real-time middleware runtime environment module, wherein when a software package update corresponding to the real-time middleware runtime environment module is detected, it is judged whether the software package update causes the completeness state of the real-time running system to change, and if the completeness state of the real-time running system changes, software package update information corresponding to the real-time middleware runtime environment module is collected, and the software package update information is actively sent to the detection module. After switching from the general running system to the real-time running system, the completeness of the kernel is detected to determine whether the kernel is switched to the real-time kernel mode, comprising:
2. The method of claim 1, wherein the detecting completeness of the kernel comprises: detecting completeness of the kernel in response to a first detection request sent by the detection module; the detecting completeness of the real-time middleware service program comprises: detecting completeness of the real-time middleware service program in response to a second detection request sent by the detection module; and the detecting completeness of the real-time middleware runtime environment module comprises: detecting completeness of the real-time middleware runtime environment module in response to a third detection request sent by the detection module. The method further comprises the steps of: after detecting completeness of the kernel, generating a kernel detection result, and sending the kernel detection result to the detection module; after detecting completeness of the real-time middleware service program, generating a real-time middleware service program detection result, and sending the real-time middleware service program detection result to the detection module; and after detecting completeness of the real-time middleware runtime environment module, generating a real-time middleware runtime environment module detection result, and sending the real-time middleware runtime environment module detection result to the detection module. The detecting completeness of the real-time middleware service program comprises: 3. The method of claim 1, wherein, 4. The method of any one of claims 1-3, wherein, Check whether the CPU management service and the memory management service provided by the real-time middleware service program complete the switching.
5. The method of any one of claims 1-3, wherein, The completeness of the real-time middleware runtime environment module is detected, including: Check whether the real-time dependent library corresponding to the real-time middleware replaces the general dependent library corresponding to the general middleware.
6. The method of any one of claims 1-3, wherein, The real-time middleware service program includes: A fast interrupt service program adapted to interrupt the execution of a real-time task and perform interrupt processing when an interrupt signal is received; A real-time scheduling service program adapted to acquire a real-time task with the highest emergency level from a real-time task queue by using a real-time scheduling algorithm, so as to immediately execute the real-time task with the highest emergency level; A real-time running component adapted to provide a memory management service for the real-time task with the highest emergency level.
7. A computing device, comprising: at least one processor; and a memory storing program instructions configured to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any one of claims 1-6.
8. A readable storage medium storing program instructions, which, when read and executed by a computing device, cause the computing device to perform the method of any one of claims 1-6.
Citation Information
Patent Citations
Virtual machine monitor dynamic integrity detection method based on security chip
CN106529342A
Method and system for improving real-time performance of non-real-time operating system
CN109522099A