CN115168013A - Task running system and method and computing device - Google Patents

Task running system and method and computing device Download PDF

Info

Publication number
CN115168013A
CN115168013A CN202210927215.2A CN202210927215A CN115168013A CN 115168013 A CN115168013 A CN 115168013A CN 202210927215 A CN202210927215 A CN 202210927215A CN 115168013 A CN115168013 A CN 115168013A
Authority
CN
China
Prior art keywords
interrupt
task
real
time
domain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210927215.2A
Other languages
Chinese (zh)
Inventor
钟俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Deepin Technology Co ltd
Original Assignee
Wuhan Deepin Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Deepin Technology Co ltd filed Critical Wuhan Deepin Technology Co ltd
Priority to CN202210927215.2A priority Critical patent/CN115168013A/en
Publication of CN115168013A publication Critical patent/CN115168013A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a task running system, a task running method and a computing device, wherein the task running system comprises a preemptive kernel, an interrupt preprocessing module, a real-time running time domain and a general running time domain, wherein the real-time running time domain and the general running time domain are arranged on the interrupt preprocessing module; when the real-time running time domain receives an interrupt signal, interrupting the real-time task which is being executed and carrying out interrupt processing, and acquiring the real-time task with the highest emergency degree from the real-time task queue so as to immediately execute the real-time task with the highest emergency degree; and when the general operation time domain receives an interrupt signal, acquiring the highest-priority calculation type task from the calculation type task queue, interrupting the low-priority calculation type task and performing interrupt processing so as to immediately execute the highest-priority calculation type task. According to the technical scheme of the invention, the mixed operation of real-time tasks and calculation tasks can be realized.

Description

