A method, medium, and terminal for reading and upgrading Linux-based NandFlash images.

CN115357275BActive Publication Date: 2026-06-16WILLFAR INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WILLFAR INFORMATION TECH CO LTD
Filing Date
2022-07-11
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

In existing technologies, ARM main control chips suffer from low efficiency when they need to be connected to external NAND Flash to upgrade underlying files and upper-level applications, especially in mass production and when upgrading multiple applications individually, as they cannot efficiently upgrade the underlying kernel and upper-level applications simultaneously.

Method used

By mounting a USB flash drive on the upgraded terminal, the image reading script is automatically run to read the image files of each partition and generate an upgrade script. The script is then run in uboot mode on the terminal to be upgraded using the USB flash drive to write the image files to the corresponding partitions, thus achieving simultaneous upgrades of the underlying kernel and upper-level applications.

🎯Benefits of technology

Without the need for a main control chip programming tool, the underlying kernel and upper-level applications can be upgraded simultaneously, improving the efficiency of mass production and simplifying the upgrade process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115357275B_ABST
    Figure CN115357275B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of computer operating system, and relates to a Linux-based Nand Flash image reading and upgrading method, medium and terminal, which comprises the following steps: mounting a U disk on a terminal with upgraded kernel and application program and automatically running an image reading script in the U disk; the image reading script in the U disk reads Nand Flash partition image files of the terminal with upgraded kernel and application program and stores them in the U disk, and generates an upgrading script; mounting the U disk containing the image files and the upgrading script on a terminal to be upgraded, automatically restarting the terminal to be upgraded and running the upgrading script in uboot mode; and the upgrading script writes the Nand Flash image files stored in the U disk into the Nand Flash of the terminal to be upgraded, thereby completing the upgrading of the terminal to be upgraded. The application does not need to use a burning tool of a master control chip to burn and write the underlying kernel of the terminal to be upgraded, and does not need to separately upgrade the application program and configure the parameters of the terminal to be upgraded, so that the upgrading efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer operating system technology, and in particular relates to a method, medium and terminal for reading and upgrading a Linux-based Nand Flash image. Background Technology

[0002] Currently, there are many ARM main control chips running Linux systems. ARM main control chips need to be connected to external Flash chips to store data such as the underlying kernel image, file system, and applications. Because Nand Flash (a type of Flash memory) has advantages such as large storage capacity and fast read / write speed, it is very suitable for storing large amounts of data. Therefore, ARM main control chips with external Nand Flash are widely used in the electronics field.

[0003] A finished terminal running a Linux system and using Nand Flash typically stores the bootstrap program, uboot, environment variables (env), kernel, file system, and applications in the Nand Flash. Upgrading the terminal requires both burning the kernel and other low-level files, as well as upgrading the upper-level applications. In mass production, a Nand Flash copier is usually used to batch-write empty Nand Flash chips, pre-writing the kernel and other low-level files into the Nand Flash. In actual use, it is often necessary to upgrade the upper-level applications individually, and a terminal may run two or more applications simultaneously. Each application upgrade requires a separate upgrade operation, and upgrading multiple applications requires multiple upgrade operations. Finished terminals may also need to update the underlying kernel. Finished terminals with soldered Nand Flash are not suitable for burning low-level files using a Nand Flash copier. If using the low-level burning tool provided by the ARM controller chip manufacturer, the terminal must be manually put into low-level burning mode before the manufacturer's tool is used for low-level burning. Therefore, whether it's upgrading the application multiple times or using the chip manufacturer's programming tools to upgrade the kernel at the underlying level, there will be a problem of low efficiency during mass production.

[0004] Patent CN103997683B discloses a system and method for implementing a customizable Flash programmer using a set-top box platform. The system includes a CPU, a main control SPI Flash, an infrared receiver, a boot switch control module, a remote control, a TV, and several Flash modules. The main control SPI Flash is electrically connected to the CPU via an SPI bus, and the CPU is electrically connected to the TV via a CVBS module. The main control SPI Flash is electrically connected to the Flash modules, the infrared receiver is electrically connected to the CPU, and the remote control is wirelessly connected to the infrared receiver. The boot switch control module is electrically connected to the CPU. This patent allows for programming different types of Flash and software upgrades by switching the main control Flash. However, it uses a batch programming method for multiple Flash modules of the same type, which results in low efficiency.

[0005] Therefore, how to provide a method that can update and upgrade the underlying kernel and upper-layer applications together to the terminal to be upgraded without batch flashing is a problem that urgently needs to be solved by those in this technical field. Summary of the Invention

[0006] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method for reading and upgrading Linux-based Nand Flash images, thereby solving the problem that existing technologies require batch burning and cannot update and upgrade the underlying kernel and upper-layer applications together to the terminal to be upgraded; in addition, this invention also provides a medium and terminal for reading and upgrading Linux-based Nand Flash images.

[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0008] In a first aspect, the present invention provides a method for reading and upgrading a Linux-based Nand Flash image, comprising the following steps:

[0009] S10. Mount the USB flash drive on the terminal with the upgraded kernel and applications and automatically run the image reading script in the USB flash drive;

[0010] S20. The image reading script in the USB flash drive reads the image files of each partition of the terminal NandFlash of the upgraded kernel and application and stores them in the USB flash drive, while generating an upgrade script.

[0011] S30. Mount the USB flash drive containing the image file and the upgrade script on the terminal to be upgraded. The terminal to be upgraded will automatically restart and run the upgrade script in uboot mode.

[0012] S40. The upgrade script writes the Nand Flash image file stored on the USB flash drive into the Nand Flash of the terminal to be upgraded, thereby completing the upgrade of the terminal to be upgraded.

[0013] Furthermore, step S10 specifically includes the following steps:

[0014] S101, The USB flash drive contains the compiled nanddump, mkfs.ubifs and mkyaffs2image tools, as well as the LCD display program and the Nand Flash image reading script;

[0015] S102. The terminal with the upgraded kernel and application recognizes the hot-plug operation of the USB flash drive through the Linux kernel mdev mechanism, and runs the USB flash drive mounting script with the specified name in the file system to mount the USB flash drive to the path specified in the file system.

[0016] S103. The USB flash drive mounting script searches for and automatically runs the Nand Flash image reading script with the specified name in the USB flash drive at the USB flash drive mounting path.

[0017] S104. The image reading script determines whether there is an upgrade script with a specified name in the USB drive. If the upgrade script does not exist, it means that the USB drive has not performed an image reading operation and the image reading step needs to be executed.

[0018] Furthermore, step S20 specifically includes the following steps:

[0019] S201. The image reading script calls the LCD display program to display a prompt message on the LCD screen indicating that reading the NandFlash image has started.

[0020] S202, The image reading script reads the image files of each partition of the terminal Nand Flash of the upgraded kernel and application according to the system partition situation;

[0021] S203. Calculate the MD5 value of each image file, and then generate an upgrade script that can be executed in U-Boot mode. The upgrade script and the read image files are all stored in the USB flash drive.

[0022] S204. The image reading script calls the LCD display program to display a prompt message on the LCD screen indicating that the image reading is complete.

[0023] Furthermore, step S30 specifically includes the following steps:

[0024] S301. The terminal to be upgraded detects the hot-plugging of the USB flash drive through the Linux kernel mdev mechanism, runs the USB flash drive mounting script in the file system, automatically mounts the USB flash drive, and runs the image reading script in the USB flash drive.

[0025] S302. The image reading script determines whether there is an upgrade script in the USB drive. If there is, it means that the USB drive has already performed an image reading operation and needs to perform an image upgrade operation.

[0026] S303, The image reading script modifies the system startup command bootcmd, changing the startup command to automatically load the upgrade script into system memory and run it when the system starts, and the image reading script operates the reboot command to restart the system;

[0027] S304. Restart the terminal to be upgraded, load the upgrade script from the USB drive into the system memory in uboot mode according to the command set in bootcmd, and run the upgrade script.

[0028] Furthermore, step S40 specifically includes the following steps:

[0029] S401. The upgrade script calls the LCD screen display command that has been added in uboot to display a prompt message indicating that the upgrade has started on the LCD screen;

[0030] S402. The upgrade script verifies the MD5 value of each partition image file. If all image files are verified to be correct, the upgrade operation is performed on the terminal to be upgraded.

[0031] S403. The upgrade script uses NAND-related commands under U-Boot to write the image files to the specified partitions respectively, and displays the upgrade process information on the LCD screen simultaneously. After all image files are successfully written to the NAND flash of the terminal to be upgraded, a prompt message indicating that the upgrade is complete is displayed on the LCD screen.

[0032] Furthermore, in step S202, the partition images such as uboot and kernel that occupy less NandFlash storage are read using nanddump. For file system partitions that occupy more NandFlash storage, the ubi file system image is read using the mkfs.ubifs tool, and the yaffs2 file system image is read using the mkyaffs2image tool.

[0033] Furthermore, in step S403, the terminal is restarted to complete the upgrade operation for the terminal to be upgraded.

[0034] Furthermore, prior to step S10, the underlying kernel and upper-layer application of the upgraded kernel and application terminal have been stored in a designated partition of the Nand Flash.

[0035] In a second aspect, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described above.

[0036] Thirdly, the present invention also provides an electronic terminal, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to cause the terminal to perform the method described above.

[0037] The method, medium, and terminal for reading and upgrading a Linux-based Nand Flash image provided by this invention have at least the following advantages compared with existing technologies:

[0038] This invention reads the image files of each partition of the Nand Flash of the upgraded terminal via a USB flash drive, generates an upgrade script, and writes the read image files to the corresponding partitions of the Nand Flash of the terminal to be upgraded. This completes the update and upgrade of the underlying kernel and upper-layer applications of the terminal to be upgraded. It eliminates the need for the main control chip's programming tool to program the underlying kernel of the terminal to be upgraded, as well as the need for separate application upgrades and parameter configurations, greatly improving efficiency in mass production. Attached Figure Description

[0039] To more clearly illustrate the solution of the present invention, a brief introduction will be given to the drawings used in the description of the embodiments below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0040] Figure 1 A flowchart illustrating a method for reading and upgrading a Linux-based Nand Flash image, provided as an embodiment of the present invention;

[0041] Figure 2 A system partition diagram of an upgraded terminal for a method of reading and upgrading a Linux-based Nand Flash image provided in an embodiment of the present invention;

[0042] Figure 3 This is a flowchart illustrating a method for reading and upgrading a Linux Nand Flash image using a USB flash drive, provided as an embodiment of the present invention. Detailed Implementation

[0043] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.

[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art; the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention.

[0045] This invention provides a method for reading and upgrading NAND Flash images based on Linux, applicable to situations where finished terminals need to update their underlying kernel and upper-layer applications. First, a terminal with an upgraded kernel and all applications is prepared. The upgraded terminal's underlying kernel and upper-layer applications are stored in a designated partition of the NAND Flash. Then... Figure 1 As shown, perform the following steps:

[0046] S10. Mount the USB flash drive on the terminal with the upgraded kernel and applications and automatically run the image reading script in the USB flash drive;

[0047] Specifically, step S10 includes:

[0048] The S101 USB flash drive contains pre-compiled nanddump, mkfs.ubifs, and mkyaffs2image tools, as well as an LCD display program and a Nand Flash image reading script.

[0049] S102. Terminals with upgraded kernels and applications recognize hot-plugging operations of USB flash drives through the Linux kernel mdev mechanism and run the USB flash drive mounting script with the specified name in the file system to mount the USB flash drive to the path specified in the file system.

[0050] S103, USB flash drive mounting script finds and automatically runs the Nand Flash image reading script with the specified name in the USB flash drive at the USB flash drive mounting path;

[0051] S104. The image reading script checks whether an upgrade script with the specified name exists on the USB drive. If the upgrade script does not exist, it means that the USB drive has not performed an image reading operation and the image reading step needs to be executed.

[0052] The image reading script in the S20 USB flash drive reads the image files of each partition of the terminal Nand Flash of the upgraded kernel and application and stores them on the USB flash drive, while generating an upgrade script.

[0053] Specifically, step S20 includes the following steps:

[0054] S201. The image reading script calls the LCD display program and displays a prompt message on the LCD screen indicating that reading the Nand Flash image has begun.

[0055] S202, the image reading script reads the image files of each partition of the terminal NAND Flash of the upgraded kernel and applications according to the system partition situation. It reads the partition images of uboot, kernel and other partitions that occupy less NAND Flash storage through nanddump. For file system partitions that occupy more NAND Flash storage, the ubi file system image can be read through the mkfs.ubifs tool and the yaffs2 file system image can be read through the mkyaffs2image tool.

[0056] The S203 Nand Flash image reading script reads the image files of all partitions in the terminal with the upgraded kernel and applications, calculates the MD5 value of each image file, and then generates an upgrade script that can be executed in uboot mode. The upgrade script and the read image files are all stored on the USB flash drive.

[0057] S204. The image reading script calls the LCD display program and displays a message indicating that the image reading is complete on the LCD screen.

[0058] S30. Mount a USB flash drive containing the image file and upgrade script to the terminal to be upgraded. The terminal to be upgraded will automatically restart and run the upgrade script in uboot mode.

[0059] Specifically, step S30 includes the following steps:

[0060] S301 The terminal to be upgraded detects the hot-plugging of the USB flash drive through the Linux kernel mdev mechanism, runs the USB flash drive mounting script in the file system, automatically mounts the USB flash drive and runs the image reading script in the USB flash drive;

[0061] S302. The image reading script determines whether an upgrade script exists on the USB drive. If it does, it means that the USB drive has already undergone an image reading operation and an image upgrade operation is required.

[0062] S303: The image reading script modifies the system startup command bootcmd, changing the startup command to automatically load the upgrade script into system memory and run it when the system starts. The image reading script then uses the reboot command to restart the system.

[0063] S304. The terminal to be upgraded restarts. According to the commands set in bootcmd, the upgrade script in the USB flash drive is loaded into the system memory in uboot mode and the upgrade script is run.

[0064] S40. The upgrade script writes the Nand Flash image file stored on the USB flash drive into the Nand Flash of the terminal to be upgraded, thereby completing the upgrade of the terminal to be upgraded.

[0065] Specifically, step S40 includes the following steps:

[0066] S401: The upgrade script calls the LCD screen display command already added in uboot to display a prompt message that the upgrade has started on the LCD screen;

[0067] S402: The upgrade script verifies the MD5 value of each partition image file. If all image files are verified to be correct, the upgrade operation is performed on the terminal to be upgraded.

[0068] S403 The upgrade script uses NAND-related commands under uboot to write the image files to the specified partitions and displays the upgrade process information on the LCD screen. After all image files are successfully written to the NAND flash of the terminal to be upgraded, the LCD screen displays a message indicating that the upgrade is complete, and the terminal is restarted to complete the upgrade operation.

[0069] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0070] For a terminal using NAND Flash and running a Linux system, its system partitions typically include the bootstrap, uboot, environment variables (env), kernel, root filesystem, and application partitions, such as... Figure 2 As shown, in uboot mode, the mtdparts command can display all system partitions. In fact, all these partition image files are stored in Nand Flash. To read the image file of the upgraded terminal's Nand Flash using a USB flash drive, you need to use the corresponding Nand Flash image reading tool to read the image file of each partition separately, depending on the actual partition situation and file system type.

[0071] To read the Nand Flash image file of a terminal with an upgraded kernel and applications using a USB flash drive, you need to store the relevant Nand Flash image reading tools on the USB flash drive and write an image reading script. The flowchart of the image reading script is as follows: Figure 3As shown, the USB drive storing the image reading script can be used to read the Nand Flash image file of the upgraded terminal and also to perform upgrade operations on the terminal to be upgraded. Both the upgraded and the terminal to be upgraded use the same USB drive to perform image reading and upgrade functions. Both the upgraded and the terminal to be upgraded recognize the hot-plugging operation of the USB drive through Linux's mdev mechanism. The USB drive is mounted using the file system's USB drive mounting script, and the image reading script on the USB drive is run. The image reading script on the USB drive checks if the upgrade script exists. If the upgrade script does not exist, it means that the upgraded terminal's Nand Flash image file has not yet been read from the USB drive, and the image reading operation needs to be performed on the upgraded terminal. If the upgrade script exists on the USB drive, it means that the USB drive has read the upgraded terminal's Nand Flash image file, and the image upgrade operation can be performed on the terminal to be upgraded.

[0072] When reading Nand Flash images, for partitions like bootstrap, uboot, and kernel that occupy relatively little Nand Flash storage space, the nanddump tool can be used directly to read the relevant images. For partitions like the root file system and application partitions that occupy more Nand Flash storage space, the nanddump tool takes a long time to read the images, which will affect the efficiency of image reading. Depending on the file system type used by the root file system and application partition, the mkfs.ubi tool can be used to read the UBI file system image, and the mkyaffs2image tool can be used to read the YAFFS2 file system image, generating the MD5 value of each partition image and the upgrade script. The entire image reading process will be displayed in real time on the LCD screen, allowing users to clearly understand the progress of image reading.

[0073] When performing an upgrade operation on the terminal, the image reading script detects the existence of the upgrade script on the USB drive. The image reading script sets the system boot command to bootcmd, restarts the terminal, and automatically runs the upgrade script in uboot mode during system startup. The upgrade script first performs MD5 value verification on the image files of each partition. After verification, the upgrade operation begins in uboot mode. The upgrade script uses the fatload command under uboot to load the image files from the USB drive into the system memory, and then uses the NAND-related commands under uboot to write the image file data loaded into memory into the NAND Flash. During the writing process, bad blocks in the NAND flash are skipped, and the ECC check value is calculated and stored in the OOB area of ​​the NAND Flash. After all image files are written, the terminal restarts to complete the upgrade operation. The entire upgrade process is also displayed in real time on the LCD screen, allowing the user to clearly understand the progress of the image upgrade.

[0074] This invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods in this embodiment.

[0075] This invention also provides an electronic terminal, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal performs any of the methods in this embodiment.

[0076] As will be understood by those skilled in the art, the computer-readable storage medium described in this embodiment allows for the implementation of all or part of the steps in the above method embodiments by computer program-related hardware. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0077] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication between them. The memory is used to store computer programs, the communication interface is used to perform communication, and the processor and the transceiver are used to run the computer programs, so that the electronic terminal performs the steps of the above method.

[0078] The method, medium, and terminal for reading and upgrading Linux-based Nand Flash images described in the above embodiments read the image files of each partition of the upgraded terminal's Nand Flash via a USB flash drive, generate an upgrade script, and write the read image files to the corresponding partitions of the Nand Flash of the terminal to be upgraded. This completes the update and upgrade of the underlying kernel and upper-layer applications of the terminal to be upgraded. It eliminates the need for a main control chip burning tool to burn the underlying kernel of the terminal to be upgraded, and also eliminates the need for separate application upgrades and parameter configurations for the terminal to be upgraded, greatly improving efficiency in mass production.

[0079] Obviously, the embodiments described above are merely preferred embodiments of the present invention, and not all embodiments. The accompanying drawings illustrate preferred embodiments of the present invention, but do not limit the scope of the patent. The present invention can be implemented in many different forms; rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this invention.

Claims

1. A method for reading and upgrading a Linux-based NAND Flash image, characterized in that, Includes the following steps: S10. Mount the USB flash drive on the terminal with the upgraded kernel and applications and automatically run the image reading script in the USB flash drive; Step S10 specifically includes the following steps: S101, The USB flash drive contains the compiled nanddump, mkfs.ubifs and mkyaffs2image tools, as well as the LCD display program and the Nand Flash image reading script; S102. The terminal with the upgraded kernel and application recognizes the hot-plug operation of the USB flash drive through the Linux kernel mdev mechanism, and runs the USB flash drive mounting script with the specified name in the file system to mount the USB flash drive to the path specified in the file system. S103. The USB flash drive mounting script searches for and automatically runs the NandFlash image reading script with the specified name in the USB flash drive at the USB flash drive mounting path. S104. The image reading script determines whether there is an upgrade script with a specified name in the USB drive. If the upgrade script does not exist, it means that the USB drive has not performed an image reading operation and the image reading step needs to be performed. S20. The image reading script in the USB flash drive reads the image files of each partition of the terminal Nand Flash of the upgraded kernel and application and stores them in the USB flash drive, while generating an upgrade script. Step S20 specifically includes the following steps: S201. The image reading script calls the LCD display program to display a prompt message on the LCD screen indicating that reading the Nand Flash image has started. S202, The image reading script reads the image files of each partition of the terminal Nand Flash of the upgraded kernel and application according to the system partition situation; S203. Calculate the MD5 value of each image file, and then generate an upgrade script that can be executed in U-Boot mode. The upgrade script and the read image files are all stored in the USB flash drive. S204. The image reading script calls the LCD display program to display a prompt message on the LCD screen indicating that the image reading is complete. S30. Mount the USB flash drive containing the image file and the upgrade script on the terminal to be upgraded. The terminal to be upgraded will automatically restart and run the upgrade script in uboot mode. Step S30 specifically includes the following steps: S301. The terminal to be upgraded detects the hot-plugging of the USB flash drive through the Linux kernel mdev mechanism, runs the USB flash drive mounting script in the file system, automatically mounts the USB flash drive, and runs the image reading script in the USB flash drive. S302. The image reading script determines whether there is an upgrade script in the USB drive. If there is, it means that the USB drive has already performed an image reading operation and needs to perform an image upgrade operation. S303, The image reading script modifies the system startup command bootcmd, changing the startup command to automatically load the upgrade script into system memory and run it when the system starts, and the image reading script operates the reboot command to restart the system; S304. Restart the terminal to be upgraded, load the upgrade script in the USB drive into the system memory in uboot mode according to the command set in bootcmd, and run the upgrade script. S40. The upgrade script writes the Nand Flash image file stored on the USB flash drive into the Nand Flash of the terminal to be upgraded, thereby completing the upgrade of the terminal to be upgraded.

2. The method for reading and upgrading a Linux-based Nand Flash image according to claim 1, characterized in that, Step S40 specifically includes the following steps: S401. The upgrade script calls the LCD screen display command that has been added in uboot to display a prompt message indicating that the upgrade has started on the LCD screen; S402. The upgrade script verifies the MD5 value of each partition image file. If all image files are verified to be correct, the upgrade operation is performed on the terminal to be upgraded. S403. The upgrade script uses NAND-related commands under U-Boot to write the image files to the specified partitions respectively, and displays the upgrade process information on the LCD screen simultaneously. After all image files are successfully written to the NAND flash of the terminal to be upgraded, a prompt message indicating that the upgrade is complete is displayed on the LCD screen.

3. The method for reading and upgrading a Linux-based Nand Flash image according to claim 1, characterized in that, In step S202, the partition images of uboot and kernel are read using nanddump. For file system partitions, the ubi file system image is read using the mkfs.ubifs tool, and the yaffs2 file system image is read using the mkyaffs2image tool.

4. The method for reading and upgrading a Linux-based Nand Flash image according to claim 2, characterized in that, In step S403, the terminal is restarted to complete the upgrade operation for the terminal to be upgraded.

5. The method for reading and upgrading a Linux-based Nand Flash image according to claim 1, characterized in that, Prior to step S10, the underlying kernel and upper-layer application of the upgraded kernel and application terminal have been stored in a designated partition of the Nand Flash.

6. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 5.

7. An electronic terminal, characterized in that, include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to cause the terminal to perform the method as described in any one of claims 1 to 5.