A router and image self-upgrade method

By setting the first and second storage areas in the memory chip of the router, and using the factory image command to write the factory image into the primary and backup partitions, the problem of cumbersome and inconsistent image upgrades in the existing technology is solved, and a simplified and safe Image upgrade process.

CN113721943BActive Publication Date: 2024-10-22NAZHEN TECHNOLOGY (SINGAPORE) PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111032392.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-03
Publication Date
2024-10-22
Estimated Expiration
2041-09-03

AI Technical Summary

Technical Problem

The image upgrade process of existing routers is cumbersome and requires downloading the factory image file from the PC, resulting in long waiting times and inconsistent primary and secondary partition images, which poses certain risks.

Method used

A router and image self-upgrade method is designed. By setting the first storage area and the second storage area in the memory chip, data is read from the first storage area at startup, and after receiving the use factory image command, data is read from the second storage area. The factory image is read from the second storage area and written into the first storage area to achieve consistency of the primary and backup partition images.

Benefits of technology

It simplifies the image upgrade process, saves the time of downloading the image remotely, improves security, and ensures the consistency of the primary and secondary partition images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113721943B_ABST
    Figure CN113721943B_ABST
Patent Text Reader

Abstract

In the router and image self-upgrade method provided by the present application, the router includes a storage chip and a controller, the storage chip includes a first storage area and a second storage area, the factory image is stored in the second storage area, and the controller is configured to: after receiving a command to use the factory image, respond to the command to use the factory image, then read the factory image from the second storage area according to the command to use the factory image self-upgrade, and write the read factory image into the first storage area, so that the factory image is stored in both the first storage area and the second storage area, so that the images of the two storage units are consistent, and there is no need to download the factory image file from the PC side, only the command to use the factory image needs to be executed, so the router and image self-upgrade process provided by the present application are simplified, and image consistency is achieved, thereby optimizing the image upgrade process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of router production, and in particular to a router and a mirroring self-upgrade method. Background Art

[0002] When routers and other devices are produced, the images burned into the chip include the production test image and the factory image. The production test image is run during the production process. At the end of the production process, the production test image needs to be upgraded to the factory image.

[0003] In actual production, the production test image is stored in the nand flash memory, which includes each primary partition and each backup partition. When burning the chip, each primary partition and each backup partition contain the production test image. The process of using web upgrade in the prior art is as follows: Figure 3 and Figure 4 As shown, the web upgrade process includes Figure 3-4 Open the management page, open the upgrade page, select the upgrade file and download it respectively; that is, when upgrading the image through the web, you need to download the factory image file from the PC. After the factory image file is downloaded, since a single web upgrade can only upgrade each backup partition first, after the web upgrade, each backup partition is upgraded to the factory image, while each primary partition is still the production test image.

[0004] From the above, it can be seen that the existing web upgrade steps are cumbersome and require downloading the factory image file from the PC, which takes a long time to wait for the download. In addition, after the web upgrade, each backup partition is upgraded to the factory image, while each primary partition is still the production test image, resulting in inconsistency between the primary and backup partition images, which poses certain risks. Summary of the invention

[0005] The embodiments of the present application provide a router and an image self-upgrade method to solve the problems that occur in the existing web upgrade process and optimize the image upgrade process.

[0006] In a first aspect, an embodiment of the present application provides a router, including:

[0007] A storage chip, comprising a first storage area and a second storage area, wherein the first storage area is a source of data read when the router is in a startup state, and the second storage area is used to store a factory image;

[0008] The controller is configured as:

[0009] A factory image use command is received, and then in response to the factory image use command, the factory image is read from the second storage area according to the factory image use command, and then the read factory image is written into the first storage area.

[0010] In a second aspect, an embodiment of the present application provides a mirror self-upgrade method, including:

[0011] Receive the command to use the factory image;

[0012] In response to the use factory image command, executing the use factory image command;

[0013] The factory image in the second storage area is read according to the use factory image command, and then the read factory image is written into the first storage area.

[0014] Beneficial effect: It can be seen from the above scheme that in the router and image self-upgrade method provided by the present application, the router includes a storage chip and a controller, the storage chip includes a first storage area and a second storage area, the factory image is stored in the second storage area, and the router reads data from the first storage area when it starts, and the controller is configured to: after receiving the use factory image command, respond to the self-upgrade command, and then read the factory image from the second storage area according to the self-upgrade command, and write the read factory image to the first storage area, so that the factory image is stored in the first storage area and the second storage area, so that the image consistency of the two storage units is achieved, thereby increasing security, and there is no need to download the factory image file from the PC side, only the use factory image command needs to be executed, so the router and image self-upgrade process provided by the present application is simplified, and image consistency is achieved, thereby optimizing the image upgrade process. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0016] Figure 1 A schematic diagram of a router structure according to some embodiments is exemplarily shown in FIG.