Task running system and method and computing device
This application is a divisional application of the invention patent application 2022104630832 filed on 29/4/2022.
Technical Field
The present invention relates to the field of edge computing and operating systems, and in particular, to a task running system, a task running method, and a computing device.
Background
The cloud computing technology improves the utilization rate of hardware resources by carrying out separated management on the resources, greatly reduces the use cost of an IT information system, and simultaneously improves the usability of the system. At present, the mainstream large internet service is based on the infrastructure provided by cloud computing.
With the development of the 5G technology, the internet develops to a deeper and wider field, and the topological distance between a network terminal and a network center is continuously lengthened, so that the timeliness of network application response is influenced. The network terminal is a boundary between the digital world and the physical world, and the network terminal device usually has a requirement on real-time performance, and needs to complete a calculation task and feed back a calculation result within a limited time.
In the prior art, because factors such as cost are considered, the computing capability of the network terminal device is generally weak, and the computing resources of the cloud center are required to be used for completing the computing tasks of the core part, and then the computing tasks of the rest part are completed by the network terminal device. However, the distance between the cloud center and the network terminal is long, so that the real-time performance of interaction is influenced in the network transmission process. 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 the computing resources and the physical distance.
The existing operating systems include both real-time operating systems and general-purpose operating systems. For network terminal equipment, a real-time operating system is generally adopted to ensure the real-time performance of task operation. For a cloud-centric server, a general-purpose operating system is generally adopted to obtain the maximum utilization rate of computing resources.
For edge compute server nodes, both compute-type tasks and real-time tasks need to be run. Therefore, neither the existing single real-time operating system nor the general-purpose operating system can satisfy the requirements of the edge computing server node.
Therefore, a task execution system with mixed time domain characteristics is needed to solve the problems in the prior art.
Disclosure of Invention
To this end, the present invention provides a task execution system, a task execution method and a computing device to solve or at least alleviate the above-existing problems.
According to an aspect of the present invention, there is provided a task execution system adapted to be deployed in an edge computing server, the system including a preemptive kernel, an interrupt preprocessing module arranged above the preemptive kernel, a real-time execution time domain and a general-purpose execution time domain arranged above the interrupt preprocessing module, wherein: the interrupt preprocessing module is suitable for responding to an interrupt signal generated by hardware, determining an interrupt type according to the interrupt signal, and sending the interrupt signal to a corresponding running time domain for processing according to the interrupt type; the real-time running time domain is suitable for interrupting the real-time task being executed and carrying out interrupt processing when an interrupt signal is received, and acquiring the real-time task with the highest emergency degree from the real-time task queue so as to immediately execute the real-time task with the highest emergency degree; the general operation time domain is suitable for acquiring a highest-priority calculation type task from a calculation type task queue when an interrupt signal is received, interrupting a low-priority calculation type task and performing interrupt processing so as to immediately execute the highest-priority calculation type task.
Optionally, in the task execution system according to the present invention, the real-time execution time domain includes: the fast interrupt module is suitable for interrupting the real-time task which is being executed and carrying out interrupt processing when receiving the interrupt signal; the real-time scheduling module is suitable for acquiring a real-time task with the highest emergency degree from the 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 the real-time operation module is suitable for providing memory management service for the real-time task with the highest emergency degree.
Optionally, in the task execution system according to the present invention, the fast interrupt module is further adapted to: and sending the interrupt signal to the processor so that the processor searches the corresponding interrupt processing program from the rapid interrupt vector table, and interrupting the real-time task being executed by the interrupt processing program and performing interrupt processing.
Optionally, in the task execution system according to the present invention, the general execution time domain includes: the general scheduling module is suitable for acquiring a highest-priority computational task from a computational task queue by using a fair scheduling algorithm when an interrupt signal is received so as to immediately execute the highest-priority computational task; the thread interrupt module is suitable for interrupting the low-priority computing task and performing interrupt processing; and the general operation module is suitable for providing memory management service for the calculation type task with the highest priority.
Optionally, in the task execution system according to the present invention, the threaded interrupt module is further adapted to: sending the interrupt signal to a processor so that the processor converts the interrupt signal into a corresponding interrupt request and searches one or more interrupt processing programs associated with the interrupt request from an interrupt request registry; sequentially waking one or more processing threads corresponding to the one or more interrupt handlers to interrupt the low-priority computing-type task and perform interrupt handling via the one or more processing threads.
Optionally, in the task execution system according to the present invention, the fair scheduling algorithm includes a CFS scheduling algorithm.
Optionally, in the task execution system according to the present invention, the real-time scheduling algorithm includes a minimum slack priority scheduling algorithm.
Optionally, in the task execution system according to the present invention, the interrupt preprocessing module is further adapted to: and acquiring interrupt source information from the interrupt signal, and determining the interrupt type according to the interrupt source information.
According to an aspect of the present invention, there is provided a task execution method executed in a task execution system, the system including a preemptive kernel, an interrupt preprocessing module arranged above the preemptive kernel, a real-time execution time domain and a general-purpose execution time domain arranged above the interrupt preprocessing module, the method including the steps of: the interrupt preprocessing module responds to an interrupt signal generated by hardware, determines an interrupt type according to the interrupt signal, and sends the interrupt signal to a corresponding running time domain for processing according to the interrupt type; when the real-time running time domain receives an interrupt signal, interrupting an executing real-time task and performing interrupt processing, and acquiring a real-time task with the highest emergency degree from a real-time task queue so as to immediately execute the real-time task with the highest emergency degree; and when the general operation time domain receives an interrupt signal, acquiring the highest-priority calculation type task from the calculation type task queue, interrupting the low-priority calculation type task and performing interrupt processing so as to immediately execute the highest-priority calculation type task.
According to an aspect of the invention, there is provided a computing device comprising: at least one processor; a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the task execution method as described above.
According to an aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform a task execution method as described above.
According to the technical scheme, the task running system can meet the requirement of mixed running of the real-time task and the calculation type task by setting the real-time running time domain and the general running time domain. The interrupt preprocessing module can respond to an interrupt signal generated by hardware, and allocates the interrupt signal to a corresponding running time domain according to the interrupt type for processing. And when the real-time running time domain receives an interrupt signal, immediately interrupting the real-time task which is being executed and performing interrupt processing, and selecting the real-time task with the highest urgency degree from the real-time task queue of the CPU so that the CPU immediately executes the real-time task with the highest urgency degree. When the general operation time domain receives an interrupt signal, the general operation time domain firstly acquires the highest priority computing task from the computing task queue of the CPU, and then can interrupt the executing low priority computing task and perform interrupt processing so that the CPU immediately executes the highest priority computing task. Therefore, the task operation system has the mixed time domain characteristic, can realize the priority processing of the real-time task with the highest emergency degree, can realize the priority processing of the calculation type task with the highest priority, and can realize the scheduling execution of the real-time task and the calculation type task at the same time. Therefore, the requirements of mixed services on computing capacity and real-time control capacity can be met, and the requirements of the edge computing server node on mixed operation of real-time tasks and computing tasks are also met. In addition, due to the limited resources of the edge computing server nodes, the task running system based on the invention can realize the mixed running of real-time tasks and computing tasks on one platform, so that the limited resources can be optimally and fully utilized. Moreover, the task operation system is deployed at the edge computing server node, so that a more complete network information system can be formed by connecting the cloud center server and the network terminal equipment, and the problem of slow response caused by too long physical distance between the cloud center server and the network terminal is solved.
The above description is only an overview of the technical solutions of the present invention, and the present invention can be implemented in accordance with the content of the description so as to make the technical means of the present invention more clearly understood, and the above and other objects, features, and advantages of the present invention will be more clearly understood.
Drawings
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, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 shows a schematic diagram of a task execution system 120 deployed in an edge compute server 100, according to one embodiment of the present invention;
FIG. 2 shows a schematic diagram of a computing device 200, according to one embodiment of the invention;
FIG. 3 shows a flow diagram of a task execution method 300 according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may 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 disclosure to those skilled in the art.
Fig. 1 shows a schematic diagram of a task execution system 120 deployed in an edge computing server 100 according to an embodiment of the present invention.
As shown in fig. 1, the edge computing server 100 may include a hardware layer 110, a task execution system 120, and an application layer 130. In some embodiments, the task execution system 120 may be a part of the operating system, that is, the task execution system 120 is included in the operating system of the edge computing server 100. In still other embodiments, the operating system of the edge computing server 100 may be implemented as the task execution system 120 of the present invention.
Specifically, the application layer 130 may include one or more applications, and the present invention is not limited to the kind and number of the applications. Developers can also develop applications based on actual business needs. Each application may call an interface provided by the task execution system to request the business execution system to perform the task. In one embodiment, the applications include, for example, applications for hybrid environment monitoring, applications for hybrid traffic debugging, applications for hybrid traffic analysis, and the like.
The hardware layer 110 may provide a hardware environment for running a task execution system and an application. The hardware layer 110 may include a processor (CPU), an internal memory, and may further include an external hardware device such as a network card, a hard disk, and a keyboard.
The task execution system 120 may provide an execution environment for one or more tasks that the application requests to execute, including real-time tasks and computing-type tasks.
The task execution system 120 according to the present invention can simultaneously execute a real-time task and a computational task. It should be noted that the real-time task is a task that needs to respond in a predetermined time, for example, a task of controlling a traffic light signal. The computing task is a task which needs to process a large amount of data and has high requirement on computing capacity, such as audio and video processing, database application and the like.
The real-time task and the computing task have different requirements in aspects of interrupt processing, scheduling processing, memory management and the like. Specifically, in terms of interrupt processing, a real-time task needs to execute a task with the highest degree of urgency as soon as possible by interrupt processing; for computational tasks, however, it is undesirable for the currently executing task to be interrupted frequently. In the aspect of scheduling processing, real-time tasks need to be scheduled as soon as possible after an event arrives; for computing services, however, it is undesirable for the currently executing task to be scheduled out frequently. In the memory management method, the real-time tasks need to be stored in the memory completely instead of being replaced by the virtual memory; the computing task needs to fully utilize the virtual memory to realize large-scale data computation because a large amount of data needs to be processed.
In view of the requirements of real-time tasks and computing tasks in terms of interrupt handling, scheduling processing, memory management, etc., the present invention provides a task execution system 120 capable of scheduling and executing real-time tasks and computing tasks simultaneously.
According to an embodiment of the present invention, as shown in fig. 1, the task execution system 120 includes a preemptive kernel 121, an interrupt preprocessing module 122 disposed above the preemptive kernel 121, and a runtime system disposed above the interrupt preprocessing module 122. The runtime system includes a real-time runtime domain 123 and a general runtime domain 124 (non-real-time runtime domain), where the real-time runtime domain 123 may provide a runtime environment for a real-time task, and the general runtime domain 124 may provide a runtime environment for a computing task.
It should be noted that the preemptive kernel 121 in the present invention adopts a full preemptive kernel to ensure the basic real-time response capability and the fused scheduling capability for resources. Each running time domain adopts a complete independent core software stack, so that the two running time domains are isolated from each other, and the independence of real-time tasks and calculation type tasks with different time characteristics during running is ensured.
In one embodiment, as shown in fig. 1, the task execution system 120 further includes an application domain management module 126 located above the real-time execution time domain 123 and the general execution time domain 124, and the application domain management module 126 may provide a unified domain control interface for one or more applications of the upper application layer, so that the applications request execution of tasks by calling the domain control interface. The application domain management module 126 may receive task execution requests sent by one or more applications and assign tasks to corresponding domains for execution according to types of the tasks. That is, when the task is a real-time task, the real-time task is allocated to the real-time running time domain 123 for execution, and the real-time running time domain 123 may provide a real-time running environment for the running of the real-time task. When the task is a computational task, the computational task is assigned to the general runtime 124 for execution, and the general runtime 124 can provide a general runtime environment for the operation of the computational task.
According to an embodiment of the present invention, each module in the real-time running time domain 123 is configured to prioritize the real-time task with the highest urgency, and each module in the general running time domain 124 is configured to prioritize the computing task with the highest priority.
Specifically, the preemptive core 121 may receive hardware generated interrupt signals, i.e., hardware interrupt signals. The hardware interrupt signal is automatically generated by a hardware device (e.g., network card, hard disk, keyboard, etc.) communicatively coupled to task execution system 120. The preemptive core 121 may then send the interrupt signal from the hardware to the interrupt preprocessing module 122, so that the interrupt signal is assigned to the corresponding runtime domain by the interrupt preprocessing module 122 for processing.
The interrupt preprocessing module 122 may, in response to an interrupt signal generated by hardware, determine an interrupt type according to the interrupt signal, and allocate the interrupt signal to a corresponding runtime domain (a real-time runtime domain 123 or a general runtime domain 124) according to the interrupt type for processing. Here, the interrupt signal includes interrupt source information, and the interrupt preprocessing module 122 may 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 most urgent real-time task or the highest priority computing task needs to be executed immediately.
When receiving the interrupt signal, the real-time running time domain 123 first interrupts the real-time task being executed and performs interrupt processing, and then may obtain the real-time task with the highest urgency from the real-time task queue of the processor (CPU) by using a real-time scheduling algorithm, so that the processor (CPU) can immediately execute the real-time task with the highest urgency. In this case, the real-time task corresponding to the highest degree of urgency preempts the usage right of the processor. It can be understood that, when receiving the interrupt signal, the real-time running time domain 123 first performs interrupt processing on the task being executed, and then performs scheduling processing.
The general runtime 124, upon receiving the interrupt signal, first obtains the highest priority compute task from the compute task queue of the processor, for example, the highest priority compute task may be obtained from the compute task queue based on a fair scheduling algorithm. Further, the executing low priority computing-type task may be interrupted and the interrupt process performed so that the processor immediately executes the highest priority computing-type task.
Further, after selecting the highest priority computing-type task from the computing-type task queue, the general runtime 124 needs to determine whether the selected highest priority computing-type task is an executing computing-type task. If the highest priority computational task is not an executing computational task, indicating that the executing computational task currently belongs to a low priority computational task, then the executing low priority computational task (i.e., the previous highest priority computational task) is interrupted and interrupt processing is performed so that the processor immediately switches to executing the highest priority computational task. At this time, the task corresponding to the highest priority computing type preempts the use right of the processor.
In addition, if the selected highest-priority computing task is the executing computing task, the executing computing task does not need to be interrupted and the interrupt processing does not need to be carried out, so that the situation that the computing task is frequently interrupted is avoided. It is to be understood that the general runtime 124 first performs a scheduling process when an interrupt signal is received, and then determines whether an interrupt process is required.
According to an embodiment of the present invention, the real-time runtime 123 includes a fast interrupt module 1231, a real-time scheduling module 1232, and a real-time runtime module 1233. During the operation of the real-time task with the highest urgency, the real-time operation module 1233 may provide a memory management service for the operation of the real-time task with the highest urgency.
The fast interrupt module 1231 runs on the processor, and the fast interrupt module 1231 can interrupt the real-time task being executed and perform interrupt processing when receiving the interrupt signal.
Further, the fast interrupt module 1231 can be bound to an interrupt handler. The fast interrupt module 1231 may send the interrupt signal to the processor upon receiving the interrupt signal, and the processor may send the interrupt signal to the interrupt handler by looking up a corresponding interrupt handler (i.e., the interrupt handler bound to the fast interrupt module 1231) from the fast interrupt vector table, so as to interrupt the real-time task being executed and perform the interrupt processing through the interrupt handler.
It should be noted that the interrupt processing refers to a processing procedure in which, when a new task requiring priority execution occurs, the processor temporarily suspends execution of the current task and then executes the new task (for example, the real-time task with the highest degree of urgency or the highest-priority computation-type task in the above-described embodiment).
The real-time scheduling module 1232 may obtain the most urgent real-time task from the real-time task queue using a real-time scheduling algorithm, so that the processor immediately executes the most urgent real-time task.
In one embodiment, the real-time scheduling algorithm may be implemented as a minimum slack priority scheduling algorithm, that is, the real-time task with the highest urgency may be obtained from the real-time task queue by using the minimum slack priority scheduling algorithm. It should be noted that the minimum slack priority scheduling algorithm determines the priority of the task according to the degree of urgency (or slack) of the task. For the embodiment of the invention, the higher the urgency of the real-time task, the higher the priority given to the real-time task so as to preferentially execute the real-time task with the highest urgency. In the real-time task queue, each real-time task is sorted according to the slack from low to high (namely, the urgency is from high to low), wherein the real-time task with the lowest slack (the urgency is the highest) is arranged at the front of the real-time task queue and is scheduled to be executed preferentially. The sag is calculated as follows: slack for real-time tasks = time that must be completed-its own run time-current time. According to the algorithm, when the minimum slack of a real-time task is reduced to 0, the real-time scheduling module 1232 must immediately schedule the real-time task to immediately preempt the processor, so as to ensure that the real-time task is executed and completed according to the requirement of the deadline.
The general runtime domain 124 includes a general scheduling module 1242, a threaded interrupt module 1241, and a general runtime module 1243, according to an embodiment of the present invention. The general execution module 1243 may provide memory management services for the highest priority compute task during its execution.
The general scheduling module 1242 may select and fetch the highest priority computational task from the computational task queue of the processor using a fair scheduling algorithm upon receiving the interrupt signal, so that the processor immediately executes the highest priority computational task. In one implementation, the fair scheduling algorithm may be implemented as a CFS scheduling algorithm. The generic scheduling module 1242 may select the highest priority computational task from the processor's task queue using a CFS scheduling algorithm. Specifically, according to the CFS scheduling algorithm, the general scheduling module 1242 always selects the slowest-running computing task from the computing task queue as the highest-priority computing task, so that the slowest-running computing task may get more running opportunities.
If the highest priority calculation-type task is an executing calculation-type task, the executing calculation-type task is continuously executed, and the executing calculation-type task does not need to be interrupted.
If the highest priority computational task is not an executing computational task, in other words, the executing computational task is a low priority computational task, then the executing low priority computational task is further interrupted and interrupted by the threaded interrupt module 1241.
In one embodiment, the threaded interrupt module 1241 runs on top of a processor. The threaded interrupt module 1241 may specifically interrupt an executing low-priority computing task and perform interrupt processing according to the following method: the interrupt signal may be sent to a processor by converting the interrupt signal to a corresponding Interrupt Request (IRQ) and looking up one or more interrupt handlers associated with the interrupt request from an interrupt request registry. And, the processor sequentially wakes up one or more processing threads corresponding to the one or more interrupt handlers to interrupt the executing low priority computing type task and perform interrupt processing via the one or more processing threads.
Specifically, the interrupt handler associated with the interrupt request may include a plurality. In the process of searching the interrupt processing programs associated with the interrupt request from the interrupt request registry, the processor wakes up the processing thread corresponding to the interrupt processing program every time one associated interrupt processing program is searched, so as to interrupt the executing low-priority computing type task and perform interrupt processing through the processing thread, and after waiting for the completion of the execution of the processing thread, then looks up the next associated interrupt processing program from the interrupt request registry, wakes up the next processing thread corresponding to the next interrupt processing program, and waits for the completion of the execution of the next processing thread. And repeating the steps until the execution of the processing threads corresponding to all the interrupt processing programs related to the interrupt request is completed, thereby completing the interrupt processing.
In addition, in an embodiment, as shown in fig. 1, a domain resource management module 125 may be further disposed between the real-time runtime domain 123 and the general runtime domain 124, and the domain resource management module 125 is configured to separate resources of the real-time runtime domain 123 and the general runtime domain 124, so as to ensure isolation of resources and characteristics between the real-time runtime domain 123 and the general runtime domain 124.
According to the task execution system 120 of the present invention, the real-time task and the calculation-type task can be mixedly executed by setting the real-time execution time domain and the general execution time domain. The interrupt preprocessing module can respond to an interrupt signal generated by hardware, and allocates the interrupt signal to a corresponding running time domain according to the interrupt type for processing. And when the real-time running time domain receives an interrupt signal, immediately interrupting the real-time task which is being executed and performing interrupt processing, and selecting the real-time task with the highest emergency degree from the real-time task queue of the CPU so that the CPU immediately executes the real-time task with the highest emergency degree. When receiving an interrupt signal, the general-purpose running time domain firstly acquires a highest-priority computational task from a computational task queue of the CPU, and then can interrupt a low-priority computational task which is being executed and interrupt processing so that the CPU immediately executes the highest-priority computational task. Therefore, the task operation system has the mixed time domain characteristic, can realize the priority processing of the real-time task with the highest emergency degree, can realize the priority processing of the calculation type task with the highest priority, and can realize the scheduling execution of the real-time task and the calculation type task at the same time. Therefore, the requirements of mixed services on computing capacity and real-time control capacity can be met, and the requirements of the edge computing server node on mixed operation of real-time tasks and computing tasks are also met. In addition, because the resources of the edge computing server nodes are limited, the task running system based on the invention can realize the mixed running of real-time tasks and computing tasks on one platform, thereby optimally and fully utilizing the limited resources. Moreover, the task operation system is deployed at the edge computing server node, so that a more complete network information system can be formed by connecting the cloud center server and the network terminal equipment, and the problem of slow response caused by too long physical distance between the cloud center server and the network terminal is solved.
According to one embodiment of the invention, the edge computing server 100 may implement a computing device 200 as shown below.
FIG. 2 shows a schematic diagram of a computing device 200, according to one embodiment of the invention.
As shown in FIG. 2, in a basic configuration 202, a computing device 200 typically includes a system memory 206 and one or more processors 204. A memory bus 208 may be used for communicating between the processor 204 and the system memory 206.
Depending on the desired configuration, the processor 204 may be any type of processing, including but not limited to: a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof. The processor 204 may include one or more levels of cache, such as a level one cache 210 and a level two cache 212, a processor core 214, and registers 216. Example processor core 214 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 218 may be used with the processor 204, or in some implementations the memory controller 218 may be an internal part of the processor 204.
Depending on the desired configuration, system memory 206 may be any type of memory including, but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 206 may include an operating system 220, one or more applications 222, and program data 224. The application 222 is actually a plurality of program instructions that direct the processor 204 to perform corresponding operations. In some embodiments, application 222 may be arranged to cause processor 204 to operate with program data 224 on an operating system.
Computing device 200 also includes storage device 232, storage device 232 including removable storage 236 and non-removable storage 238.
Computing device 200 may also include a storage interface bus 234. The storage interface bus 234 enables communication from the storage devices 232 (e.g., removable storage 236 and non-removable storage 238) to the basic configuration 202 via the bus/interface controller 230. Operating system 220, applications 222, and at least a portion of program data 224 may be stored on removable storage 236 and/or non-removable storage 238, and loaded into system memory 206 via storage interface bus 234 and executed by one or more processors 204 when computing device 200 is powered on or applications 222 are to be executed.
Computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to the basic configuration 202 via the bus/interface controller 230. The example output device 242 includes an image processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 252. Example peripheral interfaces 244 can include a serial interface controller 254 and a parallel interface controller 256, which can be configured to facilitate communications with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 258. An example communication device 246 may include a network controller 260, which may be arranged to facilitate communications with one or more other computing devices 262 over a network communication link via one or more communication ports 264.
A network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media, such as carrier waves or other transport mechanisms, in a modulated data signal. A "modulated data signal" may be a signal that has one or more of its data set or its changes made in a manner that encodes information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or private-wired network, and various wireless media such as acoustic, radio Frequency (RF), microwave, infrared (IR), or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
In an embodiment in accordance with the invention, the computing device 200 is configured to perform a task execution method 300 in accordance with the invention. The operating system of the computing device 200 includes a plurality of program instructions for performing the task execution method 300 of the present invention, such that the computing device performs the hybrid execution of real-time tasks and computing-type tasks by performing the task execution method 300 of the present invention.
In one embodiment of the invention, the task execution system 120 is included in the operating system of the computing device 200, and the task execution system 120 is configured to perform the task execution method 300 according to the invention.
FIG. 3 shows a flow diagram of a task execution method 300 according to one embodiment of the invention. The method 300 is suitable for execution in the task execution system 120. The task execution system 120 may be deployed in an edge server 100 (e.g., the aforementioned computing device 200).
As shown in FIG. 3, the method 300 includes steps S310-S330.
In step S310, the interrupt preprocessing module 122 determines an interrupt type according to the interrupt signal in response to the interrupt signal generated by the hardware, and allocates the interrupt signal to a corresponding runtime domain (the real-time runtime domain 123 or the general runtime domain 124) according to the interrupt type for processing. Here, the interrupt signal includes interrupt source information, and the interrupt preprocessing module 122 may 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 most urgent real-time task or the highest priority computing task needs to be executed immediately.
In step S320, when receiving the interrupt signal, the real-time running time domain 123 first immediately interrupts the real-time task being executed and performs interrupt processing, and then may obtain the real-time task with the highest urgency from the real-time task queue of the CPU by using a real-time scheduling algorithm, so that the CPU immediately executes the real-time task with the highest urgency. In this case, the real-time task corresponding to the highest degree of urgency preempts the use right of the CPU. It can be understood that, when receiving the interrupt signal, the real-time running time domain 123 first performs interrupt processing on the task being executed, and then performs scheduling processing.
In step S330, upon receiving the interrupt signal, the general runtime 124 first obtains the highest priority computational task from the computational task queue of the CPU, for example, the highest priority computational task may be obtained from the computational task queue based on a fair scheduling algorithm. Further, the low-priority computing-type task being executed may be interrupted and the interrupt process performed so that the CPU immediately executes the highest-priority computing-type task.
Further, after selecting the highest priority computational task from the computational task queue, it is necessary to determine whether the selected highest priority computational task is an executing computational task. If the highest priority computational task is not the executing computational task, indicating that the executing computational task currently belongs to a low priority computational task, then the executing low priority computational task (i.e., the previous highest priority computational task) is interrupted and interrupt processing is performed so that the CPU immediately proceeds to execute the highest priority computational task. In this case, the CPU is preempted by the calculation-type task corresponding to the highest priority.
In addition, if the selected highest-priority computing task is the executing computing task, the executing computing task does not need to be interrupted and the interrupt processing does not need to be carried out, so that the situation that the computing task is frequently interrupted is avoided. It is to be understood that the general runtime 124 first performs a scheduling process when receiving an interrupt signal, and then determines whether an interrupt process is required.
It should be noted that, for specific implementation of the task execution method 300, reference may be made to the foregoing description of the task execution system 120, and details are not described here.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the mobile terminal generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the task execution method of the present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the device in this example. The modules in the foregoing examples may be combined into one module or may additionally be divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Moreover, those skilled in the art will appreciate that although some embodiments described herein include some features included in other embodiments, not others, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the means for performing the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Moreover, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The present invention has been disclosed by way of illustration and not limitation with respect to the scope of the invention, which is defined by the appended claims.

