A method for detecting a real-time operating system and a computing device

By periodically checking the integrity of the kernel, real-time middleware service program, and environment modules in the real-time running system, the instability of the real-time running system caused by the complexity of hybrid running system modules is solved, and efficient integrity detection and stable operation are achieved.

CN114911658BActive Publication Date: 2025-11-25WUHAN SHENZHIDU TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210539454.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2025-11-25
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

In existing technologies, the modular complexity of multi-time characteristic hybrid operating systems makes the integrity of real-time operating systems susceptible to damage, affecting the stable operation of real-time applications.

Method used

A method for detecting real-time running systems is provided. This method performs integrity checks by periodically requesting the kernel, real-time middleware service program, and real-time middleware runtime environment module, and actively reports the test results to ensure that the system runs completely in real-time kernel mode.

Benefits of technology

It improves the efficiency of integrity detection in real-time operating systems, avoids detection delays, and ensures the stable operation of real-time applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911658B_ABST
    Figure CN114911658B_ABST
Patent Text Reader

Abstract

The application discloses a kind of detection methods of real-time running system and computing device, method is executed in the detection module on operating system, operating system includes kernel, real-time running system, method includes steps: periodically request kernel to carry out completeness detection, to determine whether kernel switches to real-time kernel mode, and receive the kernel detection result returned by kernel;Request real-time middleware service program to carry out completeness detection, and receive the real-time middleware service program detection result returned by real-time middleware service program;Request real-time middleware running environment module to carry out completeness detection, and receive the real-time middleware running environment module detection result returned by real-time middleware running environment module;Based on kernel detection result, real-time middleware service program detection result and real-time middleware running environment module detection result, determine whether real-time running system passes completeness detection.According to the technical scheme of the application, the change of real-time running system can be detected in time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of operating systems, and in particular 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 is developing into deeper and wider fields, and the topological distance between network terminals and network centers is constantly lengthening, affecting the timeliness of network application response. Network terminals are the dividing line between the digital world and the physical world, and network terminal devices usually have real-time requirements and need to complete computing tasks and feedback computing results within a limited time.

[0004] In the prior art, due to cost and other factors, the computing power of network terminal devices 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 needs to be 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 by improving the general operating system from the kernel, middleware, and API multiple levels. 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 unexpectedly close, pause or update, 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] Therefore, a real-time running system detection method is needed, which can detect the completeness of the real-time running system in a timely manner to solve the problems in the above technical solutions. SUMMARY

[0007] To this end, the application provides a detection method for a real-time running system and a computing device to solve or at least alleviate the above problems.

[0008] According to an aspect of the application, there is provided a detection method for a real-time running system, executed in a detection module on an operating system, the operating system comprising a kernel, a real-time running system, the method comprising the steps of: periodically requesting the kernel to perform completeness detection to determine whether the kernel switches to a real-time kernel mode, and receiving a kernel detection result returned by the kernel; requesting a real-time middleware service program to perform completeness detection, and receiving a real-time middleware service program detection result returned by the real-time middleware service program; requesting a real-time middleware running environment module to perform completeness detection, and receiving a real-time middleware running environment module detection result returned by the real-time middleware running environment module; and determining whether the real-time running system passes the completeness detection based on the kernel detection result, the real-time middleware service program detection result and the real-time middleware running environment module detection result.

[0009] Optionally, in the detection method for a real-time running system according to the application, the step of periodically requesting the kernel to perform completeness detection comprises: starting a timer; and in response to a trigger event of the timer, requesting the kernel to perform completeness detection.

[0010] Optionally, in the detection method for a real-time running system according to the application, the step of determining whether the real-time running system passes the completeness detection comprises: judging whether there is at least one detection result of failure in the kernel detection result, the real-time middleware service program detection result and the real-time middleware running environment module detection result; if yes, determining that the real-time running system fails to pass the completeness detection; and if no, determining that the real-time running system passes the completeness detection.

[0011] Optionally, in the detection method for a real-time running system according to the application, after it is determined that the real-time running system passes the completeness detection, the method further comprises the step of: restarting the timer.