[0017] Figure 2 exemplarily shows a schematic diagram of the contents of a preset self-upgrade command according to some embodiments;

[0018] Figure 3 A schematic diagram showing an existing web upgrade process is shown as an example;

[0019] Figure 4 The following is a schematic diagram showing an exemplary process of an existing web upgrade. DETAILED DESCRIPTION

[0020] To facilitate the technical solution of the application, some concepts involved in the application are first explained below.

[0021] The production process of routers and other equipment is as follows: SMT placement machines mount PCBs; large components are installed manually; the outer shell is assembled and MAC addresses, SNs and other information are written.

[0022] Since the MAC address, SN and other information are unique, they need to be specified for each device separately, so the information needs to be written during production. Normally, UART is used to communicate between ONU and router devices and PCs, but during the production information writing stage, the device has been assembled and cannot be connected through the UART pins, so telnet remote login is required for operation.

[0023] For system security reasons, some operators do not allow the Telnet application to be carried in ONU and router devices when they leave the factory. At the same time, the file system of the device is read-only, and the Telnet in the running image cannot be deleted. Therefore, it is necessary to upgrade the "factory image" to the device through the web after the device is produced.

[0024] Web upgrades require multiple steps such as opening a web page, finding the upgrade window, and selecting upgrade files. Web upgrades also require obtaining images from the PC, which results in slow download speeds and greatly affects production efficiency. After web upgrades, each backup partition is upgraded to a factory image, while each primary partition is still a production test image, resulting in inconsistencies in the primary and backup partition images, which poses certain risks.

[0025] To this end, the present application provides a router and image self-upgrade method to solve the problems that occur in the existing web upgrade process, optimize the image upgrade process, and improve the security of image upgrade.

[0026] The images of devices such as routers, such as production test images, are stored in the nand flash memory. When the device starts, the image in the nand flash is read into the DDR memory for execution. Therefore, after the system starts, the image stored in the nand flash can be rewritten without affecting the system operation.

[0027] The nand flash partitions of routers and other devices include boot partition, environment variable primary and backup partition, kernel primary partition, kernel backup partition, file system primary partition, file system backup partition and user data area. Among them, the boot partition, kernel primary partition, kernel backup partition, file system primary partition and file system backup partition are read-only partitions, while the environment variable partition and user data area are read-write partitions.

[0028] The boot partition is used to store the BootLoader boot program, the environment variable partition is used to store the kernel startup parameters, the kernel primary partition and kernel backup partition are used to store the kernel image, the system primary partition and file system backup partition are used to store system files such as applications and startup scripts, and the user data area is used to store production test information (MAC address, SN, etc.) and files that need to be saved after the system is started.

[0029] The following is combined with Figure 1 and attached Figure 2 The router and mirror self-upgrade method provided in this application are specifically described.

[0030] The router provided in the embodiment of the present application includes a storage chip, which may be a NAND flash memory or other forms of memory. The storage chip includes a first storage area and a second storage area. The first storage area includes the above-mentioned primary partitions, such as a kernel primary partition, a file system primary partition, and other primary partitions; the second storage area includes the above-mentioned backup partitions, such as a kernel backup partition, a file system backup partition, and other backup partitions.

[0031] In an embodiment of the present application, the first storage area is the source of the image data read when the router is started, that is, the corresponding image data is read from the first storage area, and the corresponding image data is not read from the second storage area; the second storage area is used to store the factory image, and the first storage area is used to store the production test image.

[0032] Before receiving the command to use the factory image, reading the production test image from the first storage area into the corresponding memory of the controller;

[0033] After receiving and executing the use factory image command, the factory image is read from the first storage area into the corresponding memory of the controller.

[0034] In the embodiment of the present application, the image packaging of the present application includes both the "production test image" and the "factory image", splits the production test image into blocks, and stores them in the primary partitions of the first storage area respectively; splits the factory image into blocks, and stores them in the backup partitions of the second storage area respectively; the present application uses a packaging tool to package the two sets of images according to the positions of the primary and backup partitions.

[0035] The router provided in the embodiment of the present application also includes a controller, and a third storage area is provided in the controller. After the production of the router and other equipment is completed, the technician inputs a factory image command into the controller system, presets a self-upgrade command, and stores the factory image command in the third storage area.

[0036] In some embodiments, the use of the factory image command is a general concept, which can be an upgrade command for upgrading the production test image to the factory image when leaving the factory, or a command for restoring the factory settings when the user has used it for a period of time after leaving the factory, or other forms of commands that require the use of the factory image.

[0037] In the embodiment of the present application, the exec cover command will be defined using the factory image command.

[0038] In this application system, the factory image command exec cover is added. The specific content of the exec cover command is as follows: Figure 2 shown.

[0039] The exec cover command is a general concept. In the embodiment of the present application, the exec cover command is used as an example to upgrade the production test image to the factory image as an upgrade command for specific description.

[0040] In some embodiments, after receiving the exec cover command, reading the factory image from the second storage area;

[0041] Erasing the production test image stored in the first storage area;

[0042] The read factory image is written into the first storage area.

[0043] In some embodiments, after receiving the exec cover command, reading the corresponding blocks of the factory image from the backup partitions according to the preset self-upgrade command;

[0044] Assembling the blocks of the factory image corresponding to each backup partition into a complete factory image;

[0045] Erasing all blocks of the production test image stored in each primary partition;

[0046] The read complete factory image is written into each primary partition.

[0047] In some embodiments, after receiving the exec cover command, the blocks of the factory image in the backup partitions such as the kernel backup partition and the file system backup partition are read according to the exec cover command, and the blocks of the factory image read by the image jackpot are pieced together to form a complete factory image. Then, the blocks of the production test image stored in the main partitions such as the kernel main partition and the file system main partition are erased, and the read complete factory image is written into the main partitions such as the kernel main partition and the file system main partition.

[0048] In some embodiments, after receiving the exec cover command, all blocks of the production test image stored in the main partitions such as the kernel main partition and the file system main partition are erased according to the exec cover command, and then the blocks of the factory image in the backup partitions such as the kernel backup partition and the file system backup partition are read, and the blocks of the factory image read by the image jackpot are pieced together to complete the factory image, and the read completed factory image is written into the main partitions such as the kernel main partition and the file system main partition.

[0049] From the above, it can be seen that the image packaging of this application includes both the production test image and the factory image. When performing the upgrade, you only need to read the factory image from the backup partition to overwrite the primary partition, without having to obtain the image from a remote location.

[0050] When the main chip is burned in this application, the primary partition of the file system stores the production test image, and the backup partition stores the factory image. When the exec cover command is executed, the backup partition image is read out, written into the current running partition and restarted.

[0051] The self-upgrade solution of this application is simple to operate. You only need to execute one upgrade command, and it saves the time of remote downloading images. It is more convenient and faster than web upgrades. Secondly, after the upgrade is completed, the primary and backup partitions are both "factory images", which is safer.

[0052] When receiving a command to use a factory image, specifically when the command to use the factory image is a self-upgrade command, the present application responds to the self-upgrade command, then reads the factory image from the second storage area according to the self-upgrade command, and writes the read factory image to the first storage area. Therefore, the factory image is stored in both the first storage area and the second storage area, achieving image consistency between the two storage units, and there is no need to download the factory image file from the PC side, only the preset self-upgrade command needs to be executed. Therefore, the router and image self-upgrade process provided by the present application are simplified, and image consistency is achieved, thereby optimizing the image upgrade process.

[0053] It can be understood that when the factory image command is used to upgrade the production test image to the factory image as an upgrade command, the above-mentioned factory image self-upgrade function can be realized, and when the factory image command is used as other forms of commands, the corresponding function can be realized.

[0054] Corresponding to the above-mentioned router embodiment, the present application also provides an embodiment of a mirror self-upgrade method.

[0055] In the embodiment of the present application, the image packaging of the present application includes both the "production test image" and the "factory image", splits the production test image into blocks, and stores them in the primary partitions of the first storage area respectively; splits the factory image into blocks, and stores them in the backup partitions of the second storage area respectively; the present application uses a packaging tool to package the two sets of images according to the positions of the primary and backup partitions.

[0056] The router provided in the embodiment of the present application also includes a controller, and a third storage area is provided in the controller. After the production of the router and other equipment is completed, the technician inputs a factory image command into the controller system, presets a self-upgrade command, and stores the factory image command in the third storage area.

