Movatterモバイル変換


[0]ホーム

URL:


CN113867518A - Processor low power consumption blocking delay method, apparatus and readable medium - Google Patents

Processor low power consumption blocking delay method, apparatus and readable medium
Download PDF

Info

Publication number
CN113867518A
CN113867518ACN202111081449.1ACN202111081449ACN113867518ACN 113867518 ACN113867518 ACN 113867518ACN 202111081449 ACN202111081449 ACN 202111081449ACN 113867518 ACN113867518 ACN 113867518A
Authority
CN
China
Prior art keywords
delay
processor
time
state
power consumption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111081449.1A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Eeasy Electronic Tech Co ltd
Original Assignee
Zhuhai Eeasy Electronic Tech Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Eeasy Electronic Tech Co ltdfiledCriticalZhuhai Eeasy Electronic Tech Co ltd
Priority to CN202111081449.1ApriorityCriticalpatent/CN113867518A/en
Publication of CN113867518ApublicationCriticalpatent/CN113867518A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明涉及一种处理器低功耗阻塞式延时方法、装置及可读介质的技术方案,包括:获取处理器的第一延时状态,确定第一延时状态的当延时起始时间、延时长度及超时时间点;根据当前时间、延时长度及超时时间点确定第一延时状态的剩余延时时常;启动定时器,通过定时器在剩余延时时常内将处理器保持在第一运行状态,并在剩余延时时常结束后使处理器返回第二运行状态。本发明的有益效果为:节省了处理器资源,降低了处理器在阻塞式延时的功耗。

Figure 202111081449

The present invention relates to a low-power-consumption blocking delay method, a device and a technical solution for a readable medium of a processor, comprising: acquiring a first delay state of a processor, and determining a current delay start time of the first delay state , delay length and timeout time point; determine the remaining delay time of the first delay state according to the current time, delay length and timeout time point; start the timer, and keep the processor in the remaining delay time through the timer the first operating state, and returning the processor to the second operating state after the remaining delay time has elapsed. The beneficial effects of the present invention are as follows: the processor resources are saved, and the power consumption of the processor during blocking delay is reduced.

Figure 202111081449

Description