[0012] Optionally, in the detection method for a real-time running system according to the application, the operating system further comprises a general running system; the kernel is a fusion kernel formed based on fusion of a real-time kernel and a general kernel, and is adapted to switch between the real-time kernel mode and a general kernel mode.

[0013] Optionally, in the detection method for a real-time running system according to the application, the completeness detection performed by the kernel comprises: checking whether the kernel switches to the real-time kernel mode; and if no, generating a kernel detection result of failure.

[0014] Optionally, in the detection method of the real-time running system according to the present application, the completeness detection performed by the real-time middleware service program comprises: checking whether the CPU management service and the memory management service provided by the real-time middleware service program complete the switching; if not, a detection failure result of the real-time middleware service program is generated.

[0015] Optionally, in the detection method of the real-time running system according to the present application, the completeness detection performed by the real-time middleware running environment module comprises: checking whether the real-time dependent library corresponding to the real-time middleware replaces the general dependent library corresponding to the general middleware; if not, a detection failure result of the real-time middleware running environment module is generated.

[0016] 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 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; and a real-time running component adapted to provide memory management service for the real-time task with the highest emergency level.

[0017] 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.

[0018] 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.

[0019] According to the technical scheme of the present application, a detection method of a real-time running system is provided, which can detect the completeness of the real-time running system after starting the real-time running system, wherein whether the kernel switches to the real-time kernel mode corresponding to the real-time running system is detected, and the completeness of the real-time middleware service program and the real-time middleware running environment module is 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, the change of the running state and the update of the software package are actively reported to the detection module of the upper layer. In this way, in the process of detecting the completeness of the real-time running system, the change of the running state and the update of the software package 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, avoid the problem of detection delay, and ensure that the real-time running program running based on the real-time running system can run stably and correctly.

[0020] The above description is only a summary of the technical scheme of the present application. In order to more clearly understand the technical means of the present application, the content of the specification can be implemented, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS

[0021] To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings. These aspects are indicative of various ways in which the principles disclosed herein can be practiced and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The foregoing and other objects, features, and advantages of the disclosure will be apparent from the following description of certain aspects as described below, taken in conjunction with the accompanying drawings in which like reference numbers in the various drawings are generally used to denote like elements or features, unless otherwise described in detail herein. The above-described and other difficulties autcomes, features, and advantages of the present disclosure will become apparent from the following description, taken in conjunction with the accompanying drawings in which like reference characters refer to like elements throughout. The drawings are in simplified form and are not to precise scale.

[0022] Figure 1 A schematic diagram of a computing device 100 in which a hybrid running system 120 is deployed is shown according to an embodiment of the present application;

[0023] Figure 2 A schematic diagram of a computing device 100 in which a detection module 131 is deployed is shown according to an embodiment of the present application;

[0024] Figure 3 、 Figure 4 Flowcharts of a detection method 300 of a real-time running system according to an embodiment of the present application are shown respectively;

[0025] Figure 5 A hardware structure schematic diagram of a computing device 100 according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] Exemplary embodiments of the present disclosure will be described in greater detail below 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 this disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.

[0027] 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 disclosure is shown. According to an application example, the computing device 100 can be an edge computing server applied in the field of edge computing.

[0028] As shown, 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 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 disclosure. Figure 1

[0029] Specifically, the application layer 130 can include one or more applications, runtime libraries, and interfaces provided by the hybrid runtime system. Herein, the present disclosure does not limit the types and quantities of the applications. Developers can develop the applications according to actual business requirements. Each application can invoke 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.

[0030] 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.

[0031] The hybrid runtime system 120 can provide a software runtime environment for tasks requested by one or more applications (including real-time tasks and computing tasks).

[0032] According to the hybrid runtime system 120 of the present disclosure, real-time tasks and computing tasks can be run simultaneously. It should be noted that a real-time task is a task that needs to be responded in a specified time, for example, a control task for a traffic light signal. A computing task is a task that requires high computing power for processing a large amount of data, for example, audio / video processing, database application, and the like.

[0033] ​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.

[0034] 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.

[0035] 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.

