CN109002325A - A kind of sleeping time control method and device of program - Google Patents
A kind of sleeping time control method and device of program Download PDFInfo
- Publication number
- CN109002325A CN109002325A CN201710418542.4A CN201710418542A CN109002325A CN 109002325 A CN109002325 A CN 109002325A CN 201710418542 A CN201710418542 A CN 201710418542A CN 109002325 A CN109002325 A CN 109002325A
- Authority
- CN
- China
- Prior art keywords
- processor
- precision
- clock
- kernel
- time
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4418—Suspend and resume; Hibernate and awake
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Power Sources (AREA)
Abstract
The embodiment of the invention provides a kind of sleeping time control method and device of program, method includes: the kernel based on destination OS, obtains the target program for carrying object time precision;Judge whether object time precision is higher than first time precision;When judging that object time precision is higher than first time precision, target program is dispatched to first processor, wherein first processor belongs to the first kind processor for having bound the first event clock equipment, and the first event clock equipment supports high-precision time precision;Call the corresponding kernel high-precision sleep function of first processor, so that target program is run on the first processor, and the second time precision based on kernel high-precision sleep function, the first event clock equipment and object time precision bound in first processor are slept.To realize the reasonable control to interruption (sleep) time for running different business in electronic equipment.
Description
Technical field
The present invention relates to embedded software technology fields, more particularly to the sleeping time control method and dress of a kind of program
It sets.
Background technique
In order to meet user to the needs of electronic equipment time precision, Linux provides a set of support high precision clock
Software architecture had both provided the software architecture of a set of clock of the support time precision higher than predetermined time precision (such as 10ms).
When the above-mentioned branch of electronic equipment starting for adding Linux software architecture based on ARM (Advanced RISC Machines) hardware architecture
The software architecture (i.e. starting kernel high-precision sleep function) of high precision clock is held, and selects high precision clock (time precision height
In the clock of 10ms (millisecond, millisecond)) as event clock apparatus bound to processor (such as: CPU (Central
Processing Unit, central processing unit)) in when, when clock interrupt (sleep) period of electronic equipment can reach high-precision
Between precision, such as: the time precision in clock interrupt (sleep) period can achieve us (microsecond, microsecond) grade or ns
(nanosecond, nanosecond) grade etc..
When the electronic equipment that operating system is Linux starts the software architecture of above-mentioned support high precision clock, and height is selected
Accuracy clock as event clock apparatus bound into processor when, run at this time by electronic equipment demanding to the time
Business (such as: the control of stepper motor) high-precision clock interrupt (sleep) period control is provided, however, can be to electronic equipment
The business of the other times required precision run lower (such as: time precision be not higher than 10ms) impacts.Such as: to view
The processing business of frequency evidence.In general, the frame per second of video data is generally 25 frames/per second, i.e., above-mentioned electronic equipment can be averaged
Every 40ms handles one-frame video data.If above-mentioned electronic equipment starts and is provided with the sleep of kernel high-precision sleep function
Between for 1us (such as: setting usleep (1)), and selected high precision clock as event clock apparatus bound into processor,
Electronic equipment will generate primary interruption every 1us, at this point, can be interrupted once (i.e. every 1us to the processing business of video data
The corresponding program of the processing business of video data is primary every 1us sleep) so as to the frequent of the processing business of video data
It interrupts.
As it can be seen that in the prior art, electronic equipment starts the software architecture of above-mentioned support high precision clock, and select high-precision
Clock as event clock apparatus bound into processor when, it may appear that the interruption to different business run in electronic equipment
The not reasonable problem of the control in (sleep) period.
Summary of the invention
The sleeping time control method and device for being designed to provide a kind of program of the embodiment of the present invention, to realize to electricity
The reasonable control in interruption (sleep) period of different business is run in sub- equipment.Specific technical solution is as follows:
On the one hand, the embodiment of the present invention provides a kind of sleeping time control method of program, which comprises
Kernel based on destination OS obtains target program, wherein the target program carries object time essence
Degree;
Judge whether the object time precision is higher than first time precision;
When judging that the object time precision is higher than the first time precision, the target program is dispatched to first
Processor, wherein the first processor belongs to the first kind processor for having bound the first event clock equipment, when described first
Clock event device are as follows: support the event clock equipment of high-precision time precision;
Based on the first processor, the corresponding kernel high-precision sleep function of the first processor is called, so that institute
Target program is stated to run on the first processor, and the second time precision based on the kernel high-precision sleep function,
First event clock equipment and the object time precision bound in the first processor are slept.
Optionally, in the kernel based on destination OS, before the step of obtaining target program, the method is also
Including the process that the kernel to the destination OS is configured, the process includes:
Start the high precision clock configuration of the kernel of the destination OS;
Based on the high precision clock configuration started, corresponding at least two processor of the destination OS is corresponded to,
The high precision clock is called to configure the corresponding kernel high-precision sleep function;
According to the mark of each processor in preset setup information and at least two processor, determination is set as
Each processor of second class processor;
When by the second of the corresponding kernel high-precision sleep function of each processor in the second class processor
Between precision setting be third time precision, wherein the third time precision be not higher than the first time precision, described second
Each processor in class processor has bound second clock event device, wherein the second clock event device are as follows: supports
The event clock equipment of the time precision of low precision;
The kernel for starting the destination OS, determines high precision clock;
Enter the destination OS for identified high precision clock as the first event clock facility registration
Kernel, and second clock event device bound in each processor being set as in first kind processor is updated to described
One clock event device, wherein the second class processor are as follows: the first kind processor is removed at least two processor
Outer processor.
Optionally, the corresponding kernel high-precision of each processor in the second class processor is slept described
After the step of second time precision of function is set as third time precision, the configuration process further include:
It will be about the first programmatic binding of target peripheral on any processor into the second class processor;
It is described judge the step of whether the object time precision is higher than first time precision before, the method is also wrapped
It includes:
Determine whether the target program belongs to first program;
When being determined as being not belonging to, the step for judging the object time precision and whether being higher than first time precision is executed
Suddenly.
Optionally, when judging the object time precision not higher than the first time precision, the method also includes:
The target program is dispatched to second processor, wherein the second processor belongs to the second class processing
Device;
Based on the second processor, the corresponding kernel high-precision sleep function of the second processor is called, with
Run the target program in the second processor, and based on third set by the kernel high-precision sleep function
Second clock event device bound in time precision, the second processor and the object time precision are slept.
Optionally, second clock event bound in each processor being set as in first kind processor is set described
After standby the step of being updated to the first event clock equipment, the configuration process further include:
Each processor in the first kind processor is associated with default high-precision sleep function;
The described the step of target program is dispatched to first processor, comprising:
The default high-precision sleep function is called, the target program is dispatched to first processor.
Optionally, described to be based on the first processor, call the corresponding kernel high-precision of the first processor to sleep
The step of function, comprising:
Based on the first processor, the corresponding kernel high-precision sleep function of the first processor is determined;
Judge first order of magnitude of the object time precision the second number corresponding with the kernel high-precision sleep function
Whether magnitude is identical;
When judging that first order of magnitude is identical as second order of magnitude, the corresponding institute of the first processor is called
State kernel high-precision sleep function.
Optionally, when judging first order of magnitude and second order of magnitude difference, the method also includes:
The object time precision is converted from first order of magnitude to second order of magnitude;
Call the corresponding kernel high-precision sleep function of the first processor.
On the other hand, the embodiment of the invention provides a kind of sleeping time control device of program, described device includes:
Module is obtained, for the kernel based on destination OS, obtains target program, wherein the target program is taken
Band object time precision;
Judgment module, for judging whether the object time precision is higher than first time precision;
First scheduler module is used for when judging that the object time precision is higher than the first time precision, will be described
Target program is dispatched to first processor, wherein the first processor, which belongs to, has bound the first of the first event clock equipment
Class processor, the first event clock equipment are as follows: support the event clock equipment of high-precision time precision;
First calling module calls the corresponding kernel of the first processor high-precision for being based on the first processor
Sleep function is spent, so that the target program is run on the first processor, and based on the kernel high-precision sleep letter
First event clock equipment bound in several the second time precision, the first processor and the object time precision into
Row sleep.
Optionally, described device further includes the configuration module configured to the kernel of the destination OS, wherein
The configuration module includes that start unit, call unit, the first determination unit, setting unit, the second determination unit and registration are set
Set unit;
The start unit, for before obtaining target program, starting institute in the kernel based on destination OS
State the high precision clock configuration of the kernel of destination OS;
The call unit, for based on the high precision clock configuration started, the corresponding destination OS to be corresponding
At least two processors, call the high precision clock to configure the corresponding kernel high-precision sleep function;
First determination unit, for according to the everywhere in preset setup information and at least two processor
The mark of device is managed, determines each processor for being set as the second class processor;
The setting unit, for by the corresponding kernel high-precision of each processor in the second class processor
Second time precision of sleep function is set as third time precision, wherein the third time precision is not higher than described first
Time precision, each processor in the second class processor have bound second clock event device, wherein when described second
Clock event device are as follows: support the event clock equipment of the time precision of low precision;
Second determination unit determines high precision clock for starting the kernel of the destination OS;
The registration setting unit, for using identified high precision clock as the first event clock facility registration
Enter the kernel of the destination OS, and by second clock bound in each processor being set as in first kind processor
Event device is updated to the first event clock equipment, wherein the second class processor are as follows: at least two processor
In processor in addition to the first kind processor.
Optionally, the configuration module further includes binding unit;
The binding unit, in the corresponding kernel of each processor by the second class processor
Second time precision of high-precision sleep function is set as after third time precision, and the first program about target peripheral is tied up
On the fixed any processor in the second class processor;
Described device further includes determining module;
The determining module, for it is described judge whether the object time precision is higher than first time precision before,
Determine whether the target program belongs to first program;When being determined as being not belonging to, the judgment module is triggered.
Optionally, described device further includes the second scheduler module and the second calling module;
Second scheduler module is used for when judging the object time precision not higher than the first time precision,
The target program is dispatched to second processor, wherein the second processor belongs to the second class processor;
Second calling module calls the second processor corresponding described for being based on the second processor
Kernel high-precision sleep function, so that the target program is run in the second processor, and high-precision based on the kernel
Spend third time precision set by sleep function, second clock event device bound in the second processor and described
Object time precision is slept.
Optionally, the configuration module further includes associative cell;
The associative cell, for it is described will be second bound in each processor that be set as in first kind processor
Event clock equipment is updated to after the first event clock equipment, by the first kind processor each processor with
Default high-precision sleep function is associated;
First scheduler module, is specifically used for
The default high-precision sleep function is called, the target program is dispatched to first processor.
Optionally, first calling module includes third determination unit, judging unit and the first call unit;
The third determination unit determines that the first processor is corresponding described for being based on the first processor
Kernel high-precision sleep function;
The judging unit, first order of magnitude and kernel high-precision for judging the object time precision are slept
Whether corresponding second order of magnitude of function is identical;
First call unit, for calling when judging that first order of magnitude is identical as second order of magnitude
The corresponding kernel high-precision sleep function of the first processor.
Optionally, first calling module further includes converting unit and the second call unit;
The converting unit is used for when judging first order of magnitude and second order of magnitude difference, by the mesh
Mark time precision is converted from first order of magnitude to second order of magnitude;
Second call unit, for calling the corresponding kernel high-precision sleep function of the first processor.
On the other hand, the embodiment of the invention provides a kind of electronic equipment, including multiprocessor, communication interface, memory
And communication bus, wherein multiprocessor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Any processor when for executing the computer program stored on memory, realizes that the embodiment of the present invention is mentioned
The sleeping time control method of the foregoing routine of confession.
On the other hand, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storages
Dielectric memory contains computer program, before realizing provided by the embodiment of the present invention when computer program is executed by processor
State the sleeping time control method of program.
In the embodiment of the present invention, the kernel based on destination OS obtains the target program for carrying object time precision;
Judge whether object time precision is higher than first time precision;It, will when judging that object time precision is higher than first time precision
Target program is dispatched to first processor, wherein first processor belongs at the first kind for having bound the first event clock equipment
Device is managed, the first event clock equipment supports high-precision time precision;The corresponding kernel high-precision of first processor is called to sleep
Function, so that target program is run on the first processor, and based on the second time of kernel high-precision sleep function essence
First event clock equipment bound in degree, first processor and object time precision are slept.
The object time precision and first time precision carried by target program, it is determined whether belonging at the first kind
Operational objective program on the first processor of device is managed, when first kind processor has bound support high-precision time precision first
Clock event device, and kernel high-precision sleep function can be called, it can be realized the target program high to time required precision,
Carry out the control of high-precision sleep (interruption) time.Only to the time required precision high (object time in the embodiment of the present invention
Precision be higher than first time precision) target program, carry out it is high-precision sleep (interruptions) time control, with realization to electronics
The reasonable control of the sleeping time of the run different business of equipment.Certainly, it implements any of the products of the present invention or method must be different
It is fixed to need while reaching all the above advantage.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of the sleeping time control method of program provided by the embodiment of the present invention;
Fig. 2 is the flow diagram of the configuration process of the kernel of a kind of pair of destination OS;
Fig. 3 is a kind of structural schematic diagram of the sleeping time control device of program provided by the embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of configuration module;
Fig. 5 is the structural schematic diagram of a kind of electronic equipment provided by the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention provides a kind of sleeping time control method and device of program, to realize in electronic equipment
The reasonable control in interruption (sleep) period of the business run.
As shown in Figure 1, may include walking as follows the embodiment of the invention provides a kind of sleeping time control method of program
It is rapid:
S101: the kernel based on destination OS obtains target program, wherein target program carries object time essence
Degree;
It should be noted that the embodiment of the present invention can be applied to it is any based on SMP (Symmetrical Multi-
Processing, symmetric multi-processors) hardware architecture and the electronic equipment based on destination OS software architecture, above-mentioned target
Operating system be can be provided with support high precision clock software architecture operating system, such as: Linux.I.e. above-mentioned electronics
In equipment comprising multiprocessor (such as: CPU (Central Processing Unit, central processing unit)).
Also, any processor in above-mentioned electronic equipment can execute sleeping for program provided by the embodiment of the present invention
Dormancy time control flow.That is, executing the processing of the sleeping time control flow of program provided by the embodiment of the present invention
Device can be the subsequent first processor mentioned, or the subsequent second processor mentioned, or, or above-mentioned electricity
Any processor in other processors in sub- equipment in addition to first processor, second processor.
The kernel of destination OS can refer to the core of destination OS, and the kernel of destination OS is main
It is responsible for operation, memory, external equipment (peripheral hardware) driver, file and the network system money of the process of management objectives operating system
Source etc. decides the performance and stability of destination OS.Wherein, a process can be made of one or more threads.
Above-mentioned target program can be a subject thread, or a target process, this is all possible.
Electronic equipment can obtain target program, and based on entrained by target program based on the kernel of destination OS
Object time precision, execute the sleeping time control flow of subsequent program.Wherein, the object time entrained by target program
(interruption) time of sleep needed for precision can identify target program.
S102: judge whether object time precision is higher than first time precision;
S103: when judging that object time precision is higher than first time precision, being dispatched to first processor for target program,
Wherein, first processor belongs to the first kind processor for having bound the first event clock equipment, the first event clock equipment are as follows: branch
Hold the event clock equipment of high-precision time precision;
It should be noted that above-mentioned first time precision can be preset time precision, for determining target journey
Whether sequence needs the control of high-precision sleeping time.When electronic equipment judges that object time precision is higher than first time precision
When, then it can determine that above-mentioned target program needs the control of high-precision sleeping time, at this point it is possible to which target program is dispatched to
The first processor for belonging to first kind processor (having bound the first event clock equipment for supporting high-precision time precision), after
And carry out the sleeping time control flow of subsequent program.
In the embodiment of the present invention, the time precision that can will be above first time precision is known as high-precision time precision,
The clock for the time precision for being higher than first time precision can will be supported to be known as high precision clock;Conversely, can will be not higher than the
The time precision of one time precision is known as the time precision of low precision, can not will support smart higher than the time of first time precision
The clock of degree is known as low accuracy clock.For example: when first time precision is 10ms, the time precision that will be above 10ms claims
For high-precision time precision, the clock for the time precision for being higher than 10ms will be supported to be known as high precision clock;Conversely, will be not higher than
The time precision of 10ms is known as the time precision of low precision, and the clock for the time precision for being higher than 10ms will not supported to be known as low precision
Clock, etc..
In addition, running above-mentioned target program in order to realize to the control of the high-precision sleeping time of target program
Processor bound in event clock equipment, it has to be possible to support high-precision time precision, i.e., above-mentioned first processor
The first bound event clock equipment are as follows: support the event clock equipment of high-precision time precision.Such as: work as target program
Entrained object time precision is 1ms, and the time precision that the first event clock equipment can be supported must be not less than 1ms.
S104: being based on first processor, the corresponding kernel high-precision sleep function of first processor is called, so that target journey
Sequence is run on first processor, and the second time precision based on kernel high-precision sleep function, bound in first processor
The first event clock equipment and object time precision sleep.
It is understood that the second time precision of the corresponding kernel high-precision sleep function of first processor is not less than mesh
Time precision is marked, can be realized the control to the high-precision sleeping time of target program.For example, working as target program institute
When the object time precision of carrying is 10ns, the second time precision of the corresponding kernel high-precision sleep function of first processor must
Not less than 10ns, such as: above-mentioned second time precision can be 1ns.
It should be noted that electronic equipment is based on first processor, the corresponding kernel high-precision of first processor is called to sleep
After dormancy function, target program starts to run on first processor, and the first event clock bound in first processor is set
It is standby to start to carry out timing;When the first event clock equipment timing reaches object time precision, first processor is interrupted once,
Target program sleep is primary, realizes the control to the sleeping time of target program.
Using the embodiment of the present invention, the object time precision and first time precision carried by target program is determined
Whether on the first processor for belonging to the first kind processor operational objective program, first kind processor bound support high-precision
Time precision the first event clock equipment, and kernel high-precision sleep function can be called, can be realized to time essence
Demanding target program is spent, the control of high-precision sleep (interruption) time is carried out.Only to the time in the embodiment of the present invention
The target program of required precision high (object time precision is higher than first time precision), carries out high-precision sleep (interruption) time
Control, the reasonable control of the sleeping time of different business run to electronic equipment may be implemented.It should be understood that electronics is set
The business of received shipment industry, i.e. program corresponding to operation business.
In one implementation, as shown in Fig. 2, a kind of sleeping time control of program provided by the embodiment of the present invention
Method further includes grasping to target before the step of obtaining target program (S101) in the kernel based on destination OS
Make the process that the kernel of system is configured, the above process may include:
S201: start the high precision clock configuration of the kernel of destination OS;
S202: based on the high precision clock configuration started, corresponding to corresponding at least two processor of destination OS,
High precision clock is called to configure corresponding kernel high-precision sleep function;Wherein it is possible to by calling sys_nanosleep letter
Number calls nanosleep function by destination OS, realize the calling to kernel high-precision sleep function;
S203: according to the mark of each processor in preset setup information and at least two processors, setting is determined
For each processor of the second class processor;
S204: by the second time essence of the corresponding kernel high-precision sleep function of each processor in the second class processor
Degree is set as third time precision, wherein third time precision is not higher than first time precision, each in the second class processor
Processor has bound second clock event device, wherein second clock event device are as follows: support the time precision of low precision when
Clock event device;
S205: start the kernel of destination OS, determine high precision clock;
S206: enter identified high precision clock as the first event clock facility registration in destination OS
Core, and second clock event device bound in each processor being set as in first kind processor is updated to the first clock
Event device, wherein the second class processor are as follows: the processor at least two processors in addition to first kind processor.
It should be noted that the enabled instruction that electronic equipment can be triggered by receiving and responding user, starting target behaviour
The high precision clock configuration for making the kernel of system, so that electronic equipment opens the software architecture for supporting high precision clock.In one kind
In implementation, the height to the kernel of destination OS can be realized by starting " CONFIG_HIGH_RES_TIMERS "
The starting of accuracy clock configuration.
Above-mentioned preset setup information is pre-set information, may include and describes which processor is arranged to the first kind
The information of processor and the information which processor is arranged to the second class processor is described.Specifically, above-mentioned default setting
It can recorde in information: the corresponding relationship of the mark and set result of each processor at least two processors.It lifts
For example, there are 3 processors, i.e. corresponding 3 processors of destination OS, the marks point of 3 processors in electronic equipment
Not are as follows: the corresponding mark A of processor A, the corresponding mark C of the corresponding mark B and processor C of processor B.It may packet in preset setup information
The content contained are as follows: mark A- first kind processor (set result) identifies B- first kind processor (set result);Mark
The second class of C- processor (set result).
In addition, it is necessary to explanation, the mark of each processor in above-mentioned at least two processor can be with are as follows: processor
ID (Identity, identity number), title, sequence number etc. can uniquely determine the information of each processor.
It is understood that multiple event clock equipment can be registered in the kernel of destination OS, wherein can be with
It is the corresponding event clock equipment of each processor in destination OS, event clock equipment can be corresponding place
It manages device and event clock service is provided, as corresponding processor carries out timing.Above-mentioned event clock equipment can use " clock_
Event_device " mark.
It is emphasized that the high precision clock configuration of the kernel of starting destination OS, so that electronic equipment has
Support the software architecture of high precision clock;Enter destination OS for high precision clock as the first event clock facility registration
Kernel, and when second clock event device bound in each processor being set as in first kind processor is updated to first
Clock event device, so that electronic equipment has the hardware architecture for supporting high precision clock.It is above-mentioned to be directed in first kind processor
The software architecture and hardware architecture that each processor is configured, so that each processing in electronic equipment in first kind processor
Device is able to achieve the control to the high-precision sleeping time of run program.
It should be noted that in the embodiment of the present invention, electronic equipment be based on SMP hardware framework, can in electronic equipment
With there are at least two processors.When the high precision clock configuration of the kernel of starting destination OS, it can corresponding target
Corresponding at least two processor of operating system calls high precision clock to configure corresponding kernel high-precision sleep function.In order to
Guarantee the reasonable control to the sleeping time of the business run in electronic equipment, and reduces starting high-precision to a certain extent
Clock is with postponing, and the operation of processor is born in electronic equipment.Need to configure the processor that can support the time precision of low precision
(the second class processor), and need to configure the processor (first kind processor) that can support high-precision time precision.
Specifically, can be by second of the corresponding kernel high-precision sleep function of each processor in the second class processor
Time precision is set as third time precision (third time precision is not higher than first time precision), every in the second class processor
One processor has bound the second clock event device for supporting the time precision of low precision, so that each in the second class processor
Processor can be realized and the sleeping time of the time precision of low precision is supported to control on above-mentioned software architecture and hardware architecture
System.
Furthermore it is possible to the mark according to the clock in destination OS, determines high precision clock, it further, will be high
Accuracy clock enters the kernel of destination OS as the first event clock facility registration, and is tied in first kind processor
Each processor.It is understood that each processor in first kind processor has defaulted binding second in some scenes
Event clock equipment in the embodiment of the present invention, needs each processor in first kind processor having defaulted the second of binding
Event clock equipment is updated to the first event clock equipment, so that each processor in first kind processor can be in hardware structure
The control for supporting the sleeping time of high-precision time precision is realized on frame.Also, start the height of the kernel of destination OS
For accuracy clock with postponing, each processor in first kind processor can call kernel high-precision sleep function, Ke Yi
The sleeping time control for supporting high-precision time precision is realized on software architecture.
Subsequent, based on the kernel of the destination OS after the completion of above-mentioned configuration, electronic equipment is obtaining target program
Afterwards, the object time precision and first time precision that can be carried according to target program, it is high-precision to determine whether target program needs
The control of the sleeping time of degree.When object time precision is higher than first time precision, i.e., determining target program needs high-precision
The control of sleeping time, at this point it is possible to by being run on any processor that target program is dispatched in first kind processor;Work as mesh
It marks time precision and is not higher than first time precision, that is, determine that target program does not need the control of high-precision sleeping time, at this point,
It is run on any processor that target program can be dispatched in the second class processor.
It is emphasized that in embodiments of the present invention, there must be at least one in above-mentioned electronic equipment and be arranged to
The processor of first kind processor, and, it is necessary to there are the processors that at least one is arranged to the second class processor.In a kind of reality
In existing mode, processor included in SMP hardware framework can be CPU, at this point, can generally be identified by " CPUn " different
CPU can set CPU0 to first kind CPU in a kind of plan of establishment, set second for other CPU in addition to CPU0
Class CPU.
In one implementation, there is likely to be not high to time required precision in the business run in electronic equipment
Business, that is, exist and do not need the program of high-precision sleeping time control (i.e. time precision entrained by program is not higher than the
One time precision).It is understood that realizing the control of the sleeping time of low precision compared to electronic equipment, electronic equipment is real
When the control of existing high-precision sleeping time, the operation burden of processor is larger.It handles at this time in order to reduce in electronic equipment
The operation of device is born, can by the above-mentioned program for not needing high-precision sleeping time control, be dispatched to support low precision when
Between precision processor on run, specifically, the method is also when judging object time precision not higher than first time precision
May include:
Target program is dispatched to second processor, wherein second processor belongs to the second class processor;
Based on second processor, the corresponding kernel high-precision sleep function of second processor is called, so that target program exists
It runs in second processor, and is tied up based on third time precision set by kernel high-precision sleep function, second processor
Fixed second clock event device and object time precision is slept.
In one implementation, interruption (sleep) frequency of some peripheral hardwares (external equipment for electronic equipment)
Rate is higher, also, the sleeping time control of low precision is realized compared to electronic equipment, when electronic equipment realizes high-precision sleep
Between control when, processor operation burden it is larger.At this point, the accuracy of the time precision in order to guarantee first kind processor,
And the operation burden of first kind processor is reduced, it can directly will be about the programmatic binding of above-mentioned peripheral hardware to the second class processor
On any processor, when the kernel based on destination OS directly will be about above-mentioned when obtaining the program about above-mentioned peripheral hardware
In the program scheduler of peripheral hardware to bound processor, so that the program about above-mentioned peripheral hardware (belongs in bound processor
Second class processor) on run, and based on the third time of the bound corresponding kernel high-precision sleep function of processor essence
Second clock event device and the corresponding time precision of program about above-mentioned peripheral hardware bound in degree, bound processor
It sleeps.
Specifically, the of the corresponding kernel high-precision sleep function of each processor by the second class processor
Two time precisions were set as after the step of third time precision (S204), and the configuration process can also include:
It will be about the first programmatic binding of target peripheral on any processor into the second class processor;
It is described judge the step of whether object time precision is higher than first time precision (S102) before, the method may be used also
To include:
Determine whether target program belongs to the first program;
When being determined as being not belonging to, S102 is executed.
Wherein, above-mentioned the first program about target peripheral includes but is not limited to the relative program of network interruption, USB
The relative program, SATA (Serial Advanced of (Universal Serial Bus, universal serial bus) interruption
Technology Attachment, Serial Advanced Technology Attachment are that a kind of connection hardware driver based on professional standard connects
Mouthful) interrupt relative program, WIFI (WIreless-Fidelity, Wireless Fidelity) driving relative program and Bluetooth function
Relative program.
Electronic equipment can be to have bound the first program of processor to add label, so that in electronic equipment operation above-mentioned the
It, can directly will be in above-mentioned first program scheduler to the processor bound according to above-mentioned label when one program.
In one implementation, the sleeping time control flow that program is executed in order to facilitate electronic equipment is incited somebody to action described
Second clock event device bound in each processor being set as in first kind processor is updated to the first event clock and sets
After standby step, the configuration process can also include:
Each processor in first kind processor is associated with default high-precision sleep function;
Described the step of target program is dispatched to first processor (S103), may include:
Default high-precision sleep function is called, target program is dispatched to first processor.
It is understood that electronic equipment can be realized directly by calling above-mentioned default high-precision sleep function by mesh
Beacon course sequence is dispatched to first processor, and executes the sleeping time control flow of subsequent program.Wherein, above-mentioned default high-precision
Sleep function can be identified by " hires_sleep ".
In some scenes, it is understood that there may be first order of magnitude and kernel of object time precision entrained by target program are high-precision
Second order of magnitude for spending the corresponding time precision of sleep function is different, i.e. the unit of object time precision and kernel high-precision is slept
The different situation of the unit of the corresponding time precision of function.In order to preferably realize the control to the sleeping time of target program,
Can first judge whether first order of magnitude is identical as second order of magnitude.When judging that first order of magnitude is identical as second order of magnitude,
Kernel high-precision sleep function can be called directly;When judging first order of magnitude and the second order of magnitude difference, then first will need
First order of magnitude of object time precision is converted to second order of magnitude, then, calls kernel high-precision sleep function.
In one implementation, described to be based on first processor, call the corresponding kernel high-precision of first processor to sleep
The step of dormancy function (S104), may include:
Based on first processor, the corresponding kernel high-precision sleep function of first processor is determined;
Whether judge first order of magnitude of object time precision, second order of magnitude corresponding with kernel high-precision sleep function
It is identical;
When judging that first order of magnitude is identical as second order of magnitude, the corresponding kernel high-precision of first processor is called to sleep
Function.
In another implementation, when judging first order of magnitude and the second order of magnitude difference, the method can be with
Include:
Object time precision is converted from first order of magnitude to second order of magnitude;
Call the corresponding kernel high-precision sleep function of first processor.
For example, object time precision entrained by target program is 1ms, i.e. the first quantity extremely 10-3S, and first
The corresponding time precision of the corresponding kernel high-precision sleep function of processor is 1ns, i.e. second order of magnitude is 10-9S, at this point, needing
First quantity pole of object time precision is converted to second order of magnitude, i.e., 1ms is converted to 103Ns then calls first
The corresponding kernel high-precision sleep function of processor.
Corresponding to above method embodiment, the embodiment of the invention provides a kind of sleeping time control devices of program, such as
Shown in Fig. 3, the apparatus may include:
Module 310 is obtained, for the kernel based on destination OS, obtains target program, wherein the target program
Carry object time precision;
Judgment module 320, for judging whether the object time precision is higher than first time precision;
First scheduler module 330 is used for when judging that the object time precision is higher than the first time precision, by institute
It states target program and is dispatched to first processor, wherein the first processor, which belongs to, has bound the of the first event clock equipment
A kind of processor, the first event clock equipment are as follows: support the event clock equipment of high-precision time precision;
First calling module 340 calls the corresponding kernel of the first processor high for being based on the first processor
Accuracy sleep's function so that the target program is run on the first processor, and is slept based on the kernel high-precision
First event clock equipment and the object time precision bound in second time precision of function, the first processor
It sleeps.
Using the embodiment of the present invention, the object time precision and first time precision carried by target program is determined
Whether on the first processor for belonging to the first kind processor operational objective program, first kind processor bound support high-precision
Time precision the first event clock equipment, and kernel high-precision sleep function can be called, can be realized to time essence
Demanding target program is spent, the control of high-precision sleep (interruption) time is carried out.Only to the time in the embodiment of the present invention
The target program of required precision high (object time precision is higher than first time precision), carries out high-precision sleep (interruption) time
Control, the reasonable control of the sleeping time of different business run to electronic equipment may be implemented.It should be understood that electronics is set
It is standby in the business of operation, i.e. program corresponding to operation business.
In one implementation, as shown in figure 4, described device can also include the kernel to the destination OS
The configuration module 400 configured, wherein the configuration module includes start unit 401, the determining list of call unit 402, first
Member 403, setting unit 404, the second determination unit 405 and registration setting unit 406;
The start unit 401, for being opened before obtaining target program in the kernel based on destination OS
Move the high precision clock configuration of the kernel of the destination OS;
The call unit 402, for based on the high precision clock configuration started, the corresponding destination OS pair
At least two processors answered call the high precision clock to configure the corresponding kernel high-precision sleep function;
First determination unit 403, for according to every in preset setup information and at least two processor
The mark of one processor determines each processor for being set as the second class processor;
The setting unit 404, for the corresponding kernel of each processor in the second class processor is high
Second time precision of accuracy sleep's function is set as third time precision, wherein the third time precision is not higher than described
First time precision, each processor in the second class processor have bound second clock event device, wherein described
Two event clock equipment are as follows: support the event clock equipment of the time precision of low precision;
Second determination unit 405 determines high precision clock for starting the kernel of the destination OS;
The registration setting unit 406, for using identified high precision clock as the first event clock equipment
The kernel into the destination OS is registered, and will be second bound in each processor that be set as in first kind processor
Event clock equipment is updated to the first event clock equipment, wherein the second class processor are as follows: at described at least two
Manage the processor in device in addition to the first kind processor.
In one implementation, the configuration module 400 can also include binding unit;
The binding unit, in the corresponding kernel of each processor by the second class processor
Second time precision of high-precision sleep function is set as after third time precision, and the first program about target peripheral is tied up
On the fixed any processor in the second class processor;
Described device can also include determining module;
The determining module, for it is described judge whether the object time precision is higher than first time precision before,
Determine whether the target program belongs to first program;When being determined as being not belonging to, the judgment module 320 is triggered.
In one implementation, described device can also include the second scheduler module and the second calling module;
Second scheduler module is used for when judging the object time precision not higher than the first time precision,
The target program is dispatched to second processor, wherein the second processor belongs to the second class processor;
Second calling module calls the second processor corresponding described for being based on the second processor
Kernel high-precision sleep function, so that the target program is run in the second processor, and high-precision based on the kernel
Spend third time precision set by sleep function, second clock event device bound in the second processor and described
Object time precision is slept.
In one implementation, the configuration module 400 can also include associative cell;
The associative cell, for it is described will be second bound in each processor that be set as in first kind processor
Event clock equipment is updated to after the first event clock equipment, by the first kind processor each processor with
Default high-precision sleep function is associated;
First scheduler module 330, is specifically used for
The default high-precision sleep function is called, the target program is dispatched to first processor.
In one implementation, first calling module 340 includes third determination unit, judging unit and the first tune
Use unit;
The third determination unit determines that the first processor is corresponding described for being based on the first processor
Kernel high-precision sleep function;
The judging unit, first order of magnitude and kernel high-precision for judging the object time precision are slept
Whether corresponding second order of magnitude of function is identical;
First call unit, for calling when judging that first order of magnitude is identical as second order of magnitude
The corresponding kernel high-precision sleep function of the first processor.
In one implementation, first calling module 340 further includes converting unit and the second call unit;
The converting unit is used for when judging first order of magnitude and second order of magnitude difference, by the mesh
Mark time precision is converted from first order of magnitude to second order of magnitude;
Second call unit, for calling the corresponding kernel high-precision sleep function of the first processor.
Corresponding to above method embodiment, the embodiment of the invention provides a kind of electronic equipment, as shown in figure 5, including more
Processor 510, communication interface 520, memory 530 and communication bus 540, wherein multiprocessor 510, communication interface 520 are deposited
Reservoir 530 completes mutual communication by communication bus 540,
Memory 530, for storing computer program;
Any processor 510 when for executing the computer program stored on memory 530, realizes following steps:
Kernel based on destination OS obtains target program, wherein the target program carries object time essence
Degree;
Judge whether the object time precision is higher than first time precision;
When judging that the object time precision is higher than the first time precision, the target program is dispatched to first
Processor, wherein the first processor belongs to the first kind processor for having bound the first event clock equipment, when described first
Clock event device are as follows: support the event clock equipment of high-precision time precision;
Based on the first processor, the corresponding kernel high-precision sleep function of the first processor is called, so that institute
Target program is stated to run on the first processor, and the second time precision based on the kernel high-precision sleep function,
First event clock equipment and the object time precision bound in the first processor are slept.
Using the embodiment of the present invention, the object time precision and first time precision carried by target program is determined
Whether on the first processor for belonging to the first kind processor operational objective program, first kind processor bound support high-precision
Time precision the first event clock equipment, and kernel high-precision sleep function can be called, can be realized to time essence
Demanding target program is spent, the control of high-precision sleep (interruption) time is carried out.Only to the time in the embodiment of the present invention
The target program of required precision high (object time precision is higher than first time precision), carries out high-precision sleep (interruption) time
Control, the reasonable control of the sleeping time of different business run to electronic equipment may be implemented.It should be understood that electronics is set
It is standby in the business of operation, i.e. program corresponding to operation business.
Above-mentioned electronic equipment can be hard based on SMP (Symmetrical Multi-Processing, symmetric multi-processors)
Part framework and electronic equipment based on destination OS software architecture, wherein above-mentioned destination OS is that can be provided with
Support the operating system of the software architecture of high precision clock, such as: Linux.Each processor in above-mentioned multiprocessor
Think general processor, such as: central processing unit (Central Processing Unit, CPU) etc..
Any processor in above-mentioned multiprocessor can execute the computer program stored on above-mentioned memory, with
Realize the sleeping time control method of described program provided by the embodiment of the present invention.It is deposited on the i.e. above-mentioned above-mentioned memory of execution
Any processor for the computer program put can be first processor, or second processor, or, or
Any processor in other processors in electronic equipment in addition to first processor, second processor.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component
Interconnect, PCI) bus, expanding the industrial standard structure (Extended Industry Standard
Architecture, EISA) and the bus either bus of ARM (such as: AMBA (Advanced Microcontroller Bus
Architecture) on-chip bus, APB (Advanced Peripheral Bus, peripheral bus)) etc..The communication bus can be with
It is divided into address bus, data/address bus, control bus etc..Only to be indicated with a thick line in figure, it is not intended that only convenient for indicating
There are a bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy
The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be storage device that at least one is located remotely from aforementioned processor.
Corresponding to above method embodiment, the embodiment of the invention provides a kind of computer readable storage medium, the meter
Computer program is stored in calculation machine readable storage medium storing program for executing, the computer program realizes above-mentioned program when being executed by processor
Sleeping time control method, this method may include step:
Kernel based on destination OS obtains target program, wherein the target program carries object time essence
Degree;
Judge whether the object time precision is higher than first time precision;
When judging that the object time precision is higher than the first time precision, the target program is dispatched to first
Processor, wherein the first processor belongs to the first kind processor for having bound the first event clock equipment, when described first
Clock event device are as follows: support the event clock equipment of high-precision time precision;
Based on the first processor, the corresponding kernel high-precision sleep function of the first processor is called, so that institute
Target program is stated to run on the first processor, and the second time precision based on the kernel high-precision sleep function,
First event clock equipment and the object time precision bound in the first processor are slept.
Using the embodiment of the present invention, the object time precision and first time precision carried by target program is determined
Whether on the first processor for belonging to the first kind processor operational objective program, first kind processor bound support high-precision
Time precision the first event clock equipment, and kernel high-precision sleep function can be called, can be realized to time essence
Demanding target program is spent, the control of high-precision sleep (interruption) time is carried out.Only to the time in the embodiment of the present invention
The target program of required precision high (object time precision is higher than first time precision), carries out high-precision sleep (interruption) time
Control, the reasonable control of the sleeping time of different business run to electronic equipment may be implemented.It should be understood that electronics is set
It is standby in the business of operation, i.e. program corresponding to operation business.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method
Part explanation.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (16)
1. a kind of sleeping time control method of program, which is characterized in that the described method includes:
Kernel based on destination OS obtains target program, wherein the target program carries object time precision;
Judge whether the object time precision is higher than first time precision;
When judging that the object time precision is higher than the first time precision, the target program is dispatched to the first processing
Device, wherein the first processor belongs to the first kind processor for having bound the first event clock equipment, the first clock thing
Part equipment are as follows: support the event clock equipment of high-precision time precision;
Based on the first processor, the corresponding kernel high-precision sleep function of the first processor is called, so that the mesh
Beacon course sequence is run on the first processor, and the second time precision based on the kernel high-precision sleep function, described
First event clock equipment and the object time precision bound in first processor are slept.
2. the method according to claim 1, wherein obtaining mesh in the kernel based on destination OS
Before the step of beacon course sequence, the method also includes the process that the kernel to the destination OS is configured, the mistake
Journey includes:
Start the high precision clock configuration of the kernel of the destination OS;
Based on the high precision clock configuration started, corresponding at least two processor of the destination OS is corresponded to, is called
The high precision clock configures the corresponding kernel high-precision sleep function;
According to the mark of each processor in preset setup information and at least two processor, determination is set as second
Each processor of class processor;
By the second time essence of the corresponding kernel high-precision sleep function of each processor in the second class processor
Degree is set as third time precision, wherein the third time precision is not higher than the first time precision, at second class
Each processor in reason device has bound second clock event device, wherein the second clock event device are as follows: support low essence
The event clock equipment of the time precision of degree;
The kernel for starting the destination OS, determines high precision clock;
Enter the kernel of the destination OS using identified high precision clock as the first event clock facility registration,
And when second clock event device bound in each processor being set as in first kind processor is updated to described first
Clock event device, wherein the second class processor are as follows: at least two processor in addition to the first kind processor
Processor.
3. according to the method described in claim 2, it is characterized in that, in each processing by the second class processor
It is described after the step of second time precision of the corresponding kernel high-precision sleep function of device is set as third time precision
Configuration process further include:
It will be about the first programmatic binding of target peripheral on any processor into the second class processor;
It is described judge the step of whether the object time precision is higher than first time precision before, the method also includes:
Determine whether the target program belongs to first program;
When being determined as being not belonging to, execution is described to judge the step of whether the object time precision is higher than first time precision.
4. according to the method described in claim 2, it is characterized in that, when judging the object time precision not higher than described first
When time precision, the method also includes:
The target program is dispatched to second processor, wherein the second processor belongs to the second class processor;
Based on the second processor, the corresponding kernel high-precision sleep function of the second processor is called, so that institute
It states target program to run in the second processor, and based on the third time set by the kernel high-precision sleep function
Second clock event device bound in precision, the second processor and the object time precision are slept.
5. according to the method described in claim 2, it is characterized in that, the everywhere in first kind processor will be set as described
After the step of second clock event device bound in reason device is updated to the first event clock equipment, the configuration process
Further include:
Each processor in the first kind processor is associated with default high-precision sleep function;
The described the step of target program is dispatched to first processor, comprising:
The default high-precision sleep function is called, the target program is dispatched to first processor.
6. method according to claim 1-5, which is characterized in that it is described to be based on the first processor, it calls
The step of first processor corresponding kernel high-precision sleep function, comprising:
Based on the first processor, the corresponding kernel high-precision sleep function of the first processor is determined;
Judge first order of magnitude of the object time precision, second order of magnitude corresponding with the kernel high-precision sleep function
It is whether identical;
When judging that first order of magnitude is identical as second order of magnitude, call the first processor corresponding described interior
Core high-precision sleep function.
7. according to the method described in claim 6, it is characterized in that, when judging first order of magnitude and second order of magnitude
When different, the method also includes:
The object time precision is converted from first order of magnitude to second order of magnitude;
Call the corresponding kernel high-precision sleep function of the first processor.
8. a kind of sleeping time control device of program, which is characterized in that described device includes:
Module is obtained, for the kernel based on destination OS, obtains target program, wherein the target program carries mesh
Mark time precision;
Judgment module, for judging whether the object time precision is higher than first time precision;
First scheduler module is used for when judging that the object time precision is higher than the first time precision, by the target
Program scheduler is to first processor, wherein the first processor belongs at the first kind for having bound the first event clock equipment
Manage device, the first event clock equipment are as follows: support the event clock equipment of high-precision time precision;
First calling module calls the corresponding kernel high-precision of the first processor to sleep for being based on the first processor
Dormancy function, so that the target program is run on the first processor, and based on the kernel high-precision sleep function
First event clock equipment and the object time precision bound in second time precision, the first processor are slept
It sleeps.
9. device according to claim 8, which is characterized in that described device further includes in the destination OS
The configuration module that core is configured, wherein the configuration module includes start unit, call unit, the first determination unit, setting
Unit, the second determination unit and registration setting unit;
The start unit, for starting the mesh before obtaining target program in the kernel based on destination OS
Mark the high precision clock configuration of the kernel of operating system;
The call unit, for based on the high precision clock configuration started, the corresponding destination OS to be corresponding extremely
Few two processors, call the high precision clock to configure the corresponding kernel high-precision sleep function;
First determination unit, for according to each processor in preset setup information and at least two processor
Mark, determine and be set as each processor of the second class processor;
The setting unit, for the corresponding kernel high-precision of each processor in the second class processor to be slept
Second time precision of function is set as third time precision, wherein the third time precision is not higher than the first time
Precision, each processor in the second class processor have bound second clock event device, wherein the second clock thing
Part equipment are as follows: support the event clock equipment of the time precision of low precision;
Second determination unit determines high precision clock for starting the kernel of the destination OS;
The registration setting unit, for entering institute for identified high precision clock as the first event clock facility registration
State the kernel of destination OS, and by second clock event bound in each processor being set as in first kind processor
Equipment is updated to the first event clock equipment, wherein the second class processor are as follows: removes at least two processor
Processor outside the first kind processor.
10. device according to claim 9, which is characterized in that the configuration module further includes binding unit;
The binding unit, for described that the corresponding kernel of each processor in the second class processor is high-precision
Degree sleep function the second time precision be set as after third time precision, by about the first programmatic binding of target peripheral extremely
On any processor in the second class processor;
Described device further includes determining module;
The determining module, for it is described judge whether the object time precision is higher than first time precision before, determine
Whether the target program belongs to first program;When being determined as being not belonging to, the judgment module is triggered.
11. device according to claim 9, which is characterized in that described device further includes that the second scheduler module and second are adjusted
Use module;
Second scheduler module is used for when judging the object time precision not higher than the first time precision, by institute
It states target program and is dispatched to second processor, wherein the second processor belongs to the second class processor;
Second calling module calls the corresponding kernel of the second processor for being based on the second processor
High-precision sleep function so that the target program is run in the second processor, and is slept based on the kernel high-precision
Second clock event device bound in third time precision, the second processor set by dormancy function and the target
Time precision is slept.
12. device according to claim 9, which is characterized in that the configuration module further includes associative cell;
The associative cell, for described by second clock bound in each processor being set as in first kind processor
Event device is updated to after the first event clock equipment, by each processor in the first kind processor and is preset
High-precision sleep function is associated;
First scheduler module, is specifically used for
The default high-precision sleep function is called, the target program is dispatched to first processor.
13. according to the described in any item devices of claim 8-12, which is characterized in that first calling module includes that third is true
Order member, judging unit and the first call unit;
The third determination unit determines the corresponding kernel of the first processor for being based on the first processor
High-precision sleep function;
The judging unit, for judging first order of magnitude and the kernel high-precision sleep function of the object time precision
Whether corresponding second order of magnitude is identical;
First call unit is used for when judging that first order of magnitude is identical as second order of magnitude, described in calling
The corresponding kernel high-precision sleep function of first processor.
14. device according to claim 13, which is characterized in that first calling module further includes converting unit and
Two call units;
The converting unit is used for when judging first order of magnitude and second order of magnitude difference, when by the target
Between precision convert from first order of magnitude to second order of magnitude;
Second call unit, for calling the corresponding kernel high-precision sleep function of the first processor.
15. a kind of electronic equipment, which is characterized in that including multiprocessor, communication interface, memory and communication bus, wherein more
Processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Any processor when for executing the computer program stored on memory, is realized as claimed in claim 1 to 7
The sleeping time control method of program.
16. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium
Program, the computer program realize the sleeping time control of program as claimed in claim 1 to 7 when being executed by processor
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710418542.4A CN109002325B (en) | 2017-06-06 | 2017-06-06 | Program sleep time control method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710418542.4A CN109002325B (en) | 2017-06-06 | 2017-06-06 | Program sleep time control method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109002325A true CN109002325A (en) | 2018-12-14 |
CN109002325B CN109002325B (en) | 2021-04-30 |
Family
ID=64572827
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710418542.4A Active CN109002325B (en) | 2017-06-06 | 2017-06-06 | Program sleep time control method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109002325B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112579249A (en) * | 2019-09-30 | 2021-03-30 | 奇安信安全技术(珠海)有限公司 | Multi-CPU virtual machine operation method and device, storage medium and computer equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105022669A (en) * | 2015-06-30 | 2015-11-04 | 惠州市亿能电子有限公司 | Method for improving BMS system performance by coprocessor |
CN105700961A (en) * | 2016-02-29 | 2016-06-22 | 华为技术有限公司 | Business container creation method and device |
-
2017
- 2017-06-06 CN CN201710418542.4A patent/CN109002325B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105022669A (en) * | 2015-06-30 | 2015-11-04 | 惠州市亿能电子有限公司 | Method for improving BMS system performance by coprocessor |
CN105700961A (en) * | 2016-02-29 | 2016-06-22 | 华为技术有限公司 | Business container creation method and device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112579249A (en) * | 2019-09-30 | 2021-03-30 | 奇安信安全技术(珠海)有限公司 | Multi-CPU virtual machine operation method and device, storage medium and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN109002325B (en) | 2021-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019196692A1 (en) | Virtual machine scheduling method and device | |
US20160266929A1 (en) | Cpu scheduling method, terminal device and processing device | |
CN107526640B (en) | Resource management method, resource management device, mobile terminal and computer-readable storage medium | |
US9218203B2 (en) | Packet scheduling in a multiprocessor system using inter-core switchover policy | |
CN104838359B (en) | The software interrupt and thread scheduling of latency-sensitive | |
CN102812439B (en) | For the method and system of assigned tasks in multiprocessor computer system | |
WO2016039963A2 (en) | Resource sharing between two resource allocation systems | |
ES2962838T3 (en) | Computer resource planning method, scheduler, Internet of Things system and computer readable medium | |
CN104156263A (en) | Interruption of chip component managing tasks, chip, and assembly comprising chip | |
EP2790106A2 (en) | Performance measurement unit, processor core including the same and process profiling method | |
JP2014517434A5 (en) | ||
CN104932963B (en) | The method and device of management terminal | |
CN105843731B (en) | Computer system and the method for monitoring performance executed by computer system | |
US10674017B2 (en) | Data Communication control | |
CN106133689A (en) | Thread context in multi-threaded computer system is recovered | |
US20170187790A1 (en) | Ranking system | |
CN111767199A (en) | Resource management method, device, equipment and system based on batch processing operation | |
CN106209412B (en) | Resource monitoring system and method thereof | |
CN108205476A (en) | A kind of method and device of multithreading daily record output | |
CN115033352A (en) | Task scheduling method, device and equipment for multi-core processor and storage medium | |
CN110262878A (en) | Timed task processing method, device, equipment and computer readable storage medium | |
US10698620B2 (en) | Dynamic cache allocation | |
KR101554555B1 (en) | Calculation system for cpu load in real time operation system and method thereof | |
CN109002325A (en) | A kind of sleeping time control method and device of program | |
CN107562520A (en) | The method and apparatus of the internal memory of dilatation virtual machine |
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 |