Startup method and device and electronic equipment
By detecting low temperature or low voltage conditions during the BootLoader stage and adjusting the boot strategy accordingly, limiting CPU frequency and booting a portion of the kernel, the problem of electronic devices failing to boot on the first attempt is solved, improving boot success rate and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-10-21
- Publication Date
- 2026-04-21
AI Technical Summary
Electronic devices may fail to power on on the first attempt when exposed to low temperatures or low voltage, resulting in repeated restarts and negatively impacting the user experience.
During the BootLoader loading phase, the system detects low temperature or low voltage conditions and determines the boot strategy based on the current temperature and voltage. By limiting the CPU frequency and/or enabling some kernels, the boot voltage is reduced to ensure that the electronic device can boot up on the first attempt.
This effectively avoids the problem of electronic devices repeatedly restarting under low temperature or low voltage conditions, improves the success rate of power-on, and reduces power-on time and user inconvenience.
Smart Images

Figure CN121900601A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic equipment technology, and in particular to a power-on method, apparatus, and electronic equipment. Background Technology
[0002] As chip performance improves, so does power consumption. To meet these higher power demands, the current surges dramatically upon power-on, resulting in a large instantaneous current. This large instantaneous current causes the chip voltage to drop significantly. If the electronic device is in an extreme environment, such as a low-temperature environment, the increased impedance due to the low temperature further increases the required power-on voltage. This can lead to a situation where the actual voltage of the electronic device is insufficient to power on, potentially causing repeated restarts and preventing it from powering on successfully on the first attempt. Summary of the Invention
[0003] This application provides a power-on method, apparatus, and electronic device, aiming to solve the problem of electronic devices repeatedly restarting and failing to power on on the first attempt.
[0004] In a first aspect, embodiments of this application propose a boot method applied to an electronic device. The method includes: during the BootLoader loading stage, detecting whether the electronic device is in a low-temperature state and / or a low-voltage state, wherein the low-temperature state includes a state where the current temperature of the electronic device is less than a temperature threshold, and the low-voltage state includes a state where the current voltage of the electronic device is less than a voltage threshold; if the electronic device is in a low-temperature state and / or a low-voltage state, determining a boot strategy based on the current temperature and / or the current voltage, wherein the boot strategy indicates limiting the CPU frequency and / or starting a portion of the kernel; and during the kernel loading stage, executing a boot process based on the boot strategy.
[0005] In this embodiment, during the BootLoader loading stage, it is determined whether the electronic device is in a low-temperature environment and / or a low-voltage state. If the electronic device is in a low-temperature environment and / or a low-voltage state, a corresponding boot strategy is determined. Then, during the kernel loading stage, the electronic device is booted by limiting the CPU frequency and / or starting a portion of the kernel. This scheme determines the boot strategy before starting the kernel and then executes the boot strategy during the kernel loading stage, thereby reducing the voltage required for booting. This ensures that the current voltage of the electronic device can meet the voltage requirements for booting, helping the electronic device to boot up on the first attempt and avoiding repeated boots.
[0006] In one implementation of the first aspect, the method further includes: during the BootLoader loading phase, obtaining the configuration thresholds corresponding to the power supply components from the device tree file, the configuration thresholds including temperature thresholds and voltage thresholds.
[0007] In this embodiment, the configuration threshold corresponding to the power supply component is a parameter specifically configured for the power supply component in the device tree file after the supplier evaluates the power supply component based on its hardware and software characteristics. The configuration threshold is related to the actual capability of the power supply component and can more accurately reflect its actual capability. Therefore, when the electronic device determines whether it is in a low-voltage and / or low-temperature state based on the configuration threshold, the accuracy of the determined current state of the electronic device is higher. Based on this, it helps the electronic device determine the power-on strategy that best suits its current state, thereby enabling one-time power-on and avoiding repeated restarts.
[0008] In one implementation of the first aspect, when the current temperature is below a temperature threshold and the current voltage is below a voltage threshold, the power-on policy instructs to limit the CPU frequency and start a portion of the kernel.
[0009] In this embodiment of the application, when the electronic device is in a combination of low temperature and low voltage, it indicates that the current power-on state of the electronic device is relatively poor. Therefore, by limiting the CPU frequency and starting some cores, the voltage required for power-on is reduced, so that the current voltage of the electronic device can meet the voltage requirements for power-on, which helps the electronic device to be powered on in one go and avoids repeated startups.
[0010] In one implementation of the first aspect, determining the power-on strategy based on the current temperature includes: obtaining a first correspondence, the first correspondence including correspondences between multiple temperature difference ranges and multiple power-on strategies; and determining the power-on strategy based on the first correspondence and the absolute value of the difference between the current temperature and a temperature threshold.
[0011] In this embodiment, the correspondence reflects that different temperature difference ranges correspond to different power-on strategies. Determining the power-on strategy based on the actual temperature difference range can make the determined power-on strategy more suitable for the current low temperature state of the electronic device.
[0012] In one implementation of the first aspect, when the absolute value of the difference between the current temperature and the temperature threshold corresponds to a first temperature difference interval among multiple temperature difference intervals, the power-on policy instructs the CPU frequency to be limited to the first frequency interval; when the absolute value of the difference between the current temperature and the temperature threshold corresponds to a second temperature difference interval among multiple temperature difference intervals, the power-on policy instructs the CPU frequency to be limited to the second frequency interval, wherein the temperature difference indicated by the second temperature difference interval is greater than the temperature difference indicated by the first temperature difference interval, and the frequency indicated by the second frequency interval is less than the frequency indicated by the first frequency interval.
[0013] In this embodiment, different power-on strategies are selected based on the difference between the current temperature and a temperature threshold. When the actual temperature difference is within the first temperature difference range, the electronic device is only slightly underheated, so a lighter power-on strategy is adopted, limiting the CPU frequency to the first frequency range. However, when the actual temperature difference is within the second temperature difference range, the electronic device is underheated more severely. In this case, the lighter power-on strategy cannot meet the requirements. To achieve a one-time power-on, the CPU frequency is limited to the lower second frequency range. This progressive strategy selection helps increase the likelihood of a one-time power-on and effectively avoids repeated restarts of the electronic device.
[0014] In one implementation of the first aspect, determining the power-on strategy based on the current voltage includes: obtaining a second correspondence, the second correspondence including correspondences between multiple voltage difference intervals and multiple power-on strategies; and determining the power-on strategy based on the second correspondence and the absolute value of the difference between the current voltage and a voltage threshold.
[0015] In this embodiment of the application, the second correspondence indicates that different voltage difference ranges correspond to different power-on strategies. Determining the power-on strategy based on the voltage difference range where the actual voltage difference is located can make the determined power-on strategy more suitable for the current low voltage state of the electronic device.
[0016] In one implementation of the first aspect, when the absolute value of the difference between the current voltage and the voltage threshold corresponds to a first voltage difference interval among multiple voltage difference intervals, the power-on policy indicates limiting the CPU frequency; when the absolute value of the difference between the current voltage and the voltage threshold corresponds to a second voltage difference interval among multiple voltage difference intervals, the power-on policy indicates starting a portion of the kernel, wherein the voltage difference indicated by the second voltage difference interval is greater than the voltage difference indicated by the first voltage difference interval.
[0017] In this embodiment, when the actual voltage difference is within the first voltage difference range, the electronic device is in a relatively mild low-voltage state, so a lightweight power-on strategy can achieve one-time power-on. However, when the actual voltage difference is within the second voltage difference range, it indicates that the electronic device is in a more severe low-voltage state. In this case, the lightweight power-on strategy cannot meet the requirements, so a more advanced power-on strategy is adopted, namely, starting a portion of the kernel. This progressive strategy selection helps increase the likelihood of one-time power-on and effectively avoids repeated restarts of the electronic device.
[0018] In one implementation of the first aspect, the method further includes: during the kernel loading stage, monitoring the current remaining power, and when the current remaining power reaches a preset safety threshold, increasing the CPU frequency and / or starting the remaining kernel, which is a kernel in the electronic device that has not been started.
[0019] In one implementation of the first aspect, the method further includes: after successful power-on, increasing the CPU frequency and / or starting the remaining kernels, which are kernels in the electronic device that have not been started.
[0020] In this embodiment, after successful power-on, or at an appropriate time during the power-on process, the electronic device can cancel the previous strategy of reducing the voltage required for power-on, for example, by increasing the CPU frequency or starting the remaining kernels. This allows the electronic device to return to its normal power-on state.
[0021] Secondly, a boot device is provided for use in an electronic device. The device includes: a first loading module, used to detect whether the electronic device is in a low-temperature state and / or a low-voltage state during the BootLoader loading stage; the low-temperature state includes a state where the current temperature of the electronic device is less than a temperature threshold, and the low-voltage state includes a state where the current voltage of the electronic device is less than a voltage threshold; if the electronic device is in a low-temperature state and / or a low-voltage state, a boot strategy is determined based on the current temperature and / or the current voltage, and the boot strategy indicates limiting the CPU frequency and / or starting a portion of the kernel; and a second loading module, used to execute a boot process based on the boot strategy during the kernel loading stage.
[0022] Thirdly, an electronic device is provided, including a memory and a processor, the memory for storing a computer program and the processor for invoking the computer program to perform a power-on method as described in any one of the first aspects above.
[0023] Fourthly, a computer-readable storage medium is provided, wherein a computer program or instructions are stored therein, and when the computer program or instructions are executed, the power-on method as described in any one of the first aspects above is implemented.
[0024] Fifthly, a computer program product is provided, comprising a computer program that, when run, causes a computer to perform the power-on method as described in any one of the first aspects above. Attached Figure Description
[0025] Figure 1 A schematic diagram of the electronic device is shown.
[0026] Figure 2 A software structure block diagram of an electronic device provided in an embodiment of this application is shown.
[0027] Figure 3 A flowchart of a power-on method provided in an embodiment of this application is shown.
[0028] Figure 4 A logical schematic diagram of a power-on method provided in an embodiment of this application is shown.
[0029] Figure 5 This is a structural block diagram of a power-on device provided in an embodiment of this application. Detailed Implementation
[0030] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0031] As chip performance improves, so does power consumption. To meet these high power demands, the current surges dramatically upon power-on, resulting in a large instantaneous current and consequently, very low voltage. If the electronic device happens to be in an edge-of-the-edge scenario, it may require repeated restarts and fail to power on on the first attempt. Edge-of-the-edge scenarios include low-power and low-temperature environments.
[0032] For example, when an electronic device is in a low-battery state, its battery voltage is already low. When the device is turned on, the current increases instantaneously, causing the battery voltage to drop further. This can easily lead to the battery voltage falling below the voltage threshold required for startup, potentially causing the device to fail to boot. The electronic device may then need to be repeatedly restarted until it successfully boots up.
[0033] For example, in low-temperature environments, electronic devices have higher battery impedance and require a higher startup voltage. However, when the device is turned on, the current increases instantaneously, causing the battery voltage to drop. This can lead to a situation where the battery voltage drops below the required startup voltage, potentially causing startup failure. The electronic device may then need to be repeatedly restarted until it successfully powers on.
[0034] When an electronic device repeatedly restarts when it is turned on, it can lead to long boot times and be easily misjudged as a malfunction, causing inconvenience to the user.
[0035] To address this issue, this application proposes a boot method in which, during the BootLoader loading phase, the electronic device detects whether it is in a low-temperature state and / or a low-voltage state. If the electronic device is in a low-temperature state and / or a low-voltage state, a boot strategy is determined based on the current temperature and / or current voltage. The boot strategy instructs limiting the CPU frequency and / or starting a portion of the kernel. During the kernel loading phase, the boot process is executed based on the boot strategy. The low-temperature state includes a state where the current temperature of the electronic device is below a temperature threshold, and the low-voltage state includes a state where the current voltage of the electronic device is below a voltage threshold.
[0036] This method selects a strategy during the preloading phase before the kernel starts when the electronic device is in a low-temperature state, a low-voltage state, or a combination of both. It then reduces the voltage required for booting by limiting the CPU frequency and starting only a portion of the kernel, thereby improving the ability to boot on the first attempt and helping to avoid repeated boots.
[0037] In the embodiments of this application, the electronic device can be a mobile phone, tablet computer, personal computer (PC), smart screen, artificial intelligence (AI) speaker, headphones, in-vehicle system device, and wearable terminal device such as a smartwatch. It can also be various teaching aids (e.g., learning machines, early education machines), smart toys, portable robots, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, etc., or devices with mobile office functions, smart home functions, audio-visual entertainment functions, or supporting smart travel. It should be understood that the embodiments of this application do not limit the specific technology or device form used in the electronic device.
[0038] To better understand the embodiments of this application, the hardware structure of the electronic device of the embodiments of this application will be described below.
[0039] Figure 1 A schematic diagram of the structure of the electronic device 100 is shown.
[0040] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0041] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0042] For example, when the electronic device 100 is a mobile phone or a tablet computer, it may include all the components shown in the figure, or it may include only some of the components shown in the figure.
[0043] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0044] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0045] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0046] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0047] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0048] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the terminal device via the power management module 141.
[0049] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0050] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0051] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0052] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G / 6G, for use on electronic devices 100.
[0053] A modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
[0054] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0055] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0056] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0057] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0058] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0059] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0060] Camera 193 is used to capture still images or videos. In some embodiments, electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0061] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0062] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0063] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.
[0064] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0065] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0066] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.
[0067] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.
[0068] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.
[0069] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.
[0070] The pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals.
[0071] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.
[0072] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.
[0073] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.
[0074] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of terminal devices, and can be applied to applications such as landscape / portrait switching and pedometers.
[0075] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.
[0076] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.
[0077] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0078] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.
[0079] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.
[0080] In this embodiment, the temperature sensor 180J may include multiple sensors for detecting the temperature at different locations of the electronic device 100. For example, it may be placed near the processor to obtain the processor temperature, placed near the battery to obtain the battery temperature, or placed inside the casing of the electronic device 100 to obtain the casing temperature of the electronic device 100.
[0081] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0082] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0083] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0084] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0085] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0086] For the scenarios in the above examples, the operating system of electronic device 100 may include, but is not limited to, operating systems such as Symbian, Android, Windows, Apple (MacOS, iOS), Blackberry, HarmonyOS, Linux, or Unix.
[0087] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0088] Figure 2 A software structure block diagram of an electronic device 100 provided in an embodiment of this application is shown.
[0089] As an example, when the power-on method provided in this application is run on electronic device 100, the operating system of electronic device 100 can be Android, and its system architecture can be referred to Figure 2 As shown.
[0090] In this layered architecture, the software is divided into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0091] The application layer can include a series of application packages. For example... Figure 2As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0092] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 2 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0093] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0094] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0095] A view system includes visual controls, such as controls for displaying characters and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon could include a view for displaying characters and a view for displaying images.
[0096] A phone manager is used to provide communication functions for terminal devices. For example, it manages call status (including connection and disconnection).
[0097] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0098] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating the device, and flashing indicator lights.
[0099] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0100] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0101] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0102] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0103] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0104] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0105] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0106] A 2D graphics engine is a graphics engine for 2D drawing.
[0107] The kernel layer is the layer between hardware and software. It drives the hardware, enabling it to function. The kernel layer includes at least a kernel driver, display driver, screen driver, graphics processing unit (GPU) driver, camera driver, and sensor driver. In this embodiment, the kernel driver (kernel modem) includes a first virtual module and a second virtual module. The first virtual module limits the CPU frequency, and the second virtual module controls the kernel startup. In this embodiment, during the kernel loading stage, the corresponding boot policy is executed by driving the kernel modem; the specific implementation process is described below.
[0108] The following are definitions of technical terms that may appear in the embodiments of this application. The terminology used in the implementation section of this application is only used to explain specific embodiments of this application and is not intended to limit this application.
[0109] 1. Device Tree
[0110] A device tree file is a data structure file that stores information primarily related to various hardware attributes and configuration data. This information allows the operating system to identify and configure hardware devices. Common information in the device tree includes power management information such as sleep mode and power consumption management, which helps the operating system control power. The operating system of an electronic device can read the device tree at startup and set and configure appropriate hardware devices based on the information described within.
[0111] The device tree is typically written in text format (Device Tree Source, DTS) and compiled into binary format (Device Tree Blob, DTB) for kernel use.
[0112] The main features of a device tree include: it supports dynamic configuration of devices at runtime, enabling flexible adaptation to different hardware configurations. Furthermore, the device tree describes devices and their attributes, such as CPU, memory, and peripherals, in a hierarchical structure, allowing the operating system to identify and configure different hardware without modifying the kernel code.
[0113] 2. ABL (Android boot loader)
[0114] The BootLoader is the first-stage bootloader for an Android device. Its main functions include initializing the hardware, setting up memory, loading and verifying the Android Boot Image (boot.img), and passing control to boot.img to continue the next stage of booting.
[0115] ABL is provided by the device manufacturer and needs to be adapted to specific hardware platforms. It uses a proprietary binary format instead of the standard ELF format. ABL is designed to allow users to choose between staying in fastboot, using the system kernel and a ramdisk in the system directory to boot into the Android system, or using the recovery ramdisk to boot into Recovery, depending on the button combination.
[0116] The code organization and general startup process of ABL on the Qualcomm platform are based on EDK II, and the overall project structure is a standard EDK II source code tree.
[0117] 3. Kernel
[0118] The kernel is the core component of the operating system, responsible for controlling system hardware and software resources. It manages system resources such as CPU, memory, disk, and input / output devices. It also provides a system call interface, allowing user programs to interact with the hardware.
[0119] Loading the kernel refers to the process of loading the operating system kernel from a storage device (such as a hard drive or solid-state drive) into memory. The operating system kernel is the core part of the operating system, responsible for managing system resources, handling the interaction between hardware and software, and providing system services.
[0120] 4. Power-on process of electronic devices
[0121] The power-on process of electronic devices typically includes the following key steps:
[0122] 4.1 Power on the device and press the power button. The power circuit of the electronic device will start and the device will begin self-testing.
[0123] 4.2 Hardware self-test: The basic input / output system (BIOS / UEFI) of the electronic device performs a hardware self-test to confirm that the CPU, memory, storage, display and other hardware are normal.
[0124] 4.3 Loading the BootLoader: After the hardware self-test is completed, the system will start loading the bootloader, which initializes the hardware and loads the operating system.
[0125] 4.4 Loading the kernel: The process of loading the operating system kernel includes: locating the operating system kernel (such as Android or iOS) through the bootloader, loading it from storage into memory, and decompressing it (if necessary). Kernel initialization includes setting up the Memory Management Unit (MMU), initializing drivers, recognizing hardware devices, starting system services and processes, and initiating the boot process.
[0126] 4.5. Start user space. After the kernel is loaded, start the first user space process (such as Zygote for Android or launchd for iOS) and start running system services and applications.
[0127] 4.6 User Interface Display: After the system completes initialization, the user interface is loaded, displaying the lock screen or home screen, allowing the user to begin operation.
[0128] 4.7. Power on complete. At this point, all system services and applications on the phone have been started, and the user can use the device freely.
[0129] The following describes in detail the electronic device startup method provided in the embodiments of this application with reference to the accompanying drawings.
[0130] Please refer to Figure 3 , Figure 3A flowchart of a power-on method according to an embodiment of this application is shown. This method is applied to an electronic device, and each step of the method is described in detail below.
[0131] Step 301: During the BootLoader loading stage, detect whether the electronic device is in a low temperature state and / or a low voltage state.
[0132] Low temperature state refers to the state where the current temperature of the electronic device is lower than the temperature threshold, and low voltage state refers to the state where the current voltage of the electronic device is lower than the voltage threshold.
[0133] When an electronic device is powered on, after a hardware self-test, it loads the first-stage bootloader. In this embodiment, during the bootloader loading stage, the electronic device detects its current state and determines the power-on strategy based on the current state.
[0134] The current state of an electronic device includes its voltage state and temperature state. The voltage state can be represented by the device's electrical charge level.
[0135] In this embodiment, the electronic device can obtain its current temperature via a temperature sensor and its current voltage via a voltage sensor. Alternatively, the electronic device can obtain its current battery level via a fuel gauge and determine its current voltage based on the current battery level.
[0136] Furthermore, in this embodiment of the application, the electronic device can obtain the temperature threshold and voltage threshold during the BootLoader loading stage.
[0137] In one implementation, the temperature threshold and voltage threshold can be pre-set in the software code.
[0138] In another implementation, the electronic device already possesses the ability to parse device tree files during the BootLoader loading phase. The device tree file contains various parameters corresponding to different hardware devices. In this embodiment, the electronic device can parse the device tree file and obtain the parameters of the power supply components, where the power supply component parameters include configuration thresholds.
[0139] The configuration thresholds include temperature thresholds and voltage thresholds. The purpose of these configuration thresholds is to help electronic devices determine whether they are currently in a low-voltage state and / or a low-temperature state.
[0140] In this embodiment, the configuration threshold corresponding to the power supply component is a parameter specifically configured for the power supply component in the device tree file after the supplier evaluates the power supply component based on its hardware and software characteristics. The configuration threshold is related to the actual capability of the power supply component and can more accurately reflect its actual capability. Therefore, when the electronic device determines whether it is in a low-voltage and / or low-temperature state based on the configuration threshold, the accuracy of the determined current state of the electronic device is higher. Based on this, it helps the electronic device determine the power-on strategy that best suits its current state, thereby enabling one-time power-on and avoiding repeated restarts.
[0141] For example, if an electronic device is equipped with a power supply component A, then the configuration threshold is specifically configured based on the hardware and software characteristics of the power supply component A, and is used to determine whether the electronic device equipped with the power supply component A is in a low temperature state and / or a low voltage state.
[0142] If an electronic device is equipped with a power supply component B, then the configuration threshold is specifically configured based on the hardware and software characteristics of the power supply component B, and is used to determine whether the electronic device equipped with the power supply component B is in a low temperature state and / or a low voltage state.
[0143] The configuration thresholds for power component A and power component B may differ.
[0144] In this embodiment, the electronic device can compare the current temperature with a temperature threshold. If the current temperature is lower than the temperature threshold, the electronic device is determined to be in a low-temperature state. Otherwise, the electronic device is not in a low-temperature state.
[0145] In this embodiment, the electronic device can compare the current voltage with a voltage threshold. If the current voltage is less than the voltage threshold, the electronic device is determined to be in a low-voltage state. Otherwise, the electronic device is not in a low-voltage state.
[0146] If the current temperature is below the temperature threshold and the current voltage is below the voltage threshold, then the electronic device is determined to be in a low temperature and low voltage state.
[0147] Step 302: If the electronic device is in a low temperature state and / or a low voltage state, then determine the power-on strategy based on the current temperature and / or the current voltage.
[0148] The boot policy specifies limiting the CPU frequency and / or booting a portion of the kernel.
[0149] In this application embodiment, the process of determining the power-on strategy differs depending on the state of the electronic device.
[0150] For example, in the first case: the electronic device is in a low-temperature state, the power-on strategy is determined based on the current temperature. In the second case: the electronic device is in a low-voltage state, the power-on strategy is determined based on the current voltage. In the third case: the electronic device is in both a low-temperature and low-voltage state, the power-on strategy is determined based on both the current temperature and the current voltage.
[0151] The three situations described above will be explained below:
[0152] In the first scenario, when electronic devices are operating at low temperatures, the process of determining the power-on strategy based on the current temperature can be implemented in several ways:
[0153] 1. The electronic device obtains the correspondence between low-temperature state and boot strategy. This correspondence could be, for example: low-temperature state – limiting CPU frequency; or, low-temperature state – booting part of the kernel; or, low-temperature state – limiting CPU frequency and booting part of the kernel. Then, the electronic device can determine the boot strategy based on this correspondence.
[0154] Taking the relationship "low temperature state - limit CPU frequency" as an example, when an electronic device is in a low temperature state, the power-on strategy determined by the current temperature is to limit the CPU frequency.
[0155] 2. The electronic device obtains the first correspondence, which includes the correspondence between multiple temperature difference ranges and multiple power-on strategies. Then, the electronic device can determine the power-on strategy based on the first correspondence, the current temperature, and the temperature threshold.
[0156] The electronic device can first calculate the difference between the current temperature and the temperature threshold to obtain the absolute value of the difference, which is the actual temperature difference. Then, it determines the power-on strategy based on the first correspondence and the actual temperature.
[0157] In one implementation, for example, there are three temperature difference ranges: temperature difference range 1, temperature difference range 2, and temperature difference range 3. The first correspondence can be represented as: temperature difference range 1 – boot strategy 1, temperature difference range 2 – boot strategy 2, and temperature difference range 3 – boot strategy 3. The temperature differences indicated by these three ranges increase sequentially, and correspondingly, it can be understood that the degree of voltage control by boot strategy 1 through boot strategy 3 increases sequentially. For example, boot strategy 1 could limit the CPU frequency, boot strategy 2 could boot a portion of the kernel, and boot strategy 3 could limit both the CPU frequency and boot a portion of the kernel.
[0158] It should be noted that the above boot strategies 1-3 are merely illustrative examples and do not constitute a limitation on the implementation method of this solution. Boot strategies 1-3 can also be implemented in other ways.
[0159] Then, the electronic device can determine the power-on strategy corresponding to the temperature range corresponding to the actual temperature difference based on the actual temperature difference and the first correspondence, that is, the electronic device determines the power-on strategy.
[0160] In this embodiment, different temperature difference ranges correspond to different power-on strategies. Determining the power-on strategy based on the actual temperature difference range can make the determined power-on strategy more suitable for the current low temperature state of the electronic device.
[0161] In another implementation, when the absolute value of the difference between the current temperature and the temperature threshold corresponds to the first temperature difference interval among multiple temperature difference intervals, the power-on policy instructs the CPU frequency to be limited to the first frequency interval; when the absolute value of the difference between the current temperature and the temperature threshold corresponds to the second temperature difference interval among multiple temperature difference intervals, the power-on policy instructs the CPU frequency to be limited to the second frequency interval, wherein the temperature difference indicated by the second temperature difference interval is greater than the temperature difference indicated by the first temperature difference interval, and the frequency indicated by the second frequency interval is less than the frequency indicated by the first frequency interval.
[0162] In this embodiment, when the actual temperature difference is within the first temperature difference range, the electronic device is only slightly underheated, so a lighter power-on strategy is adopted, limiting the CPU frequency to the first frequency range. However, when the actual temperature difference is within the second temperature difference range, the electronic device is underheated more severely. In this case, the lighter power-on strategy cannot meet the requirements. To achieve a one-time power-on, the CPU frequency is limited to the lower second frequency range. This progressive strategy selection helps increase the likelihood of a one-time power-on and effectively avoids repeated restarts of the electronic device.
[0163] In the second scenario, when an electronic device is in a low-voltage state, the process of determining the power-on strategy based on the current voltage can be implemented in the following ways:
[0164] 1. The electronic device obtains the correspondence between low voltage states and power-on strategies. This correspondence could be, for example: low voltage state – limiting CPU frequency; or, low voltage state – booting some kernels; or, low voltage state – limiting CPU frequency and booting some kernels. The electronic device can then determine its power-on strategy based on this correspondence.
[0165] Taking the relationship "low voltage state - booting part of the kernel" as an example, when the electronic device is in a low voltage state, the boot strategy determined by the current temperature is to boot part of the kernel.
[0166] 2. The electronic device acquires a second correspondence, which includes the correspondence between multiple voltage difference intervals and multiple power-on strategies. The electronic device can then determine the power-on strategy based on the second correspondence, the current voltage, and the voltage threshold.
[0167] The electronic device can first calculate the difference between the current voltage and the voltage threshold to obtain the absolute value of the difference, which is the actual voltage difference. Then, it determines the power-on strategy based on the second correspondence and the actual voltage difference.
[0168] In one implementation, for example, there are three voltage difference intervals: voltage difference interval 1, voltage difference interval 2, and voltage difference interval 3. The first correspondence can be represented as: voltage difference interval 1 – boot strategy 1, voltage difference interval 2 – boot strategy 2, and voltage difference interval 3 – boot strategy 3. The voltage differences indicated by these three intervals increase sequentially, and correspondingly, the degree of voltage control exerted by boot strategies 1 through 3 can be understood to increase sequentially. For example, boot strategy 1 could limit the CPU frequency, boot strategy 2 could boot a portion of the kernel, and boot strategy 3 could limit both the CPU frequency and boot a portion of the kernel.
[0169] It should be noted that the above boot strategies 1-3 are merely illustrative examples and do not constitute a limitation on the implementation method of this solution. Boot strategies 1-3 can also be implemented in other ways.
[0170] Then, the electronic device can determine the power-on strategy corresponding to the voltage difference range corresponding to the actual voltage difference based on the actual voltage difference and the second correspondence, that is, the electronic device determines the power-on strategy.
[0171] In this embodiment, different voltage difference ranges correspond to different power-on strategies. Determining the power-on strategy based on the voltage difference range in which the actual voltage difference is located can make the determined power-on strategy more suitable for the current low voltage state of the electronic device.
[0172] In another implementation, when the absolute value of the difference between the current voltage and the voltage threshold corresponds to the first voltage difference interval among multiple voltage difference intervals, the power-on policy indicates limiting the CPU frequency; when the absolute value of the difference between the current voltage and the voltage threshold corresponds to the second voltage difference interval among multiple voltage difference intervals, the power-on policy indicates starting a portion of the kernel, wherein the voltage difference indicated by the second voltage difference interval is greater than the voltage difference indicated by the first voltage difference interval.
[0173] In this embodiment, when the actual voltage difference is within the first voltage difference range, the electronic device is in a relatively mild low-voltage state, so a lightweight power-on strategy can achieve one-time power-on. However, when the actual voltage difference is within the second voltage difference range, it indicates that the electronic device is in a more severe low-voltage state. In this case, the lightweight power-on strategy cannot meet the requirements, so a more advanced power-on strategy is adopted, namely, starting a portion of the kernel. This progressive strategy selection helps increase the likelihood of one-time power-on and effectively avoids repeated restarts of the electronic device.
[0174] In the third scenario, the process of determining a power-on strategy for an electronic device under low temperature and low voltage conditions includes the following: When the current temperature of the electronic device is below a temperature threshold and the current voltage is below a voltage threshold, the electronic device is in a low temperature and low voltage state. This indicates that the environment in which the electronic device is currently located is very harsh. The power-on strategy determined by the electronic device restricts the CPU frequency and the startup of some cores. By directly limiting the frequency and removing cores, a double reduction is achieved to lower the voltage required for the power-on process, thereby ensuring that the current voltage of the electronic device meets the power-on requirements and achieves the goal of powering on in one go.
[0175] Step 303: During the kernel loading stage, the boot process is executed based on the boot policy.
[0176] In this embodiment of the application, during the kernel loading stage, the electronic device can execute the boot process according to the determined boot strategy.
[0177] For example, when the boot policy instructs to limit the CPU frequency, the electronic device reduces the CPU frequency during the kernel loading stage in order to reduce the voltage required for booting. This allows the current voltage of the electronic device to meet the voltage requirements for booting, enabling the electronic device to boot up in one go and avoiding repeated boots.
[0178] For example, when the boot policy instructs that some kernels be started—meaning that during the kernel loading phase, the electronic device can start some kernels while others are not—for instance, high-power kernels or kernels with special functions might be temporarily not started. By reducing the number of kernels started, the required boot voltage is lowered, ensuring that the current voltage of the electronic device meets the boot requirements. This helps the electronic device boot up on the first attempt, avoiding repeated boots.
[0179] For example, when the boot policy instructs to limit the CPU frequency and the number of kernels to be booted, that is, during the kernel loading stage, the electronic device must reduce both the CPU frequency and the number of kernels to be booted. This dual approach reduces the voltage required for booting, so that the current voltage of the electronic device can meet the voltage requirements for booting, which helps the electronic device to boot up in one go and avoids repeated boots.
[0180] The power-on method provided in this application identifies the current state of the electronic device by its current temperature and / or current voltage, and then flexibly selects a power-on strategy based on the current state, so that the electronic device can be powered on in one go in low voltage or low temperature scenarios, and is less likely to be repeatedly started up multiple times.
[0181] Based on the above embodiments, in this embodiment of the application, the electronic device will continuously monitor the remaining power during the kernel loading stage.
[0182] For example, when an electronic device is charging, although it is initially powered on at a low voltage, its remaining power increases as it continues to charge. During this process, the electronic device loads its kernel while simultaneously monitoring the remaining power and determining whether it has reached a preset safety threshold. This preset safety threshold refers to the power level required to ensure the electronic device powers on normally. When the remaining power reaches the preset safety threshold, the electronic device no longer needs to use the aforementioned power-on strategy to limit the voltage required for power-on. Based on this, the electronic device can increase the CPU frequency and / or start the remaining kernels, which are the kernels in the electronic device that have not yet been started.
[0183] Furthermore, once the electronic device has successfully booted up, it no longer needs to employ the aforementioned boot strategy to limit the voltage required for booting. In this case, the electronic device can increase the CPU frequency and / or start the remaining cores.
[0184] For example, if an electronic device's power-on policy specifies a limit on the CPU frequency, then the electronic device will increase the CPU frequency when the remaining battery power reaches a preset safety threshold.
[0185] For example, if the power-on policy determined by the electronic device instructs the startup of some kernels, then when the remaining power reaches a preset safety threshold, the electronic device will start the remaining kernels to complete the startup of all kernels.
[0186] For example, if the power-on policy determined by the electronic device indicates that the CPU frequency and some kernels should be limited, then when the remaining power reaches a preset safety threshold, the electronic device will increase the CPU frequency and start the remaining kernels.
[0187] Based on the above embodiments, this application will further illustrate the solution in conjunction with application scenarios.
[0188] Please refer to Figure 4 , Figure 4 The diagram illustrates a logical schematic of a power-on method provided in an embodiment of this application, as shown below. Figure 4 As shown, during the BootLoader loading phase, the configuration thresholds for the power supply components (chargers) are obtained from the device tree file using ParseDts and saved. These configuration thresholds include voltage and temperature thresholds. ParseDts is a function or library used to process and parse Data Time Stamps (DTS). In the device tree, the configuration thresholds can be represented, for example, as follows:
[0189] / {
[0190] AAA: AAA{
[0191] bootup_voltage_threshold = <xxxx>;
[0192] bootup_tempature_threshold= <xx>;
[0193] };
[0194] };
[0195] Then, the electronic device runs the update command line (updateCmdline) file. The updateCmdline file contains the command-line arguments used when loading the BootLoader, and these arguments can affect the behavior of the bootloader. During the execution of updateCmdline, the electronic device can obtain its current voltage and temperature via a software interface, as well as the configuration thresholds saved above. Then, it runs the bootup condition module, comparing the current voltage with the voltage threshold in the configuration, and comparing the current temperature with the temperature threshold in the configuration, to determine whether the electronic device is currently in a low-temperature state and / or a low-voltage state.
[0196] If the current voltage is less than the voltage threshold, the electronic device is determined to be in a low-voltage state.
[0197] If the current temperature is below the temperature threshold, the electronic device is determined to be in a low-temperature state.
[0198] If the current voltage is less than the voltage threshold and the current temperature is less than the temperature threshold, then the electronic device is determined to be in a low temperature and low voltage state.
[0199] In this embodiment, the electronic device can flexibly select different power-on strategies depending on its state. The process for selecting the power-on strategy is described above and will not be repeated here. In this embodiment, the bootup condition module can determine the power-on strategy based on the current state of the electronic device.
[0200] For example, if an electronic device is currently in a low temperature and low voltage state, the power-on strategy determined by the electronic device will instruct to reduce the CPU frequency and start some kernels.
[0201] In this embodiment of the application, a number of different boot policies are pre-set with corresponding policy flags. After the bootup condition module determines the boot policy, it will obtain the policy flag corresponding to the selected boot policy and transmit the policy flag to the kernel through the kernel cmdline.
[0202] During the BootLoader loading phase, the electronic device generates a kernel cmdline. In the Android system, the / proc / cmdline file contains the command-line parameters for kernel startup. These parameters can affect kernel behavior, such as setting the boot mode or specifying specific hardware options. In this embodiment, the policy flag corresponding to the selected boot policy is appended to the kernel cmdline file as a parameter.
[0203] like Figure 4 As shown, during the kernel loading stage, the kernel parses the kernel cmdline, obtains the policy flags from the kernel cmdline file, and executes the corresponding boot policy based on the policy flags.
[0204] In this embodiment, the kernel includes virtual modules that can perform frequency limiting of the CPU and / or perform functions for booting a portion of the kernel during the kernel loading stage.
[0205] For example, the kernel includes a first virtual module, which, after obtaining the kernel cmdline, can parse the kernel cmdline to obtain the policy flag.
[0206] When the power-on policy corresponding to the policy flag is to limit the CPU frequency, the first virtual module reads the device tree or ACPI (Advanced Configuration and Power Interface) information to obtain the hardware characteristics and power management information of the subsystem. The power management information includes battery level information. Here, "subsystem" refers to the power management subsystem or a subsystem involved in power management, such as the ADSP subsystem. The following explanation uses the ADSP subsystem as an example. When the ADSP subsystem powers on, it returns battery level information to the first virtual module. If the ADSP subsystem is not powered on, it returns empty or zero.
[0207] like Figure 4 As shown, the first virtual module can send a power acquisition request to the ADSP subsystem, and the ADSP subsystem can send power information to the first virtual module. When the ADSP subsystem is not powered on, the power information will be empty or zero. This indicates that the first virtual module has failed to acquire power. Therefore, as... Figure 4 As shown, the first virtual module limits the CPU frequency according to the boot policy corresponding to the policy flag bit passed by the bootloader through the kernel cmdline.
[0208] For example, the boot policy instruction corresponding to policy flag 001 limits the CPU frequency to a first frequency range; the boot policy instruction corresponding to policy flag 010 limits the CPU frequency to a second frequency range. Wherein, the policy flag in kernelcmdline is 010, so the first virtual module can limit the CPU frequency to the second frequency range according to policy flag 010.
[0209] In this embodiment, when the ADSP subsystem is powered on, the first virtual module can obtain power information from the ADSP subsystem and redetermine the boot strategy based on the obtained power information. The process of redetermining the boot strategy includes: determining whether the obtained power information reaches a preset safety threshold; if not, the first virtual module executes the boot process based on the boot strategy passed from the BootLoader. If the preset safety threshold is reached, the first virtual module ignores the boot strategy passed from the BootLoader and does not need to limit the CPU frequency.
[0210] In this embodiment, while limiting the CPU frequency, the first virtual module continuously acquires the power information of the ADSP subsystem and determines whether the acquired power information reaches a preset safety threshold. If the power information of the ADSP subsystem reaches the preset safety threshold, the first virtual module can stop frequency limiting and increase the CPU frequency. If the preset safety threshold is not reached, the first virtual module can continue to execute the frequency limiting strategy (i.e., the power-on strategy).
[0211] Additionally, if the CPU is still in a frequency-limited state after the electronic device is successfully powered on, the first virtual module can increase the CPU frequency.
[0212] For example, such as Figure 4 As shown by the dashed line, during the boot process, the electronic device monitors its boot status in real time. When the electronic device detects "sys.boot_completed = 1", it indicates a successful boot. Upon successful boot, the electronic device can drive the first virtual module to stop frequency limiting and increase the CPU frequency. The first virtual module increases the CPU frequency when it determines that the CPU is currently in a frequency-limited state.
[0213] In this embodiment of the application, the kernel also includes a second virtual module. When the boot policy corresponding to the policy flag is to boot some kernels, the second virtual module will determine some kernels from multiple kernels to boot, while the remaining kernels will not be booted for the time being.
[0214] It should be noted that, in this embodiment, during the process of starting a portion of the kernel, the second virtual module monitors the ADSP subsystem in real time, obtains the ADSP subsystem's power information, and determines whether the obtained power information reaches a preset safety threshold. If the power is not successfully obtained, or the obtained power information does not reach the preset safety threshold, the second virtual module continues to maintain the state of starting a portion of the kernel. If the obtained power information reaches the preset safety threshold, the second virtual module will start the remaining kernel.
[0215] In addition, if some kernels are still not started after the electronic device is successfully powered on, the second virtual module can start those remaining kernels.
[0216] For example, such as Figure 4 As shown by the dashed line, during the boot process, the electronic device monitors its boot status in real time. When the electronic device detects "sys.boot_completed=1", it indicates that the boot process is successful. In the event of a successful boot, the electronic device can drive a second virtual module to start the remaining kernel. The second virtual module, upon determining that some kernels are still not booting, will then start those remaining kernels.
[0217] In this embodiment of the application, when the boot policy corresponding to the policy flag bit is to limit the CPU frequency and start some kernels, the first virtual module can limit the CPU frequency to the first frequency range, and the second virtual module can start some kernels while the remaining kernels are not started.
[0218] Meanwhile, the power information of the ADSP subsystem is monitored in real time. When the power information of the ADSP subsystem reaches the preset safety threshold, the first virtual module increases the CPU frequency and the second virtual module starts the remaining kernel.
[0219] In this embodiment, a dual-threshold method (temperature threshold and voltage threshold) is used to determine the scenario in which the electronic device is located, such as a single low-temperature state, a single low-voltage state, or a combination of low-temperature and low-voltage states. Furthermore, when the electronic device is in a low-temperature state and / or a low-voltage state, by limiting the CPU frequency (frequency point) and / or limiting the number of boot cores, the voltage required for booting can be pre-reduced, thereby facilitating a one-time boot.
[0220] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0221] Based on the same inventive concept, this application also provides a power-on device. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations in the power-on device embodiments provided below can be found in the limitations of the power-on method above, and will not be repeated here. Figure 5 As shown, Figure 5 The present application provides a structural block diagram of a boot device, which includes a first loading module 501 and a second loading module 502. The first loading module 501 is used to detect whether the electronic device is in a low temperature state and / or a low voltage state during the BootLoader loading stage. The low temperature state includes the current temperature of the electronic device being less than a temperature threshold, and the low voltage state includes the current voltage of the electronic device being less than a voltage threshold. If the electronic device is in a low temperature state and / or a low voltage state, a boot strategy is determined based on the current temperature and / or the current voltage. The boot strategy indicates limiting the CPU frequency and / or starting a portion of the kernel. The second loading module 502 is used to execute the boot process based on the boot strategy during the kernel loading stage.
[0222] In one embodiment, the first loading module 501 is specifically used to obtain the configuration thresholds corresponding to the power components from the device tree file during the BootLoader loading stage. The configuration thresholds include temperature thresholds and voltage thresholds.
[0223] In one embodiment, when the current temperature is below a temperature threshold and the current voltage is below a voltage threshold, the power-on policy instructs to limit the CPU frequency and start a portion of the kernel.
[0224] In one embodiment, the first loading module 501 is specifically used to obtain a first correspondence, which includes the correspondence between multiple temperature difference ranges and multiple power-on strategies; and to determine the power-on strategy based on the first correspondence and the absolute value of the difference between the current temperature and the temperature threshold.
[0225] In one embodiment, when the absolute value of the difference between the current temperature and the temperature threshold corresponds to a first temperature difference interval among multiple temperature difference intervals, the power-on policy instructs to limit the CPU frequency to the first frequency interval; when the absolute value of the difference between the current temperature and the temperature threshold corresponds to a second temperature difference interval among multiple temperature difference intervals, the power-on policy instructs to limit the CPU frequency to the second frequency interval, wherein the temperature difference indicated by the second temperature difference interval is greater than the temperature difference indicated by the first temperature difference interval, and the frequency indicated by the second frequency interval is less than the frequency indicated by the first frequency interval.
[0226] In one embodiment, the first loading module 501 is specifically used to obtain a second correspondence, which includes a correspondence between multiple voltage difference intervals and multiple power-on strategies; and to determine a power-on strategy based on the second correspondence and the absolute value of the difference between the current voltage and the voltage threshold.
[0227] In one embodiment, when the absolute value of the difference between the current voltage and the voltage threshold corresponds to a first voltage difference interval among a plurality of voltage difference intervals, the power-on policy indicates limiting the CPU frequency; when the absolute value of the difference between the current voltage and the voltage threshold corresponds to a second voltage difference interval among a plurality of voltage difference intervals, the power-on policy indicates starting a portion of the kernel, wherein the voltage difference indicated by the second voltage difference interval is greater than the voltage difference indicated by the first voltage difference interval.
[0228] In one embodiment, the second loading module 502 is specifically used to monitor the current remaining power during the kernel loading stage, and when the current remaining power reaches a preset safety threshold, increase the CPU frequency and / or start the remaining kernel, which is the kernel in the electronic device that has not been started.
[0229] In one embodiment, the second loading module 502 is specifically used to increase the CPU frequency and / or start the remaining kernels after successful power-on, the remaining kernels being kernels that have not been started in the electronic device.
[0230] Each module in the aforementioned power-on device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0231] Based on the above embodiments, this application also provides a computer-readable storage medium storing a computer program (or computer-executable instructions) that, when executed by one or more processors, causes the processors to perform the steps of the boot method in the foregoing embodiments.
[0232] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps of a power-on method.
[0233] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0234] The above specific embodiments further illustrate the purpose, technical solution and beneficial effects of this application. It should be understood that the above are only specific embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of this application should be included within the scope of protection of this application.< / xx> < / xxxx>
Claims
1. A power-on method, characterized in that, Applied to electronic devices, the method includes: During the BootLoader loading phase, it is detected whether the electronic device is in a low temperature state and / or a low voltage state. The low temperature state includes the state where the current temperature of the electronic device is less than a temperature threshold, and the low voltage state includes the state where the current voltage of the electronic device is less than a voltage threshold. If the electronic device is in a low temperature and / or low voltage state, a power-on strategy is determined based on the current temperature and / or the current voltage, the power-on strategy indicating limiting the CPU frequency and / or starting a portion of the kernel; During the kernel loading phase, the boot process is executed based on the boot policy.
2. The method according to claim 1, characterized in that, The method further includes: During the BootLoader loading phase, the configuration thresholds corresponding to the power components are obtained from the device tree file. These configuration thresholds include the temperature threshold and the voltage threshold.
3. The method according to claim 1 or 2, characterized in that, If the current temperature is less than the temperature threshold and the current voltage is less than the voltage threshold, the power-on policy indicates that the CPU frequency and some kernels should be limited.
4. The method according to claim 1 or 2, characterized in that, The step of determining the power-on strategy based on the current temperature includes: Obtain the first correspondence, which includes the correspondence between multiple temperature difference ranges and multiple start-up strategies; The power-on strategy is determined based on the first correspondence and the absolute value of the difference between the current temperature and the temperature threshold.
5. The method according to claim 4, characterized in that, When the absolute value of the difference between the current temperature and the temperature threshold corresponds to the first temperature difference interval among the plurality of temperature difference intervals, the power-on strategy instructs to limit the CPU frequency to the first frequency interval. When the absolute value of the difference between the current temperature and the temperature threshold corresponds to the second temperature difference interval among the plurality of temperature difference intervals, the power-on policy indicates that the CPU frequency is limited to the second frequency interval, wherein the temperature difference indicated by the second temperature difference interval is greater than the temperature difference indicated by the first temperature difference interval, and the frequency indicated by the second frequency interval is less than the frequency indicated by the first frequency interval.
6. The method according to claim 1 or 2, characterized in that, The step of determining the power-on strategy based on the current voltage includes: Obtain a second correspondence, which includes the correspondence between multiple voltage difference intervals and multiple power-on strategies; The power-on strategy is determined based on the second correspondence and the absolute value of the difference between the current voltage and the voltage threshold.
7. The method according to claim 6, characterized in that, When the absolute value of the difference between the current voltage and the voltage threshold corresponds to the first voltage difference interval among the plurality of voltage difference intervals, the power-on policy indicates that the CPU frequency should be limited; When the absolute value of the difference between the current voltage and the voltage threshold corresponds to the second voltage difference interval among the plurality of voltage difference intervals, the power-on strategy instructs the startup of a portion of the kernel, wherein the voltage difference indicated by the second voltage difference interval is greater than the voltage difference indicated by the first voltage difference interval.
8. The method according to claim 1 or 2, characterized in that, The method further includes: During the kernel loading phase, the current remaining battery power is monitored. When the current remaining battery power reaches a preset safety threshold, the CPU frequency is increased and / or the remaining kernels are started. The remaining kernels are the kernels in the electronic device that have not been started.
9. The method according to claim 1 or 2, characterized in that, The method further includes: After a successful boot, the CPU frequency is increased and / or the remaining kernels, which are kernels in the electronic device that have not been started, are activated.
10. A power-on device, characterized in that, Applied to electronic devices, the device includes: The first loading module is used to detect whether the electronic device is in a low temperature state and / or a low voltage state during the BootLoader loading stage. The low temperature state includes the state where the current temperature of the electronic device is less than a temperature threshold, and the low voltage state includes the state where the current voltage of the electronic device is less than a voltage threshold. If the electronic device is in a low temperature state and / or a low voltage state, a boot strategy is determined based on the current temperature and / or the current voltage. The boot strategy indicates limiting the CPU frequency and / or starting a portion of the kernel. The second loading module is used to execute the boot process based on the boot strategy during the kernel loading stage.
11. An electronic device, characterized in that, It includes a memory and a processor, the memory being used to store a computer program, and the processor being used to invoke the computer program to perform the power-on method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions that, when executed, implement the power-on method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that, Includes a computer program that, when run, causes the computer to perform the power-on method as described in any one of claims 1 to 9.