[0036] It should be noted that the preemptive kernel 121 in the application is a complete preemptive kernel, so as to ensure the basic real-time response capability and the fusion scheduling capability for 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.

[0037] 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.

[0038] 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.

[0039] 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.

[0040] 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.

[0041] 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.

[0042] 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.

[0043] 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.

[0044] 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.

[0045] 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.

[0046] 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.

[0047] 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 through the interrupt handler.

[0048] 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.

[0049] 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.

[0050] In an embodiment, the real-time scheduling algorithm can be implemented as a least slack first scheduling algorithm, that is, 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 task emergency (or slack). 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.

[0051] 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.

[0052] 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 tasks can have more running opportunities.

[0053] 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.

[0054] 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.

[0055] 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 registry. 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.

[0056] 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 registry, 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 registry, 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.

[0057] In addition, in one embodiment, as shown in Figure 1 The domain resource management service program 125 can be 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.

[0058] In an embodiment according to the present application, the computing device 100 is configured to perform 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 performing the detection method 300 of the real-time running system according to the present application, so that the computing device 100 performs the detection method 300 of the real-time running system according to the present application to detect the completeness of the real-time running system.

[0059] 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, and the detection module 131 contains a plurality of program instructions for performing the detection method 300 of the real-time running system according to the present application, so as to perform the completeness detection of the real-time running system by the detection module 131.

[0060] 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.

[0061] 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.

[0062] In an embodiment according to the present application, the operating system of the computing device 100 can be implemented as a 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.

[0063] 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 the real-time middleware, and the general running system corresponds to the general middleware.

[0064] In one embodiment of the present application, the middleware includes interfaces, runtime libraries, 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, the fast interrupt service program 1231, the general running component 1243, the general scheduling service program 1242, and the threaded interrupt service program 1241.

[0065] 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 interfaces, runtime libraries, 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. 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 interfaces, runtime libraries, and the real-time middleware service programs.

[0066] The general middleware corresponding to the general running system includes interfaces, runtime libraries, 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. 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 interfaces, runtime libraries, and the general middleware service programs.

[0067] It can be understood that the common middleware of the real-time middleware and the general middleware includes interfaces, runtime libraries, the application domain management module 126, and the domain resource management service program 125.

[0068] 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.

[0069] Figure 3 、 Figure 4 A flow chart of a detection method 300 of the real-time running system according to one embodiment of the present application is shown. The method 300 is suitable for being executed in the detection module 131 deployed on the operating system of the computing device 100.

[0070] 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.

[0071] After the real-time running system is started, during the operation of the real-time running system, the detection module 131 performs a completeness test on the real-time running system by executing the detection method 300 of the real-time running system of the present invention.

[0072] 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.

[0073] like Figure 3 and Figure 4 As shown, method 300 includes steps S310 to S340.

[0074] In step S310, during the operation of the real-time running system, the detection module 131 periodically requests the kernel to perform a completeness check to check whether the kernel has successfully switched to real-time kernel mode, and receives the kernel detection result returned by the detection module 131.

[0075] Here, after the kernel performs a integrity check in response to the first check request from the check module 131, a kernel check result can be generated and sent to the check module 131. The kernel check result is the result of whether the kernel integrity check was successful or failed.

[0076] In one embodiment, by starting a timer, each time the timer is triggered, the detection module 131 responds to the timer's trigger event and begins the integrity detection process for the real-time running system, first requesting the kernel to perform a integrity check. In other words, the detection module 131, in response to the timer's trigger event, first requests the kernel to perform a integrity check, thereby periodically sending integrity check requests to the kernel.

[0077] Specifically, when the timer triggers, the detection module 131 sends a first detection request to the kernel of the operating system, for example, can call the interface provided by the operating system to send the first detection request to the kernel, to request the kernel of the operating system to perform the completeness detection. The kernel performs the completeness detection on the kernel in response to the first detection request sent by the detection module.