Processor low-power consumption blocking type time delay method, device and readable medium
Technical Field
The invention relates to the field of computers, in particular to a low-power-consumption blocking type time delay method and device of a processor and a readable medium.
Background
In the operating process of an operating system, many scenes need to be delayed, for example, when a clock is initialized in the system starting stage, the phase-locked loop needs to be delayed for stabilization, and when a display screen is initialized, a hardware signal needs to be delayed for stabilization. There are generally two implementations of latency: blocking delay and non-blocking delay. Blocking latency is when the processor waits in place without switching to other tasks. Many scenarios are not capable of task switching, such as a critical section that can be accessed by only one task during interrupt processing, an early stage of start-up in which a task scheduling function is not ready, and the like. The non-blocking type delay finger processor leaves the original task and is switched to other tasks to execute, if no other tasks exist, the idle task is executed, and the low power consumption state is entered; and when the time delay expires, switching back to the original task, and continuously executing the program after the time delay. Since the processor can run other tasks or enter a low power state during the delay, processor resources can be fully utilized or system power consumption can be reduced.
Generally, in the system operation, most scenarios use non-blocking delay, and only when the non-blocking scenario cannot be used, the blocking delay is used. The conventional method is shown in fig. 1, and the flow of the blocking type delay method includes: firstly, acquiring starting time and storing variables of the starting time; then adding the delay length to the start time to obtain the delayed overtime time; then, circularly judging whether the time delay is finished or not, namely continuously acquiring the current time of the current system, comparing the current time with the overtime, and finishing when the time delay exceeds the overtime.
In the traditional method, during the blocking type delay period, the processor is always operated at full speed, but the loop is only used for judging whether the delay is finished or not, and other things are not processed. Thus resulting in wasted processor resources and higher processor power consumption.
Disclosure of Invention
The present invention is directed to solve at least one of the problems in the prior art, and provides a low-power blocking type delay method, apparatus and readable medium for a processor, which reduces the power consumption of the processor during the delay.
The technical scheme of the invention comprises a blocking type time delay method with low power consumption of a processor, which is characterized by comprising the following steps: acquiring a first delay state of a processor, and determining the initial delay time, the delay length and the overtime time point of the first delay state; determining the residual delay time of the first delay state according to the current time, the delay length and the overtime time point; and starting a timer, keeping the processor in a first running state within the residual time delay time by the timer, and returning the processor to a second running state after the residual time delay time is over.
The processor low-power consumption blocking type time delay method comprises the following steps of: acquiring the starting time, and calculating the sum of the starting time and the delay length as the timeout time point; and after the timeout time point is determined, executing the delay processing of the next step.
The processor low-power consumption blocking type delay method, wherein the step of determining the residual delay of the first delay state according to the current time, the delay length and the overtime time point comprises the following steps: subtracting the starting time from the timeout time point to obtain the residual delay time; and if the residual time delay is often larger than a set threshold, executing the next step, wherein the set threshold can be adjusted in a self-defined manner.
The processor low-power consumption blocking type time delay method further comprises the following steps: if the residual delay is often smaller than the set threshold value, the processor is kept in a second delay state, and when the processor is in the second delay state, the current time and the timeout time point are monitored in a circulating mode until the current time is larger than or equal to the timeout time point, and then the processor exits from the second delay state.
The first operation state and the second operation state are respectively a low power consumption state and a non-low power consumption state, and the first operation state and the second operation state are switched through the timer.
The processor low-power blocking delay method, wherein the timer is configured as a high-precision timer.
The technical scheme of the invention comprises a processor low-power consumption blocking type time delay device which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, and is characterized in that any one of the method steps is realized when the processor executes the computer program.
An aspect of the invention includes a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any of the method steps.
The invention has the beneficial effects that: the processor resource is saved, and the power consumption of the processor in the blocking type delay is reduced.
Drawings
The invention is further described below with reference to the accompanying drawings and examples;
fig. 1 is a time-delay flow chart of the prior art method.
Fig. 2 shows a flow diagram according to an embodiment of the invention.
FIG. 3 is a block-type delay for low power consumption of a processor according to an embodiment of the present invention.
Fig. 4 shows a diagram of an apparatus according to an embodiment of the invention.
Detailed Description
Reference will now be made in detail to the present preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to like elements throughout.
In the description of the present invention, the meaning of a plurality of means is one or more, the meaning of a plurality of means is two or more, and larger, smaller, larger, etc. are understood as excluding the number, and larger, smaller, inner, etc. are understood as including the number.
In the description of the present invention, the consecutive reference numbers of the method steps are for convenience of examination and understanding, and the implementation order between the steps is adjusted without affecting the technical effect achieved by the technical solution of the present invention by combining the whole technical solution of the present invention and the logical relationship between the steps.
In the description of the present invention, unless otherwise explicitly defined, terms such as set, etc. should be broadly construed, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the detailed contents of the technical solutions.
Chinese-english control in this application:
start, start time;
now, the current time (of the operating system);
time _ delay, delay length;
expire, timeout time;
remaining, often remaining delay.
Fig. 2 shows a flow diagram according to an embodiment of the invention. The process of this embodiment includes the following steps:
s100, acquiring a first delay state of a processor, and determining the initial delay time, the delay length and the overtime time point of the first delay state; s200, determining the residual delay time of the first delay state frequently according to the current time, the delay length and the overtime time point; s300, starting a timer, keeping the processor in a first running state within the residual time delay time constant through the timer, and returning the processor to a second running state after the residual time delay time constant is ended. The first operation state and the second operation state are respectively a low power consumption state and a non-low power consumption state of the processor.
In order to ensure the stable and error-free implementation of the first delay state, a high-precision timer is generally adopted as the timer.
Fig. 3 shows a specific implementation of blocking type delay with low power consumption of a processor according to an embodiment of the present invention, where the process of this embodiment includes:
firstly, obtaining the initial time of the time delay, then adding the initial time to the time delay length to obtain the overtime time, and then entering a time delay main process, namely a first time delay process of the first embodiment.
Obtaining the current time of the system, subtracting the current time from the overtime time to obtain the residual delay time, and if the residual delay time is less than or equal to 0, indicating that the delay is due, ending the delay process; if the residual delay time is longer than the delay threshold, starting a high-precision timer, setting the interval as the residual delay time, switching the processor to a low-power-consumption mode, and waiting to be awakened by hardware interruption (such as interruption of a set timer) or an event; if the residual delay time is less than or equal to the delay threshold, similar to the traditional method, the current time is obtained in a circulating mode and judged until the delay is finished.
The setting of the delay threshold is mainly based on the following considerations: because the high-precision timer is started, the processor needs to consume the processor time when entering or exiting the low-power consumption mode, and the like, when the duration of the residual delay is so small that the high-precision timer is not enough to be started, and the like, the use of the timer may cause the delay to exceed the preset time, thereby causing inaccurate delay. A delay threshold is thus set and a high-precision timer is used only if the duration of the remaining delay is greater than the threshold.
Fig. 4 shows a diagram of an apparatus according to an embodiment of the invention. The apparatus comprises amemory 100 and aprocessor 200, wherein theprocessor 200 stores a computer program for performing: acquiring a first delay state of a processor, and determining the initial delay time, the delay length and the overtime time point of the first delay state; determining the residual delay time of the first delay state according to the current time, the delay length and the overtime time point; and starting a timer, keeping the processor in a first running state within the residual time delay time constant through the timer, and returning the processor to a second running state after the residual time delay time constant is ended.
It should be recognized that the method steps in embodiments of the present invention may be embodied or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The method may use standard programming techniques. Each program may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose.
Further, the operations of processes described herein can be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and/or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) collectively executed on one or more processors, by hardware, or combinations thereof. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable interface, including but not limited to a personal computer, mini computer, mainframe, workstation, networked or distributed computing environment, separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and the like. Aspects of the invention may be embodied in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optically read and/or write storage medium, RAM, ROM, or the like, such that it may be read by a programmable computer, which when read by the storage medium or device, is operative to configure and operate the computer to perform the procedures described herein. Further, the machine-readable code, or portions thereof, may be transmitted over a wired or wireless network. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein.
A computer program can be applied to input data to perform the functions described herein to transform the input data to generate output data that is stored to non-volatile memory. The output information may also be applied to one or more output devices, such as consumers. In a preferred embodiment of the present invention, the transformed data represents physical and tangible objects, including particular visual depictions of physical and tangible objects produced on the consumer.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (8)