[0057] In some embodiments, the use of the factory image command is a general concept, which can be an upgrade command for upgrading the production test image to the factory image when leaving the factory, or a command for restoring the factory settings when the user has used it for a period of time after leaving the factory, or other forms of commands that require the use of the factory image.

[0058] In the embodiment of the present application, the exec cover command will be defined using the factory image command.

[0059] The exec cover command is a general concept. In the embodiment of the present application, the exec cover command is used as an example to upgrade the production test image to the factory image as an upgrade command for specific description.

[0060] In this application system, the factory image command exec cover is added. The specific content of the exec cover command is as follows: Figure 2 shown.

[0061] In some embodiments, after receiving the exec cover command, reading the factory image from the second storage area;

[0062] Erasing the production test image stored in the first storage area;

[0063] The read factory image is written into the first storage area.

[0064] In some embodiments, after receiving the exec cover command, reading the corresponding blocks of the factory image from the backup partitions according to the preset self-upgrade command;

[0065] Assembling the blocks of the factory image corresponding to each backup partition into a complete factory image;

[0066] Erasing all blocks of the production test image stored in each primary partition;

[0067] The read complete factory image is written into each primary partition.

[0068] In some embodiments, after receiving the exec cover command, the blocks of the factory image in the backup partitions such as the kernel backup partition and the file system backup partition are read according to the exec cover command, and the blocks of the factory image read by the image jackpot are pieced together to form a complete factory image. Then, the blocks of the production test image stored in the main partitions such as the kernel main partition and the file system main partition are erased, and the read complete factory image is written into the main partitions such as the kernel main partition and the file system main partition.

[0069] In some embodiments, after receiving the exec cover command, all blocks of the production test image stored in the main partitions such as the kernel main partition and the file system main partition are erased according to the exec cover command, and then the blocks of the factory image in the backup partitions such as the kernel backup partition and the file system backup partition are read, and the blocks of the factory image read by the image jackpot are pieced together to complete the factory image, and the read completed factory image is written into the main partitions such as the kernel main partition and the file system main partition.

[0070] From the above, it can be seen that the image packaging of this application includes both the production test image and the factory image. When performing the upgrade, you only need to read the factory image from the backup partition to overwrite the primary partition, without having to obtain the image from a remote location.

[0071] When the main chip is burned in this application, the primary partition of the file system stores the production test image, and the backup partition stores the factory image. When the exec cover command is executed, the backup partition image is read out, written into the current running partition and restarted.

[0072] The self-upgrade solution of this application is simple to operate. You only need to execute one upgrade command, and it saves the time of remote downloading images. It is more convenient and faster than web upgrades. Secondly, after the upgrade is completed, the primary and backup partitions are both "factory images", which is safer.

[0073] When receiving a command to use a factory image, specifically when the command to use the factory image is a self-upgrade command, the present application responds to the self-upgrade command, then reads the factory image from the second storage area according to the self-upgrade command, and writes the read factory image to the first storage area. Therefore, the factory image is stored in both the first storage area and the second storage area, achieving image consistency between the two storage units, and there is no need to download the factory image file from the PC side, only the preset self-upgrade command needs to be executed. Therefore, the router and image self-upgrade process provided by the present application are simplified, and image consistency is achieved, thereby optimizing the image upgrade process.

[0074] It can be understood that when the factory image command is used to upgrade the production test image to the factory image as an upgrade command, the above-mentioned factory image self-upgrade function can be realized, and when the factory image command is used as other forms of commands, the corresponding function can be realized.

[0075] The solution provided in this application can also be used for devices such as optical modems. Similar to routers, images of devices such as optical modems, such as production test images, are stored in the NAND flash memory. When the device starts, the image in the NAND flash will be read into the DDR memory for execution. Therefore, after the system starts, the image stored in the NAND flash can be rewritten without affecting the system operation.

[0076] The NAND flash partitions of optical modems include boot partition, environment variable primary and backup partitions, kernel primary partition, kernel backup partition, file system primary partition, file system backup partition and user data area. Among them, the boot partition, kernel primary partition, kernel backup partition, file system primary partition and file system backup partition are read-only partitions, while the environment variable partition and user data area are read-write partitions.

[0077] The boot partition is used to store the BootLoader boot program, the environment variable partition is used to store the kernel startup parameters, the kernel primary partition and kernel backup partition are used to store the kernel image, the system primary partition and file system backup partition are used to store system files such as applications and startup scripts, and the user data area is used to store production test information (MAC address, SN, etc.) and files that need to be saved after the system is started.

