Starting-up method, electronic equipment and computer readable storage medium
By setting up the first partition and the second partition on the electronic device to perform DDR training tasks respectively, the problem of DDR training failure causing inability to boot up is solved, and the training success rate and data transmission stability are improved.
Patent Information
- Application Number
- CN202410940449.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-07-12
AI Technical Summary
DDR training failure causes electronic devices to be unable to boot up, affecting user experience, and existing technologies are difficult to effectively solve this problem.
A first partition and a second partition are set on the electronic device to store the first initial parameters and the second initial parameters obtained through backup respectively. The first DDR training task is executed first. If it fails, the second partition is switched to execute the second DDR training task until it succeeds.
Increase the probability of successful DDR training, reduce the probability of electronic devices failing to start up, and improve data transmission stability.
Smart Images

Figure CN120743358A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to a power-on method, an electronic device, and a computer-readable storage medium. Background Art
[0002] Double Data Rate Synchronous Dynamic Random Access Memory (DDR) is a type of computer memory. As a high-speed transmission bus, DDR has very strict timing requirements. To compensate for timing errors introduced by external factors (such as wiring length, component impedance, and ambient temperature), DDR must be trained before use to obtain timing offset values that match these external factors, thereby achieving optimal DDR timing.
[0003] When electronic devices are upgraded via Over-the-Air Technology (OTA), the DDR firmware version will be updated, which in turn triggers DDR training. If DDR training fails, the device may not be able to boot, affecting the user experience. Summary of the Invention
[0004] The present application provides a power-on method, an electronic device, and a computer-readable storage medium, which can reduce the probability of a power-on failure caused by a DDR training failure, thereby reducing the probability of an electronic device being unable to power on.
[0005] To achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, a power-on method is provided, which is applied to an electronic device, wherein the electronic device is provided with a first partition and a second partition. The method includes: when a power-on instruction is detected, if it is determined that a DDR training condition is met, performing a first DDR training task according to a first initial parameter in the first partition; if the first DDR training task fails, performing a second DDR training task according to a second initial parameter in the second partition, wherein the second initial parameter is obtained by backing up the first initial parameter; if the second DDR training task is successful, executing the power-on process.
[0007] In the above embodiment, by setting a first partition and a second partition on the electronic device, a first DDR training task is first performed according to the first initial parameters in the first partition. If the first DDR training task fails, the second DDR training task is performed according to the same second initial parameters in the second partition. If the second DDR training task is successful, the power-on is executed, thereby increasing the number of DDR training times according to the initial parameters, thereby increasing the probability of successful training, and thereby reducing the probability of the electronic device failing to power on.
[0008] In one embodiment, performing the first DDR training task according to the first initial parameters in the first partition includes:
[0009] Perform DDR training according to the first initial parameters; if the training fails, perform DDR training again in the first partition.
[0010] During the DDR training process, training failure may occur due to incomplete DDR training process or abnormal parameter writing after DDR training. The above problems are training process problems. Re-training DDR when DDR training fails can reduce the situation where training task failure is caused by training process problems, increase the probability of successful DDR training, and thus reduce the probability of electronic equipment failing to start up.
[0011] In one embodiment, the method further comprises:
[0012] If the DDR training performed in the first partition fails and the number of DDR trainings reaches a first preset number, it is determined that the first DDR training task has failed, thereby avoiding the DDR training failure caused by the training process and increasing the probability of DDR training success.
[0013] In one embodiment, in the case of training failure, performing DDR training again in the first partition includes:
[0014] In the event of training failure, the failure type is obtained; if the failure type meets the preset conditions, DDR training is performed again in the first partition, so that it can be determined in advance whether it is necessary to perform DDR training again in the current state, avoiding invalid DDR training, thereby improving the boot speed.
[0015] In one embodiment, the method further includes: if the second DDR training task fails, not powering on the device, thereby avoiding the problem of poor data transmission stability caused by uncalibrated DDR.
[0016] In one embodiment, the method further comprises:
[0017] If the number of DDR trainings performed in the second partition reaches a second preset number, it is determined that the second DDR training task has failed, thereby avoiding the situation where DDR training failures are caused by the training process and improving the probability of DDR training success.
[0018] In one embodiment, if the first DDR training task fails, performing a second DDR training task according to second initial parameters in the second partition includes:
[0019] If the first DDR training task fails, switch to the second partition and record the switch identifier; restart the system;
[0020] Execute the second DDR training task according to the second initial parameters;
[0021] If the second DDR training task fails, the electronic device will not be powered on, including: if the second DDR training task fails and the switching identifier is detected, it is determined that both partitions have undergone DDR training, DDR training cannot be completed, and the electronic device will not be powered on.
[0022] In one embodiment, after the power-on is executed, the method further includes: synchronizing the training parameters obtained by executing the second DDR training task to the first partition, thereby maintaining the consistency of data in the first partition and the second partition, and improving the probability of success of the next DDR training.
[0023] In one embodiment, the method further comprises:
[0024] When it is determined that the version number of the DDR firmware is updated, it is determined that the DDR training conditions are met, so that the DDR can be calibrated to match the DDR parameters with the environmental factors, thereby improving the stability of data transmission.
[0025] In one embodiment, when a power-on instruction is detected, if it is determined that a DDR training condition is met, performing a first DDR training task according to first initial parameters in the first partition includes:
[0026] When a power-on instruction is detected, verifying the first initial parameter;
[0027] When the first initial parameter verification is successful, if it is determined that the DDR training condition is met, performing a first DDR training task according to the first initial parameter in the first partition;
[0028] The method further comprises:
[0029] If the first initial parameter verification fails, the device will not be turned on.
[0030] In the above embodiment, the probability of successful DDR training can be increased by verifying the first initial parameters.
[0031] In a second aspect, a power-on device is provided, which is applied to an electronic device, wherein the electronic device is provided with a first partition and a second partition, and the device includes:
[0032] A first training module is configured to, when a power-on instruction is detected, perform a first DDR training task according to first initial parameters in the first partition if it is determined that a DDR training condition is met;
[0033] a second training module, configured to, if the first DDR training task fails, perform a second DDR training task according to second initial parameters in the second partition, where the second initial parameters are obtained by backing up the first initial parameters;
[0034] The power-on module is configured to execute a power-on process if the second DDR training task is successful.
[0035] In one embodiment, the first training module is specifically configured to:
[0036] Performing DDR training according to the first initial parameters;
[0037] In case of training failure, DDR training is performed again in the first partition.
[0038] In one embodiment, the first training module is specifically configured to:
[0039] If the DDR training performed in the first partition fails and the number of times the DDR training is performed reaches a first preset number, it is determined that the first DDR training task has failed.
[0040] In one embodiment, the first training module is specifically configured to:
[0041] In case of training failure, get the failure type;
[0042] If the failure type meets the preset condition, DDR training is performed again in the first partition.
[0043] In one embodiment, the startup module is further configured to:
[0044] If the second DDR training task fails, the system will not start up.
[0045] In one embodiment, the second training module is further configured to:
[0046] If the number of times the DDR training is performed in the second partition reaches a second preset number, it is determined that the second DDR training task has failed.
[0047] In one embodiment, the second training module is specifically configured to:
[0048] If the first DDR training task fails, switch to the second partition and record the switching flag;
[0049] Restart the system;
[0050] Execute the second DDR training task according to the second initial parameters;
[0051] The boot module is specifically used for:
[0052] If the second DDR training task fails and the switching flag is detected, the device will not be powered on.
[0053] In one embodiment, the startup module is further configured to:
[0054] Synchronize the training parameters obtained by executing the second DDR training task to the first partition.
[0055] In one embodiment, the first training module is further configured to:
[0056] When it is determined that the version number of the DDR firmware is updated, it is determined that the DDR training condition is met.
[0057] In one embodiment, the first training module is further configured to:
[0058] When a power-on instruction is detected, verifying the first initial parameter;
[0059] When the first initial parameter verification is successful, if it is determined that the DDR training condition is met, performing a first DDR training task according to the first initial parameter in the first partition;
[0060] If the first initial parameter verification fails, the device will not be turned on.
[0061] In a third aspect, an electronic device is provided, comprising a processor, wherein the processor is configured to execute a computer program stored in a memory to implement the power-on method as described in the first aspect.
[0062] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the power-on method as described in the first aspect is implemented.
[0063] In a fifth aspect, a chip is provided, comprising a processor coupled to a memory, wherein the processor executes a computer program or instruction stored in the memory to implement the power-on method described in the first aspect above.
[0064] In a sixth aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes the power-on method described in the first aspect.
[0065] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 A software architecture diagram of an electronic device provided in an embodiment of the present application;
[0067] Figure 2 A flowchart of the power-on process of an electronic device provided in an embodiment of the present application;
[0068] Figure 3 A schematic diagram of a process flow of a startup method provided in one embodiment of the present application;
[0069] Figure 4 A scene diagram for DDR training provided in one embodiment of the present application;
[0070] Figure 5 A specific flow chart of a startup method provided in an embodiment of the present application;
[0071] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0073] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0074] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0075] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0076] In addition, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0077] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0078] The power-on method provided in the embodiment of the present application is executed on an electronic device.
[0079] For example, the electronic device described in the embodiments of the present application may be a mobile phone, a tablet computer, a handheld computer, a personal digital assistant (PDA), an augmented reality (AR) or virtual reality (VR) device, a media player, a wearable device, a vehicle-mounted device, etc. The embodiments of the present application do not impose any special restrictions on the specific form / type of the electronic device. The above-mentioned electronic devices include but are not limited to devices equipped with Devices running Harmony OS or other operating systems.
[0080] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device.
[0081] Figure 1 It is a software structure block diagram of the electronic device according to an embodiment of the present invention.
[0082] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0083] The application layer can include a series of application packages.
[0084] like Figure 1 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0085] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0086] like Figure 1 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0087] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0088] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0089] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0090] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0091] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0092] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0093] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0094] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0095] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0096] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0097] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0098] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0099] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0100] A 2D graphics engine is a drawing engine for 2D drawings.
[0101] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0102] Based on the above software structure diagram, the startup process of the electronic device is as follows Figure 2 shown.
[0103] The boot process of an electronic device includes the bootloader (BootLoader) phase (also known as the XBL phase), the kernel startup phase, the application framework startup phase, and the application startup phase. The Bootloader phase is used to load the boot program from ROM to RAM and complete DDR initialization. During the DDR initialization process, if an OTA upgrade causes a DDR firmware version upgrade, DDR training will be triggered. If DDR training fails, the device will fail to boot. For example, the boot process of an electronic device is as follows. After detecting the boot command, if the DDR firmware version upgrade is determined, the electronic device performs DDR training to obtain a timing offset value that matches the environmental factors. This allows the DDR to be corrected, thereby improving data transmission stability. If DDR training is successful, the boot process is executed. If DDR training fails, the timing offset value that matches the environment cannot be obtained. To avoid unstable data transmission caused by DDR training failure, the device will not boot in the event of a DDR training failure. For example, it may trigger a full reboot or output a startup error message. Therefore, there is a high probability that the electronic device will fail to boot due to DDR training failure during the boot process.
[0104] To this end, the present application provides a boot method, which sets a first partition and a second partition on an electronic device. The first partition and the second partition are storage spaces on the memory, for example, the first partition and the second partition are storage spaces of Universal Flash Storage (UFS). The first initial parameter is stored in the first partition, and the second initial parameter is stored in the second partition. The second initial parameter is obtained by backing up the first initial parameter. The first initial parameter and the second initial parameter are the same and are both used for DDR training. At the same time, if Figure 2 As shown, a DDR fault detection module and a fault recovery module are added in the BootLoader stage. When DDR training is required, the first DDR training task is first performed according to the first initial parameters of the first partition. The DDR fault detection module is used to detect whether the first DDR training task has failed. When the failure of the first DDR training task is detected, the fault recovery module is instructed to perform fault recovery. The fault recovery module is used to perform partition switching and perform the second DDR training task according to the second initial parameters of the second partition. If the second DDR training task is successful, the power-on is executed. If the second DDR training task fails, the power-on is not executed, thereby increasing the number of DDR trainings performed according to the initial parameters, thereby increasing the probability of successful training, and thereby reducing the probability of the electronic device failing to power on.
[0105] The following is a detailed introduction to the startup method provided by this application.
[0106] like Figure 3 As shown, the power-on method provided in one embodiment of the present application includes the following steps.
[0107] S301: When a power-on instruction is detected, if it is determined that a DDR training condition is met, a first DDR training task is executed according to a first initial parameter in the first partition.
[0108] The first initial parameter is a parameter used for DDR training, for example, an initial timing offset value, and can be a factory setting parameter of the electronic device or a training parameter obtained from the last DDR training.
[0109] In one embodiment, the electronic device determines that the DDR training conditions are met when it detects that the environment in which the DDR is located has changed. For example, the electronic device determines that the DDR training conditions are met when it determines that the version number of the DDR firmware has been updated. Alternatively, the electronic device determines that the DDR training conditions are met when it determines that the OTA upgrade is completed. Alternatively, the electronic device determines that the DDR training conditions are met when it determines that the OTA upgrade is completed and the version number of the DDR firmware has changed. Alternatively, the electronic device determines that the DDR training conditions are met when it detects that the current DDR training parameters (current timing offset value) are abnormal.
[0110] For example, Figure 4 As shown, upon detecting the OTA upgrade command sent by the server 200, the electronic device 100 prompts the user whether to perform the OTA upgrade. Upon detecting the confirmation command input by the user, the electronic device 100 is restarted. Subsequently, the electronic device 100 determines whether the DDR training conditions are met based on the power-on command. If the DDR training conditions are met, the first DDR training task is executed based on the first initial parameters.
[0111] In other embodiments, the electronic device may also determine that the DDR training condition is met when the power-on instruction is detected and it is determined that the device is powered on for the first time. The electronic device may also determine that the DDR training condition is met when the power-on instruction is detected.
[0112] In one embodiment, when the electronic device detects a power-on instruction, it verifies the first initial parameter. If the first initial parameter verification is successful, if it is determined that the DDR training conditions are met, the first DDR training task is performed according to the first initial parameter in the first partition, thereby avoiding the training failure caused by the error of the first initial parameter. The verification of the first initial parameter includes verifying any one or more of the format of the first initial parameter, the range of each parameter in the first initial parameter, and the number of parameters of the first initial parameter. Correspondingly, the successful verification of the first initial parameter means that the format of the first initial parameter is a preset format, the range of each parameter in the first initial parameter meets the preset requirements, or the number of parameters of the first initial parameter is a preset value.
[0113] The electronic device performing the first DDR training task may refer to the electronic device performing one DDR training, or it may refer to the electronic device performing multiple DDR trainings. For example, DDR training is the process of establishing stable communication and data transmission between the DDR memory controller and the DDR memory chip. DDR training includes processes such as initialization, memory calibration, delay control, timing adjustment, and signal training. Among them, initialization is the memory controller sending initialization instructions to the memory chip to ensure that the memory chip is in a normal working mode and working state. Memory calibration is the memory controller sending calibration instructions to the memory chip to calibrate the timing characteristics and electrical characteristics of the memory chip. Delay control is the memory controller adjusting the phase and delay of the clock according to the feedback signal of the memory chip to ensure the correct transmission of data. Timing adjustment is the memory controller adjusting the timing parameters of data transmission according to the feedback signal of the memory chip. Signal training is the memory controller sending training instructions to the memory chip to ensure the stability and correctness of signal transmission.
[0114] In one embodiment, the specific process of an electronic device performing a first DDR training task according to the first initial parameters in the first partition is as follows. The electronic device performs DDR training according to the first initial parameters. In the event of a training failure, DDR training is performed again in the first partition. Herein, performing DDR training again in the first partition means performing DDR training according to the current training parameters until the number of training times reaches a first preset number. Herein, if the training parameters were obtained during the last DDR training, the current training parameters are the parameters obtained during the last DDR training; if the training parameters were not obtained during the last DDR training, the current training parameters are the first initial parameters. The first preset number of times may be 2 or 3. Exemplarily, the electronic device performs DDR training in the first partition. If the training fails, it is determined whether the number of DDR training times in the first partition has reached the first preset number. If the first preset number has been reached, the DDR training is terminated; if the first preset number has not been reached, the DDR training is performed again according to the current training parameters.
[0115] During the DDR training process, training failure may occur due to incomplete DDR training process or abnormal parameter writing after DDR training. The above problems are training process problems. By training in one partition multiple times, the situation where training task failures are caused by training process problems can be reduced, the probability of successful DDR training can be increased, and the probability of electronic equipment failing to start up can be reduced.
[0116] In one embodiment, an electronic device performs DDR training in a first partition. If the training fails, the failure type is obtained. If the failure type meets a preset condition and the number of DDR training attempts has not reached a first preset number, DDR training is performed again in the first partition. If the failure type does not meet the preset condition, DDR training in the first partition is terminated. The failure type can be hardware-related, software-related, power supply abnormality-related, signal quality-related, or other types. The preset condition can be pre-set. If the failure type meets the preset condition, the training failure can be avoided by retraining; if the failure type does not meet the preset condition, the training failure cannot be avoided by retraining. The electronic device can pre-set an identifier (e.g., a letter and / or number) corresponding to each failure type. After performing DDR training, the electronic device generates an identifier corresponding to the failure type based on abnormal information detected during training. The electronic device then reads the identifier. If the identifier is a preset value, the failure type is determined to meet the preset condition. If the identifier is not a preset value, the failure type is determined to not meet the preset condition. By adding a step to determine the failure type, DDR training can be stopped if retraining is unrecoverable, thereby saving startup time for the electronic device.
[0117] In one embodiment, the power-on method provided in the embodiment of the present application further includes: after the electronic device verifies the first initial parameter, if the first initial parameter verification is unsuccessful, the electronic device does not power on, thereby avoiding subsequent invalid DDR training.
[0118] In one embodiment, the power-on method provided in the embodiment of the present application further includes: after the electronic device detects the power-on instruction, if it is determined that the DDR training conditions are not met, the DDR training is not performed and the power-on process is directly executed, thereby saving power-on time.
[0119] S302: If the first DDR training task fails, executing a second DDR training task according to second initial parameters in the second partition, where the second initial parameters are obtained by backing up the first initial parameters.
[0120] Specifically, if the DDR training performed in the first partition fails and the number of DDR trainings performed reaches a first preset number, the first DDR training task is determined to have failed. For example, if the first DDR training task includes multiple DDR trainings, if the DDR training performed in the first partition fails, the DDR training is performed again in the first partition. If the DDR training performed in the first partition fails and the number of DDR trainings performed reaches the first preset number, the first DDR training task is determined to have failed.
[0121] The second partition is a backup partition of the first partition, and the second initial parameters are the parameters obtained by backing up the first initial parameters. Therefore, the second initial parameters are the same as the first initial parameters and can both be used for DDR training. After executing the first DDR training task in the first partition, the DDR training parameters will be obtained, and the DDR training parameters will overwrite the first initial parameters. Therefore, DDR training cannot be performed again based on the first initial parameters. Therefore, in the event that the first DDR training task fails to be executed in the first partition, executing the second DDR training task in the second partition can ensure that the parameters in the first partition are refreshed, and the backup second initial parameters are still available to complete the DDR training, thereby ensuring that the DDR training can proceed normally to ensure the normal operation of the DDR.
[0122] The process for executing the second DDR training task in the second partition can be the same as the process for executing the first DDR training task in the first partition. For example, the electronic device switches partitions, restarts the system, and verifies the second initial parameters. If the second initial parameters fail to verify successfully, the device does not boot up. If the second initial parameters are verified successfully, a determination is made as to whether DDR training conditions are met. If the DDR training conditions are not met, the boot process is executed. If the DDR training conditions are met, the second DDR training task is executed. The process for executing the second DDR training task is as follows: DDR training is performed based on the second initial parameters. If training fails, a determination is made as to whether the number of DDR training attempts in the second partition has reached a second preset number. If the second preset number has been reached, the second DDR training task is determined to have failed. If training fails and the failure type does not meet the preset conditions, the second DDR training task is determined to have failed. If the second preset number has not been reached and the failure type meets the preset conditions, DDR training is performed again based on the current training parameters. If the training parameters were obtained during the previous DDR training, the current training parameters are the parameters obtained during the previous DDR training. If the training parameters were not obtained during the previous DDR training, the current training parameters are the second initial parameters. The second preset number of times may be equal to or different from the first preset number of times.
[0123] In other feasible implementations, after switching partitions, the electronic device performs a second DDR training task if it determines that the DDR training conditions are met. The second DDR training task may also include only one DDR training session. If the second DDR training task includes multiple DDR training sessions, the electronic device may also determine whether a second preset number of DDR training sessions has been reached if training fails. If the second preset number of DDR training sessions has not been reached, the electronic device performs DDR training again. If the second preset number of DDR training sessions has been reached, the electronic device determines that the second DDR training task has failed.
[0124] S303: If the second DDR training task is successful, the power-on process is executed.
[0125] Specifically, after successful DDR training, training parameters are obtained and a training success flag is generated. Upon obtaining the training success flag, the electronic device determines that the second DDR training task is successful and executes the boot process. Executing the boot process refers to sequentially executing the kernel boot phase, the application framework boot phase, and the application boot phase of the boot process.
[0126] S304: If the second DDR training task fails, do not power on the device.
[0127] In one embodiment, if the number of times DDR training is performed in the second partition reaches a second preset number, it is determined that the second DDR training task has failed.
[0128] In one embodiment, if the DDR training in the second partition fails and the failure type does not meet a preset condition, it is determined that the second DDR training task has failed.
[0129] In one embodiment, upon determining that the first DDR training task has failed, the electronic device switches to the second partition and records the switching action, such as a switching flag. The electronic device then restarts the system and executes the second DDR training task in the second partition. If the second DDR training task has failed, the electronic device detects whether the switching flag exists. If the switching flag exists, it is determined that the partition has already been switched, i.e., the first DDR training task has already been executed in the first partition. DDR training is then discontinued and the system is not restarted.
[0130] In one embodiment, if the electronic device successfully executes the first DDR task, obtains training parameters, and stores them in the first partition, the electronic device synchronizes the training parameters to the second partition, thereby maintaining data consistency between the first and second partitions and increasing the probability of successful DDR training the next time. If the electronic device successfully executes the second DDR task, obtains training parameters, and stores them in the second partition, the electronic device synchronizes the training parameters to the first partition, thereby maintaining data consistency between the first and second partitions and increasing the probability of successful DDR training the next time. The electronic device can synchronize the training parameters in the first partition to the second partition, or synchronize the training parameters in the second partition to the first partition, during the application framework startup phase of the boot process.
[0131] In the above embodiment, by setting a first partition and a second partition on the electronic device, a first DDR training task is first performed according to the first initial parameters in the first partition. If the first DDR training task fails, a second DDR training task is performed according to the same second initial parameters in the second partition. If the second DDR training task is successful, the power-on is executed. If the second DDR training task fails, the power-on is not executed. This can increase the number of DDR training times according to the initial parameters, thereby increasing the probability of successful training and reducing the probability of the electronic device failing to power on.
[0132] In one embodiment, the specific process of the startup method provided by this application is as follows: Figure 5 shown.
[0133] After detecting a power-on command, the electronic device performs a DDR training task in one of the partitions. Specifically, the initial parameters are first verified to determine whether the verification is successful. If the verification is unsuccessful, the device does not power on. If the verification is successful, the DDR firmware version number is then determined to be updated. If the DDR firmware version number is not updated, the device powers on normally. If the DDR firmware version number is updated, DDR training is performed to obtain training parameters to refresh the initial parameters. A determination is then made as to whether the DDR training is successful. If so, the device powers on normally. If not, a determination is made as to whether retraining is required. If the number of training attempts does not reach a preset number and the failure type of the training failure meets preset conditions, retraining is required. If the number of training attempts reaches a preset number or the failure type of the training failure does not meet preset conditions, retraining is not required. If retraining is required, DDR training is triggered and the device returns to the DDR training step. If retraining is not required, the device determines whether the partition has been switched. If the partition has been switched, the device does not power on. If the partition has not been switched, the partition is switched and the switching action is recorded. The system is then restarted and, after powering on, the same DDR training task is performed in the other partition, returning to the initialization parameter verification step. For any partition, after normal startup, synchronize the training parameters to another partition.
[0134] In the above embodiment, the DDR initial parameters for both partitions are obtained through a backup partition. For any partition, if the initial training fails, DDR training is performed again using the training parameters obtained by refreshing the initial parameters. If training fails again, the partition is switched and DDR training is performed in the other partition. If the initial training fails again, DDR training is performed again. This increases the number of DDR training cycles, namely, the number of DDR training cycles using the initial parameters and the number of DDR training cycles using the training parameters after refreshing the initial parameters. This increases the probability of DDR training success and reduces the probability of a system failure due to DDR training failure.
[0135] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0136] For example, Figure 6 A structural diagram of the electronic device 100 is shown.
[0137] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light 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.
[0138] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0139] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0140] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0141] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0142] In some embodiments, the processor 110 may include one or more interfaces. The 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.
[0143] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0144] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0145] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor.
[0146] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0147] The external memory 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 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0148] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0149] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0150] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0151] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.
[0152] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0153] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0154] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0155] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0156] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.
[0157] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0158] In the embodiments provided in this application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0159] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0160] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A startup method, characterized in that: Applied to an electronic device, the electronic device is provided with a first partition and a second partition, the method comprising: When a power-on instruction is detected, if it is determined that a DDR training condition is met, performing a first DDR training task according to a first initial parameter in the first partition; If the first DDR training task fails, performing a second DDR training task according to second initial parameters in the second partition, where the second initial parameters are obtained by backing up the first initial parameters; If the second DDR training task is successful, the power-on process is executed.
2. The method according to claim 1, characterized in that The performing the first DDR training task according to the first initial parameters in the first partition includes: Performing DDR training according to the first initial parameters; In case of training failure, DDR training is performed again in the first partition.
3. The method according to claim 2, characterized in that The method further comprises: If the DDR training performed in the first partition fails and the number of times the DDR training is performed reaches a first preset number, it is determined that the first DDR training task has failed.
4. The method according to claim 2, characterized in that The step of performing DDR training again in the first partition in the case of training failure includes: In case of training failure, get the failure type; If the failure type meets the preset condition, DDR training is performed again in the first partition.
5. The method according to claim 1, wherein The method further comprises: If the second DDR training task fails, the system will not start up.
6. The method according to claim 5, characterized in that The method further comprises: If the number of times the DDR training is performed in the second partition reaches a second preset number, it is determined that the second DDR training task has failed.
7. The method according to claim 1, characterized in that If the first DDR training task fails, performing a second DDR training task according to the second initial parameters in the second partition includes: If the first DDR training task fails, switch to the second partition and record the switching flag; Restart the system; Execute the second DDR training task according to the second initial parameters; If the second DDR training task fails, not starting the computer includes: If the second DDR training task fails and the switching flag is detected, the device will not be powered on.
8. The method according to any one of claims 1 to 7, characterized in that After the booting is performed, the method further includes: Synchronize the training parameters obtained by executing the second DDR training task to the first partition.
9. The method according to claim 1, characterized in that The method further comprises: When it is determined that the version number of the DDR firmware is updated, it is determined that the DDR training condition is met.
10. The method according to claim 1, characterized in that When a power-on instruction is detected, if it is determined that a DDR training condition is met, a first DDR training task is performed according to the first initial parameters in the first partition, including: When a power-on instruction is detected, verifying the first initial parameter; When the first initial parameter verification is successful, if it is determined that the DDR training condition is met, performing a first DDR training task according to the first initial parameter in the first partition; The method further comprises: If the first initial parameter verification fails, the device will not be turned on.
11. An electronic device, characterized in that: The device comprises a processor configured to execute a computer program stored in a memory to implement the method according to any one of claims 1 to 10.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Boot fault handling method, equipment and computer readable storage medium
CN107341013A
Memory training method and system
CN111221582A
Memory management method and device, electronic equipment and storage medium
CN112084017A
OTA-based partition dynamic adjustment method, apparatus and device, and storage medium
CN117687663A
Methods and structure to assure data integrity in a storage device cache in the presence of intermittent failures of cache memory subsystem
US20140122922A1
Cited By
Storage hardware training method and electronic equipment
CN121234053A