CN108958157B - Control program control scheduling method, control program control scheduling device, computer equipment and storage medium - Google Patents
Control program control scheduling method, control program control scheduling device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN108958157B CN108958157B CN201810746025.4A CN201810746025A CN108958157B CN 108958157 B CN108958157 B CN 108958157B CN 201810746025 A CN201810746025 A CN 201810746025A CN 108958157 B CN108958157 B CN 108958157B
- Authority
- CN
- China
- Prior art keywords
- control program
- scheduling
- scheduling time
- time slice
- operating system
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G05B19/054—Input/output
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Programmable Controllers (AREA)
Abstract
The embodiment of the invention discloses a control program control scheduling method, a control program control scheduling device, computer equipment and a storage medium. The method comprises the following steps: determining a scheduling time slice of a control program on each operating system according to the time length of the scheduling time period; adjusting the scheduling time slice corresponding to the scheduling time slice adjustment information according to the received scheduling time slice adjustment information; judging whether the current time is in an updated scheduling time slice corresponding to any control program; if yes, switching the control program to operate according to the set scheduling rule; otherwise, switching to the control program with the highest priority in the priority control program queue to run. The embodiment of the invention can reasonably distribute time resources and improve the reliability and the real-time performance of the operating system.
Description
Technical Field
The present invention relates to information processing technologies, and in particular, to a method and an apparatus for controlling scheduling of a program, a computer device, and a storage medium.
Background
In order to achieve higher equipment utilization rate, a multi-core central processing unit is generally adopted in the industry to achieve integration of computer resources, so that the resources of the computer are utilized to the maximum extent, and the cost is saved.
At present, for a multi-core central processing unit, a plurality of virtual machines are usually correspondingly created, and an operating system which is directly run on an actual hardware platform is placed in the virtual machines to run. By adopting a plurality of virtual machines, the tasks can be partitioned, a real-time operating system runs on the real-time operating system in a part of virtual partitions, a real-time application program runs on the real-time operating system, a non-real-time operating system runs on the non-real-time operating system in a part of virtual machine partitions, and the non-real-time application program runs on the non-real-time operating system. Because some devices (such as devices controlled by a Programmable Logic Controller) have a high real-time requirement on the operating system, a Programmable Logic Controller (PLC) for real-time operating of the real-time operating system can be set to indirectly control the real-time devices in real time. For example, 4 kernels are supported by one kernel of the operating system, one kernel is occupied by the non-real-time operating system windows, 3 kernels are all used for running one PLC, the kernels running the PLC can be used as microkernels, and each kernel runs the PLC through a time schedule table.
At present, each PLC operates according to time slices allocated in a time scheduling table, if the time slices allocated to the PLC are far longer than the time required by the execution of a PLC task, the waste of time resources is caused, and meanwhile, the real-time performance of motion control is poor; and due to the influence of the precision of the timer, the PLC can be switched to the next PLC to execute the task when the task is not completed in the allocated time slice, so that the reliability and the real-time performance of the PLC are reduced.
Disclosure of Invention
The embodiment of the invention provides a control program control scheduling method, a control program control scheduling device, computer equipment and a storage medium, which can reasonably allocate time resources and improve the reliability and the real-time performance of an operating system.
In a first aspect, an embodiment of the present invention provides a method for controlling scheduling of a program, including:
determining a scheduling time slice of a control program on each operating system according to the time length of the scheduling time period;
adjusting the scheduling time slice corresponding to the scheduling time slice adjustment information according to the received scheduling time slice adjustment information;
judging whether the current time is in an updated scheduling time slice corresponding to any control program; if yes, switching the control program to operate according to the set scheduling rule; otherwise, switching to the control program with the highest priority in the priority control program queue to run.
In a second aspect, an embodiment of the present invention further provides a control program control scheduling apparatus, including:
the scheduling time slice determining module is used for determining the scheduling time slices of the control programs on each operating system according to the time length of the scheduling time period;
the scheduling time slice adjusting module is used for adjusting the scheduling time slice corresponding to the scheduling time slice adjusting information according to the received scheduling time slice adjusting information;
the equipment scheduling module is used for judging whether the current time is in an updated scheduling time slice corresponding to any control program; if yes, switching the control program to operate according to the set scheduling rule; otherwise, switching to the control program with the highest priority in the priority control program queue to run.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the control program control scheduling method according to any one of the embodiments of the present invention when executing the computer program.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the control program control scheduling method according to any one of the embodiments of the present invention.
According to the embodiment of the invention, the scheduling time slices of the control programs are correspondingly adjusted according to the scheduling time slice adjustment information, so that the problem of time resource waste caused by too large or too small time slices allocated to the control programs to execute tasks in the prior art is solved, the time resources are reasonably allocated, and the real-time performance and the reliability of a real-time operating system are improved.
Drawings
Fig. 1 is a flowchart of a control program control scheduling method according to an embodiment of the present invention;
fig. 2a is a flowchart of a control program control scheduling method according to a second embodiment of the present invention;
fig. 2b is a flowchart of S250 in a control program control scheduling method according to a second embodiment of the present invention;
fig. 3a is a flowchart of a control program control scheduling method according to a third embodiment of the present invention;
FIG. 3b is a diagram illustrating an application scenario to which a third embodiment of the present invention is applied;
FIG. 3c is a diagram illustrating an application scenario to which a third embodiment of the present invention is applied;
fig. 4 is a schematic structural diagram of a control program controlled scheduling apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a control program control scheduling method according to an embodiment of the present invention, where this embodiment is applicable to a case where a multi-core central processing unit on an industrial server controls a device in real time through a control program, and the method may be executed by a control program control scheduling apparatus according to an embodiment of the present invention, where the apparatus may be implemented in a software and/or hardware manner, and may be generally integrated into a terminal device, such as a PC. As shown in fig. 1, the method of this embodiment specifically includes:
and S110, determining the scheduling time slice of the control program on each operating system according to the time length of the scheduling time period.
In this embodiment, the scheduling time slice may refer to a preset operation duration of the control program, and it is understood that scheduling each control program according to the scheduling time slice may refer to that each control program performs rotation operation according to a corresponding preset operation duration; the scheduling time period is the total time length of the rotation operation of a plurality of control programs, wherein the scheduling time period only comprises the scheduling time slice corresponding to at least one control program, and also comprises the idle time of the operation of no control program; the control program may refer to a device controller, such as a PLC.
Specifically, the scheduling time slice of the control program may be correspondingly set according to the duration of the set scheduling time period, where the duration of the scheduling time slice is less than or equal to the duration of the scheduling time period. For example, the duration of the scheduling time period may be equally divided into a plurality of scheduling time slices according to the number of the control programs to be run, and the scheduling time slices may be allocated to the control programs to be run. It should be noted that, the duration of the scheduling time period may also be divided into a plurality of time slices according to the priority of the control program that needs to be run, and the time slices are allocated to the corresponding control program.
And S120, adjusting the scheduling time slice corresponding to the scheduling time slice adjustment information according to the received scheduling time slice adjustment information.
The scheduling time slice adjustment information is used for adjusting the scheduling time slices corresponding to the control programs, and specifically, the scheduling time slice adjustment information may include scheduling time slice spare information and scheduling time slice alarm information.
In this embodiment, the scheduling time slice corresponding to each control program may be adjusted according to the running state of each control program in its assigned scheduling time slice, and each control program may be scheduled to run according to the updated scheduling time slice.
Optionally, the scheduling time slice adjustment information is scheduling time slice spare information; the adjusting the scheduling time slice corresponding to the scheduling time slice adjusting information includes: respectively adding mark information at the starting time of the task and the ending time of the task aiming at the scheduling time slice corresponding to each control program; determining the idle time of each control program in the currently allocated scheduling time slice according to the marking information of the starting time and the marking information of the ending time; and reducing the scheduling time slice of each control program according to the idle time.
Specifically, the marking information may be a timestamp, which is used to mark the time taken by each control program to complete the task within the scheduling time slice allocated to the control program; the idle time may refer to a remaining time of the scheduling slot excluding a time required for the control program to execute the task. Specifically, when the idle time exceeds the preset time threshold, it may be determined that the scheduling time slice allocated by the control program is too long, and the time duration of the scheduling time slice allocated by the control program needs to be reduced, so as to release the redundant time resources and provide the redundant time resources for other control programs to execute tasks.
By adding marks at the starting time and the ending time of the execution task of each control program, the idle time of each control program in the scheduling time slice is obtained, and the scheduling time slice of each control program is adjusted according to the idle time, so that the residual time resources in the scheduling time slice can be released, the waste of the time resources is reduced, and the utilization rate of the time resources is improved.
Optionally, the scheduling time slice adjusting information is scheduling time slice alarm information; the adjusting the scheduling time slice corresponding to the scheduling time slice adjusting information includes: determining a control program corresponding to the scheduling time slice alarm information; and acquiring a scheduling time slice of the control program, and increasing the scheduling time slice of the control program according to the scheduling time slice alarm information.
Specifically, the scheduling time slice alarm information may refer to information indicating that the control program has not completed tasks within the allocated scheduling time slice. In this embodiment, whether the control program completes the task in the allocated scheduling time slice may be determined according to whether there is flag information corresponding to the end time of the control program completing the task in the scheduling time slice, and when it is determined that the control program does not complete the task in the allocated scheduling time slice, scheduling time slice alarm information may be generated to increase the scheduling time slice of the control program.
It should be noted that, the duration of the corresponding scheduling time slice may be individually increased and/or decreased for each control program, and the duration of the scheduling time period is re-determined according to the scheduling time slice updated by each control program, or one scheduling time period may be directly increased and/or decreased, and the durations of all scheduling time slices in the scheduling time period may be increased and/or decreased according to a set proportion.
S130, judging whether the current time is in the updated scheduling time slice corresponding to any control program; if so, go to S140; otherwise, S150 is performed.
It will be appreciated that within a scheduled time period, scheduled time slices as well as idle time for each control program may be included.
And S140, switching the control program to operate according to the set scheduling rule.
Specifically, the setting of the scheduling rule may be to perform the arrangement according to the priority, the task difficulty, and the time required for task completion of at least one control program corresponding to the scheduling time slice, and sequentially select the control programs to run according to the arrangement order.
S150, switching to the control program with the highest priority in the priority control program queue to operate.
In this embodiment, the scheduling of each control program may be performed within a scheduling time period according to a preset scheduling rule: if the current time is a scheduling time slice of the control program, operating each control program according to a set scheduling rule; and if the current time is idle time, selecting the control program with the highest priority and in the ready state from the priority control program queue to run. The control program in the priority control program queue is a control program sequence arranged according to the order of priority, and the control program in the ready state may mean that the control program obtains all resources except the CPU resource, and is waiting for the operating system to allocate the CPU resource, and once the control program in the ready state obtains the CPU resource, the control program in the ready state may start to execute the task, and the state is changed to the running state.
According to the embodiment of the invention, the scheduling time slices of the control programs are correspondingly adjusted according to the scheduling time slice adjustment information, so that the problem of time resource waste caused by too large or too small time slices allocated to the control programs to execute tasks in the prior art is solved, the time resources are reasonably allocated, and the real-time performance and the reliability of a real-time operating system are improved.
Example two
Fig. 2a is a flowchart of a control program control scheduling method according to a second embodiment of the present invention, which is embodied on the basis of the foregoing embodiment, in which the control program operation is switched according to a set scheduling rule, specifically: when a first timer and a second timer are adopted to schedule the control programs, the control programs in the ready state at the current moment are switched to operate, wherein the first timer is used for controlling the switching of the control programs in a scheduling time period, and the second timer is used for controlling the switching of the scheduling time period; and when the first timer and the second timer are not set, comparing the priority of the control program in the ready state at the current moment with the priority of the control program with the highest priority in the priority control program queue, and switching to the control program with the highest priority to operate.
Correspondingly, the method of the embodiment may include:
s210, determining the scheduling time slice of the control program on each operating system according to the time length of the scheduling time period.
S220, according to the received scheduling time slice adjusting information, adjusting the scheduling time slice corresponding to the scheduling time slice adjusting information.
S230, judging whether the current time is in the updated scheduling time slice corresponding to any control program; if so, go to S240; otherwise, S260 is performed.
And S240, when the control programs are scheduled by adopting a first timer and a second timer, switching to the control program in a ready state at the current moment to operate, wherein the first timer is used for controlling the switching of the control programs in a scheduling time period, and the second timer is used for controlling the switching of the scheduling time period.
In this embodiment, the ready state may refer to that the control program has a running condition and is waiting for the operating system to allocate the CPU resource to run; the control program in the ready state at the current time may be a control program corresponding to the scheduling time slice at the current time, and the control program is in the ready state. In addition, if the control program corresponding to the scheduling time slice in which the current time is located is in a non-ready state, that is, there is no control program in a ready state at the current time, the control program with the highest priority and in the ready state may be selected from the priority control program queue to run.
It can be understood that, considering that the existing scheduling time period is switched by using the system clock, there may occur a phenomenon that an interrupt occurs at a small time interval, and such frequent interrupts may cause a delay in the scheduling time period. For example, assuming that the total duration of the scheduling time period is 500ms, the duration of the scheduling time slice corresponding to the first control program (e.g., PLC1) is 100ms, and assuming that the interrupt handling time is 1ms, if 10 interrupts are generated during the operation of PLC1, a 10ms delay is caused, that is, PLC1 operates 110ms to switch to the second control program (e.g., PLC2), and accordingly, when the duration 500ms corresponding to the scheduling time period arrives, the scheduling time slice or the idle time actually stays in the scheduling time period, and it needs to wait for 510ms before switching to the first scheduling time slice in the scheduling time period, so the scheduling time period switching may generate a 10ms delay.
In order to avoid the delay of the switching of the control program and the switching of the scheduling time period, the embodiment provides two timers for the scheduling time period, wherein the first timer is used for timing the scheduling time slice (control program) to control the switching of the scheduling time slice (control program), and the second timer is used for timing the scheduling time period to control the switching of the scheduling time period.
The method for controlling the switching of the scheduling time slices by the first timer specifically comprises the following steps: and when the timing period corresponding to the first timer is reached, switching the current scheduling time slice in the scheduling time period into the next adjacent scheduling time slice. The timing cycle of the first timer is the duration corresponding to each scheduling time slice, and the timing cycle can be automatically switched to the duration corresponding to the current scheduling time slice along with the switching of the scheduling time slices. Accordingly, the timing period of the first timer in the initial working state may be set to be the duration corresponding to the first scheduling time slice in the current scheduling time period, when the timing meets the duration corresponding to the first scheduling time slice, that is, when the timing period arrives, the first scheduling time slice is switched to the second scheduling time slice, and the timing period is changed to the duration corresponding to the second scheduling time slice, and so on. From this point of view, switching of scheduling time slots can also be understood as switching between control Programs (PLCs). For example, if the first scheduled time slot and the second scheduled time slot are both non-idle time and PLC1 and PLC2 are placed in ready states, respectively, the first scheduled time slot is switched to the second scheduled time slot, i.e., PLC1 is switched to PLC 2.
The method for controlling the switching of the scheduling time period by the second timer specifically comprises the following steps: and when the timing period corresponding to the second timer arrives, switching the current scheduling time slice in the current scheduling time period into the first scheduling time slice in the next adjacent scheduling time period. The timing period of the second timer is a scheduling time period, i.e. the total duration of one scheduling time period, such as 500 ms. That is, when the timing satisfies the total duration of the current scheduling time period, that is, the timing period arrives, no matter which scheduling time slice is currently located, the scheduling time slice is switched to the first scheduling time slice of the next scheduling time period, and the timing is performed from the beginning, so that the synchronization of the scheduling time periods is realized.
Therefore, the method for switching the operation of the equipment according to the set scheduling rule specifically comprises the following steps: when a timing period corresponding to a first timer is reached, firstly, a current scheduling time slice in the current scheduling time period is switched to an adjacent next scheduling time slice, then, when the next scheduling time slice is determined to be non-idle time, a first control program in a ready state at the current time is obtained from the switched non-idle time, and the first control program is operated. When the timing period corresponding to the second timer is reached, the current scheduling time slice in the current scheduling time period is firstly switched to the first scheduling time slice in the next adjacent scheduling time period, and when the first scheduling time slice is determined to be non-idle time, the first control program in the ready state at the current time is obtained from the switched non-idle time and is operated.
It should be noted that, each time the idle time is switched to the updated scheduling time slice corresponding to any control program at the current time, the first control program in the ready state at the current time needs to be acquired again for running, and if the control program corresponding to the scheduling time slice at the current time is in the non-ready state at this time, the control program with the highest priority and in the ready state is directly selected from the priority control program queue for running.
The two timers are arranged, the first timer is used for timing the scheduling time slices corresponding to the control programs and controlling the control programs to be switched in one scheduling time period, and the second timer is used for timing the scheduling time period and controlling the scheduling time period to be switched, so that the phenomenon that the control program switching and the scheduling time period switching are delayed due to the fact that a system clock is adopted as a switching time standard in the scheduling time period can be effectively avoided.
And S250, when the first timer and the second timer are not set, comparing the priority of the control program in the ready state at the current moment with the priority of the control program with the highest priority in the priority control program queue, and switching to the control program with the highest priority to operate.
In this embodiment, without setting a timer, the priority of the control program corresponding to the scheduling time slice at the current time may be compared, where the control program is in the ready state, and the control program with the highest priority in the priority control program queue and in the ready state is selected to run.
Specifically, as shown in fig. 2b, when the first timer and the second timer are not set, the method for switching the operation of the control program according to the set scheduling rule, that is, S250 may specifically include:
and S251, when the first timer and the second timer are not set and the current time is in an updated scheduling time slice corresponding to any control program, acquiring a first control program of which the current time is in a ready state and a second control program with the highest priority in the priority control program queue.
S252, the priorities of the first control program and the second control program are compared.
And S253, if the priority level of the first control program is higher than or equal to that of the second control program, operating the first control program.
In one specific example, the current time is within the first scheduling time slice, and the PLC1 that is in the ready state at the current time has a priority of 7, while the PLC4 that has the highest priority and is in the ready state is retrieved from the priority control program queue having a priority of 4. Comparing the priority of PLC1 and PLC4, it may be determined that PLC4 is of higher priority, thereby selecting PLC4 to operate.
In another specific example, the current time is within the first scheduling time slice, and the PLC1 that is currently in the ready state has a priority of 4, while the PLC4 that has the highest priority and is in the ready state is retrieved from the priority control program queue having a priority of 4. Comparing the priorities of PLC1 and PLC4, which are the same, can prioritize PLC1 operation.
And S260, switching to the control program with the highest priority in the priority control program queue to operate.
It can be understood that there may be a plurality of control programs having the same priority and all being in the ready state in the priority control program queue, and at this time, the control programs may be operated in a round-robin manner, and each control program is allocated with a preset time duration. For example, the number of the control programs which have the highest priority and are all in the ready state in the priority control program queue is 3, the preset time duration is 10ms, then the 3 control programs are sequentially run according to the set sequence, and the running time of each control program is 10 ms.
The embodiment of the invention combines the scheduling time period, the priority and the scheduling time slice to schedule each control program to run, thereby meeting the requirements of different users, eliminating the accumulated clock error, improving the utilization rate of time resources and CPU resources and improving the real-time performance and reliability of a real-time operating system.
EXAMPLE III
Fig. 3a is a flowchart of a control program control scheduling method according to a third embodiment of the present invention, which is embodied based on the foregoing embodiment, and in this embodiment, the operation of switching the operation of the control program is specifically: and switching to any control program to run through the interrupt operation.
Correspondingly, the method of the embodiment may include:
s310, determining the scheduling time slice of the control program on each operating system according to the time length of the scheduling time period.
S320, according to the received scheduling time slice adjusting information, adjusting the scheduling time slice corresponding to the scheduling time slice adjusting information.
S330, judging whether the current time is in the updated scheduling time slice corresponding to any control program; if so, go to S340; otherwise, S350 is performed.
And S340, switching the control program to run through interrupt operation according to the set scheduling rule.
And S350, switching to the control program with the highest priority in the priority control program queue to run through the interrupt operation.
In this embodiment, the switching of the control program may be performed by an interrupt operation.
In a symmetric Multi-Processing (SMP) architecture of an x86 platform, an Interrupt line of an external device is connected to an Input/Output Advanced Programmable Interrupt Controller (I/O APIC), and a CPU corresponding to each operating system is provided with a Local Advanced Programmable Interrupt Controller (Local APIC), and all the Local APICs are connected to the I/O APIC, so that a plurality of Local APICs and the I/O APICs can operate with each other as a whole through an APIC bus to form a Multi-APIC system.
Generally, there are 24 interrupt lines, i.e. 24 interrupt pins, on an I/O APIC, each interrupt pin corresponds to a Redirection Table Entry (RTE), and the RTE includes an interrupt mask code, a trigger mode, an interrupt pin polarity, an interrupt delivery mode, a transmission state, a destination domain mode, a destination domain, and an interrupt vector. When the control program generates an interrupt operation signal, the I/O APIC formats an interrupt message according to the internal RTE, sends the interrupt message to the Local APIC of the target CPU, and then the Local APIC informs the target CPU to process.
It will be appreciated that the control program manager may be arranged to manage centrally in order to manage control program initiated interrupt operations. Specifically, interrupt lines of the external devices controlled by the control program are all connected to the input/output advanced programmable interrupt controller, each external device may initiate an interrupt operation through the control program, and send an interrupt operation signal to the input/output advanced programmable interrupt controller through the interrupt lines, and the control program manager manages the interrupt operation initiated by each control program.
Specifically, switching the control program to run by the interrupt operation may include: when detecting the interrupt operation initiated by the control program, generating an interrupt message according to the redirection table entry; and sending the interrupt message to a central processing unit of an operating system corresponding to the control program through the input/output advanced programmable interrupt controller, and executing the interrupt operation by the central processing unit of the operating system.
However, in an actual hardware environment, there is usually only one I/O APIC, and multiple operating systems operate redirection table entries of the I/O APIC simultaneously, which can cause confusion of real I/O APIC data. Therefore, the management delivery of the interrupt message is generally performed by a control program manager (e.g., a virtual machine manager), which intercepts the interrupt message when an external interrupt is generated and causes a CPU running the control program to generate a control program exit (e.g., a virtual machine exit (VM-exit)) operation. When the control program finishes processing the interrupt, the virtual interrupt controller is informed of the interrupt end information, and the operation can cause the control program to quit the operation for the second time. That is, when each interrupt occurs, two control program exit operations are generated, so that a huge context switching overhead is caused by transfer of a control flow involved in each control program exit, thereby causing a decrease in interrupt processing efficiency and an increase in delay, and for a real-time operating system, the real-time performance of the real-time operating system is reduced, wherein the control program manager may be a Virtual Machine Manager (VMM).
Therefore, in this embodiment, in order to improve the real-time performance of the real-time operating system, the control program manager intercepts the operation of the operating system on the redirection table entry of the I/O APIC, and forcibly modifies the RTE by the control program manager, so as to achieve the purpose of directly delivering the interrupt message to the real-time operating system. Optionally, before generating the interrupt message according to the redirection table entry, the method further includes: respectively establishing a corresponding extended page table for each control program according to the physical address of the input/output advanced programmable interrupt controller; when an operating system corresponding to the control program accesses the input/output advanced programmable interrupt controller, triggering the control program manager to execute an extended page table exception handling operation, wherein the logical address of the operating system of the control program corresponding to the extended page table does not map the physical address of the input/output advanced programmable interrupt controller; determining a virtual advanced programmable interrupt controller corresponding to an address with an extended page table exception through an extended page table exception handling operation; modifying, by the corresponding virtual advanced programmable interrupt controller, a redirection table entry of the input/output advanced programmable interrupt controller and/or virtual advanced programmable interrupt controller.
Correspondingly, the generating an interrupt message according to the redirection table entry may include: and generating an interrupt message according to the modified redirection table entry.
The extended page-table (EPT) mechanism provides virtualization of the physical address space of the operating system, isolation of the physical address space of the operating system is achieved through the EPT mechanism, and when the EPT is enabled, an address used by the operating system is not a real physical address, but only the real physical address can be accessed through EPT translation. Therefore, a corresponding EPT can be established for each control program according to the physical address of the I/O APIC.
And simultaneously setting the EPT to not map the physical address of the I/O APIC, so as to trigger the EPT exception handler when the operating system accesses the I/O APIC, thereby triggering the control program manager to enter the EPT exception handler and triggering the CPU running the control program to generate the control program exit operation when the operating system in the control program accesses the I/OAPIC by utilizing an EPT mechanism.
Furthermore, an EPT exception handler may obtain an address where an EPT exception occurs, call a corresponding exception instruction simulation function, and analyze an exception instruction of the EPT exception, which may obtain an I/O API Entry index and data of the exception operation, an instruction code, and the like, where the data represents data that needs to be written into a Redirection Table Entry (RTE).
Optionally, before establishing the corresponding EPT for each control program, the method may include: the virtual APIC is initialized by the control program manager, and the read-write interface address of the virtual APIC is registered to the management bus. Furthermore, according to the address of EPT exception, the corresponding virtual APIC is searched from the management BUS (such as I/O BUS), and then the writing interface of the virtual APIC is called, so as to realize the RTE writing operation of the I/O APIC.
Specifically, in the process of initializing the virtual APIC by the control program manager, the RTE of the I/O APIC is forcibly modified, that is, a correspondingly modified RTE is established for each control program, and when it is detected that the I/O APIC is accessed by the operating system corresponding to the control program, that is, when the control program is interrupted, the interrupt message can be directly delivered to the corresponding operating system through the real I/O APIC according to the modified RTE.
Optionally, the write operation to the RTE of the I/O APIC may specifically include: and judging whether the RTE corresponding to the I/O APIC table entry index of the abnormal operation is allocated to the control program, if so, modifying the I/O APIC and the corresponding RTE of the virtual APIC according to the data through the write interface of the corresponding virtual APIC, otherwise, modifying the corresponding RTE of the virtual APIC according to the data through the write interface of the corresponding virtual APIC.
Wherein, modifying the corresponding RTE of the I/O APIC according to the data through the write interface of the corresponding virtual APIC may specifically include: if the corresponding RTE is shared by a plurality of Peripheral Component Interconnect (PCI) devices, modifying an interrupt delivery mode in the RTE into a fixed delivery mode, and a destination domain mode into a logic mode, and adding an APIC ID of an operating system in the device in the destination domain.
At this time, the non-PCI device monopolizes one I/O APIC interrupt line and therefore monopolizes one RTE, and therefore the acquired data is directly written to the RTE at this time, so that the corresponding operating system can monopolize the interrupt line of the I/O APIC of the non-PCI device. However, for a PCI device, there may be a plurality of PCI devices using the same I/O APIC interrupt line, and therefore, it is necessary to modify an interrupt delivery mode and a destination domain mode in data, and add an APIC id of a corresponding real-time operating system in the destination domain, at this time, because the real-time operating system easily obtains its source code, and the real-time requirement of the real-time operating system is high, in this embodiment of the present invention, a corresponding RTE may be modified mainly for the real-time operating system, so that the PCI device corresponding to the real-time operating system is interrupted, that is, when a control program corresponding to the PCI device initiates an interrupt operation signal, an interrupt message may be directly delivered to a CPU of the corresponding real-time operating system through the I/O APIC.
The modifying, by the write interface of the corresponding virtual APIC, the RTE corresponding to the virtual APIC according to the data may specifically include: judging whether the RTE corresponding to the I/O APIC table entry index is allocated to the control program corresponding to the equipment in a write interface of the virtual APIC, namely the control program which generates control program quitting operation, if so, writing data in the I/O APIC and the virtual APIC at the same time, namely modifying the corresponding RTE, and if the control program is interrupted later, directly sending an interruption message to a CPU (central processing unit) of a corresponding operating system by the real I/O APIC based on the modified RTE; otherwise, the RTE corresponding to the I/O APIC table entry index is not allocated to the control program, and only needs to be written into the virtual APIC for management, but not written into the real I/O APIC, thereby only realizing a virtual mapping. When the control program sends an interrupt, because the RTE of the real I/OAPIC is not allocated to the control program, the interrupt message can not be sent to the control program, the occurrence of the exit operation of the control program is reduced, and the interrupt processing efficiency is improved.
Correspondingly, if the control program is the control program corresponding to the non-PCI equipment and the equipment monopolizes one RTE of the I/O APIC, the interrupt message is directly sent to the CPU of the corresponding operating system through the I/O APIC; if the control program is the control program corresponding to the PCI equipment and the equipment and other equipment share one RTE of the I/O APIC, the interrupt message is broadcasted to the CPU of the corresponding operating system through the I/O APIC.
In the embodiment of the invention, an EPT mechanism is utilized to trigger EPT exception and enter an exception handling program of a control program manager, and modifies RTE of I/O APIC through write interface of virtual APIC to realize the purpose of monitoring the read/write of operating system to RTE of I/O APIC, and can realize the modification of RTE corresponding to the operating system, so that when the interrupt operation of the control program occurs, based on the modified RTE, the I/O APIC may deliver the interrupt message directly to the CPU of the corresponding operating system, and the delivery is managed without a control program manager, thereby reducing the control program exit operation which is brought by each interrupt processing process in the prior art, reducing the time delay from the interrupt generation to the call of the interrupt processing function, therefore, the real-time performance of the real-time operating system can be improved, and the access efficiency of the I/O control program can be improved.
Based on the foregoing embodiment, a specific application scenario may be adopted to further describe the foregoing embodiment in detail, and specifically as shown in fig. 3b, the interrupt processing method between operating systems corresponding to a multi-core central processing unit may specifically include:
s371, the PLC manager initializes the virtual APIC and registers the read-write driving interface corresponding to the virtual APIC to the I/O BUS.
S372, the logical address of the operating system in the EPT of each control program is set not to map the physical address of the I/O APIC.
For example, the physical address of the I/O APIC is 0xFE000000-0xFE001000, which is not mapped in the EPT of the control program. When the operating system on the control program accesses the I/O APIC, the EPT exception can be triggered to enter the EPT exception handling program, so that the purpose of monitoring the RTE read-write of the operating system on the I/O APIC by utilizing an EPT mechanism is achieved, and the corresponding RTE is modified.
S373, generating an EPT exception when the operating system in the control program initializes the I/O APIC, causing the CPU running the control program to generate a PLC exit operation, and triggering the PLC manager to enter an EPT exception handling program.
Specifically, by setting the EPT, each operating system accesses the I/O APIC when initializing the I/O APIC, and because there is no physical address mapped to the I/O APIC, an EPT exception is triggered and an EPT exception handler is entered.
S374, acquiring the address of the EPT exception through the EPT exception handling program, calling a simulation function to simulate the execution of the exception instruction, analyzing the exception instruction by the simulation function according to the address of the EPT exception, and acquiring the instruction code, the I/OAPIC table entry index of the exception operation and the data.
Wherein the data indicates data to be written to the EPT.
S375, according to the address of EPT abnormity, searching the registered virtual APIC control program driver from the I/O BUS, and calling the write interface of the registered I/O APIC.
And S376, when the RTE corresponding to the index of the I/O APIC table entry in the write interface of the virtual APIC is allocated to the control program generating the PLC exit operation, writing the data into the data structures of the real I/O APIC and the virtual APIC.
And S377, writing the data into the data structure of the virtual APIC when the RTE corresponding to the I/O APIC table entry index in the write interface of the virtual APIC is not allocated to the control program generating the PLC exit operation.
By intercepting the operation of the control program manager and forcibly tampering the RTE by using the operating system, finally after the control program is interrupted, the interrupt message can be directly sent to the CPU of the operating system through the I/O APIC without passing through the PLC manager, thereby reducing the exit operation of the PLC and improving the interrupt processing efficiency.
S378, if the RTE is shared by a plurality of PCI control programs, the RTE of the real I/O APIC is only written by the non-real-time operating system, meanwhile, the interrupt delivery mode in the data is modified to be a fixed delivery mode, the target domain mode is a logic mode, and the APIC ID of the real-time operating system is added to the target domain.
Therefore, by modifying the RTE when the I/O APIC is initialized, the PLC quitting operation only occurs during initialization, when the control program is interrupted, the real I/O APIC directly sends the interrupt message to the CPU of the corresponding operating system according to the modified RTE, and the PLC quitting operation of the control program is reduced without a PLC manager, so that the interrupt processing efficiency is improved, and the real-time performance of the real-time operating system is ensured.
Based on the foregoing embodiment, a specific application scenario may be adopted to further describe the foregoing embodiment in detail, and specifically as shown in fig. 3c, the interrupt processing method between operating systems corresponding to a multi-core central processing unit may specifically include:
s381, initialize the I/O APIC through the real-time operating system and the non-real-time operating system, generate EPT exception, and cause the CPU running the control program to generate PLC exit operation.
And the non-real-time operating system and the real-time operating system respectively run corresponding PLCs.
S382, triggering the PLC manager to enter an EPT exception handler.
And at least acquiring the address of the EPT exception, the I/O APIC table entry index of the exception operation and the data through the EPT exception handling program.
S383, searching the registered virtual APIC control program driver, and calling the write interface of the registered I/O APIC so as to modify the RTE of the I/O APIC.
And S384, when the control program is interrupted, the I/O APIC sends the interrupt message to the Local APIC of the CPU of the corresponding operating system according to the modified RTE, and the Local APIC informs the CPU of processing, so that the interrupt message is directly delivered to the real-time operating system.
Example four
Fig. 4 is a schematic diagram of a control program controlled scheduling apparatus according to a fourth embodiment of the present invention. The present embodiment is a corresponding apparatus for implementing the method for controlling and scheduling a program according to the foregoing embodiments of the present invention, where the apparatus specifically includes:
a scheduling time slice determining module 410, configured to determine a scheduling time slice of a control program on each operating system according to a time length of a scheduling time period;
a scheduling time slice adjusting module 420, configured to adjust a scheduling time slice corresponding to scheduling time slice adjusting information according to received scheduling time slice adjusting information;
the control program scheduling module 430 is configured to determine whether the current time is within an updated scheduling time slice corresponding to any control program; if yes, switching the control program to operate according to the set scheduling rule; otherwise, switching to the control program with the highest priority in the priority control program queue to run.
According to the embodiment of the invention, the scheduling time slices of the control programs are correspondingly adjusted according to the scheduling time slice adjustment information, so that the problem of time resource waste caused by too large or too small time slices allocated to the control programs to execute tasks in the prior art is solved, the time resources are reasonably allocated, and the real-time performance and the reliability of a real-time operating system are improved.
Further, the scheduling time slice adjustment information is scheduling time slice spare information.
Further, the scheduling time slice adjusting module 420 is further configured to: respectively adding mark information at the starting time of the task and the ending time of the task aiming at the scheduling time slice corresponding to each control program; determining the idle time of each control program in the currently allocated scheduling time slice according to the marking information of the starting time and the marking information of the ending time; and reducing the scheduling time slice of each control program according to the idle time.
Further, the scheduling time slice adjusting information is scheduling time slice alarm information.
Further, the scheduling time slice adjusting module 420 is further configured to: determining a control program corresponding to the scheduling time slice alarm information; and acquiring a scheduling time slice of the control program, and increasing the scheduling time slice of the control program according to the scheduling time slice alarm information.
Further, the control program scheduling module 430 is further configured to: when a first timer and a second timer are adopted to schedule the control programs, the control programs in the ready state at the current moment are switched to operate, wherein the first timer is used for controlling the switching of the control programs in a scheduling time period, and the second timer is used for controlling the switching of the scheduling time period; and when the first timer and the second timer are not set, comparing the priority of the control program in the ready state at the current moment with the priority of the control program with the highest priority in the priority control program queue, and switching to the control program with the highest priority to operate.
Further, the apparatus further comprises: and the switching operation module is used for switching to any control program to operate through interrupt operation.
Further, the control program manager manages the interrupt operation initiated by each control program.
Further, the switching operation module includes: an interrupt message generating module, configured to generate an interrupt message according to the redirection table entry when an interrupt operation initiated by the control program is detected; and the interrupt operation sending module is used for sending the interrupt message to a central processing unit of an operating system corresponding to the control program through the input/output advanced programmable interrupt controller, and the central processing unit of the operating system executes the interrupt operation.
Further, the apparatus is further configured to: respectively establishing a corresponding extended page table for each control program according to the physical address of the input/output advanced programmable interrupt controller; when an operating system corresponding to the control program accesses the input/output advanced programmable interrupt controller, triggering the control program manager to execute an extended page table exception handling operation, wherein the logical address of the operating system of the control program corresponding to the extended page table does not map the physical address of the input/output advanced programmable interrupt controller; determining a virtual advanced programmable interrupt controller corresponding to an address with an extended page table exception through an extended page table exception handling operation; modifying, by the corresponding virtual advanced programmable interrupt controller, a redirection table entry of the input/output advanced programmable interrupt controller and/or virtual advanced programmable interrupt controller.
Further, the interrupt message generation module is further configured to: and generating an interrupt message according to the modified redirection table entry.
The scheduling device can execute the control program control scheduling method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the executed control program control scheduling method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a computer device according to a fifth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary computer device 501 suitable for use in implementing embodiments of the present invention. The computer device 501 shown in fig. 5 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer device 501 is in the form of a general purpose computing device. The components of computer device 501 may include, but are not limited to: one or more processors or processing units 502, a system memory 503, and a bus 504 that couples various system components including the system memory 503 and the processing unit 502.
The system Memory 503 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 505 and/or cache Memory 506. The computer device 501 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 507 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read-Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 504 by one or more data media interfaces. System memory 503 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 509 having a set (at least one) of program modules 508 may be stored, for example, in system memory 503, such program modules 508 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 508 generally perform the functions and/or methodologies of the described embodiments of the invention.
The computer device 501 may also communicate with one or more external devices 510 (e.g., keyboard, pointing device, display 511, etc.), with one or more devices that enable a user to interact with the computer device 501, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 501 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 512. Further, computer device 501 may also communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network, such as the internet) via Network adapter 513. As shown, network adapter 513 communicates with the other modules of computer device 501 via bus 504. It should be appreciated that although not shown in FIG. 5, other hardware and/or software modules may be used in conjunction with computer device 501, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, RAID (Redundant Arrays of inexpensive Disks) systems, tape drives, and data backup storage systems, among others.
The processing unit 502 executes various functional applications and data processing by running a program stored in the system memory 503, for example, to implement a control program control scheduling method provided by an embodiment of the present invention.
That is, the processing unit implements, when executing the program: determining a scheduling time slice of a control program on each operating system according to the time length of the scheduling time period; adjusting the scheduling time slice corresponding to the scheduling time slice adjustment information according to the received scheduling time slice adjustment information; judging whether the current time is in an updated scheduling time slice corresponding to any control program; if yes, switching the control program to operate according to the set scheduling rule; otherwise, switching to the control program with the highest priority in the priority control program queue to run.
EXAMPLE six
A sixth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for controlling and scheduling by a control program according to all embodiments of the present invention:
that is, the program when executed by the processor implements: determining a scheduling time slice of a control program on each operating system according to the time length of the scheduling time period; adjusting the scheduling time slice corresponding to the scheduling time slice adjustment information according to the received scheduling time slice adjustment information; judging whether the current time is in an updated scheduling time slice corresponding to any control program; if yes, switching the control program to operate according to the set scheduling rule; otherwise, switching to the control program with the highest priority in the priority control program queue to run.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a RAM, a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a LAN or a WAN, or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (7)
1. A method for controlling scheduling of a program, comprising:
determining a scheduling time slice of a control program on each operating system according to the time length of the scheduling time period;
adjusting the scheduling time slice corresponding to the scheduling time slice adjustment information according to the received scheduling time slice adjustment information; the scheduling time slice adjusting information is used for adjusting the scheduling time slices corresponding to the control programs and adjusting the scheduling time slices corresponding to the control programs according to the running states of the control programs in the allocated scheduling time slices;
judging whether the current time is in an updated scheduling time slice corresponding to any control program; if yes, switching the control program to run through interrupt operation according to a set scheduling rule; otherwise, switching to the control program with the highest priority in the priority control program queue to run through the interrupt operation;
the control program manager manages interrupt operation initiated by each control program;
the switching of the control program operation by the interrupt operation includes:
respectively establishing a corresponding extended page table for each control program according to the physical address of the input/output advanced programmable interrupt controller;
when an operating system corresponding to the control program accesses the input/output advanced programmable interrupt controller, triggering the control program manager to execute an extended page table exception handling operation, wherein the logical address of the operating system of the control program corresponding to the extended page table does not map the physical address of the input/output advanced programmable interrupt controller;
determining a virtual advanced programmable interrupt controller corresponding to an address with an extended page table exception through an extended page table exception handling operation;
modifying, by the corresponding virtual advanced programmable interrupt controller, a redirection table entry of the input/output advanced programmable interrupt controller and/or virtual advanced programmable interrupt controller;
when the interrupt operation initiated by the control program is detected, generating an interrupt message according to the modified redirection table entry;
and sending the interrupt message to a central processing unit of an operating system corresponding to the control program through an input/output advanced programmable interrupt controller, and executing the interrupt operation by the central processing unit of the operating system.
2. The method of claim 1, wherein the scheduled time slice adjustment information is scheduled time slice free information;
the adjusting the scheduling time slice corresponding to the scheduling time slice adjusting information includes:
respectively adding mark information at the starting time of the task and the ending time of the task aiming at the scheduling time slice corresponding to each control program;
determining the idle time of each control program in the currently allocated scheduling time slice according to the marking information of the starting time and the marking information of the ending time;
and reducing the scheduling time slice of each control program according to the idle time.
3. The method according to claim 1 or 2, wherein the schedule time slice adjustment information is schedule time slice alert information;
the adjusting the scheduling time slice corresponding to the scheduling time slice adjusting information includes:
determining a control program corresponding to the scheduling time slice alarm information;
and acquiring a scheduling time slice of the control program, and increasing the scheduling time slice of the control program according to the scheduling time slice alarm information.
4. The method according to claim 1, wherein switching the control program to run by an interrupt operation according to the set scheduling rule comprises:
when a first timer and a second timer are adopted to schedule the control programs, the control programs in the ready state at the current moment are switched to operate, wherein the first timer is used for controlling the switching of the control programs in a scheduling time period, and the second timer is used for controlling the switching of the scheduling time period;
and when the first timer and the second timer are not set, comparing the priority of the control program in the ready state at the current moment with the priority of the control program with the highest priority in the priority control program queue, and switching to the control program with the highest priority to operate.
5. A control program controlled scheduler, comprising:
the scheduling time slice determining module is used for determining the scheduling time slices of the control programs on each operating system according to the time length of the scheduling time period;
the scheduling time slice adjusting module is used for adjusting the scheduling time slice corresponding to the scheduling time slice adjusting information according to the received scheduling time slice adjusting information; the scheduling time slice adjusting information is used for adjusting the scheduling time slices corresponding to the control programs and adjusting the scheduling time slices corresponding to the control programs according to the running states of the control programs in the allocated scheduling time slices;
the control program scheduling module is used for judging whether the current time is in an updated scheduling time slice corresponding to any control program; if yes, switching the control program to run through interrupt operation according to a set scheduling rule; otherwise, switching to the control program with the highest priority in the priority control program queue to run through the interrupt operation;
the control program manager manages interrupt operation initiated by each control program;
the control program scheduling module is further configured to:
respectively establishing a corresponding extended page table for each control program according to the physical address of the input/output advanced programmable interrupt controller;
when an operating system corresponding to the control program accesses the input/output advanced programmable interrupt controller, triggering the control program manager to execute an extended page table exception handling operation, wherein the logical address of the operating system of the control program corresponding to the extended page table does not map the physical address of the input/output advanced programmable interrupt controller;
determining a virtual advanced programmable interrupt controller corresponding to an address with an extended page table exception through an extended page table exception handling operation;
modifying, by the corresponding virtual advanced programmable interrupt controller, a redirection table entry of the input/output advanced programmable interrupt controller and/or virtual advanced programmable interrupt controller;
when the interrupt operation initiated by the control program is detected, generating an interrupt message according to the modified redirection table entry;
and sending the interrupt message to a central processing unit of an operating system corresponding to the control program through an input/output advanced programmable interrupt controller, and executing the interrupt operation by the central processing unit of the operating system.
6. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the control program controlled scheduling method according to any of claims 1-4 when executing the program.
7. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the control program controlled scheduling method of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810746025.4A CN108958157B (en) | 2018-07-09 | 2018-07-09 | Control program control scheduling method, control program control scheduling device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810746025.4A CN108958157B (en) | 2018-07-09 | 2018-07-09 | Control program control scheduling method, control program control scheduling device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108958157A CN108958157A (en) | 2018-12-07 |
CN108958157B true CN108958157B (en) | 2020-09-18 |
Family
ID=64482484
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810746025.4A Active CN108958157B (en) | 2018-07-09 | 2018-07-09 | Control program control scheduling method, control program control scheduling device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108958157B (en) |
Families Citing this family (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111371815A (en) * | 2018-12-25 | 2020-07-03 | 上海亮衡信息科技有限公司 | Communication method, system and communication equipment based on time slice triggering |
CN109947548B (en) * | 2019-03-15 | 2020-11-20 | 美智光电科技股份有限公司 | Method and device for distributing time slices and method and device for controlling task execution |
KR102763676B1 (en) * | 2019-04-15 | 2025-02-05 | 엘에스일렉트릭(주) | Plc system and method for cycle control of input and output refresh the same |
JP7277292B2 (en) * | 2019-07-08 | 2023-05-18 | ファナック株式会社 | PLC device |
CN110703677A (en) * | 2019-09-29 | 2020-01-17 | 四川中曼电气工程技术有限公司 | PLC control system integrated on industrial personal computer |
CN111099306A (en) * | 2019-11-22 | 2020-05-05 | 珠海格力智能装备有限公司 | Method and device for determining clamping plate of tooling plate |
CN111026037B (en) * | 2019-11-26 | 2021-01-08 | 西安航天精密机电研究所 | Industrial robot motion controller based on WINDOWS platform and control method |
CN111027101B (en) * | 2019-12-17 | 2021-11-12 | 北京交大思诺科技股份有限公司 | Safe computer platform with flexibly distributed operation cycles |
CN113051198A (en) * | 2021-03-08 | 2021-06-29 | 惠州Tcl移动通信有限公司 | Mobile terminal module processing method and device, mobile terminal and storage medium |
CN113886077B (en) * | 2021-09-28 | 2025-02-18 | 北京威努特技术有限公司 | A performance improvement method for CPU context switching |
CN114488923B (en) * | 2021-12-23 | 2025-01-03 | 中控技术股份有限公司 | PLC control method, system and controller for realizing time scheduling function |
CN114281404B (en) * | 2021-12-24 | 2023-03-24 | 科东(广州)软件科技有限公司 | Method and device for transplanting algorithm codes of industrial personal computer |
CN114879593B (en) * | 2022-05-07 | 2023-03-14 | 科东(广州)软件科技有限公司 | Method, device and equipment for operating PLC (programmable logic controller) in real-time system and storage medium |
CN115048206B (en) * | 2022-08-15 | 2022-12-27 | 阿里巴巴(中国)有限公司 | Resource scheduling method and server |
CN117851012B (en) * | 2024-01-08 | 2024-09-27 | 广州南网科研技术有限责任公司 | Multi-task COS operating system, operation method, computer equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102929772A (en) * | 2012-10-16 | 2013-02-13 | 苏州迈科网络安全技术股份有限公司 | Monitoring method and system of intelligent real-time system |
CN103049332A (en) * | 2012-12-06 | 2013-04-17 | 华中科技大学 | Virtual CPU scheduling method |
CN103678003A (en) * | 2013-12-18 | 2014-03-26 | 华中科技大学 | Virtual CPU scheduling method capable of enhancing real-time performance |
CN107506234A (en) * | 2017-07-03 | 2017-12-22 | 北京东土科技股份有限公司 | A kind of dispatching method of virtual machine and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106470228B (en) * | 2015-08-19 | 2020-12-15 | 研祥智能科技股份有限公司 | Network communication method and system |
-
2018
- 2018-07-09 CN CN201810746025.4A patent/CN108958157B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102929772A (en) * | 2012-10-16 | 2013-02-13 | 苏州迈科网络安全技术股份有限公司 | Monitoring method and system of intelligent real-time system |
CN103049332A (en) * | 2012-12-06 | 2013-04-17 | 华中科技大学 | Virtual CPU scheduling method |
CN103678003A (en) * | 2013-12-18 | 2014-03-26 | 华中科技大学 | Virtual CPU scheduling method capable of enhancing real-time performance |
CN107506234A (en) * | 2017-07-03 | 2017-12-22 | 北京东土科技股份有限公司 | A kind of dispatching method of virtual machine and device |
Also Published As
Publication number | Publication date |
---|---|
CN108958157A (en) | 2018-12-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108958157B (en) | Control program control scheduling method, control program control scheduling device, computer equipment and storage medium | |
CN107046508B (en) | Message receiving method and network equipment | |
US20180121366A1 (en) | Read/write request processing method and apparatus | |
CN103744716B (en) | A kind of dynamically interruption Well-Balanced Mapping method based on current VCPU dispatch state | |
US8260996B2 (en) | Interrupt optimization for multiprocessors | |
US20200153751A1 (en) | Monitoring data streams and scaling computing resources based on the data streams | |
CN109726005B (en) | Method, server system and computer readable medium for managing resources | |
US9697029B2 (en) | Guest idle based VM request completion processing | |
JP2000330806A (en) | Computer system | |
US20150026678A1 (en) | Control method for computer, and computer | |
CN105718309A (en) | Method and system for interrupt processing in virtual environment | |
US20110219373A1 (en) | Virtual machine management apparatus and virtualization method for virtualization-supporting terminal platform | |
US9727364B2 (en) | Virtual device hypervisor memory limited receive queuing | |
US10564889B2 (en) | Method and apparatus for processing data based on physical host | |
US9600314B2 (en) | Scheduler limited virtual device polling | |
US20170024231A1 (en) | Configuration of a computer system for real-time response from a virtual machine | |
US11184263B1 (en) | Intelligent serverless function scaling | |
US20190138472A1 (en) | Validation of correctness of interrupt triggers and delivery | |
WO2023201987A1 (en) | Request processing method and apparatus, and device and medium | |
US11366679B2 (en) | Guest operating system wake-up method, device, electronic apparatus, and readable medium | |
CN108241522B (en) | Sleep state switching method and device in virtualization environment and electronic equipment | |
CN111930502A (en) | Server management method, device, equipment and storage medium | |
US9766917B2 (en) | Limited virtual device polling based on virtual CPU pre-emption | |
CN113535341B (en) | Method and device for realizing interrupt communication between CPU cores under Linux | |
CN106681812B (en) | Partition scheduling method |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
EE01 | Entry into force of recordation of patent licensing contract |
Application publication date: 20181207 Assignee: Beijing Shuili Intelligent Building Technology Co.,Ltd. Assignor: KYLAND TECHNOLOGY Co.,Ltd. Contract record no.: X2022990000047 Denomination of invention: Control program control scheduling method, device, computer equipment and storage medium Granted publication date: 20200918 License type: Common License Record date: 20220121 |
|
EE01 | Entry into force of recordation of patent licensing contract |