Translated fromChinese
1.一种处理器低功耗阻塞式延时方法,其特征在于,包括以下步骤:1. a processor low power consumption blocking type delay method, is characterized in that, comprises the following steps:获取处理器的第一延时状态,确定所述第一延时状态的当延时起始时间、延时长度及超时时间点;Obtain the first delay state of the processor, and determine the current delay start time, delay length and timeout time point of the first delay state;根据当前时间、所述延时长度及所述超时时间点确定所述第一延时状态的剩余延时时常;Determine the remaining delay time of the first delay state according to the current time, the delay length and the timeout time point;启动定时器,通过所述定时器在所述剩余延时时常内将所述处理器保持在第一运行状态,并在所述剩余延时时常结束后使所述处理器返回第二运行状态。A timer is started, the timer is used to keep the processor in the first operating state during the remaining delay time, and the processor is returned to the second operating state after the remaining delay time is over.2.根据权利要求1所述的处理器低功耗阻塞式延时方法,其特征在于,所述确定所述第一延时状态的延时起始时间、所述延时长度及所述超时时间点包括:2. The processor low power consumption blocking type delay method according to claim 1, wherein the determining the delay start time of the first delay state, the delay length and the timeout Time points include:获取所述起始时间,计算所述起始时间与所述延时长度的和作为所述超时时间点;Obtain the start time, and calculate the sum of the start time and the delay length as the timeout time point;确定所述超时时间点后,执行下一步骤的延时处理。After the timeout time point is determined, the delay processing of the next step is performed.3.根据权利要求1所述的处理器低功耗阻塞式延时方法,其特征在于,所述根据所述当前时间、所述延时长度及所述超时时间点确定所述第一延时状态的剩余延时时常包括:3. The processor low power consumption blocking delay method according to claim 1, wherein the first delay is determined according to the current time, the delay length and the timeout time point The remaining delays for states often include:通过所述超时时间点减去所述起始时间得到所述剩余延时时常;The remaining delay time is obtained by subtracting the start time from the timeout time point;若所述剩余延时时常大于设定阈值,则执行下一步骤,其中所述设定阈值可自定义调整。If the remaining delay is often greater than the set threshold, the next step is performed, wherein the set threshold can be adjusted by user.4.根据权利要求3所述的处理器低功耗阻塞式延时方法,其特征在于,该方法还包括:4. The processor low power consumption blocking delay method according to claim 3, wherein the method further comprises:若所述剩余延时时常小于所述设定阈值,将所述处理器保持在第二延时状态,处于所述第二延时状态时,循环监控所述当前时间与所述超时时间点,直至所述当前时间大于或等于所述超时时间点,进而退出所述第二延时状态。If the remaining delay is often less than the set threshold, the processor is kept in the second delay state, and in the second delay state, the current time and the timeout time point are cyclically monitored, Until the current time is greater than or equal to the timeout time point, and then exit the second delay state.5.根据权利要求1所述的处理器低功耗阻塞式延时方法,其特征在于,所述第一运行状态及所述第二运行状态分别为低功耗状态及非低功耗状态,所述第一运行状态及所述第二运行状态通过所述定时器进行切换。5. The processor low power consumption blocking delay method according to claim 1, wherein the first operating state and the second operating state are respectively a low power consumption state and a non-low power consumption state, The first operating state and the second operating state are switched by the timer.6.根据权利要求1所述的处理器低功耗阻塞式延时方法,其特征在于,所述定时器被配置为高精度定时器。6 . The low-power blocking delay method of a processor according to claim 1 , wherein the timer is configured as a high-precision timer. 7 .7.一种处理器低功耗阻塞式延时装置,该装置包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1-6任一所述的方法步骤。7. A processor low power consumption blocking type delay device, the device comprises a memory, a processor and a computer program stored in the memory and running on the processor, characterized in that the processor The method steps of any one of claims 1-6 are implemented when the computer program is executed.8.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-6任一所述的方法步骤。8. A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the method steps according to any one of claims 1-6 are implemented.
CN202111081449.1A2021-09-152021-09-15 Processor low power consumption blocking delay method, apparatus and readable mediumPendingCN113867518A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111081449.1ACN113867518A (en)2021-09-152021-09-15 Processor low power consumption blocking delay method, apparatus and readable medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111081449.1ACN113867518A (en)2021-09-152021-09-15 Processor low power consumption blocking delay method, apparatus and readable medium