[0078] It should be noted that after starting the real-time running system, it is necessary to ensure that the kernel is successfully switched to the real-time kernel mode corresponding to the real-time running system, that the middleware service program is switched to the real-time middleware service program, and that the middleware running environment module is switched to the real-time middleware running environment module. In an implementation manner, the kernel (fusion kernel) of the operating system has a debugging switch, and the kernel can be switched between the general kernel mode and the real-time kernel mode by controlling the opening or closing of the debugging switch.

[0079] Based on this, in the process of performing the completeness detection on the kernel, it can be 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. If it is determined that the kernel has been switched to the real-time kernel mode, the completeness detection on the kernel is passed, the kernel detection result of detection success is generated, and the kernel detection result of detection success is sent to the detection module 131. On the contrary, if the kernel has not been switched to the real-time kernel mode, the completeness detection on the kernel is not passed, the kernel detection result of detection failure is generated, and the kernel detection result of detection failure is sent to the detection module 131.

[0080] In an implementation manner, by checking whether the debugging switch of the kernel is in the closed state, if the debugging switch is in the closed state, it can be determined that the kernel is switched to the real-time kernel mode, that is, the current is in the real-time kernel mode, in this case, it is determined that the kernel meets the completeness, the completeness detection on the kernel is passed, and the corresponding kernel detection result is detection success. If the debugging switch is in the open state, it is determined that the kernel has not been switched to the real-time kernel mode, and the current is in the general kernel mode, in this case, it is determined that the kernel does not meet the completeness, and the corresponding kernel detection result is detection failure.

[0081] Subsequently, in step S320, the detection module 131 requests the real-time middleware service program to perform the completeness detection, and receives the real-time middleware service program detection result returned by the real-time middleware service program.

[0082] Here, the real-time middleware service program can generate the corresponding real-time middleware service program detection result after completing the completeness detection, and send the real-time middleware service program detection result to the detection module 131.

[0083] 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 real-time middleware service program to perform the completeness detection. The real-time middleware service program performs the completeness detection on the real-time middleware service program in response to the second detection request sent by the detection module.

[0084] In one embodiment, during the completeness detection of the real-time middleware service program, it is checked whether the real-time middleware service program completes the switching. For example, it is checked whether the middleware service program successfully switches from the general middleware service program to the real-time middleware service program.

[0085] As described above, the real-time middleware service program includes the fast interrupt service program, the real-time scheduling service program, and the real-time running component. The fast interrupt service program interrupts the execution of the real-time task and performs the interrupt processing when receiving the interrupt signal. The real-time scheduling service program acquires the real-time task with the highest emergency level from the real-time task queue by using the real-time scheduling algorithm, so that the CPU immediately executes the real-time task with the highest emergency level. The real-time running component provides the memory management service for the real-time task with the highest emergency level. During the starting of the real-time running system, the fast interrupt service program, the real-time scheduling service program, and the real-time running component are started, and based on these real-time middleware service programs, the CPU management service and the memory management service can be provided for the real-time application program running based on the real-time running system.

[0086] During the completeness detection of the real-time middleware service program, it is specifically checked whether the fast interrupt service program completes the switching, whether the real-time scheduling service program completes the switching, and whether the real-time running component completes the switching. In other words, it is checked whether the CPU management service and the memory management service provided by the real-time middleware service program complete the switching and are in the ready state. If the real-time middleware service program completes the switching (the CPU management service and the memory management service provided by the real-time middleware service program complete the switching and are in the ready state), the generated real-time middleware service program detection result is detection success, and the detection success real-time middleware service program detection result is sent to the detection module 131.

[0087] It should be noted that, in the process of performing completeness detection on the real-time middleware service program, if the real-time middleware service program does not complete switching (the CPU management service and the memory management service provided by the real-time middleware service program do not complete switching or are not in a ready state), or the memory pool of the real-time middleware service program is in a depleted state, it is detected that the running state of the real-time middleware service program is changed, a real-time middleware service program detection result of detection failure is generated, and the real-time middleware service program detection result of detection failure is sent to the detection module 131. It can be understood that if the running state of the real-time middleware service program is detected to change, the corresponding real-time middleware service program detection result is detection failure.

