ONU upgrade management method, storage medium, electronic device and ONU

By saving the current system files and configuration files of ONU in the optical circuit terminal (OLT), and rolling back when the upgrade fails, the problem of the inability to effectively verify the software functions and dual mirroring method increase costs during the ONU system software upgrade, and a safe and reliable system software upgrade and rollback are achieved.

CN114064084BActive Publication Date: 2025-05-02RAISECOM TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111397033.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2025-05-02
Estimated Expiration
2041-11-23

AI Technical Summary

Technical Problem

The existing optical network unit (ONU) cannot effectively verify the software functions when the system software is upgraded, resulting in the upgrade failure. The dual mirroring method occupies additional storage space, increases costs, and cannot analyze the reasons for the upgrade failure or restore to the state before the upgrade.

Method used

Before ONU upgrades the system software, save the system files and configuration files with the current running version number in the OLT terminal (OLT), and use the OLT stored files to roll back the system software when the upgrade fails and restore to the running version before the upgrade.

Benefits of technology

It realizes the secure upgrade and fallback of ONU system software, avoids the problem of equipment failure caused by upgrade failure, reduces storage space usage, reduces operation and maintenance costs, and can analyze and solve the reasons for upgrade failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064084B_ABST
    Figure CN114064084B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an ONU upgrade management method, storage medium, electronic device and ONU. The method comprises: before the optical network unit ONU performs a system software upgrade, the optical line terminal OLT saves the system files and configuration files corresponding to the current running version number of the ONU; after performing the ONU system software upgrade operation, if the upgrade is not successful, the system software is rolled back using the system files and configuration files stored in the OLT.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of information processing, and in particular to an upgrade management method of an ONU, a storage medium, an electronic device, and an ONU. Background Art

[0002] The system software of the Optical Network Unit (ONU) is usually stored in a non-volatile storage chip, such as NAND FLASH or NOR FLASH. The process of upgrading the ONU is generally to copy the system software upgrade file (including the ONU operating system kernel file and user application file) to the ONU memory through the network or serial port. Then the ONU will perform a simple integrity check on the upgrade file. If the check is correct, the new system software will be written into the FLASH.

[0003] Generally speaking, when upgrading the ONU, only the validity and integrity of the upgrade file are verified, and the software functions cannot be verified. In order to avoid the failure of the upgrade causing the ONU to be unable to be used normally, the ONU with conditions often adopts the dual-image method, that is, two images (image 1 and image 2) are set in the ONU, and a startup flag (generally a BOOT environment variable parameter) is set for the currently running image. Assuming that the current running image is image 1, during the upgrade, only the upgrade file is written to the partition where image 2 is located, and then the startup flag for image 2 is updated to try to start, indicating that the next startup will try to start from image 2; if the next time the ONU starts successfully from image 2, it means that there is no problem with the upgrade file in image 2. The system software will clear the try to start flag for image 2, set the startup flag, and clear the startup flag of image 1, indicating that it will start from image 2 in the future. If the ONU fails to start successfully from image 2, the try to start flag is cleared, and when the device restarts, image 1 is still selected.

[0004] Although the dual-mirror method solves the problem of ONU failure to start due to upgrade failure through redundant backup, this method has several main disadvantages:

[0005] 1) Dual mirroring requires nearly double the FLASH space, which increases product costs and is not suitable for terminal devices with greater cost pressure.

[0006] 2) Dual mirroring is just a simple upgrade fault recovery mechanism. It cannot analyze the cause of the upgrade failure, nor can it actively restore the image to the content before the upgrade. If the upgrade causes the images of the primary and backup partitions to be damaged, the ONU will not be able to start normally and cannot be configured and managed through the OLT. The operator can only visit the home to replace the equipment, increasing operation and maintenance costs. Summary of the invention

[0007] In order to solve any of the above technical problems, the embodiments of the present application provide an ONU upgrade management method, a storage medium, an electronic device and an ONU.

[0008] In order to achieve the purpose of the embodiment of the present application, the embodiment of the present application provides an ONU upgrade management method, including:

