Electronic equipment starting method and device, electronic equipment, storage medium and computer program product

By using a combined storage solution of NOR flash memory and NAND flash memory in electronic devices, dual backup of system software is achieved, solving the problem of system damage caused by abnormal restart during software upgrades, improving equipment reliability and reducing maintenance costs.

CN120653318APending Publication Date: 2025-09-16CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410302763.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the prior art, electronic devices are prone to system software damage due to abnormal restart or power failure during software upgrades. In addition, the maintenance cost of high-position installed equipment is high, and there is a lack of effective system software backup solutions.

Method used

A smaller-capacity NOR flash memory is used to store the read-only version of the backup system software, and a larger-capacity NAND flash memory is used to store the upgradeable main system software. When the main system software fails to start, the backup system software is switched to and the main system software is repaired after startup.

Benefits of technology

It improves the system reliability of electronic equipment, reduces maintenance costs, and ensures that equipment can start and recover normally under abnormal circumstances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653318A_ABST
    Figure CN120653318A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic equipment starting method and device, electronic equipment, a storage medium and a computer program product. Wherein the electronic equipment comprises an NOR flash memory and an NAND flash memory, the NOR flash memory stores standby system software of the electronic equipment, which can only be read, the NAND flash memory stores main system software of the electronic equipment, the main system software can be upgraded, and the NAND flash memory stores the standby system software of the electronic equipment. The storage capacity of the NOR flash memory is smaller than that of the NAND flash memory; the method comprises the steps that under the condition that starting of the electronic equipment by means of the main system software fails, the electronic equipment is started by means of the standby system software, and the main system software is repaired after starting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to wireless communication technology, and in particular to a method and apparatus for starting an electronic device, an electronic device, a storage medium, and a computer program product. Background Art

[0002] Electronic devices (such as small base stations) may need software upgrades during use. During this process, an abnormal restart or power outage could corrupt the system software being upgraded. Furthermore, if only one copy of the system software is saved, the device may not function properly.

[0003] When the components of an electronic device related to the system software are installed at a higher position (for example, the radio frequency unit of a small base station is installed on the roof indoors), once the electronic device fails to operate normally, the electronic device needs to be disassembled from a higher position and the system software needs to be re-burned, which increases the maintenance cost. Therefore, in this case, the system reliability requirements for the electronic device are higher.

[0004] Therefore, in the related art, there is currently no solution for how to back up the system software of electronic devices. Summary of the Invention

[0005] To solve related technical problems, embodiments of the present application provide a method and apparatus for starting an electronic device, an electronic device, a storage medium, and a computer program product.

[0006] The technical solution of the embodiment of the present application is implemented as follows:

[0007] An embodiment of the present application provides a method for starting an electronic device, wherein the electronic device includes a NOR flash memory and a NAND flash memory, wherein the NOR flash memory stores backup system software of the electronic device that can only be read, and the NAND flash memory stores main system software of the electronic device, wherein the main system software can be upgraded, and the storage capacity of the NOR flash memory is smaller than the storage capacity of the NAND flash memory. The method includes:

[0008] In the case that the electronic device fails to be started by using the main system software, the electronic device is started by using the backup system software, and the main system software is repaired after starting.

[0009] In the above solution, the method further includes:

[0010] After the electronic device is powered on, the SPL stored in the NOR flash memory is loaded, and the second-stage program loader (SPL) obtains first information from the first register of the electronic device, where the first information indicates whether the last startup of the electronic device was normal startup or abnormal startup;

[0011] In a case where the first information indicates that the last startup of the electronic device was abnormal, the backup system software is loaded.

[0012] In the above solution, the type of the first register includes a non-volatile storage medium.

[0013] In the above solution, the method further includes:

[0014] After the electronic device is started up using the backup system software, the updated first information is recorded in the first register, where the updated first information indicates that the current startup of the electronic device is normal.

[0015] In the above solution, the method further includes:

[0016] The SPL records second information into a second register, where the second information indicates that the electronic device is started from a NOR flash memory.

[0017] The post-startup repair of the main system software includes:

[0018] After the file system of the electronic device is started, obtaining the second information from the second register;

[0019] Determining, based on the second information, that the current startup mode of the electronic device is NOR flash memory startup;

[0020] The software that fails to load in the main system software is repaired using the first information, where the first information includes information about the software that fails to load in the main system software.

[0021] In the above solution, the second register includes a non-volatile storage medium.

[0022] In the above solution, the method further includes:

[0023] The SPL records the third information into the third register, and the third information indicates that the last startup of the electronic device was an abnormal startup; the third information can be read as log information after the electronic device is started by the main system software, and the third register is cleared after the third information is read, and the log information is stored in the NAND flash memory.

[0024] In the above solution, the third register includes a non-volatile storage medium.