Claims (11)

1. A task execution system adapted to be deployed in an edge computing server, the system comprising a preemptive kernel, an interrupt pre-processing module disposed above the preemptive kernel, a real-time runtime domain and a general runtime domain disposed above the interrupt pre-processing module, a domain resource management module disposed between the real-time runtime domain and the general runtime domain, wherein:
the preemptive kernel is suitable for receiving an interrupt signal generated by hardware and sending the interrupt signal to the interrupt preprocessing module;
the interrupt preprocessing module is suitable for responding to an interrupt signal generated by hardware, determining an interrupt type according to the interrupt signal, and sending the interrupt signal to a corresponding running time domain for processing according to the interrupt type;
the real-time running time domain is suitable for interrupting the real-time task which is being executed and carrying out interrupt processing when an interrupt signal is received, and acquiring the real-time task with the highest emergency degree from the real-time task queue so as to immediately execute the real-time task with the highest emergency degree;
the general operation time domain is suitable for acquiring a highest-priority calculation type task from a calculation type task queue when an interrupt signal is received, interrupting a low-priority calculation type task and carrying out interrupt processing so as to immediately execute the highest-priority calculation type task;
the domain resource management module is suitable for separating the resources of the real-time operation time domain and the universal operation time domain.
2. The system of claim 1, wherein the real-time runtime domain comprises:
the quick interrupt module is suitable for interrupting the real-time task which is being executed and carrying out interrupt processing when receiving the interrupt signal;
the real-time scheduling module is suitable for acquiring a real-time task with the highest emergency degree from the 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 the real-time operation module is suitable for providing memory management service for the real-time task with the highest emergency degree.
3. The system of claim 2, wherein the fast interrupt module is further adapted to:
and sending the interrupt signal to the processor so that the processor searches the corresponding interrupt processing program from the rapid interrupt vector table, and interrupting the real-time task being executed by the interrupt processing program and performing interrupt processing.
4. The system of any of claims 1-3, wherein the generic runtime domain comprises:
the general scheduling module is suitable for acquiring a highest-priority computational task from a computational task queue by using a fair scheduling algorithm when an interrupt signal is received so as to immediately execute the highest-priority computational task;
the thread-based interrupt module is suitable for interrupting the low-priority computing task and performing interrupt processing;
and the general operation module is suitable for providing memory management service for the calculation type task with the highest priority.
5. The system of claim 4, wherein the threaded interrupt module is further adapted to:
sending the interrupt signal to a processor so that the processor converts the interrupt signal into a corresponding interrupt request and searches one or more interrupt handlers associated with the interrupt request from an interrupt request registry;
sequentially waking one or more processing threads corresponding to the one or more interrupt handlers to interrupt the low-priority computing-type task and perform interrupt handling via the one or more processing threads.
6. The system of claim 4 or 5,
the fair scheduling algorithm includes a CFS scheduling algorithm.
7. The system of claim 2 or 3,
the real-time scheduling algorithm comprises a minimum slack priority scheduling algorithm.
8. The system of any one of claims 1-7, wherein the interrupt pre-processing module is further adapted to:
and acquiring interrupt source information from the interrupt signal, and determining the interrupt type according to the interrupt source information.
9. A task execution method, performed in a task execution system, the system including a preemptive kernel, an interrupt pre-processing module disposed above the preemptive kernel, a real-time runtime domain and a general runtime domain disposed above the interrupt pre-processing module, a domain resource management module disposed between the real-time runtime domain and the general runtime domain, the domain resource management module being adapted to separate resources of the real-time runtime domain and the general runtime domain, the method comprising the steps of:
the preemptive kernel receives an interrupt signal generated by hardware and sends the interrupt signal to an interrupt preprocessing module;
the interrupt preprocessing module responds to an interrupt signal generated by hardware, determines an interrupt type according to the interrupt signal, and sends the interrupt signal to a corresponding running time domain for processing according to the interrupt type;
when the real-time running time domain receives an interrupt signal, interrupting an executing real-time task and performing interrupt processing, and acquiring a real-time task with the highest emergency degree from a real-time task queue so as to immediately execute the real-time task with the highest emergency degree;
and when the general operation time domain receives an interrupt signal, acquiring the highest-priority calculation type task from the calculation type task queue, interrupting the low-priority calculation type task and performing interrupt processing so as to immediately execute the highest-priority calculation type task.
10. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the method of claim 9.
11. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method of claim 9.
CN202210927215.2A 2022-04-29 2022-04-29 Task running system and method and computing device Pending CN115168013A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210927215.2A CN115168013A (en) 2022-04-29 2022-04-29 Task running system and method and computing device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210927215.2A CN115168013A (en) 2022-04-29 2022-04-29 Task running system and method and computing device
CN202210463083.2A CN114579285B (en) 2022-04-29 2022-04-29 Task running system and method and computing device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202210463083.2A Division CN114579285B (en) 2022-04-29 2022-04-29 Task running system and method and computing device