[0088] Subsequently, in step S330, the detection module 131 requests the real-time middleware running environment module to perform completeness detection, and receives the real-time middleware running environment module detection result returned by the real-time middleware running environment module.

[0089] Here, after performing completeness detection, the real-time middleware running environment module can generate a corresponding real-time middleware running environment module detection result, and send the real-time middleware running environment module detection result to the detection module 131.

[0090] In one embodiment, the detection module 131 sends a third detection request to the real-time middleware running environment module to request completeness detection on the real-time middleware running environment module. The real-time middleware running environment module performs completeness detection on the real-time middleware running environment module in response to the third detection request sent by the detection module.

[0091] In one embodiment, in the process of performing completeness detection on the real-time middleware running environment module, it includes checking whether the real-time middleware running environment module completes switching (whether it is currently switched to the real-time middleware running environment module).

[0092] In one embodiment, whether the real-time middleware running environment module completes switching can be determined by checking whether the software package corresponding to the real-time middleware running environment module is updated. If it is detected that the software package corresponding to the real-time middleware running environment module is updated (changed), it can be determined that the real-time middleware running environment module does not complete switching, and the corresponding real-time middleware running environment module detection result is detection failure.

[0093] 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) corresponding to the general middleware, and the real-time middleware runtime environment module includes real-time dependent libraries (with real-time) corresponding to the real-time middleware. The dependent libraries corresponding to the real-time runtime system are real-time dependent libraries with real-time, the dependent libraries corresponding to the general runtime system are general dependent libraries without real-time.

[0094] 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 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. By starting the real-time dependent libraries when starting the real-time runtime system, the tasks running based on the real-time runtime system can meet the real-time requirement at runtime, so that they can access memory in real time, perform inter-process communication in real time, etc.

[0095] Based on this, during the completeness detection of the real-time middleware runtime environment module, specifically 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. If the real-time dependent libraries corresponding to the real-time middleware have replaced the general dependent libraries corresponding to the general middleware (the real-time dependent libraries are currently started), the generated real-time middleware runtime environment module detection result is detection success, and the detection success runtime environment module detection result is sent to the detection module 131.

[0096] If the real-time dependent libraries corresponding to the real-time middleware have not replaced the general dependent libraries corresponding to the general middleware (the general dependent libraries are currently started), the real-time middleware runtime environment module detection result of detection failure is generated, and the real-time middleware runtime environment module detection result of detection failure is sent to the detection module 131.

[0097] It can be understood that if the real-time dependent libraries corresponding to the real-time middleware have not replaced the general dependent libraries corresponding to the general middleware, the software package update (change) corresponding to the real-time middleware runtime environment module will be detected, and the corresponding real-time middleware runtime environment module detection result is detection failure.

[0098] Finally, in step S340, the detection module 131 determines whether the real-time runtime system passes the completeness detection based on the received kernel detection result, real-time middleware service program detection result, and real-time middleware runtime environment module detection result. Thus, the completeness detection of the real-time runtime system is completed this time.

[0099] In one embodiment, the detection module 131 judges 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 runtime environment module detection result by aggregating the kernel detection result, the real-time middleware service program detection result and the real-time middleware runtime environment module detection result.

[0100] 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 whole real-time running system 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 whole real-time running system fails. Then, the next completeness detection process of the real-time running system can be started in response to the next triggering event of the timer. It can be understood that when the completeness detection of the whole real-time running system fails, the reason why the real-time running system changes can be analyzed based on the detection result aggregated by the detection module, so as to maintain the real-time running system.

[0101] If the kernel detection result, the real-time middleware service program detection result and the real-time middleware runtime 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 whole real-time running system is successful.

[0102] In addition, if the kernel detection result, the real-time middleware service program detection result and the real-time middleware runtime environment module detection result are all successful, the completeness detection passes, and the timer is restarted so as to start the next completeness detection process of the real-time running system.

[0103] 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 periodically during the running of the real-time running system, wherein the detection module periodically requests the kernel, the real-time middleware service program and the real-time middleware runtime environment module to perform the completeness detection, receives the detection results returned by the kernel, the real-time middleware service program and the real-time middleware runtime environment module, and finally determines whether the real-time running system passes the completeness detection based on the detection results of the three, wherein if there is at least one detection result of detection failure, the completeness detection result of the real-time running system is failure. In this way, the change of the real-time running system can be detected in time, and data basis is provided for the maintenance of the real-time running system, so as to ensure that the real-time running program based on the real-time running system can run stably and correctly.

[0104] Figure 5 A hardware structure schematic diagram of the computing device 100 according to one embodiment of the present application is shown. As shown in FIG. 1, the computing device 100 includes a central processing unit (CPU) 101, a memory 102, a storage device 103, an input device 104, an output device 105 and a bus 106.Figure 5 As 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.

[0105] 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.

[0106] 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 with communication function, a baseband processing chip, and a transceiving antenna, etc. The audio input device such as a microphone can receive voice data. The output device 92 can include a display, an audio output device, etc.

[0107] 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.

[0108] 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.

[0109] 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.

[0110] 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.

[0111] 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.

[0112] 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.

[0113] 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.

[0114] 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.

[0115] 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 or processes 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.

[0116] 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.

[0117] 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, elements of a method or process described herein are examples of means for performing the function performed by the elements of the method or process.

[0118] 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 or order of those instances.

[0119] 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 appended claims. As noted above, the use of the first, second, third, etc. adjectives to describe similar objects is merely used for readability and teaching purposes, and is not intended to limit the scope of the application to only those embodiments having the features described with respect to such adjectives. Accordingly, the disclosure of the present application is intended to be illustrative, but not limiting, of the scope of the application, which is set forth in the following claims.

Claims

1. A method for detecting a real-time running system, executed in a detection module on 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, 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 and a real-time middleware service program, the real-time running system corresponding to a real-time middleware runtime environment module, the general running system corresponding to the general kernel mode and a general middleware service program, the general running system corresponding to a general middleware runtime environment module, the method comprising the steps of: during the running of the real-time running system, requesting the kernel to perform completeness detection to determine whether the kernel switches to the real-time kernel mode and receiving a kernel detection result returned by the kernel; requesting the real-time middleware service program to perform completeness detection, comprising: checking whether CPU management services and memory management services provided by the real-time middleware service program complete the switch, and if not, generating a real-time middleware service program detection result of detection failure; receiving a real-time middleware service program detection result returned by the real-time middleware service program; requesting the real-time middleware runtime environment module to perform completeness detection, comprising: checking whether a real-time dependent library corresponding to the real-time middleware replaces a general dependent library corresponding to the general middleware, and if not, generating a real-time middleware runtime environment module detection result of detection failure; receiving a real-time middleware runtime environment module detection result returned by the real-time middleware runtime environment module; determining whether there is at least one detection result of detection failure in the kernel detection result, the real-time middleware service program detection result and the real-time middleware runtime environment module detection result; if yes, determining that the real-time running system fails the completeness detection; and if not, determining that the real-time running system passes the completeness detection. The step of requesting the kernel to perform completeness detection comprises: starting a timer; and in response to a trigger event of the timer, requesting the kernel to perform completeness detection. After determining that the real-time running system passes the completeness detection, the method further comprises the step of: restarting the timer. The completeness detection performed by the kernel comprises: checking whether the kernel switches to the real-time kernel mode; and if not, generating a kernel detection result of detection failure. The real-time middleware service program comprises: a fast interrupt service program adapted to interrupt an executing 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 urgency 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 urgency; and a real-time running component adapted to provide memory management services for the real-time task with the highest urgency.

6. A computing device comprising: at least one processor; and ​ ​ ​ ​ ​ ​ ​ 2. The method of claim 1, wherein, ​ ​ ​ 3. The method of claim 1, wherein, ​ ​ 4. The method of any one of claims 1-3, wherein, ​ ​ ​ 5. The method of any one of claims 1-3, wherein, ​ ​ ​ ​ ​ ​ ​ 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-5.

7. 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-5.

Citation Information

Patent Citations

  • Virtual machine monitor dynamic integrity detection method based on security chip

    CN106529342A