[0025] In the above solution, the method further includes:

[0026] Restart the electronic device using the repaired main system software.

[0027] An embodiment of the present application further provides a startup device for an electronic device, the electronic device comprising a NOR flash memory and a NAND flash memory, the NOR flash memory storing backup system software of the electronic device that can only be read, the NAND flash memory storing main system software of the electronic device, the main system software being upgradeable, the storage capacity of the NOR flash memory being smaller than the storage capacity of the NAND flash memory, comprising:

[0028] The startup unit is used to start the electronic device using the backup system software when the main system software fails to start the electronic device, and to repair the main system software after startup.

[0029] An embodiment of the present application further provides an electronic device, comprising a NOR flash memory and a NAND flash memory, wherein the NOR flash memory stores backup system software of the electronic device that can only be read, and the NAND flash memory stores main system software of the electronic device, wherein the main system software can be upgraded, and the storage capacity of the NOR flash memory is smaller than the storage capacity of the NAND flash memory, comprising: a processor and a communication interface; wherein,

[0030] The processor is configured to, when the electronic device fails to be started using the primary system software, start the electronic device using the backup system software, and repair the primary system software after starting.

[0031] An embodiment of the present application further provides an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor,

[0032] The processor is configured to execute the steps of any of the above methods when running the computer program.

[0033] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0034] An embodiment of the present application further provides a computer program product, comprising a computer program, which implements the steps of any of the above methods when executed by a processor.

[0035] The embodiments of the present application provide a method, device, electronic device, storage medium, and computer program product for starting an electronic device, wherein the electronic device includes a NOR flash memory and a NAND flash memory, wherein the NOR flash memory stores backup system software of the electronic device that can only be read, and the NAND flash memory stores main system software of the electronic device, wherein the main system software can be upgraded, and the storage capacity of the NOR flash memory is smaller than the storage capacity of the NAND flash memory; in the event that the electronic device fails to start using the main system software, the electronic device is started using the backup system software, and the main system software is repaired after startup. The technical solution provided by the embodiments of the present application uses a smaller-capacity NOR flash memory to store a read-only version of the backup system software, and uses a larger-capacity NAND flash memory to store the main system software; during the startup process of the electronic device (such as a small base station), if the main system software cannot be used for startup (such as an exception occurs during the upgrade of the main system software or a bad block appears in the NAND flash memory), the backup system software can be used to start the electronic device. In the above solution, the system software is backed up through NOR flash memory, which can balance cost and reliability. In addition, when a problem occurs in the main system software, it can be switched to the backup system software in time to start the electronic device, thereby greatly improving the system reliability of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a flowchart of a method for starting an electronic device according to an embodiment of the present application;

[0037] Figure 2 This is a schematic diagram of the structure of a NOR flash memory according to an embodiment of the present application;

[0038] Figure 3 This is a schematic diagram of the structure of a NAND flash memory according to an embodiment of the present application;

[0039] Figure 4 This is a flowchart of a software loading method for the application example of this application;

[0040] Figure 5 This is a schematic diagram of the structure of a starting device of an electronic device according to an embodiment of the present application;

[0041] Figure 6 This is a schematic diagram of the electronic device structure of an embodiment of the present application. DETAILED DESCRIPTION

[0042] The present application will be described in further detail below with reference to the accompanying drawings and embodiments.

[0043] In the related art, for small base stations, there may be a situation where the software needs to be upgraded during use. During the software upgrade process, if an abnormal power outage occurs, the system software being upgraded by the small base station may be damaged. At the same time, if the small base station only saves one copy of the system software, it will cause the small base station to fail to operate normally; on the other hand, the radio frequency unit of the small base station is generally set on the roof of the room. Once the small base station fails to operate normally, it is necessary to dismantle the small base station from a higher position and re-burn the system software, which makes the maintenance cost high. Therefore, in this case, the system reliability requirements of the small base station are relatively high.

[0044] Based on this, the implementation methods of backing up the system software of small base stations in related technologies mainly include the following:

[0045] The first implementation involves storing two image files in a NOR flash memory (also known as flash). One image file can be used to load the normal software version, while the other image file can be used for software upgrades. Only after the software upgrade is successful does the small base station radio unit switch to the upgraded version. Software components may include SPL, u-boot, Linux kernel image, root file system, and radio unit application software. The combined size of these software images is approximately 13MB. If all software is stored in two image files, at least 32MB of NOR flash memory is required. However, large-capacity NOR flash memory is expensive, making this solution unsuitable for cost-sensitive small base station radio units.

[0046] The second implementation method is to store two mirror files in low-cost NAND flash memory. However, due to the low reliability of NAND flash memory, it is prone to bad blocks. If a problem occurs during the software upgrade and the backup software also has bad blocks, the system will become unavailable.

[0047] A third implementation method is to store the system software bootloader in both NOR flash memory and NAND flash memory. If the small base station radio unit fails to load the bootloader from one storage medium, it can switch to the other storage medium to load the bootloader. However, backing up only the system software bootloader is not enough; in fact, the entire system software needs to be backed up; if any link in the boot process fails, the entire system may become unavailable.

[0048] In summary, the relevant solutions cannot meet the dual backup requirements of small base station system software; that is, there is currently no solution for how to back up the system software of small base stations.

[0049] Based on this, in various embodiments of the present application, a smaller-capacity NOR flash memory is used to store a read-only version of the backup system software, and a larger-capacity NAND flash memory is used to store the upgradeable main system software to achieve a balance between cost and reliability; at the same time, during the startup process of the small base station, if the main system software cannot be used for startup, it can be switched to the backup system software for restart, which greatly improves the system reliability of the small base station.

[0050] An embodiment of the present application provides a method for starting an electronic device, which is applied to the electronic device, wherein the electronic device includes a NOR flash memory and a NAND flash memory, wherein the NOR flash memory stores backup system software of the electronic device that can only be read, and the NAND flash memory stores main system software of the electronic device, wherein the main system software can be upgraded, and the storage capacity of the NOR flash memory is smaller than the storage capacity of the NAND flash memory, such as Figure 1 As shown, the method includes:

[0051] Step 102: If the electronic device fails to be started using the primary system software, the electronic device is started using the backup system software, and the primary system software is repaired after startup.

[0052] In actual application, the electronic device may include a small base station, and the radio frequency unit of the small base station is generally set on the roof of an indoor room; wherein, the small base station can be understood as a base station with small transmission power and small coverage radius, which is mainly used to solve hot spot and blind spot coverage problems. The type of electronic device in the embodiment of the present application is not limited, as long as it is an electronic device that can apply the solution of the embodiment of the present application (such as cost-sensitive electronic devices, etc.).

[0053] In actual application, NOR flash memory and NAND flash memory can be set in the electronic device, and different partitioning methods can be used to divide the areas so as to store the backup system software of the electronic device and the main system software of the electronic device.

[0054] Here, the NOR flash memory can store the backup system software that can only be read (can also be understood as a read-only version); wherein, after the electronic device is successfully started, a communication link can be established with a server (such as a background server) to obtain (can also be understood as downloading) the required backup system software and store it.

[0055] For example, Figure 2As shown, assuming that the size of the NOR flash memory is 16MB, by dividing the NOR flash memory, three partitions can be obtained, namely BOOT (size is 1MB), Kernel (size is 5MB) and rootfs (size is 10MB). The divided BOOT, Kernel and rootfs can be called backup areas; among them, BOOT stores the first-stage startup code SPL, the second-stage startup code u-boot, environment variables and device tree files for the electronic device to start BOOT; Kernel stores the kernel image; rootfs stores the root file system, and the root file system stores the application software (which can be expressed as APP in English) for the normal startup of the electronic device; in this case, the backup system software can include application software for the normal startup of the electronic device and boot loader software (that is, the above-mentioned SPL, u-boot, Kernel and rootfs).

[0056] In actual application, the NAND flash memory can store the main system software; wherein, the main system software can be upgraded. For example, Figure 3 As shown, assuming that the size of the NAND flash memory is 128MB, by dividing the NAND flash memory, five partitions can be obtained, namely BOOT (size 1MB), Kernel (size 5MB), rootfs (size 82MB) data (size 20MB) and log (size 20MB). The divided BOOT, Kernel and rootfs can be called the main area; among them, BOOT stores the first-stage boot code SPL, the second-stage boot code u-boot, environment variables and device tree files of the electronic device boot BOOT; Kernel stores the kernel image; rootfs stores the root file system, and the root file system stores the latest version of application software; data stores backup data and system configuration information (such as cell frequency, bandwidth and other configuration information issued by the network management after the system is started, or the backup version of the application software, etc.); log stores log information; in this case, the main system software can include the latest version of application software and boot loader software (that is, the above-mentioned SPL, u-boot, Kernel and rootfs).

[0057] In actual application, during a process of starting the electronic device, the SPL may determine the starting mode of the electronic device, and thus the electronic device is started based on the determined starting mode.

[0058] Based on this, in one embodiment, if Figure 1 As shown, the method may further include:

[0059] Step 100: After the electronic device is powered on, the SPL stored in the NOR flash memory is loaded, and the SPL obtains first information from a first register of the electronic device, where the first information indicates whether the last startup of the electronic device was normal startup or abnormal startup;

[0060] Step 101: When the first information indicates that the last startup of the electronic device was abnormal, load the backup system software.

[0061] In actual application, the first register can be called a startup flag register and can be set in an electrically erasable programmable read-only memory (EEPROM) of the electronic device; that is, the type of the first register can include a non-volatile storage medium.

[0062] In addition, the first information can be understood as a startup flag, and the indication method of the first information can be set as needed. For example, the first information is set to 0xaa to indicate that the last startup of the electronic device was a normal startup, and the first information is set to 0xbb to indicate that the last startup of the electronic device was an abnormal startup. The embodiment of the present application does not limit the indication method of the first information, as long as its function is realized.

[0063] In actual application, after obtaining the first information, when the first information indicates that the last startup of the electronic device was normal, the main system software can be loaded from the NAND flash memory, thereby starting the electronic device using the main system software.

[0064] For example, Figure 3 As shown, when the NAND flash memory contains five partitions, u-boot, Kernel, and root file system can be loaded from the NAND flash memory in sequence. In each of the above loading stages, the first information can be updated so that when the electronic device is started next time, it can be determined whether the last startup was a normal startup. For example, before loading u-boot, SPL sets the first information to 0x11; after completing the loading of u-boot, u-boot sets the first information to 0x22; after completing the loading of Kernel, Kernel sets the first information to 0x33. In this way, the loading of the main system software is realized.

[0065] Here, in the process of loading the main system software, if the electronic device is started from the NAND flash memory, the SPL can record the current startup mode in the second register to load the application software; wherein, the type of the second register includes a non-volatile storage medium, and the second register can be called a startup mode register, which can be set in the EEPROM, and the embodiment of the present application does not limit this.

[0066] Exemplarily, the SPL may record fourth information into the second register, where the fourth information indicates that the electronic device is started from a NAND flash memory.

[0067] In actual application, after loading the root file system stored in the NAND flash memory (it can also be understood as after the root file system is started), the root file system can obtain the fourth information from the second register, and determine that the startup mode of the electronic device this time is NAND flash memory startup based on the fourth information. Then, the root file system can verify the application software file to be started; if the verification is successful, the root file system can update the first information to indicate that the startup of the electronic device this time is a normal startup through the updated first information, and then, the application software stored in the root file system can be loaded. If the verification fails, the first information can be updated to indicate that the startup of the electronic device this time is an abnormal startup through the updated first information. The updated first information can be understood as an abnormal startup flag.

[0068] It should be noted that, if the verification fails, the root file system can repair (also understood as restore) the application software file and verify the repaired application software file again; if the second verification is successful, the root file system can update the first information to indicate that the electronic device is started normally this time through the first information.

[0069] In actual application, when the main system software fails to start the electronic device (for example, an abnormal situation such as reset or freezing occurs), it is possible to switch to the NOR flash memory to load the backup system software from the NOR flash memory; wherein, the reset can be understood as the restart of the board of the electronic device, and the freezing can be understood as the system software hanging. For example, a watchdog can be set to determine whether a freezing occurs. When the watchdog times out, it can be considered that a freezing situation has occurred.

[0070] For example, Figure 2As shown, when the NOR flash memory contains three partitions, u-boot, kernel, and root file system can be loaded from the NOR flash memory in sequence. In each of the above loading stages, the first information can be updated so that when the electronic device is started next time, it can be determined whether the last startup was a normal startup. For example, before loading u-boot, SPL sets the first information to 0x11; after completing the loading of u-boot, u-boot sets the first information to 0x22; after completing the loading of kernel, kernel sets the first information to 0x33. In this way, the loading of the backup system software is realized.

[0071] In addition, in step 101, when the first information indicates that the last startup of the electronic device was abnormal, the backup system software may also be loaded from the NOR flash memory.

[0072] That is to say, if the main system software fails to start the electronic device or the first information indicates that the last startup of the electronic device was abnormal, the backup system software can be loaded from the NOR flash memory and the electronic device can be started using the backup system software; in this case, the SPL can record the current startup method for subsequent loading of application software.

[0073] Based on this, in one embodiment, the method may further include:

[0074] The SPL records the second information into the second register, where the second information indicates that the electronic device is started from the NOR flash memory.

[0075] In actual application, when the electronic device is started using the backup system software, the first information may be updated so that when the electronic device is started next time, it can be determined whether the last startup was a normal startup.

[0076] Based on this, in one embodiment, the method may further include:

[0077] After the electronic device is started up using the backup system software, the updated first information is recorded in the first register, where the updated first information indicates that the current startup of the electronic device is normal.

[0078] In actual application, the updated first information can be understood as a startup success flag. For example, after the loading of the rootfs is completed, the rootfs updates the first information to 0xaa.

[0079] In actual application, after the electronic device is started up using the backup system software, the main system software can be repaired.

[0080] Specifically, in one embodiment, the post-startup repair of the primary system software includes:

[0081] After the file system of the electronic device is started, obtaining the second information from the second register;

[0082] Determining, based on the second information, that the current startup mode of the electronic device is NOR flash memory startup;

[0083] The software that fails to load in the main system software is repaired using the first information, where the first information includes information about the software that fails to load in the main system software.

[0084] In actual application, after the file system of the electronic device is started, the application software stored in the root file system can be loaded, and the application software can obtain the second information from the second register; when it is determined based on the second information that the startup method of the electronic device this time is NOR flash memory startup, the application software can obtain the first information (which can be understood as the unupdated first information) from the first register. In this way, using the first information, the application software can judge the abnormal situation during the last startup, that is, the problem of the software that failed to load in the main system software, thereby repairing the software that failed to load and obtaining the repaired main system software.

[0085] In actual application, after the software repair is completed, the electronic device can be restarted.

[0086] Based on this, in one embodiment, the method may further include:

[0087] Restart the electronic device using the repaired main system software.

[0088] Here, after the software repair is completed, the application software can update the first information, and the updated first information indicates that the electronic device is started normally. In this way, after the electronic device is restarted (which can also be understood as powered on), the SPL can obtain the updated first information from the first register and choose to start the electronic device from the NAND flash memory based on the first information, that is, use the repaired main system software to start the electronic device.

[0089] In actual application, the SPL may also record the abnormal situation when the electronic device was last started, so that the application software can read it later.

[0090] Based on this, in one embodiment, the method may further include:

[0091] The SPL records the third information into the third register, and the third information indicates that the last startup of the electronic device was an abnormal startup; the third information can be read as log information after the electronic device is started by the main system software, and the third register is cleared after the third information is read, and the log information is stored in the NAND flash memory.

[0092] In actual application, the third register includes a non-volatile storage medium. The third register can be called an abnormality flag recording register and can be set in an EEPROM. This embodiment of the present application does not limit this.

[0093] In actual application, after starting the electronic device using the repaired main system software, the application software can read the third information from the third register and store the read information as log information in the NAND flash memory, such as in the log partition.

[0094] The embodiment of the present application provides a method for starting an electronic device, wherein the electronic device includes a NOR flash memory and a NAND flash memory, wherein the NOR flash memory stores backup system software of the electronic device that can only be read, and the NAND flash memory stores main system software of the electronic device, wherein the main system software can be upgraded, and the storage capacity of the NOR flash memory is smaller than the storage capacity of the NAND flash memory; in the case where the main system software fails to be used to start the electronic device, the backup system software is used to start the electronic device, and the main system software is repaired after startup. The technical solution provided by the embodiment of the present application uses a smaller-capacity NOR flash memory to store a read-only version of the backup system software, and uses a larger-capacity NAND flash memory to store the main system software; during the startup process of the electronic device (such as a small base station), if the main system software cannot be used for startup (such as an exception occurs when the main system software is upgraded or a bad block appears in the NAND flash memory), the backup system software can be used to start the electronic device. In the above solution, the system software is backed up through NOR flash memory, which can balance cost and reliability. In addition, when a problem occurs in the main system software, it can be switched to the backup system software in time to start the electronic device, thereby greatly improving the system reliability of the electronic device.

[0095] The present application is described in further detail below with reference to application examples.

[0096] In the application example of the present application, an economical and reliable dual backup solution for the software version of the radio frequency unit of a small base station (i.e., the above-mentioned electronic device) is proposed. Specifically, a smaller-capacity Nor Flash (i.e., the above-mentioned NOR flash memory) is used to store a backup full-set system software version (i.e., the above-mentioned backup system software), which is stored in the Nor Flash as a read-only version; a larger-capacity, lower-cost Nand Flash (i.e., the above-mentioned NAND flash memory) is used to store the main full-set system software version (i.e., the above-mentioned main system software), and the main version in the Nand Flash can be upgraded. Once the main full-set system software version in the Nand Flash has bad blocks due to an upgrade anomaly or the unreliability of the Nand Flash itself, it switches to the backup full-set system software version in the Nor Flash and restarts. After the startup is successful, the main full-set system software version in the Nand Flash is repaired.

[0097] Here, the process of the dual backup solution of the small base station radio unit software version is as follows: Figure 4 As shown, the following steps are included:

[0098] Step 401: The radio frequency unit of the small base station is powered on;

[0099] Step 402: Load SPL from Nor flash;

[0100] Step 403: The SPL determines the startup flag in the EEPROM;

[0101] Here, SPL reads the startup flag (i.e., the first information mentioned above) from the startup flag register (i.e., the first register mentioned above) in the EEPROM; if the startup flag indicates that the last startup was a normal startup, step 404 is executed; if the startup flag indicates that the last startup was an abnormal startup, step 414 is executed.

[0102] For example, if the boot flag is 0xaa, it means that the last boot was a normal boot; if the boot flag is in other ways, it means that the last boot was an abnormal boot; wherein, the boot flag can be read and recorded (i.e., written) by SPL, and can be recorded by u-boot, Kernel, rootfs and application software.

[0103] At the same time, the SPL can record the current startup mode (ie, whether the current startup is from the main area or the backup area) into the partition flag register (ie, the second register mentioned above); wherein, the SPL can record and the application software can read.

[0104] Step 404: SPL loads u-boot from Nand flash;

[0105] Step 405: u-boot loads Kernel from Nand flash;

[0106] Step 406: Kernel loads rootfs from Nand flash;

[0107] Step 407: Set the start flag;

[0108] The set startup flag is used to determine whether the last startup was normal when the system is restarted next time.

[0109] Specifically, before loading u-boot, set the startup flag to 0x11; after loading u-boot, set the startup flag to 0x22; after loading the kernel, set the startup flag to 0x33.

[0110] Step 408: Verify the file;

[0111] In actual application, after the file system is started, if the current startup mode is to boot from Nand Flash, the application software stored in the root file system can be loaded and the application software file can be verified. If the verification is successful, step 412 is executed; if the verification fails, step 409 is executed.

[0112] Step 409: Restore the file;

[0113] Here, the application software file can be repaired to obtain a repaired application software file.

[0114] Step 410: Verify the file;

[0115] In actual application, the repaired application software file may be verified; if the verification succeeds, step 412 is executed; if the verification fails, step 411 is executed.

[0116] Step 411: Setting an abnormal startup flag;

[0117] Among them, the abnormal startup flag (i.e. the third information mentioned above) can be recorded in the abnormal flag recording register (i.e. the third register mentioned above); the application software reads and records it in the log, and then the application software clears the EEPROM flag; wherein, the abnormal startup flag can be read and recorded by the application software.

[0118] Then, the board is reset, that is, step 402 is executed.

[0119] Step 412: Set the startup flag 0xaa;

[0120] Here, the startup flag may be set to 0xaa before the application software is loaded, so as to indicate through the startup flag that this startup is a normal startup.

[0121] Step 413: Load the APP;

[0122] Step 414: Load u-boot from Nor flash;

[0123] Step 415: Load the kernel from the Nor flash;

[0124] Step 416: Load rootfs from Nor flash;

[0125] Step 417: Set the start flag;

[0126] The set startup flag is used to determine whether the last startup was normal when the system is restarted next time.

[0127] Specifically, before loading u-boot, set the startup flag to 0x11; after loading u-boot, set the startup flag to 0x22; after loading the kernel, set the startup flag to 0x33.

[0128] Step 418: System recovery.

[0129] After the file system boots, the application software stored in the root file system is loaded, the abnormal boot flag in the EEPROM is read and recorded, and the EEPROM boot flag is set to 0xaa. Then, based on the abnormal flag recorded during the previous boot, the process determines the stage reached during the previous Nand Flash boot and, therefore, the software version causing the problem, allowing the corresponding software version in the Nand Flash to be repaired. After the repair is complete, the board is restarted, and the SPL can load u-boot from the Nand Flash based on the normal boot flag set.

[0130] It should be noted that, during the process described in steps 401 to 418 above, if an abnormal situation occurs (such as startup failure, power failure, reset or freeze), the Nor flash backup partition can be entered to perform system repair.

[0131] In the application example of this application, when two complete sets of system software versions are stored in two different storage media, by modifying the function of the system's underlying SPL (such as adding support for EEPROM read and write functions), the SPL can determine the loading medium of the subsequent u-boot boot program based on the value of the boot flag register stored in the EEPROM (associated with the previous boot situation), thereby determining whether to load the complete set of system software versions from Nand Flash or from NorFlash. The above solution is more intelligent and more reliable, and can ensure that the small base station radio frequency unit has a complete set of system software versions available in the backup area; at the same time, the above solution performs double backup and protection for all system software involved in the small base station radio frequency unit, further improving system reliability.

[0132] Secondly, registers are set at each step of system software startup loading. Since the registers are stored in EEPROM rather than CPU registers, even if the small base station loses power, the data in the registers will not be lost, further improving reliability. In addition, the data in the registers can indicate the last startup process, which facilitates system maintenance and fault location.

[0133] In order to implement the method of the embodiment of the present application, the embodiment of the present application also provides a startup device of an electronic device, which is set on the electronic device, wherein the electronic device includes a NOR flash memory and a NAND flash memory, wherein the NOR flash memory stores a backup system software of the electronic device that can only be read, and the NAND flash memory stores the main system software of the electronic device, wherein the main system software can be upgraded, and the storage capacity of the NOR flash memory is smaller than the storage capacity of the NAND flash memory, such as Figure 5 As shown, the device includes:

[0134] The starting unit 502 is configured to start the electronic device using the backup system software if starting the electronic device using the primary system software fails, and to repair the primary system software after starting.

[0135] In one embodiment, if Figure 5 As shown, the device further includes: a loading unit 501; wherein,

[0136] The loading unit 501 is used to:

[0137] After the electronic device is powered on, the second-stage program loader SPL stored in the NOR flash memory is loaded, and the SPL obtains first information from the first register of the electronic device, where the first information indicates whether the last startup of the electronic device was normal startup or abnormal startup;

[0138] In a case where the first information indicates that the last startup of the electronic device was abnormal, the backup system software is loaded.

[0139] In one embodiment, the loading unit 501 is further configured to record updated first information into the first register after the electronic device is started using the backup system software, wherein the updated first information indicates that the electronic device is started normally.

[0140] In one embodiment, the loading unit 501 is further configured to record second information into a second register by the SPL, where the second information indicates that the electronic device is started from a NOR flash memory.

[0141] Accordingly, the starting unit 502 is configured to:

[0142] After the file system of the electronic device is started, obtaining the second information from the second register;

[0143] Determining, based on the second information, that the current startup mode of the electronic device is NOR flash memory startup;

[0144] The software that fails to load in the main system software is repaired using the first information, where the first information includes information about the software that fails to load in the main system software.

[0145] In one embodiment, the loading unit 501 is also used to record third information into a third register by the SPL, wherein the third information indicates that the last startup of the electronic device was an abnormal startup; the third information can be read as log information after the electronic device is started by the main system software, and the third register is cleared after the third information is read, and the log information is stored in the NAND flash memory.

[0146] In one embodiment, the startup unit 502 is further configured to restart the electronic device using the repaired main system software.

[0147] In actual application, the loading unit 501 and the starting unit 502 can be implemented by a processor in a starting device of an electronic device.

[0148] It should be noted that the electronic device startup device provided in the above embodiment only uses the division of the above program modules as an example to illustrate when starting the electronic device. In actual application, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the electronic device startup device provided in the above embodiment and the electronic device startup method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0149] Based on the hardware implementation of the above program module, and in order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an electronic device, the electronic device includes a NOR flash memory and a NAND flash memory, the NOR flash memory stores the backup system software of the electronic device that can only be read, the NAND flash memory stores the main system software of the electronic device, the main system software can be upgraded, the storage capacity of the NOR flash memory is smaller than the storage capacity of the NAND flash memory, such as Figure 6 As shown, the electronic device 600 includes:

[0150] Communication interface 601, capable of exchanging information with other devices;

[0151] A processor 602, connected to the communication interface 601 to implement information exchange with other devices, and configured to execute the methods provided by one or more of the above technical solutions when running a computer program;

[0152] The computer program is stored in the memory 603 .

[0153] Specifically, the processor 602 is configured to, if the electronic device fails to be started using the primary system software, start the electronic device using the backup system software, and repair the primary system software after startup.

[0154] In one embodiment, the processor 602 is further configured to:

[0155] After the electronic device is powered on, the second-stage program loader SPL stored in the NOR flash memory is loaded, and the SPL obtains first information from the first register of the electronic device, where the first information indicates whether the last startup of the electronic device was normal startup or abnormal startup;

[0156] In a case where the first information indicates that the last startup of the electronic device was abnormal, the backup system software is loaded.

[0157] In one embodiment, the processor 602 is further configured to:

[0158] After the electronic device is started up using the backup system software, the updated first information is recorded in the first register, where the updated first information indicates that the current startup of the electronic device is normal.

[0159] In one embodiment, the processor 602 is further configured to:

[0160] The SPL records second information into a second register, where the second information indicates that the electronic device is started from a NOR flash memory.

[0161] After the file system of the electronic device is started, obtaining the second information from the second register;

[0162] Determining, based on the second information, that the current startup mode of the electronic device is NOR flash memory startup;

[0163] The software that fails to load in the main system software is repaired using the first information, where the first information includes information about the software that fails to load in the main system software.

[0164] In one embodiment, the processor 602 is further configured to:

[0165] The SPL records the third information into the third register, and the third information indicates that the last startup of the electronic device was an abnormal startup; the third information can be read as log information after the electronic device is started by the main system software, and the third register is cleared after the third information is read, and the log information is stored in the NAND flash memory.

[0166] In one embodiment, the processor 602 is further configured to:

[0167] Restart the electronic device using the repaired main system software.

[0168] It should be noted that the specific processing process of the processor 602 can be understood by referring to the above method.

[0169] Of course, in actual application, the various components in the electronic device 600 are coupled together through the bus system 604. It can be understood that the bus system 604 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 604 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 6 Various buses are labeled as bus system 604 .

[0170] The memory 603 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 600. Examples of such data include: any computer program used to operate on the electronic device 600.

[0171] The methods disclosed in the above embodiments of the present application can be applied to the processor 602 or implemented by the processor 602. The processor 602 may be an integrated circuit chip with signal processing capabilities. During implementation, the steps of the above methods can be completed by hardware integrated logic circuits in the processor 602 or instructions in software form. The above processor 602 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 602 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 603. The processor 602 reads the information in the memory 603 and completes the steps of the above methods in combination with its hardware.

[0172] In an exemplary embodiment, the electronic device 600 can be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.

[0173] It is understood that the memory (memory 603) of the embodiment of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an EEPROM, a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a magnetic disk memory or a magnetic tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronized dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM). The memory described in the embodiments of the present application is intended to include, but is not limited to, these and any other suitable types of memory.

[0174] In an exemplary embodiment, the present application also provides a storage medium, namely, a computer storage medium, specifically a computer-readable storage medium, including, for example, a memory 603 storing a computer program. The computer program can be executed by a processor 602 of an electronic device 600 to perform the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.

[0175] In an exemplary embodiment, the present application further provides a computer program product, including a computer program, which can be executed by the first processor 602 of the electronic device 600 to complete the steps of the aforementioned method.

[0176] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0177] In addition, the technical solutions described in the embodiments of the present application can be arbitrarily combined without conflict.

[0178] The above description is merely a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application.

Claims

1. A method for starting an electronic device, characterized in that: The electronic device includes a NOR flash memory and a NAND flash memory, the NOR flash memory stores backup system software of the electronic device that can only be read, the NAND flash memory stores main system software of the electronic device, the main system software can be upgraded, and the storage capacity of the NOR flash memory is smaller than the storage capacity of the NAND flash memory. The method includes: In the case that the electronic device fails to be started by using the main system software, the electronic device is started by using the backup system software, and the main system software is repaired after starting.

2. The method according to claim 1, characterized in that The method further comprises: After the electronic device is powered on, the second-stage program loader SPL stored in the NOR flash memory is loaded, and the SPL obtains first information from the first register of the electronic device, where the first information indicates whether the last startup of the electronic device was normal startup or abnormal startup; In a case where the first information indicates that the last startup of the electronic device was abnormal, the backup system software is loaded.

3. The method according to claim 2, characterized in that The type of the first register includes a non-volatile storage medium.

4. The method according to claim 2, characterized in that The method further comprises: After the electronic device is started up using the backup system software, the updated first information is recorded in the first register, where the updated first information indicates that the current startup of the electronic device is normal.

5. The method according to claim 2, characterized in that The method further comprises: The SPL records second information into a second register, where the second information indicates that the electronic device is started from a NOR flash memory. The post-startup repair of the main system software includes: After the file system of the electronic device is started, obtaining the second information from the second register; Determining, based on the second information, that the current startup mode of the electronic device is NOR flash memory startup; The software that fails to load in the main system software is repaired using the first information, where the first information includes information about the software that fails to load in the main system software.

6. The method according to claim 5, characterized in that The second register includes a non-volatile storage medium.

7. The method according to claim 2, characterized in that The method further comprises: The SPL records the third information into the third register, and the third information indicates that the last startup of the electronic device was an abnormal startup; the third information can be read as log information after the electronic device is started by the main system software, and the third register is cleared after the third information is read, and the log information is stored in the NAND flash memory.

8. The method according to claim 7, characterized in that The third register includes a non-volatile storage medium.

9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: Restart the electronic device using the repaired main system software.

10. A starting device for an electronic device, characterized in that: The electronic device includes a NOR flash memory and a NAND flash memory, wherein the NOR flash memory stores backup system software of the electronic device that can only be read, and the NAND flash memory stores main system software of the electronic device, wherein the main system software can be upgraded, and the storage capacity of the NOR flash memory is smaller than the storage capacity of the NAND flash memory, including: The startup unit is used to start the electronic device using the backup system software when the main system software fails to start the electronic device, and to repair the main system software after startup.

11. An electronic device, characterized in that: The electronic device includes a NOR flash memory and a NAND flash memory, wherein the NOR flash memory stores backup system software of the electronic device that can only be read, and the NAND flash memory stores main system software of the electronic device, wherein the main system software can be upgraded, and the storage capacity of the NOR flash memory is smaller than that of the NAND flash memory, and includes: a processor and a communication interface; wherein, The processor is configured to, when the electronic device fails to be started using the primary system software, start the electronic device using the backup system software, and repair the primary system software after starting.

12. An electronic device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the steps of the method according to any one of claims 1 to 9.

13. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.