Publications (1)

Publication NumberPublication Date
CN113867518Atrue CN113867518A (en)2021-12-31

Family

ID=78996005

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111081449.1APendingCN113867518A (en)2021-09-152021-09-15 Processor low power consumption blocking delay method, apparatus and readable medium

Country Status (1)

CountryLink
CN (1)CN113867518A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101981530A (en)*2008-04-112011-02-23飞思卡尔半导体公司Microprocessor having a low-power mode and a non-low power mode, data processing system and computer program product.
CN102103484A (en)*2009-12-182011-06-22英特尔公司Instruction for enabling a procesor wait state
CN102918474A (en)*2009-05-132013-02-06苹果公司Power Management Lock Optimization
CN104375620A (en)*2014-11-252015-02-25珠海全志科技股份有限公司Method for reducing power dissipation of ucos-ii system
CN104503565A (en)*2015-01-042015-04-08华为技术有限公司Power consumption management method and device for mobile device and mobile device
CN106125885A (en)*2010-12-212016-11-16英特尔公司System and method for power management
CN107885306A (en)*2016-09-292018-04-06联芯科技有限公司The dormancy control method and equipment of central processing unit

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101981530A (en)*2008-04-112011-02-23飞思卡尔半导体公司Microprocessor having a low-power mode and a non-low power mode, data processing system and computer program product.
CN102918474A (en)*2009-05-132013-02-06苹果公司Power Management Lock Optimization
CN102103484A (en)*2009-12-182011-06-22英特尔公司Instruction for enabling a procesor wait state
CN106125885A (en)*2010-12-212016-11-16英特尔公司System and method for power management
CN104375620A (en)*2014-11-252015-02-25珠海全志科技股份有限公司Method for reducing power dissipation of ucos-ii system
CN104503565A (en)*2015-01-042015-04-08华为技术有限公司Power consumption management method and device for mobile device and mobile device
CN107885306A (en)*2016-09-292018-04-06联芯科技有限公司The dormancy control method and equipment of central processing unit

Similar Documents

PublicationPublication DateTitle
US7596705B2 (en)Automatically controlling processor mode of multi-core processor
CN104516475B (en) Method and apparatus for managing global chip power on a multi-core system-on-chip
CN104303149B (en) Method and system for scheduling requests in a portable computing device
EP3391212B1 (en)Controlling operation of a gpu
EP3391211B1 (en)Controlling scheduling of a gpu
US9652027B2 (en)Thread scheduling based on performance state and idle state of processing units
CN104951044B (en)Dynamic voltage and frequency adjustment method, system on chip and device
US20200379820A1 (en)Synchronization mechanism for workgroups
WO2023193527A1 (en)Thread execution method and apparatus, electronic device, and computer-readable storage medium
US20210067451A1 (en)Dynamic control of latency tolerance reporting values
US20250264932A1 (en)System agnostic autonomous system state management
JP5971214B2 (en) Data processing apparatus and data processing program
CN110851297A (en)Method, device, system and medium for processing interface jitter state
US20050066093A1 (en)Real-time processor system and control method
CN113867518A (en) Processor low power consumption blocking delay method, apparatus and readable medium
US10901491B2 (en)Sleep management method and device, and computer storage medium
US11627215B1 (en)Smart usage monitoring and access control of web and mobile applications
CN115421859B (en)Dynamic loading method and device for configuration file, computer equipment and storage medium
JP6928263B2 (en) Information processing equipment, computer control method, and computer control program
JP2024539043A (en) Real-time operating system using CPU cycle time base
CN116431226A (en) Operating system switching method and device, electronic device, storage medium
CN119522407A (en) Task scheduling device, computing system, task scheduling method and program
CN109934327B (en) A smart card timing method and system
CN113778640A (en)Task execution method and device, electronic equipment and storage medium
CN119065819B (en)Task optimization method, device and medium based on Android standby energy conservation

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20211231


[8]ページ先頭

©2009-2025 Movatter.jp