Publications (1)

Publication Number Publication Date
CN115168013A true CN115168013A (en) 2022-10-11

Family

ID=81778540

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202210927215.2A Pending CN115168013A (en) 2022-04-29 2022-04-29 Task running system and method and computing device
CN202210463083.2A Active CN114579285B (en) 2022-04-29 2022-04-29 Task running system and method and computing device

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202210463083.2A Active CN114579285B (en) 2022-04-29 2022-04-29 Task running system and method and computing device

Country Status (1)

Country Link
CN (2) CN115168013A (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115167996A (en) * 2022-06-23 2022-10-11 哲库科技(北京)有限公司 Scheduling method and device, chip, electronic equipment and storage medium
CN115237556A (en) * 2022-06-23 2022-10-25 哲库科技(北京)有限公司 Scheduling method and device, chip, electronic equipment and storage medium
CN116483549B (en) * 2023-06-25 2023-09-19 清华大学 Task scheduling method and device for intelligent camera system, camera and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8146107B2 (en) * 2007-07-10 2012-03-27 Mitel Networks Corporation Virtual machine environment for interfacing a real time operating system environment with a native host operating system
CN101819426B (en) * 2009-02-27 2012-01-11 中国科学院沈阳计算技术研究所有限公司 Method for synchronizing kernel data of real-time system and non-real-time system of industrial Ethernet numerical control system
CN101894045A (en) * 2010-06-18 2010-11-24 阳坚 Real-time Linux operating system
US11494214B2 (en) * 2019-03-28 2022-11-08 Amazon Technologies, Inc. Verified isolated run-time environments for enhanced security computations within compute instances
CN111736905B (en) * 2020-08-12 2021-08-17 江苏深瑞汇阳能源科技有限公司 Edge computing terminal meeting real-time service requirement
CN112131741B (en) * 2020-09-22 2024-01-30 西安电子科技大学 Real-time dual-kernel single-machine semi-physical simulation architecture and simulation method

Also Published As

Publication number Publication date
CN114579285A (en) 2022-06-03
CN114579285B (en) 2022-09-06

Similar Documents

Publication Publication Date Title
CN114579285B (en) Task running system and method and computing device
EP2701074B1 (en) Method, device, and system for performing scheduling in multi-processor core system
US9772879B2 (en) System and method for isolating I/O execution via compiler and OS support
JP4247228B2 (en) Hetero multiprocessor system and its OS configuration method
WO2024021489A1 (en) Task scheduling method and apparatus, and kubernetes scheduler
CN111343288B (en) Job scheduling method and system and computing device
CN109840149B (en) Task scheduling method, device, equipment and storage medium
CN112162835A (en) Scheduling optimization method for real-time tasks in heterogeneous cloud environment
CN115167996A (en) Scheduling method and device, chip, electronic equipment and storage medium
US20230037783A1 (en) Resource scheduling method and related apparatus
CN114637536A (en) Task processing method, computing coprocessor, chip and computer equipment
CN114168352B (en) Multi-core task scheduling method and device, electronic equipment and storage medium
CN114816709A (en) Task scheduling method, device, server and readable storage medium
CN113391911B (en) Dynamic scheduling method, device and equipment for big data resources
CN111158875B (en) Multi-module-based multi-task processing method, device and system
WO2019029721A1 (en) Task scheduling method, apparatus and device, and storage medium
CN107634978B (en) Resource scheduling method and device
US11954518B2 (en) User-defined metered priority queues
CN111831408A (en) Asynchronous task processing method and device, electronic equipment and medium
KR20150089665A (en) Appratus for workflow job scheduling
CN114816703A (en) Task processing method, device, equipment and medium
US20120167119A1 (en) Low-latency communications
CN113485810A (en) Task scheduling execution method, device, equipment and storage medium
CN114911538A (en) Starting method of running system and computing equipment
CN114911703A (en) Detection method of real-time operation system and computing equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination