CN109800073A - Dispatching method, device, terminal and the storage medium of real-time process - Google Patents

Dispatching method, device, terminal and the storage medium of real-time process Download PDF

Info

Publication number
CN109800073A
CN109800073A CN201910079921.4A CN201910079921A CN109800073A CN 109800073 A CN109800073 A CN 109800073A CN 201910079921 A CN201910079921 A CN 201910079921A CN 109800073 A CN109800073 A CN 109800073A
Authority
CN
China
Prior art keywords
cpu
real
time process
terminal
task
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.)
Granted
Application number
CN201910079921.4A
Other languages
Chinese (zh)
Other versions
CN109800073B (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910079921.4A priority Critical patent/CN109800073B/en
Publication of CN109800073A publication Critical patent/CN109800073A/en
Application granted granted Critical
Publication of CN109800073B publication Critical patent/CN109800073B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Power Sources (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the present application discloses dispatching method, device, terminal and the storage medium of a kind of real-time process, belong to field of computer technology, since this method can select the first CPU according to predetermined selection mode from terminal, and detect whether the first CPU is in closing scheduling method, when the first CPU, which is in, closes scheduling method, it detects whether the 2nd CPU is in closing scheduling method, when the 2nd CPU, which is not at, closes scheduling method, target real-time process is placed in the 2nd CPU and is handled.Therefore, method provided by the embodiments of the present application, closing scheduling method whether can be in by active detecting CPU when dispatching CPU for target real-time process, when CPU is in scheduling close pattern, using other CPU processing target real-time processes for being not at scheduling close pattern, target real-time process has been saved when CPU is in scheduling close pattern, the CPU is waited to be changed into the time for being not at scheduling close pattern, the delay for reducing real-time process improves the dispatching efficiency of real-time process.

Description

Dispatching method, device, terminal and the storage medium of real-time process
Technical field
The invention relates to field of computer technology, in particular to a kind of dispatching method of real-time process, device, end End and storage medium.
Background technique
Central processing unit (Central Processing with the development of computer technology, as terminal core Unit, CPU) scheduling process it is also more and more important.
In a kind of possible mode, terminal can integrate several to improve the ability of processing task in the terminal CPU.When integrating several CPU in terminal, the method that terminal needs reasonably to dispatch enables the task in terminal high The execution of effect.
Summary of the invention
The embodiment of the present application provides dispatching method, device, terminal and the storage medium of a kind of real-time process.
The technical solution is as follows:
According to the one side content of the application, a kind of dispatching method of real-time process is provided, which comprises
The first central processor CPU is selected from terminal according to predetermined selection mode;
Detect whether the first CPU is in closing scheduling method, the closing scheduling method is used to indicate stopping response The mode of the scheduling of terminal;
When the first CPU, which is not at, closes scheduling method, whether the 2nd CPU of detection is in the closing scheduling mould Formula;
When the 2nd CPU is not at the closing scheduling method, target real-time process is placed on the 2nd CPU Middle processing.
According to the another aspect content of the application, a kind of dispatching device of real-time process is provided, described device includes:
CPU chooses module, for selecting the first central processor CPU from terminal according to predetermined selection mode;
First detection module, for detecting whether the first CPU is in closing scheduling method, the closing scheduling method It is used to indicate the mode for stopping the scheduling of response terminal;
Second detection module, for when the first CPU is in the closing scheduling method, whether the 2nd CPU of detection In the closing scheduling method;
Process processing module, for when the 2nd CPU is not at and closes scheduling method, target real-time process to be placed It is handled in the 2nd CPU.
According to the another aspect content of the application, a kind of terminal is provided, the terminal includes processor and memory, institute It states and is stored at least one instruction in memory, described instruction is loaded by the processor and executed to realize that the application such as is implemented The dispatching method of the real-time process of offer.
According to the another aspect content of the application, a kind of computer readable storage medium is provided, in the storage medium It is stored at least one instruction, described instruction is loaded by processor and executed to realize that the application such as implements the real-time process provided Dispatching method.
Technical solution bring beneficial effect provided by the embodiments of the present application may include:
Since this method can select the first CPU according to predetermined selection mode from terminal, and detect whether the first CPU locates In closing scheduling method, which is used to indicate the mode for stopping the scheduling of response terminal, when the first CPU is not at When closing scheduling method, whether the 2nd CPU of detection is in closing scheduling method, will when the 2nd CPU is in and closes scheduling method Target real-time process is placed in the 2nd CPU and handles.Because actively being examined when this method can dispatch CPU for target real-time process Survey whether the first CPU is in closing scheduling method, when the first CPU, which is in, closes scheduling method, whether the 2nd CPU of detection is in Scheduling method is closed, when the 2nd CPU is not at scheduling close pattern, using the 2nd CPU processing target real-time process, is saved Target real-time process waits the CPU to be changed into and is not at scheduling close pattern when the first CPU is in scheduling close pattern Time reduces the delay of real-time process, improves the dispatching efficiency of real-time process.
Detailed description of the invention
It, below will be to institute in the embodiment of the present application description in order to more clearly introduce the technical solution in the embodiment of the present application Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the application Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings Obtain other attached drawings.
Fig. 1 is the structural block diagram for the terminal that one exemplary embodiment of the application provides;
Fig. 2 is the flow chart of the dispatching method for the real-time process that one exemplary embodiment of the application provides;
Fig. 3 is the dispatching method flow chart for the real-time process that another exemplary embodiment of the application provides;
Fig. 4 is the dispatching method flow chart for the real-time process that another exemplary embodiment of the application provides;
Fig. 5 is the dispatching method flow chart for the real-time process that another exemplary embodiment of the application provides;
Fig. 6 is the structural block diagram of the dispatching device for the real-time process that one exemplary embodiment of the application provides.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party Formula is described in further detail.
In the following description when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different attached drawings indicate same or similar Element.Embodiment described in following exemplary embodiment does not represent all embodiment party consistent with the application Formula.On the contrary, they are only the device and side consistent with some aspects as detailed in the attached claim, the application The example of method.
In the description of the present application, it is to be understood that term " first ", " second " etc. are used for description purposes only, without It can be interpreted as indication or suggestion relative importance.In the description of the present application, it should be noted that unless otherwise specific regulation And restriction, term " connected ", " connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, Or it is integrally connected;It can be mechanical connection, be also possible to be electrically connected;It can be directly connected, intermediary can also be passed through It is indirectly connected.For the ordinary skill in the art, the tool of above-mentioned term in this application can be understood with concrete condition Body meaning.In addition, unless otherwise indicated, " multiple " refer to two or more in the description of the present application."and/or" is retouched The incidence relation of affiliated partner is stated, indicates may exist three kinds of relationships, for example, A and/or B, can indicate: individualism A, together When there are A and B, these three situations of individualism B.Character "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or".
For scheme shown in the embodiment of the present application it can be readily appreciated that below to several nouns occurred in the embodiment of the present application into Row is introduced.
Predetermined selection mode: refer to the mode of selected first CPU of setting in the terminal.It, should in a kind of possible scene Predetermined selection mode can be the selection mode of traversal.In alternatively possible scene, which can be wheel The selection mode of inquiry.
Optionally, in this application, terminal can also select the using identical predetermined selection mode from the CPU of terminal Two CPU.For example, terminal by way of traversal in terminal CPU in selected the first CPU, then in the CPU not selected Select a CPU as the 2nd CPU.
First CPU: refer to the CPU that detection is scheduled by the present embodiment.In a kind of possible embodiment, wrapped in terminal Include at least two CPU, wherein at least two CPU include the first CPU.
2nd CPU: a CPU in other CPU in terminal in addition to the first CPU.
Close scheduling method: the first CPU of instruction stops scheduling of the response terminal to the first CPU.In a kind of possible side In formula, which includes the mode in hard break (also known as hardware interrupts), the mode in traps and is in Mode etc. comprising atomic lock.It should be noted that when the process positive carry atomic lock etc. in CPU forbids process preemption mechanism Lock when, terminal determine the CPU be in close scheduling method.
Optionally, as a kind of possible mode, the dispatching method of real-time process shown in the embodiment of the present application is applied In the terminal for carrying linux operating system.
Illustratively, the dispatching method of real-time process shown in the embodiment of the present application can be applied in the terminal, the terminal Have processor and has the function of the scheduling of real-time process.Terminal may include mobile phone, tablet computer, laptop computer, platform Formula computer, computer all-in-one machine, server, work station, TV, set-top box, smart glasses, smart watches, digital camera, MP4 are broadcast Put terminal, MP5 playback terminal, learning machine, point reader, electric paper book, electronic dictionary, car-mounted terminal, virtual reality (Virtual Reality, VR) playback terminal or augmented reality (Augmented Reality, AR) playback terminal etc..
Referring to FIG. 1, it is the structural block diagram for the terminal that one exemplary embodiment of the application provides, as shown in Figure 1, should Terminal includes processor 120 and memory 140, is stored at least one instruction in the memory 140, described instruction is by described Processor 120 loads and executes the dispatching method to realize the real-time process as described in each embodiment of the method for the application.
In this application, terminal 100 is the electronic equipment for having the scheduling feature of real-time process.When terminal 100 is according to pre- Selection mode is determined from terminal when a selected CPU, terminal 100 is able to detect whether the first CPU is in closing scheduling method, When the first CPU is not at closing scheduling method, target real-time process is placed in the first CPU and is handled.
Processor 120 may include one or more processing core.Processor 120 utilizes various interfaces and connection Various pieces in entire terminal 100, by running or executing the instruction being stored in memory 140, program, code set or refer to Collection is enabled, and calls the data being stored in memory 140, executes the various functions and processing data of terminal 100.Optionally, Processor 120 can use Digital Signal Processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA) at least one of example, in hardware realize.Processor 120 can integrating central processor (Central Processing Unit, CPU), in image processor (Graphics Processing Unit, GPU) and modem etc. One or more of combinations.Wherein, the main processing operation system of CPU, user interface and application program etc.;GPU is for being responsible for The rendering and drafting of content to be shown needed for display screen;Modem is for handling wireless communication.On it is understood that Stating modem can not also be integrated into processor 120, be realized separately through chip piece.
Memory 140 may include random access memory (Random Access Memory, RAM), also may include read-only Memory (Read-Only Memory).Optionally, which includes non-transient computer-readable medium (non- transitory computer-readable storage medium).Memory 140 can be used for store instruction, program, generation Code, code set or instruction set.Memory 140 may include storing program area and storage data area, wherein storing program area can store Instruction for realizing operating system, the instruction at least one function (such as touch function, sound-playing function, image Playing function etc.), for realizing instruction of following each embodiments of the method etc.;It is real that storage data area can store following each method Apply the data etc. being related in example.
Referring to FIG. 2, it is the flow chart of the dispatching method for the real-time process that one exemplary embodiment of the application provides. The dispatching method of the real-time process can be applied in the terminal shown in above-mentioned.In Fig. 2, the dispatching method packet of real-time process It includes:
Step 210, the first central processor CPU is selected from terminal according to predetermined selection mode.
In the embodiment of the present application, operating system can be carried in terminal, and different CPU is provided in different operating system Scheduling mode.In some operating systems, process can be divided into multiple levels according to priority by terminal.For example, terminal can With the sequence according to priority from high to low, it is (real that process is divided into stop class process, deadline process, real time When) five levels such as process, fair class process and idle class process.The embodiment of the present application can be used for dispatching wherein Real-time process.
Step 220, whether the first CPU of detection is in closing scheduling method, closes scheduling method and is used to indicate stopping response The mode of the scheduling of terminal.
In the embodiment of the present application, terminal can be after selecting the first CPU in terminal, and whether the first CPU of detection is in Close scheduling method.In a kind of possible detection mode, whether the first CPU of terminal detection, which is in, is seized illegal state.Wherein, It seizes illegal state and is used to indicate terminal and the first CPU is forbidden to be seized by first task, which is except current just first The task outside the second task handled in CPU.
Optionally, if the first CPU, which is in, seizes illegal state, the first CPU of this explanation, which is in, closes scheduling method.
Optionally, if the first CPU, which is not at, is seized illegal state, the first CPU of this explanation is not at closing scheduling method.
In alternatively possible mode, marker can also be arranged in the first CPU in terminal, pass through the numerical value of marker To determine whether the first CPU is in closing scheduling method.For example, the value of marker can be 0, it is also possible to 1.Terminal can be with 0 by the value of marker, be set as the first CPU be in seize illegal state.Meanwhile the value of marker can be by terminal 1, it is set as the first CPU and is not to seize illegal state.
Step 230, when the first CPU, which is in, closes scheduling method, whether the 2nd CPU of detection is in closing scheduling method.
In the embodiment of the present application, for terminal when detecting that the first CPU is in closing scheduling method, terminal will test second Whether CPU is in closing scheduling method.
Optionally, in a kind of possible real-time mode, terminal can select the 2nd CPU from terminal, and be directed to second CPU is detected, and detects whether the 2nd CPU is in closing scheduling method.
Step 240, when the 2nd CPU, which is not at, closes scheduling method, target real-time process is placed in the 2nd CPU Reason.
In the embodiment of the present application, terminal can be when the 2nd CPU be not at and closes scheduling method, by target real-time process It is placed in the 2nd CPU and handles.It should be noted that target real-time process is after being placed in the 2nd CPU, can directly into Row executes processing.Since the embodiment of the present application is judged whether the first CPU is in closing scheduling method, in the first CPU In when closing scheduling method, whether the 2nd CPU of detection is in closing scheduling method, is not at closing scheduling mould in the 2nd CPU The 2nd CPU processing target real-time process is called directly when formula, avoids terminal when the first CPU is in and closes scheduling method one Directly wait the first CPU from close scheduling method jump out, caused by real-time process delay disposal, improve terminal scheduling in real time into The efficiency of journey reduces the time delay of real-time process operation.
In conclusion the dispatching method of real-time process provided in this embodiment, can dispatch CPU for target real-time process When active detecting CPU whether be in closing scheduling method, saved target real-time process when CPU is in scheduling close pattern, It waits the CPU to be changed into the time for being not at scheduling close pattern, reduces the delay of real-time process, improve real-time process Dispatching efficiency.
Fig. 3 is referred to, is the dispatching method flow chart for the real-time process that another exemplary embodiment of the application provides. The dispatching method of the real-time process can be applied in above-mentioned terminal shown in FIG. 1.In Fig. 3, the dispatching party of the real-time process Method includes:
Step 311, according to predetermined selection mode from terminal selected target central processor CPU.
The implementation procedure of step 311 and the implementation procedure of step 210 are identical, and details are not described herein again.
Step 312, whether the first CPU of detection is in closing scheduling method.
In the embodiment of the present application, the implementation procedure of step 312 and the implementation procedure of step 220 are identical, no longer superfluous herein It states.
Step 320, when the first CPU, which is in, closes scheduling method, whether the 2nd CPU of detection, which is handling hard break, is appointed Business.
In the embodiment of the present application, terminal is able to detect whether the 2nd CPU is handling hard break task.In the application In, hard break processing task is the signal that the hardware in terminal generates, and hardware may include in disk, network interface card, keyboard and clock At least one.In one possible implementation, each hardware can have the interrupt requests for belonging to the hardware, terminal In bus by interrupt requests, hard break task will be sent to the 2nd CPU.In corresponding task arrangement, the 2nd CPU It is capable of handling hard break task.
As a kind of possible mode classification, hard break task may include maskable interrupts (English: maskable Interrupt), (English is interrupted between non-maskable interrupts (English: non-maskable interrupt writes a Chinese character in simplified form: NMI), processor Text: interprocessor interrupt) and pseudo-interrupt (English: spurious interrupt).
In a kind of possible implementation of the embodiment of the present application, terminal can pass through the execution shape of the 2nd CPU of inquiry State or designated identification bits, to detect whether the 2nd CPU is handling hard break task.
Step 331, it when the 2nd CPU is handling hard break task, determines that the 2nd CPU is in and seizes illegal state.
Step 332, it when the 2nd CPU is not when handling hard break task, determines that the 2nd CPU is not at and seizes illegal state.
Step 340, when the 2nd CPU, which is not at, seizes illegal state, target real-time process is placed in the 2nd CPU Reason.
Target real-time process is placed on to accordingly holding for the implementation procedure and step 240 handled in the 2nd CPU in step 340 Row process is identical, and details are not described herein again.
In conclusion the present embodiment detects whether the 2nd CPU is in closing scheduling method, closing is not in the 2nd CPU When scheduling method, target real-time process is placed in the 2nd CPU and is handled, handled so as to avoid as the 2nd CPU When hard break task, real-time process needs to wait until always that hard break task processing is completed, and the CPU for improving terminal is locating When managing hard break task, for the dispatching efficiency of real-time process, the delay that real-time process is run in the scene is reduced.
Fig. 4 is referred to, is the dispatching method flow chart for the real-time process that another exemplary embodiment of the application provides. The dispatching method of the real-time process can be applied in above-mentioned terminal shown in FIG. 1.In Fig. 4, the dispatching party of the real-time process Method includes:
Step 411, the first central processor CPU is selected from terminal according to predetermined selection mode.
The implementation procedure of step 411 and the implementation procedure of step 210 are identical, and details are not described herein again.
Step 412, whether the first CPU of detection is in closing scheduling method.
In the embodiment of the present application, the implementation procedure of step 412 and the implementation procedure of step 220 are identical, no longer superfluous herein It states.
Step 420, when the first CPU, which is in, closes scheduling method, whether the 2nd CPU of detection is related to handling traps times Business.
In one possible implementation, terminal will test whether the 2nd CPU is handling traps task.
In alternatively possible implementation, terminal will test whether have in the 2nd CPU in wait (English: Pending) the traps task of state.
In another possible implementation, terminal will detect simultaneously whether the 2nd CPU is handling traps task, And whether there is the traps task being waited in the 2nd CPU of detection.When there are the 2nd CPU in above-mentioned two detection When having the traps task being waited in processing traps task or the 2nd CPU, terminal will determine whether the 2nd CPU relates to And processing traps task.
Step 431, it when the 2nd CPU is related to handling traps task, determines that the 2nd CPU is in and seizes illegal state.
Step 432, it when the 2nd CPU is not related to handling traps task, determines that the 2nd CPU is not to seize and forbids shape State.
Step 440, when the 2nd CPU, which is not at, seizes illegal state, target real-time process is placed in the 2nd CPU Reason.
Target real-time process is placed on to accordingly holding for the implementation procedure and step 240 handled in the 2nd CPU in step 440 Row process is identical, and details are not described herein again.
In conclusion the present embodiment, after terminal determines the first CPU, whether the first CPU of detection is in closing scheduling method, When the first CPU is in and closes scheduling method, whether the 2nd CPU of detection is in closing scheduling method, is not at pass in the 2nd CPU When closing scheduling method, target real-time process is placed in the 2nd CPU and is handled, so as to avoid when the first CPU be related to handling it is soft When interrupt task, real-time process needs to wait until always that traps task processing is completed, and the CPU for improving terminal is related to handling When traps task, for the dispatching efficiency of real-time process, the delay that real-time process is run in the scene is reduced.
Fig. 5 is referred to, is the dispatching method flow chart for the real-time process that another exemplary embodiment of the application provides. The dispatching method of the real-time process can be applied in above-mentioned terminal shown in FIG. 1.In Fig. 5, the dispatching party of the real-time process Method includes:
Step 511, the first central processor CPU is selected from terminal according to predetermined selection mode.
In the embodiment of the present application, the implementation procedure of step 511 and the implementation procedure of step 210 are identical, no longer superfluous herein It states.
Step 512, whether the first CPU of detection is in closing scheduling method.
In the embodiment of the present application, the implementation procedure of step 512 and the implementation procedure of step 220 are identical, no longer superfluous herein It states.
Step 520, when the first CPU, which is in, closes scheduling method, whether the 2nd CPU of detection, which is handling hard break, is appointed Business.
In the embodiment of the present application, the implementation procedure of step 520 and the implementation procedure of step 320 are identical, no longer superfluous herein It states.
Step 530, when the 2nd CPU is not handling hard break task, whether the 2nd CPU of detection is related to handling traps Task.
In the embodiment of the present application, detect whether the 2nd CPU is related to handling the implementation procedure of traps task in step 530 Identical with the implementation procedure of step 420, details are not described herein again.
It should be noted that the execution sequence of step 520 and step 530 can be interchanged.For example, terminal first detects second Whether CPU is related to handling traps task, and then, when the 2nd CPU is not related to handling traps times, whether the 2nd CPU of detection Handling hard break task.
Step 540, when the 2nd CPU is not related to handling traps task, determine that the 2nd CPU is not at closing scheduling mould Formula.
Step 551a is detected in the 2nd CPU when the 2nd CPU, which is not at, closes scheduling method with the presence or absence of than target reality The high process of the priority of Shi Jincheng.
In the embodiment of the present application, when the 2nd CPU, which is not at, closes scheduling method, terminal can also detect the 2nd CPU In whether there is the process higher than the priority of target real-time process.
In one possible implementation, terminal indicates the priority of process by numerical value.For example, terminal can make With the real number or integer value expression priority in [0,99] section.Such as the numerical value of the priority of process A is 67, process B's The numerical value of priority is 89, and the numerical value of the priority of process C is 36.Then the priority of process B is higher than the priority of process A, into The priority of journey A is higher than the priority of process C.
Step 551b, it is when the process higher than the priority of target real-time process is not present in the 2nd CPU, target is real-time Process is placed in the 2nd CPU and handles.
Step 552a obtains the surplus capacity of the 2nd CPU when the 2nd CPU, which is not at, closes scheduling method.
In the embodiment of the present application, when the 2nd CPU, which is not at, closes scheduling method, terminal obtains the residue of the 2nd CPU Ability.In one possible implementation, terminal can obtain the surplus capacity of the 2nd CPU, which can refer to The residual time length for being presently in the process of reason, such as 2 milliseconds, 5 milliseconds etc. are completed in one CPU operation.
Step 552b, it is when the surplus capacity of the 2nd CPU is not less than the requirement capability of target real-time process, target is real-time Process is placed in the 2nd CPU and handles.
It in the embodiment of the present application, will when the surplus capacity of the 2nd CPU is not less than the requirement capability of target real-time process Target real-time process is placed in the 2nd CPU and handles.It should be noted that working as the demand energy of surplus capacity and target real-time process When power is indicated with duration, the residual time length that the process for being presently in reason is completed in the 2nd CPU operation is shorter than target real-time process When institute's received waiting time threshold value of energy, indicate that the surplus capacity of the 2nd CPU is not less than the requirement capability of target real-time process.
For example, institute's received waiting time threshold value of energy of target real-time process is 50 microseconds, the 2nd CPU operation is completed current The residual time length of handled process is 30 microseconds, then illustrates that the surplus capacity of the 2nd CPU is not less than the need of target real-time process Ability is sought, target real-time process is placed in the 2nd CPU handles at this time by terminal.
In one possible implementation, the surplus capacity of CPU is that the total capacity of CPU subtracts operation process on CPU The sum of load.
As the substitution implementation of step 552b a kind of, terminal can also traverse CPU all in terminal, obtain wherein Surplus capacity is strongest.In a kind of realization scene, terminal can also traverse CPU all in terminal, obtain wherein residue etc. It is shortest to duration, target real-time process is placed in residue waiting time shortest CPU and is handled.
Optionally, target real-time process is being placed in the 2nd CPU before processing, terminal can also judge the 2nd CPU In process whether positive carry atomic lock etc. forbids the lock of process preemption mechanism, above-mentioned process preemption mechanism of forbidding if it does not exist Lock, then target real-time process is placed in the 2nd CPU and handles by terminal.
In conclusion the present embodiment can not handle hard break task in the 2nd CPU, it is not related to handling traps, and The priority ratio target real-time process of process therein is low, and the surplus capacity of the 2nd CPU can satisfy the demand energy of the 2nd CPU When power, target real-time process is placed in the 2nd CPU and is handled, enables the terminal to determine that influencing target real-time process executes speed Each factor of degree avoids blindness of the target real-time process before execution and waits, reduces the operation of terminal processes real-time process Delay, improve the efficiency of terminal operating real-time process.
Referring to FIG. 6, it illustrates the knots of the dispatching device of the real-time process of one exemplary embodiment of the application offer Structure block diagram.The dispatching device of the real-time process can pass through the whole of software, hardware or both being implemented in combination with as terminal Or a part.The device includes:
CPU chooses module 610, for selecting the first central processor CPU from terminal according to predetermined selection mode;
First detection module 620, for detecting whether the first CPU is in closing scheduling method, the closing scheduling Mode is used to indicate the mode for stopping the scheduling of response terminal;
Second detection module 630 is used for when the first CPU is in the closing scheduling method, and the 2nd CPU of detection is It is no to be in the closing scheduling method;
Process processing module 640, it is for when the 2nd CPU is not at the closing scheduling method, target is real-time Process is placed in the 2nd CPU and handles.
In an alternative embodiment, second detection module 630, for detecting whether the 2nd CPU is in Seize illegal state, it is described seize illegal state and be used to indicate forbid the 2nd CPU to be seized by first task, it is described first Business is the task in addition to the second task currently handled in the 2nd CPU.
In an alternative embodiment, second detection module 630, for whether to detect the 2nd CPU Handle hard break task;Wherein, it when the 2nd CPU is handling hard break task, determines that the 2nd CPU is in and seizes taboo Only state;When the 2nd CPU not processing hard break task, determine that the 2nd CPU is not at and seize illegal state.
In an alternative embodiment, second detection module 630, for detecting whether the 2nd CPU is related to Handle traps task;Wherein, when the 2nd CPU be related to handle traps task, determine the 2nd CPU be in seize taboo Only state;When the 2nd CPU be not related to handle traps task, determine that the 2nd CPU is not at and seize illegal state.
In an alternative embodiment, second detection module 630, for whether to detect the 2nd CPU Handle traps task;And/or whether there is the traps task being waited in detection the 2nd CPU.
In an alternative embodiment, the process processing module 640, for being not at closing as the 2nd CPU When scheduling method, detects and whether there is the process higher than the priority of the target real-time process in the 2nd CPU;When described When the process higher than the priority of the target real-time process being not present in the 2nd CPU, the target real-time process is placed on It is handled in 2nd CPU.
In an alternative embodiment, described device further includes execution module, the execution module, for when described the When two CPU are not at closing scheduling method, the surplus capacity of the 2nd CPU is obtained;When the 2nd CPU surplus capacity not Less than the target real-time process requirement capability when, the target real-time process is placed in the 2nd CPU and is handled.
The embodiment of the present application also provides a kind of computer-readable medium, which has at least one Instruction, at least one instruction are loaded as the processor and are executed to realize real-time process described in as above each embodiment Dispatching method.
It should be understood that the dispatching device of real-time process provided by the above embodiment is in the dispatching party for executing real-time process When method, only the example of the division of the above functional modules, in practical application, it can according to need and by above-mentioned function Distribution is completed by different functional modules, i.e., the internal structure of equipment is divided into different functional modules, to complete above retouch The all or part of function of stating.In addition, the dispatching device of real-time process provided by the above embodiment and the scheduling of real-time process Embodiment of the method belongs to same design, and specific implementation process is detailed in embodiment of the method, and which is not described herein again.
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely the exemplary embodiments that can be realized of the application, not to limit the application, it is all Within spirit herein and principle, any modification, equivalent replacement, improvement and so on should be included in the protection of the application Within the scope of.

Claims (10)

1. a kind of dispatching method of real-time process, which is characterized in that the described method includes:
The first central processor CPU is selected from terminal according to predetermined selection mode;
Detect whether the first CPU is in closing scheduling method, the closing scheduling method is used to indicate stopping response terminal Scheduling mode;
When the first CPU is in the closing scheduling method, whether the 2nd CPU of detection is in the closing scheduling method;
When the 2nd CPU is not at the closing scheduling method, target real-time process is placed in the 2nd CPU Reason.
2. the method according to claim 1, wherein whether detection the 2nd CPU is in closing scheduling Mode, comprising:
Detect the 2nd CPU and whether be in and seize illegal state, it is described seize illegal state and be used to indicate forbid described second CPU is seized by first task, and the first task is appointing in addition to the second task currently handled in the 2nd CPU Business.
3. according to the method described in claim 2, it is characterized in that, whether detection the 2nd CPU is in seize and forbid State, comprising:
Detect whether the 2nd CPU is handling hard break task;
Wherein, it when the 2nd CPU is handling hard break task, determines that the 2nd CPU is in and seizes illegal state;Work as institute The 2nd CPU is stated not in processing hard break task, determines that the 2nd CPU is not at and seizes illegal state.
4. according to the method described in claim 2, it is characterized in that, whether detection the 2nd CPU is in seize and forbid State, comprising:
Detect whether the 2nd CPU is related to handling traps task;
Wherein, when the 2nd CPU be related to handle traps task, determine the 2nd CPU be in seize illegal state;Work as institute It states the 2nd CPU not to be related to handling traps task, determines that the 2nd CPU is not at and seize illegal state.
5. according to the method described in claim 4, it is characterized in that, whether detection the 2nd CPU is related to handling in soft Disconnected task, comprising:
Detect whether the 2nd CPU is handling traps task;
And/or
Whether detect in the 2nd CPU has the traps task being waited for.
6. method according to any one of claims 1 to 5, which is characterized in that described to be adjusted when the 2nd CPU is not at closing When degree mode, target real-time process is placed in the 2nd CPU and is handled, comprising:
When the 2nd CPU, which is not at, closes scheduling method, detect in the 2nd CPU with the presence or absence of more real-time than the target The high process of the priority of process;
It is when the process higher than the priority of the target real-time process is not present in the 2nd CPU, the target is real-time Process is placed in the 2nd CPU and handles.
7. method according to any one of claims 1 to 5, which is characterized in that the method also includes:
When the 2nd CPU, which is not at, closes scheduling method, the surplus capacity of the 2nd CPU is obtained;
It is when the surplus capacity of the 2nd CPU is not less than the requirement capability of the target real-time process, the target is real-time Process is placed in the 2nd CPU and handles.
8. a kind of dispatching device of real-time process, which is characterized in that described device includes:
CPU chooses module, for selecting the first central processor CPU from terminal according to predetermined selection mode;
First detection module, for detecting whether the first CPU is in closing scheduling method, the closing scheduling method is used for Indicate the mode of the scheduling of stopping response terminal;
Second detection module, for when the first CPU is in the closing scheduling method, whether the 2nd CPU of detection to be in The closing scheduling method;
Process processing module, for when the 2nd CPU is not at the closing scheduling method, target real-time process to be placed It is handled in the 2nd CPU.
9. a kind of terminal, which is characterized in that the terminal includes processor and memory, and at least one is stored in the memory Item instruction, described instruction are loaded by the processor and are executed to realize such as the real-time process as described in claim 1 to 7 is any Dispatching method.
10. a kind of computer readable storage medium, which is characterized in that be stored at least one instruction, institute in the storage medium State the dispatching method for the real-time process that instruction is loaded by processor and executed with realization as described in claim 1 to 7 is any.
CN201910079921.4A 2019-01-28 2019-01-28 Real-time process scheduling method, device, terminal and storage medium Active CN109800073B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910079921.4A CN109800073B (en) 2019-01-28 2019-01-28 Real-time process scheduling method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910079921.4A CN109800073B (en) 2019-01-28 2019-01-28 Real-time process scheduling method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109800073A true CN109800073A (en) 2019-05-24
CN109800073B CN109800073B (en) 2021-06-18

Family

ID=66560517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910079921.4A Active CN109800073B (en) 2019-01-28 2019-01-28 Real-time process scheduling method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109800073B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101887383A (en) * 2010-06-30 2010-11-17 中山大学 Process real-time scheduling method
CN102822802A (en) * 2010-03-30 2012-12-12 富士通株式会社 Multi-core processor sytem, control program, and control method
CN103389913A (en) * 2013-07-30 2013-11-13 武汉邮电科学研究院 Real-time interrupt processing method for Linux system
CN105550029A (en) * 2015-12-24 2016-05-04 迈普通信技术股份有限公司 Process scheduling method and device
CN106375239A (en) * 2016-08-25 2017-02-01 北京智芯微电子科技有限公司 Network data reception processing method and apparatus
CN107066340A (en) * 2017-03-27 2017-08-18 恒安嘉新(北京)科技股份公司 A kind of fast packet receiving of the no trunk based on LINUX, method and apparatus of giving out a contract for a project
CN108123850A (en) * 2017-12-25 2018-06-05 上海交通大学 The integrated dispatch method and device of problem is seized for interruption holder
CN108241522A (en) * 2016-12-27 2018-07-03 阿里巴巴集团控股有限公司 Sleep state switching method, device and electronic equipment in virtualized environment
CN108694151A (en) * 2017-04-09 2018-10-23 英特尔公司 Computing cluster in universal graphics processing unit is seized

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102822802A (en) * 2010-03-30 2012-12-12 富士通株式会社 Multi-core processor sytem, control program, and control method
CN101887383A (en) * 2010-06-30 2010-11-17 中山大学 Process real-time scheduling method
CN103389913A (en) * 2013-07-30 2013-11-13 武汉邮电科学研究院 Real-time interrupt processing method for Linux system
CN105550029A (en) * 2015-12-24 2016-05-04 迈普通信技术股份有限公司 Process scheduling method and device
CN106375239A (en) * 2016-08-25 2017-02-01 北京智芯微电子科技有限公司 Network data reception processing method and apparatus
CN108241522A (en) * 2016-12-27 2018-07-03 阿里巴巴集团控股有限公司 Sleep state switching method, device and electronic equipment in virtualized environment
CN107066340A (en) * 2017-03-27 2017-08-18 恒安嘉新(北京)科技股份公司 A kind of fast packet receiving of the no trunk based on LINUX, method and apparatus of giving out a contract for a project
CN108694151A (en) * 2017-04-09 2018-10-23 英特尔公司 Computing cluster in universal graphics processing unit is seized
CN108123850A (en) * 2017-12-25 2018-06-05 上海交通大学 The integrated dispatch method and device of problem is seized for interruption holder

Also Published As

Publication number Publication date
CN109800073B (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN107800546B (en) Management method and device for broadcast messages
US9563585B2 (en) System and method for isolating I/O execution via compiler and OS support
EP2232376B1 (en) Resource controlling
US6553487B1 (en) Device and method for performing high-speed low overhead context switch
CN101419579B (en) Apparatus and method for providing quality of service on DRAM
CN104199730B (en) A kind of single thread multi-task processing method based on synchronous i/o multiplexing mechanism
CN109918141A (en) Thread execution method, device, terminal and storage medium
TW200805065A (en) Region protection unit, instruction set and method for protecting a memory region
CN113704301B (en) Data processing method, device, system, equipment and medium of heterogeneous computing platform
CN110008027A (en) Operation method, device, terminal and the storage medium of process
CN110209493A (en) EMS memory management process, device, electronic equipment and storage medium
CN110138662A (en) Session entry processing method, device and multiple nucleus system in multiple nucleus system
CN115562838A (en) Resource scheduling method and device, computer equipment and storage medium
US8949845B2 (en) Systems and methods for resource controlling
US20120226842A1 (en) Enhanced prioritising and unifying interrupt controller
WO2024198748A1 (en) Data processing method and system, chip, and terminal
CA2769899C (en) Enhanced prioritising and unifying interrupt controller
CN109800073A (en) Dispatching method, device, terminal and the storage medium of real-time process
CN101639791B (en) Method for improving interruption delay of embedded type real-time operation system
CN101634956A (en) Dispatching method and dispatcher of information of polynuclear processor
CN109067864A (en) Notification message method for pushing, device and electronic equipment
CN102117261A (en) Communication method between inner processors of chip
CN105429733B (en) A kind of message scheduling sending method and device
CN114911538A (en) Starting method of running system and computing equipment
CN110515718A (en) Batch tasks breakpoint is continuous to make method, apparatus, equipment and medium

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