[0009] Before the optical network unit ONU performs a system software upgrade, the optical line terminal OLT saves the system files and configuration files corresponding to the current running version number of the ONU;

[0010] After performing the ONU system software upgrade operation, if the upgrade is not successful, the system software is rolled back using the system files and configuration files stored in the OLT.

[0011] A storage medium stores a computer program, wherein the computer program is configured to execute the method described above when running.

[0012] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the method described above.

[0013] An ONU includes the electronic device described above.

[0014] One of the above technical solutions has the following advantages or beneficial effects:

[0015] Before the ONU performs a system software upgrade, the OLT saves the system files and configuration files corresponding to the current running version number of the ONU, and when the system software upgrade fails, the system files and configuration files stored in the OLT are used to roll back the system software, so as to restore the system software of the ONU to the running version before the upgrade, thereby ensuring the normal startup of the ONU.

[0016] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by implementing the embodiments of the present application. The purpose and other advantages of the embodiments of the present application can be achieved and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are used to provide further understanding of the technical solutions of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the embodiments of the present application, they are used to explain the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0018] Figure 1A flowchart of an ONU upgrade management method provided in an embodiment of the present application;

[0019] Figure 2 A flowchart of an ONU upgrade protection method provided in an embodiment of the present application;

[0020] Figure 3 A flowchart of an ONU upgrade recovery method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present application more clear, the embodiments of the present application will be described in detail in conjunction with the accompanying drawings. It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily.

[0022] Figure 1 Flow chart of the ONU upgrade management method provided by the embodiment of the present application. Figure 1 As shown, the method includes:

[0023] Step S1, before the ONU performs a system software upgrade, the system file and configuration file corresponding to the current running version number of the ONU are saved in the optical line terminal (OLT);

[0024] By saving the system files and configuration files corresponding to the current running version number on the OLT, the problem of being unable to perform system software rollback due to the above files being overwritten by the upgrade operation can be overcome; at the same time, there is no need to set up independent storage space on the ONU to store the above files, reducing the occupancy of the ONU storage space.

[0025] Step S2: After performing the ONU system software upgrade operation, if the upgrade is not successful, the system software is rolled back using the system files and configuration files stored in the OLT;

[0026] When the system software upgrade fails, the system software can be rolled back using the system files and configuration files stored in the OLT, so that the ONU system software can be restored to the running version before the upgrade to ensure the normal startup of the ONU.

[0027] The method provided in the embodiment of the present application saves the system files and configuration files corresponding to the current running version number of the ONU in the OLT before the ONU performs a system software upgrade, and when the system software upgrade is unsuccessful, the system files and configuration files stored in the OLT are used to roll back the system software, thereby restoring the system software of the ONU to the running version before the upgrade, thereby ensuring the normal startup of the ONU.

[0028] The method provided in the embodiment of the present application is described below:

[0029] In an exemplary embodiment, the system files and configuration files corresponding to the current running version number of the ONU are saved in the OLT in the following manner, including:

[0030] When the OLT learns that the ONU needs to upgrade the system software but the system file with the current version number of the ONU is not saved locally, it initiates a system software upload request to the ONU;

[0031] After receiving the system software upload request, the ONU reads the currently stored system software and configuration files from the FLASH to the memory, and then uploads them to the OLT;

[0032] The OLT locally saves the system files and configuration files corresponding to the current running version number of the ONU.

[0033] By utilizing the above interaction process, before the ONU executes the system software upgrade, the OLT saves the system files and configuration files of the current running version of the ONU.

[0034] In an exemplary embodiment, when the ONU is restarted after executing the system software upgrade, if the ONU restart fails, it is determined that the ONU is not successfully upgraded, and the implementation method is simple.

[0035] In an exemplary embodiment, the method further comprises:

[0036] Set the attempt trigger flag and loading status flag on the ONU;

[0037] The value of the attempt trigger flag is used to indicate whether the startup mode of the ONU is normal startup;