[0078] The optical modem provided in the embodiment of the present application also includes a controller, which has a third storage area. After the production of the optical modem and other equipment is completed, the technician inputs a factory image command and a preset self-upgrade command into the controller system, and the factory image command is stored in the third storage area.

[0079] In some embodiments, the use of the factory image command is a general concept, which can be an upgrade command for upgrading the production test image to the factory image when leaving the factory, or a command for restoring the factory settings when the user has used it for a period of time after leaving the factory, or other forms of commands that require the use of the factory image.

[0080] In the embodiment of the present application, the exec cover command will be defined using the factory image command.

[0081] The exec cover command is a general concept. In the embodiment of the present application, the exec cover command is used as an example to upgrade the production test image to the factory image as an upgrade command for specific description.

[0082] In this application system, the factory image command exec cover is added. The specific content of the exec cover command is as follows: Figure 2 shown.

[0083] In some embodiments, after receiving the exec cover command, reading the factory image from the second storage area;

[0084] Erasing the production test image stored in the first storage area;

[0085] The read factory image is written into the first storage area.

[0086] In some embodiments, after receiving the exec cover command, reading the corresponding blocks of the factory image from the backup partitions according to the preset self-upgrade command;

[0087] Assembling the blocks of the factory image corresponding to each backup partition into a complete factory image;

[0088] Erasing all blocks of the production test image stored in each primary partition;

[0089] The read complete factory image is written into each primary partition.

[0090] In some embodiments, after receiving the exec cover command, the blocks of the factory image in the backup partitions such as the kernel backup partition and the file system backup partition are read according to the exec cover command, and the blocks of the factory image read by the image jackpot are pieced together to form a complete factory image. Then, the blocks of the production test image stored in the main partitions such as the kernel main partition and the file system main partition are erased, and the read complete factory image is written into the main partitions such as the kernel main partition and the file system main partition.

[0091] In some embodiments, after receiving the exec cover command, all blocks of the production test image stored in the main partitions such as the kernel main partition and the file system main partition are erased according to the exec cover command, and then the blocks of the factory image in the backup partitions such as the kernel backup partition and the file system backup partition are read, and the blocks of the factory image read by the image jackpot are pieced together to complete the factory image, and the read completed factory image is written into the main partitions such as the kernel main partition and the file system main partition.

[0092] From the above, it can be seen that the image packaging of this application includes both the production test image and the factory image. When performing the upgrade, you only need to read the factory image from the backup partition to overwrite the primary partition, without having to obtain the image from a remote location.

[0093] When the main chip is burned in this application, the primary partition of the file system stores the production test image, and the backup partition stores the factory image. When the exec cover command is executed, the backup partition image is read out, written into the current running partition and restarted.

[0094] The self-upgrade solution of this application is simple to operate. You only need to execute one upgrade command, and it saves the time of remote downloading images. It is more convenient and faster than web upgrades. Secondly, after the upgrade is completed, the primary and backup partitions are both "factory images", which is safer.

[0095] Upon receiving a command to use a factory image, specifically when the command to use the factory image is a self-upgrade command, the present application responds to the self-upgrade command, then reads the factory image from the second storage area according to the self-upgrade command, and writes the read factory image into the first storage area. Therefore, the factory image is stored in both the first storage area and the second storage area, thereby achieving image consistency between the two storage units, and there is no need to download the factory image file from the PC side, only the execution of the preset self-upgrade command. Therefore, the optical modem and image self-upgrade process provided by the present application are simplified, and image consistency is achieved, thereby optimizing the image upgrade process.

[0096] It can be understood that when the factory image command is used to upgrade the production test image to the factory image as an upgrade command, the above-mentioned factory image self-upgrade function can be realized, and when the factory image command is used as other forms of commands, the corresponding function can be realized.

[0097] In summary, this application is applicable to devices such as routers and optical modems. The production test image and the factory image are simultaneously embedded through image packaging. When performing an upgrade, you only need to read the factory image from the backup partition to overwrite the primary partition, without the need to obtain the image remotely.

[0098] When the main chip is burned in this application, the primary partition of the file system stores the production test image, and the backup partition stores the factory image. When the exec cover command is executed, the backup partition image is read out, written into the current running partition and restarted.

[0099] The self-upgrade solution of this application is simple to operate. You only need to execute one upgrade command, and it saves the time of remote downloading images. It is more convenient and faster than web upgrade. Secondly, after the upgrade is completed, the primary and backup partitions are both factory images, which is safer.

[0100] Finally, it should be noted that: this embodiment is described in a progressive manner, and different parts can refer to each other; in addition, the above embodiments are only used to illustrate the technical solution of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that: it is still possible to modify the technical solutions recorded in the aforementioned embodiments, or to replace some of the technical features therein with equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A router, It is characterized in that include: A storage chip, comprising a first storage area and a second storage area, wherein the first storage area is a source of image data read when the router is started, the first storage area is used to store a production test image, and the second storage area is used to store a factory image, the production test image and the factory image are packaged at the same time, wherein the image data is read from the first storage area when the router is started, and the image data is not read from the second storage area; The controller is configured as: Before receiving the command to use the factory image, reading the production test image from the first storage area; receiving the use factory image command, where the use factory image command is used to instruct to upgrade the production test image to the factory image; In response to the use factory image command, the production test image in the first storage area is erased, and the factory image is read from the second storage area according to the use factory image command, and then the read factory image is written to the first storage area to upgrade the production test image in the first storage area to the factory image, and then the factory image is read from the first storage area, and the first storage area and the second storage area are both filled with the factory image.

2. The router according to claim 1, It is characterized in that The first storage area is used to store the production test image; Before receiving the use factory image command, the controller is configured to read the production test image from the first storage area into a corresponding memory of the controller; After receiving and executing the use factory image command, the controller is configured to read the factory image from the first storage area into a corresponding memory of the controller.

3. The router according to claim 1, It is characterized in that The controller comprises a third storage area, and the third storage area is used to store the received use factory image command; The first storage area includes primary partitions, and the second storage area includes backup partitions; Each of the primary partitions stores each block of the production test image, and each of the backup partitions stores each block of the factory image.

4. The router according to claim 1, It is characterized in that When reading the factory image from the second storage area according to the use factory image command, and then writing the read factory image into the first storage area, the controller is configured to: Reading the factory image from the second storage area according to the use factory image command; Erasing the production test image stored in the first storage area; The read factory image is written into the first storage area.

5. The router according to claim 3, It is characterized in that When reading the factory image from the second storage area according to the use factory image command, and then writing the read factory image into the first storage area, the controller is configured to: Reading the corresponding blocks of the factory image from the backup partitions according to the use factory image command; Assembling the blocks of the factory image corresponding to each backup partition into a complete factory image; Erasing all blocks of the production test image stored in each primary partition; The read complete factory image is written into each primary partition.

6. A mirror self-upgrade method, It is characterized in that The router according to any one of claims 1 to 5, comprising: Before receiving the command to use the factory image, reading the production test image from the first storage area; receiving the use factory image command, where the use factory image command is used to instruct to upgrade the production test image to the factory image; In response to the use factory image command, the production test image in the first storage area is erased, and the factory image is read from the second storage area according to the use factory image command, and then the read factory image is written to the first storage area, so as to upgrade the production test image in the first storage area to the factory image, and then the factory image is read from the first storage area, and the first storage area and the second storage area are both filled with the factory image.

7. The image self-upgrade method according to claim 6, It is characterized in that The first storage area is used to store the production test image; The first storage area includes primary partitions, and the second storage area includes backup partitions; Each of the primary partitions stores each block of the production test image, and each of the backup partitions stores each block of the factory image.

8. The image self-upgrade method according to claim 6, It is characterized in that Reading the factory image from the second storage area according to the use factory image command, and then writing the read factory image into the first storage area, includes: Reading the factory image from the second storage area according to the use factory image command; Erasing the production test image stored in the first storage area; The read factory image is written into the first storage area.

9. The image self-upgrade method according to claim 7, It is characterized in that Reading the factory image from the second storage area according to the use factory image command, and then writing the read factory image into the first storage area, includes: Reading the corresponding blocks of the factory image from the backup partitions according to the use factory image command; Assembling the blocks of the factory image corresponding to each backup partition into a complete factory image; Erasing all blocks of the production test image stored in each primary partition; The read complete factory image is written into each primary partition.

10. The image self-upgrade method according to claim 9, It is characterized in that The factory images corresponding to the backup partitions are assembled into a complete factory image, including: Reading each block of the corresponding factory image from each backup partition; The blocks of the factory image are pieced together into a complete factory image through the image header.