Clock switching control method and apparatus, electronic device, and medium
By receiving and processing power mode signals and switching the states of clock gating and high-frequency clock sources, the power loss problem during high- and low-power mode switching is solved, achieving seamless switching between high- and low-power modes and energy-saving effects.
Patent Information
- Application Number
- CN202211594525.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-13
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-12-13
AI Technical Summary
In existing technologies, modules using high-frequency clocks experience significant power loss when switching between high and low power consumption modes, leading to increased system power consumption.
By receiving power consumption mode signals, the type of the signal is determined, and the power consumption mode is switched based on the type. This includes setting the enable state of the clock gating unit and the high-frequency clock source to achieve seamless switching between high and low power consumption modes and avoid shutting down the original clock.
It effectively reduces power consumption loss during high-low power switching, saves system power consumption, and ensures that functional modules that rely on the original clock continue to work during the switching process.
Smart Images

Figure CN116266066B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of control technology, and in particular to a clock switching control method, apparatus, electronic device, and medium. Background Technology
[0002] The chip has multiple low-power operating modes to meet low power requirements, such as low-power operation mode, sleep mode, low-power sleep mode, stop mode, and standby mode.
[0003] Among them, the modules using high-frequency clocks have the need to switch between high and low power consumption of the chip. For example, some circuits in module A using high-frequency clocks work in high-power mode using high-frequency clocks. When module A switches to low-power mode for tasks such as detection, the high-frequency clock of module A in low-power mode needs to be turned off. At this time, module B, which originally relied on the output of the circuits in module A working in high-frequency clock mode, cannot participate in the subsequent work. It needs to wait for module A to switch from low-power mode to high-power mode before module B can continue to complete the subsequent work in high-power mode.
[0004] However, when using the above switching method, the power consumption of modules using high-frequency clocks is relatively large when switching between high and low power consumption operating modes of the chip. Summary of the Invention
[0005] In view of the above problems, embodiments of this application provide a clock switching control method, apparatus, electronic device and medium, which overcome the problem of high power consumption.
[0006] Firstly, a clock switching control method is provided, including:
[0007] Receive a power consumption mode signal, the power consumption mode signal including: a high power consumption indicator signal or a low power consumption indicator signal;
[0008] In response to the power consumption mode signal, the type of the power consumption mode signal is determined, and the type of the power consumption mode signal includes: a first type and a second type, wherein the first type corresponds to the low power consumption indication signal and the second type corresponds to the high power consumption indication signal;
[0009] Based on the type of the power consumption mode signal, switch the power consumption operating mode.
[0010] In one alternative approach, when the power consumption mode signal is of the first type, switching the power consumption operating mode based on the type of the power consumption mode signal includes:
[0011] The clock gating unit is set to an disabled state based on the first high-frequency clock gating enable signal;
[0012] The current clock signal is switched to a low-frequency clock signal based on the first clock switching signal;
[0013] Based on the first high-frequency clock enable signal, the high-frequency clock source is set to be disabled, so as to switch the power consumption mode from high power consumption mode to low power consumption mode.
[0014] In one alternative approach, when the power consumption mode signal is of the second type, switching the power consumption operating mode based on the type of the power consumption mode signal includes:
[0015] The high-frequency clock source is set to an enabled state based on the second high-frequency clock enable signal;
[0016] The current clock signal is switched to a high-frequency clock signal based on the second clock switching signal;
[0017] The clock gating unit is set to an enabled state based on the second high-frequency clock gating enable signal, so as to switch the power consumption operating mode from the low power consumption mode to the high power consumption mode.
[0018] In one alternative approach, it also includes:
[0019] After the high-frequency clock source is set to be in an disabled state based on the first high-frequency clock enable signal, if the first control completion signal is received, it is determined that the power consumption operating mode is switched from the high power consumption mode to the low power consumption mode.
[0020] In one alternative approach, it also includes:
[0021] If the preset first control time is reached, the power consumption mode is determined to switch from the high power consumption mode to the low power consumption mode.
[0022] In one alternative embodiment, before switching the current clock signal to a high-frequency clock signal based on the second clock switching signal, the method further includes:
[0023] The second control completion signal has been received.
[0024] In one alternative embodiment, before switching the current clock signal to a high-frequency clock signal based on the second clock switching signal, the method further includes:
[0025] Determine the time to reach the preset second control time.
[0026] Secondly, a clock switching control device is provided, comprising:
[0027] The receiving module is used to receive power consumption mode signals, the power consumption mode signals including: high power consumption indicator signals or low power consumption indicator signals;
[0028] A determining module is configured to determine the type of the power consumption mode signal in response to the power consumption mode signal. The type of the power consumption mode signal includes: a first type and a second type, wherein the first type corresponds to the low power consumption indication signal and the second type corresponds to the high power consumption indication signal.
[0029] The switching module is used to switch the power consumption operating mode based on the type of the power consumption mode signal.
[0030] In one alternative approach, the module is switched, specifically for:
[0031] The clock gating unit is set to an disabled state based on the first high-frequency clock gating enable signal;
[0032] The current clock signal is switched to a low-frequency clock signal based on the first clock switching signal;
[0033] Based on the first high-frequency clock enable signal, the high-frequency clock source is set to be disabled, so as to switch the power consumption mode from high power consumption mode to low power consumption mode.
[0034] In one alternative approach, the module is switched, specifically for:
[0035] The high-frequency clock source is set to an enabled state based on the second high-frequency clock enable signal;
[0036] The current clock signal is switched to a high-frequency clock signal based on the second clock switching signal;
[0037] The clock gating unit is set to an enabled state based on the second high-frequency clock gating enable signal, so as to switch the power consumption operating mode from the low power consumption mode to the high power consumption mode.
[0038] In an alternative embodiment, the receiving module is further configured to, after the high-frequency clock source is set to be in an disabled state based on the first high-frequency clock enable signal, determine, if a first control completion signal is received, that the power consumption operating mode is switched from the high-power mode to the low-power mode.
[0039] In one alternative approach, the determining module is further configured to determine, if a preset first control time has elapsed, that the power consumption operating mode has switched from the high power consumption mode to the low power consumption mode.
[0040] In an alternative embodiment, the receiving module is also configured to receive a second control completion signal.
[0041] In one alternative approach, the determining module is also used to determine the arrival of a preset second control time.
[0042] Thirdly, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the clock switching control method as described in any of the above embodiments.
[0043] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, and when executed by a processor, the computer program implements the steps of the clock switching control method as described in any of the above embodiments.
[0044] The clock switching control method provided in this application embodiment can determine the high / low power switching indication through the received power mode signal, and switch the power operating mode based on the type of the power mode signal in response to the power mode signal. Thus, when switching between high and low power, there is no need to shut down the original clock, allowing functional modules that rely on the original clock to achieve effective high / low power switching while maintaining the original clock's operation. This reduces the power loss caused by shutting down the clock during high / low power switching, effectively saving system power consumption.
[0045] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description
[0046] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a flowchart illustrating a clock switching control method provided in this embodiment;
[0048] Figure 2 This is a schematic diagram of a clock switching control logic provided in this embodiment;
[0049] Figure 3 This is a schematic diagram of the structure of a clock switching control device provided in this embodiment;
[0050] Figure 4 This is a schematic diagram of the structure of an electronic device provided in this embodiment. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims and drawings of this application are intended to cover non-exclusive inclusion.
[0053] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of the phrase "embodiment" in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0054] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists, A and B exist simultaneously, or B exists. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0055] Furthermore, the terms "first," "second," etc., in the specification and claims of this application or in the aforementioned drawings are used to distinguish different objects rather than to describe a specific order, and may explicitly or implicitly include one or more of the features.
[0056] In the description of this application, unless otherwise stated, "multiple" means two or more (including two), and similarly, "multiple groups" means two or more (including two groups).
[0057] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0058] Figure 1 The present invention provides a flowchart of a clock switching control method, which may include the following components.
[0059] S110, Receive power consumption mode signal.
[0060] The power mode signal can be a power switching indication signal initiated by the chip based on its operational needs, instructing the running functional module to switch to the current power mode. The functional module can be a Direct Memory Access (DMA) unit / component; the following example uses a DMA unit to illustrate this concept.
[0061] The power consumption mode signal may include a high power consumption indicator signal or a low power consumption indicator signal.
[0062] For example, when the power mode signal is a high power indicator signal, it indicates that the DMA unit needs to switch from a low power mode to a high power mode. Conversely, when the power mode signal is a low power indicator signal, it indicates that the DMA unit needs to switch from a high power mode to a low power mode.
[0063] It should be noted that the chip generates a low-power indication signal only when the DMA unit is in high-power mode, instructing the DMA unit to enter low-power mode, i.e., switch from high-power mode to low-power mode. Conversely, the chip generates a high-power indication signal only when the DMA unit is in low-power mode, instructing the DMA unit to enter high-power mode, i.e. switch from low-power mode to high-power mode.
[0064] S120, in response to the power consumption mode signal, determine the type of the power consumption mode signal.
[0065] The power consumption mode signal can be of two types: a first type and a second type. The first type corresponds to a low power consumption indicator signal, and the second type corresponds to a high power consumption indicator signal.
[0066] When the power consumption mode signal is a low power consumption indication signal, the power consumption mode signal type can be the first type; when the power consumption mode signal is a high power consumption indication signal, the power consumption mode signal type can be the second type.
[0067] S130: Switch power consumption mode based on the type of power consumption mode signal.
[0068] The power consumption operating modes can include: high power consumption mode and low power consumption mode. High power consumption mode can be used to describe the DMA unit's high-frequency clock operating in high power consumption mode, and low power consumption mode can be used to describe the DMA unit's low-frequency clock operating in low power consumption mode. Alternatively, high power consumption mode can be used to describe the DMA unit's low-frequency clock operating in high power consumption mode, and low power consumption mode can be used to describe the DMA unit's high-frequency clock operating in low power consumption mode.
[0069] Based on the above examples, when the power mode signal type is the first type, switching the power mode can be from high power mode to low power mode; when the power mode signal type is the second type, switching the power mode can be from low power mode to high power mode.
[0070] It should be noted that when switching between high and low power consumption, there is no need to turn off the clock in the original power consumption mode. For example, if the circuit in the DMA unit that operates under a high-frequency clock is operating in a high-power mode, when switching from high-power mode to low-power mode, there is no need to turn off the circuit that originally operated under a high-frequency clock, so that the circuit in the DMA unit that operates under a high-frequency clock can continue to work in low power consumption.
[0071] In this embodiment, the high / low power switching indication can be determined by receiving the power mode signal, and the power mode switching can be implemented based on the type of the power mode signal in response to the power mode signal. Thus, when switching between high and low power, there is no need to shut down the original clock. This allows functional modules that rely on the original clock to achieve effective high / low power switching while maintaining the original clock's operation, thereby reducing power consumption caused by shutting down the clock during high / low power switching and effectively saving system power.
[0072] In some embodiments, when the power consumption mode signal is of type 1, switching the power consumption operating mode based on the type of the power consumption mode signal may include:
[0073] The clock gating unit is set to an disabled state based on the first high-frequency clock gating enable signal; the current clock signal is switched to a low-frequency clock signal based on the first clock switching signal; the high-frequency clock source is set to an disabled state based on the first high-frequency clock enable signal, so as to switch the power consumption mode from high power consumption mode to low power consumption mode.
[0074] The clock gating unit is used to describe high-frequency clock gating and can be used as a gate switch for a high-frequency clock source.
[0075] The first high-frequency clock gating enable signal can be used to describe the gating disable signal to control the clock gating unit to turn off. The first clock switching signal can be used to select a low-frequency clock source, that is, to control the current clock signal to be a low-frequency clock signal; the first clock signal can be a low-level signal. The first high-frequency clock enable signal can be used to describe the clock source disable signal to control the high-frequency clock source to turn off.
[0076] See Figure 2As shown, when the clock control module 210 receives the low-power signal, it sends a first high-frequency clock gating enable signal to the clock gating unit 220 to disable the high-frequency clock gating enable signal. At this time, the clock signal of the functional module 230 (such as the DMA unit) remains at a low level. The clock control module 210 sends a first clock switching signal to the comparator 240 to set the clock switching signal high. The functional module 230 selects the low-frequency clock source 250, and the clock control module 210 sends a first high-frequency clock enable signal to the high-frequency clock source 260 to disable the high-frequency clock enable signal. This achieves automatic switching from high-power mode to low-power mode.
[0077] The first clock switching signal changes only after the clock gating unit is turned off, thus avoiding glitch (electronic pulse) during the high-power mode switching process.
[0078] The following examples can be used to determine whether the power consumption mode has been successfully switched from high power mode to low power mode.
[0079] In some embodiments, after setting the high-frequency clock source to a disabled state based on the first high-frequency clock enable signal, if a first control completion signal is received, it is determined that the power consumption operating mode is switched from high power consumption mode to low power consumption mode.
[0080] The first control completion signal may be a low-level signal with a preset period, or a high-level signal with a preset period, or a continuous pulse signal with a preset period. This disclosure does not specifically limit the output form of the first control completion signal.
[0081] Thus, by receiving the first control completion signal from the high-frequency clock source, it can be effectively determined that the power consumption mode has successfully switched from high power consumption mode to low power consumption mode.
[0082] In other embodiments, if a preset first control time is reached, the power consumption mode is determined to switch from a high-power mode to a low-power mode. The first control time is the maximum cutoff time required for the high-frequency clock to shut down. Therefore, a control completion signal is not required; a timing method can effectively measure the successful switch from high-power mode to low-power mode.
[0083] Based on the above embodiments, the power consumption mode signal can also be of a second type.
[0084] In other embodiments, when the power consumption mode signal is of type two, switching the power consumption operating mode based on the type of the power consumption mode signal may include:
[0085] The high-frequency clock source is enabled based on the second high-frequency clock enable signal; the current clock signal is switched to a high-frequency clock signal based on the second clock switching signal; the clock gating unit is enabled based on the second high-frequency clock gating enable signal to switch the power consumption mode from low power mode to high power mode.
[0086] The second high-frequency clock enable signal can be used to describe the clock source enable signal to control the high-frequency clock source to be turned on. The second clock switching signal can be used to select the high-frequency clock source, that is, to control the current clock signal to be a high-frequency clock signal. The second clock signal can be a high-level signal. The second high-frequency clock gating enable signal can be used to describe the gating enable signal to control the clock gating unit to be turned on.
[0087] See Figure 2 As shown, when the clock control module 210 receives the high-power signal, it sends a second high-frequency clock enable signal to the high-frequency clock source 260 to enable the high-frequency clock signal. The clock control module 210 sends a second clock switching signal to the comparator 240 to set the clock switching signal low. At this time, the clock signal of the functional module 230 (such as the DMA unit) remains at a low level. The clock control module 210 sends a second high-frequency clock gating enable signal to the clock gating unit 220 to enable the high-frequency clock gating enable signal, thereby realizing the automatic switching from low-power mode to high-power mode.
[0088] The following examples can be used to determine whether the high-frequency clock source enable state has been successfully set based on the second high-frequency clock enable signal.
[0089] In some embodiments, before switching the current clock signal to a high-frequency clock signal based on the second clock switching signal, the method of this embodiment may further include: receiving a second control completion signal.
[0090] The second control completion signal may be a low-level signal with a preset period, or a high-level signal with a preset period, or a continuous pulse signal with a preset period. This disclosure does not specifically limit the output form of the second control completion signal.
[0091] Therefore, by receiving the second control completion signal from the high-frequency clock source, the successful setting of the high-frequency clock source enable state can be effectively determined.
[0092] It should be noted that the second control completion signal may have the same output form as the first control completion signal, or the second control completion signal may have a different output form than the first control completion signal; this disclosure does not impose any specific limitations.
[0093] In other embodiments, before switching the current clock signal to a high-frequency clock signal based on the second clock switching signal, the method of this embodiment may further include: determining when a preset second control time has been reached. The second control time is the maximum cutoff time required for the high-frequency clock to be turned on. Therefore, a control completion signal is not required, and a timing method can be used to effectively measure the successful setting of the high-frequency clock source enable state.
[0094] In addition, the power consumption mode signal can be issued through software commands or automatically controlled by the hardware based on predetermined signal levels.
[0095] For example, when the chip is working normally, it operates in a high-power mode and runs a specific software program. When the signal instruction to enter low-power mode is encountered, the system enters low-power mode. At this time, only one counter works in low-power mode. When the timer reaches the set time, it generates a timing overflow signal. Upon recognizing the timing overflow signal, the hardware switches to high-power mode, and the functional modules in high-power mode (such as the DMA unit) begin to work. After the DMA unit completes its work, it generates a completion flag signal. Upon recognizing the completion flag signal, the hardware automatically re-enters low-power mode, thus repeating the automatic switching between high and low-power modes. In this embodiment, by automatically switching the clock in hardware, the system's response time can be effectively improved, software and design complexity reduced, and power consumption decreased, further expanding the system's application scenarios.
[0096] Figure 3 This is a schematic diagram of a clock switching control device provided in this embodiment. The clock switching control device may include: a receiving module 310, a determining module 320, and a switching module 330.
[0097] The receiving module 310 is used to receive a power consumption mode signal, which includes a high power consumption indication signal or a low power consumption indication signal.
[0098] The determining module 320 is configured to determine the type of the power consumption mode signal in response to the power consumption mode signal. The type of the power consumption mode signal includes a first type and a second type, wherein the first type corresponds to the low power consumption indication signal and the second type corresponds to the high power consumption indication signal.
[0099] The switching module 330 is used to switch the power consumption operating mode based on the type of the power consumption mode signal.
[0100] In some embodiments, optionally, the switching module 330 is specifically used for:
[0101] The clock gating unit is set to a disabled state based on the first high-frequency clock gating enable signal; the current clock signal is switched to a low-frequency clock signal based on the first clock switching signal; the high-frequency clock source is set to a disabled state based on the first high-frequency clock enable signal, so as to switch the power consumption mode from high power consumption mode to low power consumption mode.
[0102] In some embodiments, optionally, the switching module 330 is specifically used for:
[0103] The high-frequency clock source is enabled based on the second high-frequency clock enable signal; the current clock signal is switched to a high-frequency clock signal based on the second clock switching signal; the clock gating unit is enabled based on the second high-frequency clock gating enable signal to switch the power consumption mode from the low-power mode to the high-power mode.
[0104] In some embodiments, optionally, the receiving module 310 is further configured to, after the high-frequency clock source is set to be in an disabled state based on the first high-frequency clock enable signal, determine that the power consumption operating mode is switched from the high-power mode to the low-power mode if a first control completion signal is received.
[0105] In some embodiments, optionally, the determining module 320 is further configured to determine that the power consumption operating mode is switched from the high power consumption mode to the low power consumption mode after a preset first control time has elapsed.
[0106] In some embodiments, optionally, the receiving module 310 is also configured to receive a second control completion signal.
[0107] In some embodiments, optionally, the determining module 320 is further configured to determine when a preset second control time has been reached.
[0108] The clock switching control device provided in this embodiment of the invention can determine the high-low power switching indication through the received power mode signal, and switch the power operating mode according to the type of the power mode signal in response to the power mode signal. Thus, when switching between high and low power, there is no need to shut down the original clock, allowing functional modules that rely on the original clock to achieve effective switching between high and low power while maintaining the original clock's operation. This reduces the power loss caused by shutting down the clock during high-low power switching, effectively saving system power consumption.
[0109] This application also provides an electronic device. Please refer to the following for details. Figure 4 , Figure 4 This is a basic structural block diagram of the electronic device in this embodiment.
[0110] The electronic device includes a memory 410 and a processor 420 that are interconnected via a system bus. It should be noted that only an electronic device with components 410-420 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components may be implemented alternatively. Those skilled in the art will understand that the electronic device described herein is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0111] Electronic devices can be computing devices such as desktop computers, laptops, PDAs, and cloud servers. Electronic devices can interact with users through methods such as keyboards, mice, remote controls, touchpads, or voice-activated devices.
[0112] The memory 410 includes at least one type of readable storage medium, which includes non-volatile memory or volatile memory, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. RAM may include static RAM or dynamic RAM. In some embodiments, the memory 410 may be an internal storage unit of an electronic device, such as the hard disk or RAM of the electronic device. In other embodiments, the memory 410 may also be an external storage device of the electronic device, such as a plug-in hard drive, SmartMediaCard (SMC), SecureDigital (SD) card, or FlashCard. Of course, the memory 410 may include both internal and external storage units of the electronic device. In this embodiment, the memory 410 is typically used to store the operating system and various application software installed on the electronic device, such as the program code of the methods described above. Furthermore, the memory 410 may also be used to temporarily store various types of data that have been output or will be output.
[0113] Processor 420 is typically used to perform the overall operation of an electronic device. In this embodiment, memory 410 is used to store program code or instructions, including computer operation instructions, and processor 420 is used to execute the program code or instructions stored in memory 410 or process data, such as program code that runs the methods described above.
[0114] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus system can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.
[0115] Another embodiment of this application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads computer-readable program code stored in the computer-readable medium, enabling the processor to execute the functional actions specified in each step or combination of steps in the above method; and to generate means for implementing the functional actions specified in each block or combination of blocks in the block diagram.
[0116] Computer-readable media include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any suitable combination thereof, wherein the memory is used to store program code or instructions, the program code including computer operation instructions, and the processor is used to execute the program code or instructions of the above-described methods stored in the memory.
[0117] The definitions of memory and processor can be found in the description of the foregoing electronic device embodiments, and will not be repeated here.
[0118] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0119] In the various embodiments of this application, the functional units or modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0120] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0121] In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" as described in this application does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims listing several means, several units of these means may be embodied by the same item of hardware. The use of "first," "second," and "third," etc., does not indicate any order and these words should be interpreted as names. Unless otherwise specified, the steps in the above embodiments should not be construed as limiting the order of execution.
[0122] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A clock switching control method, characterized in that, include: Receive a power consumption mode signal, the power consumption mode signal including: a high power consumption indicator signal or a low power consumption indicator signal; In response to the power consumption mode signal, the type of the power consumption mode signal is determined, and the type of the power consumption mode signal includes: a first type and a second type, wherein the first type corresponds to the low power consumption indication signal and the second type corresponds to the high power consumption indication signal; Based on the type of the power consumption mode signal, switch the power consumption operating mode; When the power consumption mode signal is of the first type, the step of switching the power consumption operating mode based on the type of the power consumption mode signal includes: The clock gating unit is set to an disabled state based on the first high-frequency clock gating enable signal; The current clock signal is switched to a low-frequency clock signal based on the first clock switching signal; Based on the first high-frequency clock enable signal, the high-frequency clock source is set to be in a disabled state so as to switch the power consumption operating mode from high power consumption mode to low power consumption mode. When the power consumption mode signal is of the second type, the step of switching the power consumption operating mode based on the type of the power consumption mode signal includes: The high-frequency clock source is set to an enabled state based on the second high-frequency clock enable signal; The current clock signal is switched to a high-frequency clock signal based on the second clock switching signal; The clock gating unit is set to the enabled state based on the second high-frequency clock gating enable signal, so as to switch the power consumption operating mode from the low power consumption mode to the high power consumption mode. In this way, when switching between high and low power consumption, there is no need to turn off the original clock, so that functional modules that rely on the original clock can achieve effective switching between high and low power consumption while keeping the original clock working. Also includes: After the high-frequency clock source is set to be in an disabled state based on the first high-frequency clock enable signal, if a first control completion signal is received, it is determined that the power consumption operating mode is switched from the high power consumption mode to the low power consumption mode; the first control completion signal is a low-level signal with a preset period, or a high-level signal with a preset period, or a continuous pulse signal with a preset period.
2. The method according to claim 1, characterized in that, Also includes: If the preset first control time is reached, the power consumption mode is determined to switch from the high power consumption mode to the low power consumption mode.
3. The method according to claim 1, characterized in that, Before switching the current clock signal to a high-frequency clock signal based on the second clock switching signal, the method further includes: The second control completion signal has been received.
4. The method according to claim 1, characterized in that, Before switching the current clock signal to a high-frequency clock signal based on the second clock switching signal, the method further includes: Determine the time to reach the preset second control time.
5. A clock switching control device, characterized in that, include: The receiving module is used to receive power consumption mode signals, the power consumption mode signals including: high power consumption indicator signals or low power consumption indicator signals; A determining module is configured to determine the type of the power consumption mode signal in response to the power consumption mode signal. The type of the power consumption mode signal includes: a first type and a second type, wherein the first type corresponds to the low power consumption indication signal and the second type corresponds to the high power consumption indication signal. The switching module is used to switch the power consumption operating mode based on the type of the power consumption mode signal; The switching module is specifically used for: when the power consumption mode signal is of the first type, setting the clock gating unit to a disabled state based on the first high-frequency clock gating enable signal; switching the current clock signal to a low-frequency clock signal based on the first clock switching signal; and setting the high-frequency clock source to a disabled state based on the first high-frequency clock enable signal, so as to switch the power consumption mode from high-power mode to low-power mode. The switching module is specifically configured to: when the power consumption mode signal is of the second type, set the high-frequency clock source to an enabled state based on the second high-frequency clock enable signal; switch the current clock signal to a high-frequency clock signal based on the second clock switching signal; and set the clock gating unit to an enabled state based on the second high-frequency clock gating enable signal, so as to switch the power consumption mode from the low-power mode to the high-power mode. In this way, when switching between high and low power consumption, it is not necessary to turn off the original clock, so that functional modules that rely on the original clock can achieve effective switching between high and low power consumption while maintaining the operation of the original clock. The receiving module is further configured to, after the high-frequency clock source is set to be in an disabled state based on the first high-frequency clock enable signal, determine that the power consumption operating mode is switched from the high-power mode to the low-power mode if a first control completion signal is received.
6. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the clock switching control method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the clock switching control method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Low-power design method for wireless sensor network core chip
CN103324268A