[0038] The value of the loading status identifier is used to indicate starting in a detection mode or a recovery mode when the startup mode is not a normal startup;

[0039] The detection mode startup process includes executing a system software upgrade; and the recovery mode startup process includes using the system files and configuration files stored in the OLT to roll back the system software.

[0040] When the ONU starts, the current startup mode can be determined according to the values ​​of the attempt trigger flag and the loading state flag, which facilitates the control of the ONU to execute different processing steps and provides support for upgrade management.

[0041] In an exemplary embodiment, during the startup process in the detection mode, the value of the loading status identifier is updated according to the system kernel file loading status and the application software startup status;

[0042] After the startup in the detection mode is successful, the value of the attempt trigger identifier is updated to indicate that the startup mode of the ONU is normal startup.

[0043] During the startup process in the detection mode, the ONU can perform a system software upgrade, and the value of the loading state identifier is updated to indicate the ONU upgrade progress, so that when the system software is rolled back, the system software is rolled back according to the ONU upgrade progress.

[0044] After the startup in the detection mode is successful, it means that the upgrade is successful, and the value of the attempt trigger identifier is updated to indicate that the startup mode used by the ONU during the next startup is normal startup.

[0045] Specifically, updating the value of the loading status identifier according to the system kernel file loading status and the application software startup status includes:

[0046] When the kernel file starts to be loaded, the value of the loading status flag is updated to indicate that the kernel file has been loaded;

[0047] If the kernel file is loaded successfully, the value of the loading status identifier is updated to indicate that the application software is in the startup state; otherwise, the value of the loading status identifier is maintained to indicate that the kernel file has been loaded;

[0048] If the application software is successfully started, it is determined that the startup is successful in the detection mode; otherwise, the value of the loading state identifier is maintained as a value used to indicate that the application software is in the startup state.

[0049] By managing the value of the loading status identifier, the cause of the upgrade failure can be indicated, providing an operational basis for the subsequent rollback of the system software.

[0050] In an exemplary embodiment, a watchdog timer is provided. When the kernel file starts to be loaded, the watchdog timer is started. When it is determined that the application startup is not completed when the timing duration of the watchdog timer is reached, the ONU is restarted.

[0051] By setting the watchdog timer, you can prevent the problem that the startup card cannot continue or exit at a certain stage when the ONU starts abnormally.

[0052] Among them, when the application is successfully started, the watchdog timer is turned off.

[0053] When the application software is successfully started, it means that the startup is successful in the detection mode. Therefore, there is no need to perform timing management and the watchdog timer can be turned off.

[0054] In an exemplary embodiment, the value of the loading state identifier corresponding to the failure to load the kernel file or the failure to start the application is used to indicate that the startup mode is to start in recovery mode.

[0055] If the kernel file fails to load or the application fails to start, the upgrade fails. Therefore, you need to start in recovery mode the next time you start the system.

[0056] In an exemplary embodiment, before the ONU performs an upgrade operation using a pre-stored upgrade file, the method further includes:

[0057] The ONU records the registration information required for registering the OLT;

[0058] The ONU uses the system files and configuration files stored in the OLT to roll back the operating system, including:

[0059] Initializing a passive optical network (PON) protocol stack according to the registration information;

[0060] Download the corresponding file from the OLT according to the value of the loading status identifier;

[0061] After the download is completed, the value of the update attempt trigger flag is used to indicate that the startup mode is normal startup.

[0062] The registration information includes the current PON mode (EPON / GPON), authentication method (LOID authentication / SN authentication), etc.; this information is used to initialize the PON protocol stack of the ONU when the ONU upgrade fails and enters the BootLoader, so that the ONU can re-register with the OLT.

[0063] The registration information is used to initialize the PON protocol stack so that the ONU and the OLT establish information. Since the OLT stores the system files and configuration files of the running version before the upgrade, the ONU can obtain the corresponding files from the OLT to implement the rollback of the ONU system software, so that the ONU can start in a normal startup mode at the next startup. Therefore, the attempt to trigger the flag is indicated as a normal startup.

[0064] The reason for the upgrade failure can be determined according to the value of the loading status identifier, and the corresponding files can be obtained in a targeted manner, thereby improving the processing efficiency of the system software rollback.

[0065] In an exemplary embodiment, downloading a corresponding file from the OLT according to a value of the loading status identifier includes:

[0066] If the value state of the loading state identifier indicates that the kernel file has been loaded, the operating system kernel file and the user application file corresponding to the ONU are downloaded from the OLT.

[0067] If the value of the loading status indicator indicates that the application software is in the startup state, the following operations are performed, including:

[0068] Determine whether the current file system partition is correct;

[0069] If the current file system partition is correct, then determine whether the current configuration file is correct. If the current configuration file is correct, then download the user application file corresponding to the ONU from the OLT; otherwise, download the configuration file corresponding to the ONU from the OLT;

[0070] If the current file system partition is incorrect, the user application file corresponding to the ONU is downloaded from the OLT.

[0071] The step of determining whether the current file system partition is correct includes:

[0072] Determine whether the length and checksum of the upgrade file stored in the current file system partition are the same as the length and checksum of the upgrade file recorded locally;

[0073] If the length and checksum of the upgrade file are the same, it is determined that the current file system partition is correct; otherwise, it is determined that the current file system partition is incorrect;

[0074] The setting location stored on the ONU is a location in the file system partition other than the location storing the configuration file and the system software.

[0075] By locally recording the length and checksum of the upgrade file in the above manner, the problem that the comparison cannot be performed because the upgrade operation overwrites the above information can be overcome.

[0076] The step of determining whether the current configuration file is correct includes:

[0077] Determine whether the length and checksum of the configuration file stored in the current configuration partition are the same as the length and checksum of the configuration file recorded locally;

[0078] If the length and checksum of the configuration files are the same, it is determined that the current file system partition is correct; otherwise, it is determined that the current file system partition is incorrect.

[0079] The length and checksum of the locally recorded configuration file are stored in a set location on the ONU, where the location is a location in the file system partition other than the location storing the configuration file and the system software.

[0080] By locally recording the length and checksum of the configuration file in the above manner, the problem that the comparison cannot be performed due to the upgrade operation overwriting the above information can be overcome.

[0081] The present application aims to provide a method for ONU upgrade protection, which can determine the failure cause and automatically roll back the software version when the ONU upgrade fails, so as to ensure that the ONU can still run normally on the network when the upgrade is unsuccessful. In the following embodiments, the ONU has been registered on the OLT before the upgrade and can communicate normally.

[0082] In order to implement the upgrade protection of ONU, two status identifiers are set in advance at the specified position of ONU FLASH: try to trigger try_active and load state boot_state, and the corresponding relationship between try_active, boot_state and the current startup state of ONU is determined as follows. When the ONU is in normal working state, that is, the initial state of ONU to be upgraded: try_active is set to "0", see Table 1 for details.

[0083] try_active boot_state ONU current startup status 0 - Normal startup 1 0 Start in detection state 1 1 Enable watchdog timer 1 >1 Kernel loaded successfully

[0084] Table 1

[0085] Figure 2 Flow chart of the ONU upgrade protection method provided in the embodiment of the present application. Figure 2 As shown, the method includes:

[0086] Step 101: When receiving a file upgrade request, the ONU locally records the length and checksum of the current configuration file of the ONU, and the information of the OLT currently registered by the ONU, wherein the information of the OLT at least includes: the current PON mode (EPON / GPON), the authentication method (LOID authentication / SN authentication), etc.; this information is used to initialize the PON protocol stack of the ONU when the ONU upgrade fails and enters the BootLoader, so that the ONU can re-register under the OLT;

[0087] In this step, the ONU receives a file upgrade request, which indicates that the ONU is about to upgrade the system software, and it needs to make necessary preparations for the upgrade. The source of the file upgrade request may be a system external instruction that directly acts on the ONU, or may be an instruction from the OLT. This is not specifically limited here, but as the subject receiving the file upgrade request, the ONU can identify the source, for example, by making a judgment through the interface receiving the file upgrade request.

[0088] Step 102: When the OLT learns that the ONU needs to upgrade the system software, it determines the version number of the system software currently running on the ONU, and determines whether the system software of the current running version number of the ONU has been saved locally. If yes, it proceeds to step 106; if not, it proceeds to step 103;

[0089] In this step, the OLT may learn that the ONU needs to perform a system software upgrade when it receives an external trigger command, and then send a file upgrade request to the ONU; or the ONU may notify the OLT when it receives a file upgrade request included in an external instruction from the system; the specific method is determined according to the implementation process combined with step 101;

[0090] In this step, the OLT may determine the version number of the system software currently running on the ONU in a manner known in the prior art. Typically, in order to achieve communication, the OLT will know and locally record the version number of the software running on the ONU registered thereon;

[0091] In some implementation scenarios, when the OLT does not store the system software version number currently running on the registered ONU locally, it can also be obtained by active query. At this time, after learning that the ONU is about to be upgraded, the OLT can send an instruction to the ONU to obtain the software version number currently running, and the ONU reports the software version number currently running according to the instruction; the OLT can learn that the ONU is about to be upgraded by external triggering or by ONU reporting triggering, which is not limited here;

[0092] In other implementations, the ONU may proactively report the currently running software version number to the registered OLT upon receiving the file upgrade request, regardless of whether the OLT has actually recorded the information;

[0093] When the ONU and the OLT exchange the version number of the system software currently running on the ONU, it may be through a specific message instruction that complies with the communication protocol between the two, or it may be carried by using a specific field when the OLT and the ONU exchange existing information.

[0094] Step 103: The OLT initiates a system software upload request to the ONU;

[0095] In this step, the system software upload request may be carried out through a specific message instruction that complies with the communication protocol between the two parties, or may be carried by the OLT and the ONU using a specific field when exchanging existing information.

[0096] Step 104: The ONU reads the currently stored system software and configuration files from the FLASH into the memory, and then uploads them to the OLT.

[0097] In this step, after receiving the upload system software request initiated by the OLT to the ONU, the ONU knows that the OLT will back up the system software of the ONU locally, and uploads the system software and configuration files to the OLT. The upload of the system software and configuration files can be carried and transmitted through protocol messages, typically OMCI messages.

[0098] Step 105: The OLT stores the received system software and configuration files locally corresponding to the ONU.

[0099] In this step, when the OLT receives the information uploaded by the ONU, according to the prior art, it can know from which ONU the information comes from the corresponding field according to the protocol type, which will not be described in detail here.

[0100] Step 106: Write the upgrade file to the designated location of the system file in the FLASH of the ONU as the current system file, locally record the length and checksum of the upgrade file, set try_active to "1", and set boot_state to "0" to indicate that the ONU will start in the detection state next time;

[0101] In this step, the upgrade of ONU can be carried out by executing a special upgrade script. The upgrade file is written to the specified location of FLASH after verification, and the current system file is updated by overwriting the original system file. In the process of writing the upgrade file, device information comparison (for example, device type, batch number, software version number, etc.), integrity verification, MD5 code verification and other operations can also be performed according to the existing technology, which will not be repeated here.

[0102] Therefore, through the above 101-106, preparations have been made for the system software upgrade of the ONU.

[0103] Step 107: Trigger ONU to restart;

[0104] Whether the ONU can be successfully started is a criterion for judging whether the software upgrade of the ONU is successful; in this step, the startup trigger operation of the ONU can be performed in any way in the prior art, for example, an external trigger formed by an operator judging that the upgrade file has been written, or a self-trigger formed by the ONU judging that the upgrade file has been written, a trigger operation performed after the ONU judges that its own upgrade has failed, and also includes other trigger conditions that require the ONU to restart. The trigger mode is not specifically limited here, except that if it is a restart after the upgrade, it needs to be completed after the upgrade file is written and try_active is set to "1";

[0105] Step 108: Determine the set values ​​of try_active and boot_state. If try_active is set to "0", boot in normal mode, which is not involved in this application. If try_active is set to "1" and boot_state is set to "0", it indicates booting in detection mode. Execute step 109. If try_active is set to "1" and boot_state is set to ">0, enter recovery mode. For the specific operation method of recovery mode, see Figure 2 The following will be described in detail later;

[0106] In this step, the startup mode is determined by the set values ​​of try_active and boot_state, which not only realizes the detection mode and recovery mode but also is compatible with the normal startup mode. If the non-upgraded ONU is restarted, try_active is set to "0" at this time, and it will not enter the detection phase due to the upgrade, nor will it enter the recovery mode due to the upgrade failure;

[0107] Step 109: Set boot_state to "1";

[0108] Step 110: Start the watchdog timer; the timing duration of the watchdog timer is determined by a person skilled in the art according to the longest startup duration estimated by the ONU in the normal startup phase, and typically can be: 60s;

[0109] In this step, the purpose of setting the watchdog timer is to prevent the problem that the startup card cannot continue or exit at a certain stage when the ONU starts abnormally;

[0110] Step 111: Load the operating system kernel file and determine whether the operating system kernel file is loaded successfully. If yes, execute step 112; if not, execute step 115;

[0111] In this step, the bootloader loads the operating system kernel file and determines whether the loading is successful;

[0112] Step 112: Set boot_state to "2". At this time, try_active remains unchanged and is still "1".

[0113] Step 113: Start the user applications in sequence and determine whether all the user applications are successfully started. If yes, execute step 114; otherwise, execute step 115;

[0114] In this step, after each user application is started, the name of the started process will be added to the started application started_app variable, and the pre-set application startup script will be used to determine whether all user applications have been started; the application startup script knows all applications that need to be successfully started; further, after all user applications are started, the startup script also checks the status of all started processes, such as whether the processes exist normally, whether the CPU utilization is normal, etc., and only when all applications have been started and the startup process status is normal, it is determined that all user applications have been successfully started;

[0115] Step 114: turn off the watchdog timer, set try_active to "0", and set boot_state to "0" to indicate that the upgrade of the ONU has been successful and the ONU can be started in normal mode next time.

[0116] Step 115: Determine whether the watchdog timer timing duration has been reached. If so, it indicates that there is a problem with the startup of this stage, and return to step 107. Otherwise, execute step 115.

[0117] In this step, when the watchdog timer reaches its timing duration, whether it is because the kernel fails to load successfully or the user application fails to start successfully, it will return to triggering the ONU restart, and the boot_state is set to "1" or "2" at this time to trigger the ONU to restart and enter the recovery mode.

[0118] Supplementary explanation for the above process:

[0119] (1) The ONUs mentioned above are all separate ONU individuals. The OLT can identify the ONUs registered on it based on their identifiers;

[0120] (2) The setting of try_active and boot_state is completed by the bootloader and the startup script;

[0121] (3) In the above steps, the ONU locally records the length and checksum of the current configuration file of the ONU, and the ONU locally records the length and checksum of the upgrade file. The local here refers to the set location on the ONU, but this location is not the location in the file system partition where the configuration file and system software are stored.

[0122] Figure 3 Flow chart of the ONU upgrade recovery method provided in the embodiment of the present application. Figure 3 As shown, the method includes:

[0123] When the ONU is triggered to restart, if try_active is set to "1" and boot_state is set to > 0 (i.e. 1 or 2), it indicates that the ONU upgrade failed and needs to enter the recovery mode. If boot_state is set to "1", it indicates that the kernel failed to load, and boot_state is set to "2", it indicates that the user application failed to start. The execution process of the recovery mode includes:

[0124] Step 201: The ONU obtains the locally recorded information of the registered OLT, where the OLT information at least includes: PON mode (EPON / GPON), authentication method (LOID authentication / SN authentication, etc.);

[0125] The OLT information is recorded locally before the ONU is upgraded, as described in the above step 101;

[0126] Step 202: The ONU initializes the PON protocol stack according to the acquired OLT information to facilitate subsequent registration and data transmission in the OLT;

[0127] Step 203: Determine the boot_state setting value. If boot_state is set to "1", it indicates that the kernel loading failed, which is usually caused by the failure to write to the flash during the upgrade; execute step 204; if boot_state is set to "2", it indicates that the user application failed to start. At this time, the bootloader needs to analyze the specific cause and execute step 205:

[0128] Step 204: download the operating system kernel file and user application file corresponding to the ONU from the OLT, and then execute step 210;

[0129] Step 205: Determine whether the current file system partition is normal, if yes, execute step 207, otherwise, execute step 206;

[0130] In this step, whether the current file system partition is normal is determined by whether the length and checksum of the upgrade file stored in the current file system partition are the same as the length and checksum of the upgrade file recorded locally. If they are not the same, it indicates that the file system partition is incorrect, which is usually caused by a failure to write to the flash during the upgrade;

[0131] Step 206: Download the user application file corresponding to the ONU from the OLT, and then execute step 210;

[0132] Step 207: Determine whether the currently configured partition is correct. If so, it indicates that there is a problem with the currently loaded application and a version rollback is required. Execute step 209. Otherwise, execute step 208.

[0133] In this step, whether the current configuration partition is correct is determined based on whether the length and checksum of the configuration file stored in the current configuration partition are the same as the length and checksum of the configuration file recorded locally. If they are not the same, it indicates that the current configuration partition is incorrect;

[0134] Step 208: Download the configuration file corresponding to the ONU from the OLT, and then execute step 210;

[0135] Step 209: Download the user application file corresponding to the ONU from the OLT, and then execute step 210;

[0136] Step 210: Set try_active to "1" and boot_state to "0" to start in the detection state when the ONU is triggered to restart.

[0137] It can be seen that in the above recovery mode implementation process, the reason for the upgrade failure can be determined according to the current setting values ​​of try_active and boot_state of the ONU local, and the corresponding files can be downloaded from the OLT to recover the problems caused by the upgrade of the ONU. It should be noted here that in the above embodiment, after the ONU files are restored, it is necessary to start in the detection state again to ensure the reliability of the entire system. This is a better implementation method and can further improve the reliability of the system; in other embodiments, try_active can also be set to "0" after automatic recovery, so as to directly start in normal mode when the ONU restart is triggered.

[0138] In summary, the method provided in the embodiment of the present application provides an upgrade protection and recovery mechanism for a single-image embedded device, avoiding upgrade failures and device startup problems caused by various abnormal conditions (such as power failure during upgrade). Compared with the traditional dual-image protection mechanism, the use of FLASH can be reduced, and for price-sensitive terminal embedded products, the cost can be effectively reduced and the product competitiveness can be improved.

[0139] An embodiment of the present application provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute any of the methods described above when running.

[0140] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the methods described above.

[0141] An ONU includes the electronic device described above.

[0142] The electronic device can be independently arranged in the ONU, or integrated with the processor in the ONU.

[0143] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Claims

1. An ONU upgrade management method, characterized in that: include: Step 01, before the optical network unit ONU performs system software upgrade, the system file and configuration file corresponding to the current running version number of the ONU are saved in the optical line terminal OLT, so as to initialize the PON protocol stack of the ONU when the ONU upgrade fails and enters the BootLoader, so that the ONU can re-register under the OLT, and then execute step 02; Step 02: After the ONU upgrade is completed, the value of the loading state flag boot_state is updated to 0, the value of the attempt trigger flag try_active is updated to 1, and the ONU restart is triggered to execute step 03; Step 03, when the ONU restarts, according to the system kernel file loading status and the application startup status, the value of boot_state is updated, and the ONU restart is triggered to execute step 04; before loading the kernel file, the value of boot_state is updated to 1, and the value of try_active is kept as 1; when the kernel file is loaded successfully, the value of boot_state is updated to 2, and the value of try_active is kept as 1; when the application is successfully started, the value of try_active and the value of boot_state are both set to 0 to indicate that the ONU starts in normal mode; Step 04: When the ONU restarts, obtain the value of try_active. If the value of try_active is 0, it indicates that the ONU system software upgrade operation is successful and the process ends; otherwise, it indicates that the ONU system software upgrade operation is unsuccessful. According to the value of boot_state, the system files and configuration files stored in the OLT are used to roll back the system software, and the value of boot_state is updated to 0, and the value of try_active is updated to 1, triggering the ONU restart again to re-execute step 03; The setting of try_active and boot_state are both completed by the bootloader and the startup script, wherein the bootloader is used to load the operating system kernel file and determine whether the loading is successful, and the startup script is used to determine whether all applications have been started.

2. The method according to claim 1, characterized in that The system files and configuration files corresponding to the current running version number of the ONU are saved in the OLT in the following manner, including: When the OLT learns that the ONU needs to upgrade the system software but the system file with the current version number of the ONU is not saved locally, it initiates a system software upload request to the ONU; After receiving the system software upload request, the ONU reads the currently stored system software and configuration files from the FLASH to the memory, and then uploads them to the OLT; The OLT locally saves the system files and configuration files corresponding to the current running version number of the ONU.

3. The method according to claim 1, characterized in that: The following methods can be used to determine if the ONU upgrade is successful: When the ONU restarts after performing a system software upgrade, the ONU restart fails.

4. The method according to claim 1, characterized in that: A watchdog timer is set. Before loading the kernel file, the watchdog timer is started. When it is determined that the application startup is not completed when the timing duration of the watchdog timer is reached, the ONU is restarted.

5. The method according to claim 4, characterized in that: When the application starts successfully, turn off the watchdog timer.

6. The method according to claim 1, characterized in that: The ONU records the registration information required for registering the OLT; Before performing system software rollback using system files and configuration files stored in the OLT according to the value of boot_state, the method further includes: The passive optical network (PON) protocol stack is initialized according to the registration information.

7. The method according to claim 1, characterized in that The system software rollback is performed using the system files and configuration files stored in the OLT according to the value of boot_state, including: If the value of boot_state is 1, the operating system kernel file and user application file corresponding to the ONU are downloaded from the OLT.

8. The method according to claim 1, characterized in that The system software rollback is performed using the system files and configuration files stored in the OLT according to the value of boot_state, including: If the value of boot_state is 2, determine whether the current file system partition is correct; If the current file system partition is correct, then determine whether the current configuration file is correct. If the current configuration file is correct, then download the user application file corresponding to the ONU from the OLT; otherwise, download the configuration file corresponding to the ONU from the OLT; If the current file system partition is incorrect, the user application file corresponding to the ONU is downloaded from the OLT.

9. The method according to claim 8, characterized in that The determining whether the current file system partition is correct includes: Determine whether the length and checksum of the upgrade file stored in the current file system partition are the same as the length and checksum of the upgrade file recorded locally; If the length and checksum of the upgrade file are the same, it is determined that the current file system partition is correct; otherwise, it is determined that the current file system partition is incorrect; The length and checksum of the locally recorded upgrade file are stored in a set location on the ONU, where the location is a location in the file system partition other than the location storing the configuration file and the system software.

10. The method according to claim 9, characterized in that The determining whether the current configuration file is correct includes: Determine whether the length and checksum of the configuration file stored in the current configuration partition are the same as the length and checksum of the configuration file recorded locally; If the length and checksum of the configuration files are the same, it is determined that the current file system partition is correct; otherwise, it is determined that the current file system partition is incorrect; The length and checksum of the locally recorded configuration file are stored in a set location on the ONU, where the location is a location in the file system partition other than the location storing the configuration file and the system software.

11. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 10 when executed.

12. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 10.

13. An ONU, characterized in that: Comprising the electronic device as claimed in claim 12.

Citation Information

Patent Citations

  • Method and system for carrying out recovery after upgrade failure of mobile terminal on basis of network

    CN105955846A

  • Cloud broadcast upgrading method and system with trial operation and self-checking functions

    CN109614130A