White-box device restoration method and apparatus, and device and computer-readable storage medium

By embedding mutually backup ONIE boot files in the white-box device and utilizing high-reliability storage, the reliability problem in the event of NOS or ONIE failure in the prior art is solved, and self-recovery of NOS operation is achieved.

WO2025218533A1PCT designated stage Publication Date: 2025-10-23HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/087786
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-16
Filing Date
2025-04-08
Publication Date
2025-10-23

AI Technical Summary

Technical Problem

When the NOS or ONIE of a white-box device fails, existing technologies struggle to reliably obtain the ONIE boot file from an external source, resulting in low reliability of NOS recovery.

Method used

The white-box device contains multiple backup copies of the ONIE boot file. By selecting the escape mode through the interactive interface, the ONIE boot file is loaded from the internal memory to restore the operation of NOS. The ONIE boot file is stored using highly reliable memory such as NOR flash memory.

Benefits of technology

It improves the reliability of restoring NOS operation when the ONIE boot file cannot be obtained from the outside, and enhances the self-recovery capability of white-box devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025087786_23102025_PF_FP_ABST
    Figure CN2025087786_23102025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computers. Disclosed are a white-box device restoration method and apparatus, and a device and a computer-readable storage medium. The method comprises: running an NOS in a first memory of a white-box device; if the NOS fails to run, loading into the first memory an ONIE startup file in a second memory of the white-box device, and running the ONIE startup file in the first memory to restore the running of the NOS; and in the case of at least one of a loading failure or a running failure of the ONIE startup file, loading into the first memory an ONIE startup file in a third memory of the white-box device, and running the ONIE startup file in the first memory to restore the running of the NOS. A plurality of ONIE startup files are embedded, such that if one ONIE startup file cannot be acquired from a network server and a USB flash drive, another ONIE startup file can still be acquired from the interior of a white-box device, thereby achieving high reliability in the acquisition of the ONIE startup file.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, equipment and computer readable storage medium for restoring white box device

[0001] The present application claims priority from the Chinese patent application No. 202410468424.4 filed on April 16, 2024 and entitled "Method, device, equipment and computer readable storage medium for restoring white box device", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the technical field of computer, in particular to a method, device, equipment and computer readable storage medium for restoring white box device. BACKGROUND

[0003] The white box device is an open network device that decouples physical hardware and network operating system (NOS) in a network. In the case that different networks adapt different NOS, the white box device can adapt to different networks by installing different NOS on the same physical hardware. The white box device needs to install NOS by running open network install environment (ONIE). The ONIE is a linux-based operating system that can run on the white box device and provide an installation environment in which NOS is installed on the white box device.

[0004] In the case that at least one of NOS or ONIE fails, a method for restoring the white box device is needed to restore the operation of the white box device. SUMMARY

[0005] The present application provides a method, device, equipment and computer readable storage medium for restoring white box device to restore the operation of NOS.

[0006] In a first aspect, a method for restoring white box device is provided, the method comprising: running NOS in a first memory of the white box device; in the case that the running of NOS fails, loading ONIE startup file in a second memory of the white box device into the first memory, and running the ONIE startup file in the first memory to restore the operation of NOS; in the case that at least one of loading failure or running failure of the ONIE startup file occurs, loading ONIE startup file in a third memory of the white box device into the first memory, and running the ONIE startup file in the first memory to restore the operation of NOS, the ONIE startup files in the second memory and the third memory being backups of each other.

[0007] In the method, the multiple ONIE startup files that are mutually backed up are built in, so that in the case that the ONIE startup file cannot be obtained from the external network server and the U disk, the ONIE startup file can still be obtained from the inside of the white box device, and then the operation of the NOS is recovered based on the obtained ONIE startup file, and the reliability of obtaining the ONIE startup file is high.

[0008] In a possible implementation, in the case that the NOS fails to operate, the ONIE startup file in the second memory of the white box device is loaded into the first memory, including: in the case that the NOS fails to operate, displaying an interactive interface of the white box device; obtaining an entering instruction generated based on selection of entering the escape mode on the interactive interface; and loading the ONIE startup file in the second memory into the first memory based on the entering instruction. Thus, even if the white box device is not inserted into the U disk storing the ONIE startup file, and / or does not have a network connection with the network server storing the ONIE startup file, the white box device can still enter the escape mode based on the interactive interface, and in the case of entering the escape mode, the ONIE startup file is loaded into the first memory.

[0009] In a possible implementation, the second memory is a memory storing a first-level startup program after the white box device is powered on. Since the reliability of the memory for storing the first-level startup program after the white box device is powered on is high, the reliability of storing the ONIE startup file is high by storing the ONIE startup file in the second memory.

[0010] In a possible implementation, the first-level startup program after the white box device is powered on is a basic input output system (BIOS), and the second memory is used to operate the BIOS; and the NOS is operated in the first memory of the white box device, including: operating the BIOS in the second memory to load the NOS into the first memory; and operating the NOS in the first memory. Thus, the method can be applied to the white box device using the BIOS.

[0011] In a possible implementation, the ONIE startup file includes a kernel image and a random access memory disk (RAM disk) initialized by a boot loader (initrd), and the initrd includes a root file system; and running the ONIE startup file in the first memory to restore the running of the NOS includes: running the kernel image in the first memory to mount the initrd on the kernel image, obtaining the root file system from the initrd; running the ONIE by running the root file system; obtaining the installation package of the NOS by running the ONIE; and installing the NOS based on the installation package of the NOS and running the NOS after the NOS is successfully installed.

[0012] The method can be applied to a white box device using a kernel image and an initrd. By dividing the ONIE startup file into the kernel image and the initrd, the complexity of program instructions included in the kernel image is relatively low, so that the complexity of program instructions executed in the kernel is relatively low in the case that the kernel image is executed in the kernel.

[0013] In a possible implementation, at least one of the second memory or the third memory is a not-AND (NOR) flash. Since the reliability of the NOR flash is relatively high, the reliability of the ONIE startup file stored in the NOR flash is relatively high.

[0014] In a possible implementation, at least one of the ONIE startup files in the second memory and the third memory is a read-only ONIE startup file. In the case that the ONIE startup file is a read-only ONIE startup file, the user of the white box device cannot modify the ONIE startup file. In the case that the obtained ONIE startup file is a read-only ONIE startup file, the reliability of the obtained ONIE startup file is relatively high.

[0015] In a second aspect, a recovery apparatus of a white box device is provided, which includes: a running module configured to run a NOS in a first memory of the white box device; and a recovery module configured to, in the case that the running of the NOS fails, load an ONIE startup file in a second memory of the white box device into the first memory, and run the ONIE startup file in the first memory to restore the running of the NOS; and the recovery module is further configured to, in the case that at least one of loading the ONIE startup file fails or running the ONIE startup file fails, load an ONIE startup file in a third memory of the white box device into the first memory, and run the ONIE startup file in the first memory to restore the running of the NOS, the ONIE startup files in the second memory and the third memory being backups of each other.

[0016] In a possible implementation, the recovery module is configured to display an interactive interface of the white-box device in a case where the NOS fails to run; acquire an entering instruction generated based on selection of entering the escape mode on the interactive interface; and load the ONIE startup file in the second memory into the first memory based on the entering instruction.

[0017] In a possible implementation, the second memory is a memory in which a first-level startup program after power-on of the white-box device is stored.

[0018] In a possible implementation, the first-level startup program after power-on of the white-box device is BIOS, and the second memory is configured to run the BIOS; the running module is configured to run the BIOS in the second memory to load the NOS into the first memory; and the NOS is run in the first memory.

[0019] In a possible implementation, the ONIE startup file includes a kernel image and an initrd, and the initrd includes a root file system; the recovery module is configured to run the kernel image in the first memory to mount the initrd on the kernel image, acquire the root file system from the initrd, run the ONIE by running the root file system, acquire an installation package of the NOS by running the ONIE, install the NOS based on the installation package of the NOS, and run the NOS after successful installation of the NOS.

[0020] In a possible implementation, at least one of the second memory or the third memory is a NOR flash memory.

[0021] In a possible implementation, at least one of the ONIE startup files in the second memory and the third memory is a read-only ONIE startup file.

[0022] In a third aspect, a recovery device of a white-box device is provided, and the device includes a processor. When the processor executes program instructions or codes, the device implements the white-box device recovery method in any of the first aspect. Exemplarily, the device further includes a memory configured to store the program instructions or codes.

[0023] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores at least one program instruction or code. When the program instruction or code is loaded and executed by a processor, the computer implements the white-box device recovery method in any of the first aspect.

[0024] In a fifth aspect, a communication apparatus is provided, which comprises a transceiver, a memory and a processor. The transceiver, the memory and the processor are in communication with each other through internal connection paths. The memory is configured to store instructions, and the processor is configured to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals. When the processor executes the instructions stored in the memory, the processor is caused to perform the recovery method of the white-box device according to any one of the first aspect.

[0025] Exemplarily, the processor is one or more, and the memory is one or more.

[0026] Exemplarily, the memory can be integrated with the processor, or the memory and the processor are separately arranged.

[0027] In a specific implementation process, the memory can be a non-transitory memory, such as a read only memory (ROM), which can be integrated on the same chip with the processor, or arranged on different chips respectively. The type of the memory and the arrangement manner of the memory and the processor are not limited in the present application.

[0028] In a sixth aspect, a computer program or a computer program product is provided, which comprises computer program code. When the computer program code is run by a computer, the computer is caused to perform the recovery method of the white-box device according to any one of the first aspect.

[0029] In a seventh aspect, a chip is provided, which comprises a processor configured to call and run instructions stored in a memory, so that a network device installed with the chip performs the recovery method of the white-box device according to any one of the first aspect. Exemplarily, the chip further comprises an input interface, an output interface and the memory, and the input interface, the output interface, the processor and the memory are connected through internal connection paths.

[0030] It should be understood that the technical solutions of the second aspect to the seventh aspect of the present application and the corresponding possible implementation manners have the beneficial effects as described above for the first aspect and the corresponding possible implementation manners, which will not be described here again. BRIEF DESCRIPTION OF DRAWINGS

[0031] FIG. 1 is a process schematic diagram of installing NOS on a white-box device according to an embodiment of the present application;

[0032] FIG. 2 is a process schematic diagram of running NOS on a white-box device according to an embodiment of the present application;

[0033] FIG. 3 is a process schematic diagram of running ONIE on a white-box device in a related art;

[0034] FIG. 4 is a schematic diagram of a process of recovering ONIE by a white-box device in the related art;

[0035] FIG. 5 is a schematic diagram of a white-box device connected with a U disk and a network server in the related art;

[0036] FIG. 6 is a schematic diagram of a white-box device failing to acquire an ONIE startup file in the related art;

[0037] FIG. 7 is another schematic diagram of a white-box device failing to acquire an ONIE startup file in the related art;

[0038] FIG. 8 is a schematic diagram of an implementation environment of a recovery method of a white-box device according to an embodiment of the present application;

[0039] FIG. 9 is a flowchart of a recovery method of a white-box device according to an embodiment of the present application;

[0040] FIG. 10 is a schematic diagram of a hardware structure of a white-box device according to an embodiment of the present application;

[0041] FIG. 11 is a schematic diagram of a process of presetting a read-only ONIE startup file according to an embodiment of the present application;

[0042] FIG. 12 is a schematic diagram of acquiring an ONIE startup file according to an embodiment of the present application;

[0043] FIG. 13 is another schematic diagram of acquiring an ONIE startup file according to an embodiment of the present application;

[0044] FIG. 14 is a schematic diagram of a structure of a recovery device of a white-box device according to an embodiment of the present application;

[0045] FIG. 15 is a schematic diagram of a structure of a recovery device of a white-box device according to an embodiment of the present application;

[0046] FIG. 16 is another schematic diagram of a structure of a recovery device of a white-box device according to an embodiment of the present application. DETAILED DESCRIPTION

[0047] The terms used in the implementation part of the present application are only used to explain the embodiments of the present application, and are not intended to limit the present application. The embodiments of the present application are described below with reference to the accompanying drawings.

[0048] The traditional brand switch can be referred to as a black-box switch. The software and hardware in the black-box switch are closed development, which leads to low interoperability between devices of different manufacturers, and it is difficult for the operation and maintenance team to uniformly control. In the case of network failure including multiple black-box switches, it is difficult to locate the failure in multiple black-box switches. In addition, due to the closed development of software and hardware, the difficulty of upgrading and function expansion of the black-box switch is high.

[0049] White-box switch is a concept opposite to black-box switch. The software and hardware in the white-box switch can be decoupled, so that white-box switches of different manufacturers can use the same hardware and different software. In the case of consistent hardware of white-box switches, the hardware of each white-box switch does not need to be controlled separately, and the difficulty of controlling the white-box switch is lower. In the case of failure of a network including multiple white-box switches, the difficulty of locating the fault is lower. In addition, since the software and hardware of the white-box switch are decoupled, at least one of the upgrading or expanding functions is realized by software, without processing the hardware, the difficulty of upgrading or expanding the function of the white-box device is lower.

[0050] In addition, the white-box switch is usually used with software defined network (SDN) to establish a communication network. In the white-box switch, the hardware includes but is not limited to at least one of a switching chip, a central processing unit (CPU) chip, a network card, a memory or a peripheral hardware device, and the interface and structure of the hardware need to conform to the open compute project (OCP) standardized specification. The software of the white-box switch includes but is not limited to at least one of a network operating system (NOS) or a network application of the NOS. In the case of different networks adapting different NOSs, the white-box switch can adapt to different networks by installing different NOSs on the same physical hardware.

[0051] The white-box switch belongs to a kind of white-box devices. The white-box device needs to install NOS through ONIE, wherein the ONIE is a basic operating system (OS) running environment, and the ONIE allows different NOSs to be installed on the white-box device without changing the hardware of the white-box device. Fig. 1 is a process diagram of installing NOS on a white-box device according to an embodiment of the present application. As shown in Fig. 1, in the BIOS stage, the operating system loader (osloader) of the white-box device starts the basic operating system, and enters the OS stage. In the OS stage, the ONIE is run to obtain the installation package of the NOS through the network or the USB, and the NOS is installed. The osloader and the ONIE are provided by the hardware manufacturer to which the white-box device belongs, and the NOS installation package and the NOS are provided by the NOS software manufacturer.

[0052] After the NOS is installed, if the white-box device is started again, the stage of running the ONIE will be skipped, and the NOS will be directly run. FIG. 2 is a schematic diagram of a process of running the NOS on the white-box device according to an embodiment of the present application. As shown in FIG. 2, in the BIOS stage, the osloader starts the underlying operating system, and enters the OS stage. In the OS stage, the osloader directly acquires the NOS, and runs the NOS without running the ONIE again.

[0053] Exemplarily, the osloader can provide a menu for selecting the ONIE mode, so that the user can select the ONIE mode to be used through the menu. The ONIE mode includes, but is not limited to, at least one of an install NOS mode, an uninstall NOS mode, an update ONIE mode, or an escape mode. In the install NOS mode, the NOS can be automatically installed when the ONIE is running. In the uninstall NOS mode, the NOS can be automatically uninstalled when the ONIE is running. In the update ONIE mode, the ONIE can be updated when the ONIE is running. In the escape mode, the ONIE can be run by acquiring the ONIE startup file, and the NOS can be restored by running the ONIE. In the case that both the ONIE and the NOS of the white-box device fail to run, the ONIE needs to be restored, and then the NOS is restored through the ONIE, so as to restore the running of the NOS.

[0054] FIG. 3 is a schematic diagram of a process of running the ONIE on the white-box device in the related art. After the white-box device is powered on, the BIOS is run, the osloader is loaded into the memory through the BIOS, and the osloader is run. The operations of running the BIOS and loading the osloader are not shown in FIG. 3. The osloader acquires the ONIE startup file, loads the ONIE startup file into the memory, and enters the operating system interface of the ONIE by booting the ONIE startup file, so as to run the ONIE. As shown in FIG. 3, the ONIE startup file includes a kernel image and an initrd, and the kernel image and the initrd are stored in the main memory of the white-box device, which can be a serial advanced technology attachment (SATA) hard disk.

[0055] In the related art, in the case that both ONIE and NOS fail to run, the ONIE startup file is obtained from an external network server or a universal serial bus flash disk (USB disk), and then the ONIE startup file is loaded into the memory, the ONIE startup file is booted to enter the operating system interface of ONIE, ONIE is run, and NOS is recovered by running ONIE. The USB disk is also called U disk.

[0056] FIG. 4 is a process diagram of a white box device recovering ONIE in the related art. As shown in FIG. 4, the kernel image and initrd in the main memory are both damaged, so that the ONIE startup file cannot be obtained from the main memory, and the ONIE startup file cannot be loaded into the memory to run ONIE in the memory. In the case that both NOS and ONIE fail to run, the white box device can only run osloader. In this case, as shown in FIG. 4, the osloader obtains the ONIE startup file, that is, the kernel image and initrd, from the U disk or the network server. The obtained ONIE file is loaded into the memory, and ONIE is run in the memory.

[0057] In the case of obtaining the ONIE startup file from the network server, the white box device can obtain the ONIE startup file from the network server based on any one of file transfer protocols, such as file transfer protocol (FTP), trivial file transfer protocol (TFTP), or secure shell protocol file transfer protocol (SFTP). In addition, in the case of obtaining the ONIE startup file from the network server, the white box device needs to include a separate management network interface, and ensure that the management network interface can be connected in communication with the network server. In the case of obtaining the ONIE startup file from the U disk, the white box device needs to include a USB interface and the U disk has been inserted into the USB interface. Thus, in the related art, if the ONIE startup file is obtained from the network server or the U disk to recover the running of ONIE, the following premises 1 to 3 need to be met.

[0058] Premise 1: Since the ONIE recovery method in the related art relies on hardware implementation, the white box device needs to have a USB interface or a management network interface. Both the USB interface and the management network interface are connected with the CPU of the white box device.

[0059] Precondition 2: If the white-box device has a USB interface, the hardware and software driver of the white-box device need to ensure that the USB interface is available; if the white-box device has a management network interface, the hardware and software driver of the white-box device need to ensure that the management network interface is available.

[0060] Precondition 3: If the white-box device has a USB interface, a U disk needs to be inserted into the USB interface of the white-box device; if the white-box device has a management network interface, it is needed to ensure that the communication link between the white-box device and a network server implemented based on the management network interface is normal. The U disk and the network server store an ONIE startup file.

[0061] FIG. 5 is a schematic diagram of a white-box device connected with a U disk and a network server in the related art. As shown in FIG. 5, the white-box device includes a CPU, a physical layer (PHY) module, a management network interface, and a USB interface, wherein the physical layer module is connected with the CPU and the management network interface respectively, to realize the connection between the CPU and the management network interface, and the CPU is further connected with the USB interface. In the case of connecting with the network server storing the ONIE startup file through the management network interface, if the communication link is normal, the management network interface hardware is normal, and the driver of the management network interface works normally, the white-box device can obtain the ONIE startup file from the network server. In the case of inserting the U disk storing the ONIE startup file into the USB interface, if the USB interface hardware is normal and the driver of the USB interface works normally, the white-box device can obtain the ONIE startup file from the U disk.

[0062] However, the way of obtaining the ONIE startup file from the network server or the U disk increases the risk of the white-box device being attacked from outside. In addition, if at least one of the following conditions occurs, the white-box device cannot obtain the ONIE startup file from the U disk: the USB interface is unavailable or the U disk is not inserted. If at least one of the following conditions occurs, the white-box device cannot obtain the ONIE startup file from the network server: the communication link between the white-box device and the network server is abnormal or the network management interface is unavailable, resulting in low reliability of obtaining the ONIE startup file.

[0063] Figure 6 is a diagram illustrating that a white-box device cannot obtain an ONIE startup file in the related art. In Figure 6, the USB interface of the white-box device is not plugged into a U disk. As shown in (1) of Figure 6, in the case that the driver of the management network interface is not working properly, even if the communication link between the white-box device and the network server storing the ONIE startup file is normal, the hardware of the management network interface is normal, the hardware of the USB interface is normal, and the driver of the USB interface is working properly, the white-box device cannot obtain the ONIE startup file from the network server. As shown in (2) of Figure 6, in the case that the communication link between the white-box device and the network server storing the ONIE startup file is not normal, even if the driver of the management network interface is working properly, the hardware of the management network interface is normal, the hardware of the USB interface is normal, and the driver of the USB interface is working properly, the white-box device cannot obtain the ONIE startup file from the network server. As shown in (3) of Figure 6, in the case that the hardware of the management network interface is not normal, even if the communication link between the white-box device and the network server storing the ONIE startup file is normal, the driver of the management network interface is working properly, the hardware of the USB interface is normal, and the driver of the USB interface is working properly, the white-box device cannot obtain the ONIE startup file from the network server.

[0064] Figure 7 is a diagram illustrating that a white-box device cannot obtain an ONIE startup file in another related art. In Figure 7, the white-box device is not connected to a network server. As shown in (1) of Figure 7, in the case that the hardware of the USB interface is not normal, even if the USB interface is plugged into a U disk, the driver of the USB interface is working properly, the driver of the management network interface is working properly, and the hardware of the management network interface is normal, the white-box device cannot obtain the ONIE startup file from the U disk. As shown in (2) of Figure 7, in the case that the driver of the USB interface is not working properly, even if the USB interface is plugged into a U disk, the hardware of the USB interface is normal, the driver of the management network interface is working properly, and the hardware of the management network interface is normal, the white-box device cannot obtain the ONIE startup file from the U disk. As shown in (3) of Figure 7, in the case that the USB interface is not plugged into a U disk, even if the driver of the USB interface is working properly, the hardware of the USB interface is normal, the driver of the management network interface is working properly, and the hardware of the management network interface is normal, the white-box device cannot obtain the ONIE startup file from the U disk.

[0065] The embodiment of the present application provides a white box device recovery method, which is used for improving the reliability of obtaining an ONIE startup file, thereby improving the reliability of running NOS based on the ONIE startup file. FIG. 8 is a schematic diagram of an implementation environment of a white box device recovery method provided by the embodiment of the present application. As shown in FIG. 8, the method can be applied to a white box device, and the white box device includes but is not limited to a processor 801, a first memory 802, a second memory 803 and a third memory 804, wherein the processor 801 is connected with the first memory 802, the second memory 803 and the third memory 804 respectively. Exemplarily, the white box device is a white box switch, the processor 801 is a CPU, and the first memory 802 is a random access memory (RAM). The second memory 803 is a startup flash, for example, the second memory 803 is a NOR flash. The third memory 804 is a main memory, for example, the third memory 804 is a SATA hard disk. The white box device can further include other modules, which are not limited in the embodiment of the present application.

[0066] The white box device recovery method provided by the embodiment of the present application can be as shown in FIG. 9. Next, the method is described in combination with the implementation scenario shown in FIG. 8, and the method can be applied to the white box device shown in FIG. 8. As shown in FIG. 9, the method includes but is not limited to S901-S903.

[0067] S901, running NOS in the first memory of the white box device.

[0068] In a possible implementation, the white box device is a white box switch, and the first memory can be a RAM. Therefore, the white box device can run NOS in the RAM. Exemplarily, the white box device further includes a second memory and a third memory, the second memory is used for storing an ONIE startup file and a first-stage startup program after the white box device is powered on, and the third memory is used for storing the ONIE startup file. The second memory can be a startup flash of the white box device, for example, the second memory is a NOR flash. The third memory can be a main memory of the white box device, for example, the third memory is a SATA hard disk. Since the reliability of the NOR flash is higher than that of a NAND flash and a SATA hard disk, the reliability of storing the ONIE startup file is higher in the case that the ONIE startup file is stored in the NOR flash. The white box device can further include a processor, the processor is used as a control unit of the white box device, the processor can control operations performed by the first memory, the second memory and the third memory, and the processor can be a CPU.

[0069] Exemplarily, in the case that the third memory is a main memory and the white box device has installed NOS, the third memory is further used to store the installed NOS, and the NOS is run in the first memory of the white box device, including: after the white box device is powered on, running the first-level startup program; obtaining the NOS from the third memory by running the first-level startup program, and loading the NOS into the first memory; and running the NOS in the first memory. In the case that the white box device does not have installed NOS, the NOS is run in the first memory of the white box device, including: after the white box device is powered on, running the first-level startup program; obtaining the ONIE startup file from the second memory or the third memory by running the first-level startup program, and loading the ONIE startup file into the first memory; running ONIE in the first memory based on the ONIE startup file, obtaining the NOS installation package by running the ONIE; and installing the NOS in the first memory based on the NOS installation package, and running the NOS.

[0070] Exemplarily, the first-level startup program is stored in the second memory, and then the white box device can run the first-level startup program in the second memory after being powered on, so as to trigger the running of the NOS in the first memory. For example, the first-level startup program after the white box device is powered on is BIOS, and the second memory is used to run the BIOS in the first memory of the white box device, including: running the BIOS in the second memory to load the NOS into the first memory, and running the NOS in the first memory. Thus, the method can be applied to the white box device using BIOS.

[0071] Exemplarily, the second memory further stores osloader, and the running of the BIOS in the second memory to load the NOS into the first memory includes: running the BIOS in the third memory; loading the osloader into the first memory by running the BIOS in the third memory, and running the osloader in the first memory to load the NOS into the first memory. For example, in the case that the NOS has been installed and the installed NOS is stored in the third memory, the NOS is obtained from the third memory by running the osloader in the first memory, and the NOS is loaded into the first memory. For another example, in the case that the NOS has not been installed, the ONIE startup file is obtained from the second memory or the third memory by running the osloader in the first memory, and the ONIE startup file is loaded into the first memory; ONIE is run in the first memory based on the ONIE startup file, the NOS installation package is obtained by running the ONIE; and the NOS is installed in the first memory based on the NOS installation package, and the NOS is run in the first memory.

[0072] S902, in the case of NOS running failure, loading the ONIE startup file in the second memory of the white box device into the first memory, running the ONIE startup file in the first memory to restore the running of the NOS.

[0073] In a possible implementation, the white box device further comprises a third memory, and the third memory stores an ONIE startup file. The ONIE startup files in the second memory and the third memory are backups of each other. For example, the ONIE startup file in the second memory and the ONIE startup file in the third memory are respectively an ONIE startup file used for starting the running of the ONIE and an ONIE startup file used for backup. For example, in the case that the ONIE startup file in the second memory is the ONIE startup file used for starting the running of the ONIE and the ONIE startup file in the third memory is the ONIE startup file used for backup, the ONIE startup file is obtained from the second memory by running the osloader in the first memory, and the ONIE startup file is loaded into the first memory. For another example, in the case that the ONIE startup file in the third memory is the ONIE startup file used for starting the running of the ONIE and the ONIE startup file in the second memory is the ONIE startup file used for backup, the ONIE startup file is obtained from the third memory by running the osloader in the first memory, and the ONIE startup file is loaded into the first memory.

[0074] In the case that the ONIE startup file in the second memory is the ONIE startup file used for backup, the area in the second memory used for storing the ONIE startup file can be referred to as an escape partition. In the case that the ONIE startup file in the third memory is the ONIE startup file used for backup, the area in the third memory used for storing the ONIE startup file can be referred to as an escape partition. For example, at least one of the second memory or the third memory is a NOR flash. Since the NOR flash has high reliability, the reliability of storing the ONIE startup file in the NOR flash is high.

[0075] In a possible implementation, the second memory further stores a first-level startup program after the white box device is powered on. Since the reliability of the memory used for storing the first-level startup program after the white box device is powered on is high, by storing the ONIE startup file in the second memory, the reliability of storing the ONIE startup file is high.

[0076] Fig. 10 is a schematic diagram of a hardware structure of a white box device according to an embodiment of the present application. As shown in Fig. 10, the white box device includes a CPU, a RAM, a main memory and a startup flash memory. The CPU is connected to the RAM, the main memory and the startup flash memory respectively, and the CPU is a control unit of the white box device. The main memory stores an ONIE startup file, and the main memory can also store a NOS, which is not shown in Fig. 10. The startup flash memory stores the ONIE startup file in an escape partition of the startup flash memory, and the startup flash memory also stores a BIOS and an osloader in other areas of the startup flash memory except the escape partition. The BIOS is a first level startup program after the white box device is powered on. The RAM is a first memory of the white box device, the startup flash memory is a second memory of the white box device, and the main memory is a third memory of the white box device.

[0077] In the white box device shown in Fig. 10, after the white box device is powered on, the BIOS in the startup flash memory is run first, the osloader in the startup flash memory is loaded into the RAM by the BIOS, and the osloader in the RAM is run. The ONIE startup file or the NOS is obtained from the main memory by running the osloader in the RAM, the obtained ONIE startup file or NOS is loaded into the RAM, and the ONIE startup file or NOS in the RAM is run. In the case of obtaining the ONIE startup file, the ONIE startup file is run to run the ONIE, the NOS installation package is obtained by running the ONIE, the NOS is installed based on the NOS installation package, and the NOS is run after the NOS is successfully installed. In the case of obtaining the NOS, the NOS is run. In the case of NOS running failure, the ONIE startup file is obtained from the escape partition of the startup flash memory, the ONIE startup file is loaded into the RAM, the ONIE startup file in the RAM is run to run the ONIE, the NOS is obtained by running the ONIE, and the NOS is run, thereby realizing the recovery of the running of the NOS.

[0078] In a possible implementation, at least one of the ONIE startup files in the second memory and the third memory is a read-only ONIE startup file. Thus, in the case of the ONIE startup file being a read-only ONIE startup file, the user of the white box device cannot modify the ONIE startup file. In the case of the obtained ONIE startup file being a read-only ONIE startup file, the reliability of the obtained ONIE startup file is higher.

[0079] The ONIE startup file in the second memory and the third memory can be pre-installed by the manufacturer of the white box device when the white box device is produced, and for the memory storing the read-only ONIE startup file, the memory is not updated after the white box device is delivered to the user. FIG. 11 is a process diagram of pre-installing the read-only ONIE startup file according to an embodiment of the present application. In FIG. 11, the ONIE startup file stored in the second memory is taken as an example of the read-only ONIE startup file. In this case, the ONIE startup file in the second memory is the backup ONIE startup file. As shown in FIG. 11, the second memory includes a first storage area and a second storage area. The first storage area is used to store the BIOS and the osloader, and the second storage area is used as an escape partition. The escape partition is used to store the backup ONIE startup file, which is the read-only ONIE startup file. The manufacturer of the white box device directly writes the ONIE startup file into the second storage area of the second memory during the production process when the white box device is produced, thereby realizing the pre-installation of the ONIE startup file. After the white box device is delivered to the user, the ONIE startup file in the second storage area is not updated.

[0080] Exemplarily, whether the ONIE startup file in the second memory or the ONIE startup file in the third memory, the ONIE startup file includes a kernel image and an initrd, and the initrd includes a root file system. Therefore, the method can be applied to the white box device using the kernel image and the initrd. The kernel image and the initrd are two files stored respectively. Exemplarily, the kernel image and the initrd each include at least one program instruction, wherein the program instruction included in the kernel image is executed in the kernel space, and the program instruction included in the initrd is executed in the user space. By dividing the ONIE startup file into the kernel image and the initrd, the complexity of the program instruction included in the kernel image is lower, so that the complexity of the program instruction executed in the kernel is lower.

[0081] Exemplarily, in the case that the ONIE startup file includes a kernel image and an initrd, running the ONIE startup file in the first memory to restore the running of the NOS includes: running the kernel image in the first memory to mount the initrd on the kernel image, and obtaining a root file system from the initrd; running the ONIE by running the root file system; obtaining an installation package of the NOS by running the ONIE; installing the NOS based on the installation package of the NOS, and running the NOS after the NOS is successfully installed. In a possible implementation, the kernel image and the initrd are obtained twice and loaded into the first memory. Taking obtaining the kernel image and the initrd from the second memory as an example, the kernel image is first obtained from the second memory, loaded into the first memory, and run in the first memory; then, the position of the initrd in the second memory is determined by running the kernel image, the initrd is obtained from the second memory, loaded into the first memory, and mounted on the kernel image.

[0082] In a possible implementation, the white-box device displays an interactive interface, and the interactive interface is used to select whether to enter the escape mode. In the case that the white-box device displays the interactive interface, the white-box device can determine whether to load the ONIE startup file in the second memory into the first memory based on the selection of whether to enter the escape mode. Therefore, even if the white-box device is not plugged into the U disk storing the ONIE startup file, and / or does not have a network connection with the network server storing the ONIE startup file, the white-box device can still obtain the ONIE startup file and restore the running of the NOS based on the ONIE startup file in the case that the white-box device enters the escape mode. Exemplarily, in the case that the NOS fails to run, loading the ONIE startup file in the second memory of the white-box device into the first memory includes: in the case that the NOS fails to run, displaying an interactive interface of the white-box device; obtaining an entering instruction generated based on the selection of entering the escape mode on the interactive interface; and loading the ONIE startup file in the second memory into the first memory based on the entering instruction.

[0083] FIG. 12 is a schematic diagram of obtaining an ONIE startup file according to an embodiment of the present application. As shown in FIG. 12, the osloader of the white-box device is further configured to trigger the display of an interactive interface, and the interactive interface includes an interactive menu. A user of the white-box device selects whether to enter the escape mode through an option of the interactive menu. The ONIE startup file is obtained from the second memory based on the selection of entering the escape mode. In FIG. 12, the second memory is a startup flash memory of the white-box device, or a main memory of the white-box device. The startup flash memory also stores a BIOS and an osloader, and the ONIE startup file is stored in two regions of the startup flash memory together with the BIOS and the osloader.

[0084] FIG. 13 is a schematic diagram of another method for obtaining the ONIE startup file according to an embodiment of the present application. As shown in FIG. 13, the white box device includes a USB interface and a management network interface, a U disk storing the ONIE startup file is plugged into the USB interface, the management network interface is connected to the CPU of the white box device through a physical layer module, and the white box device is connected to a network server storing the ONIE startup file through the management network interface. The white box device further includes a startup flash memory, and the startup flash memory stores a BIOS, an osloader and the ONIE startup file, wherein the BIOS and the osloader are stored in different areas of the startup flash memory.

[0085] The white box device can further include a main memory, which is not shown in FIG. 13. The main memory stores the ONIE startup file and the NOS. In the case that the ONIE startup file and the NOS stored in the main memory are both unavailable, and the ONIE startup file cannot be obtained from the network server and the U disk, the user of the white box device selects to enter the escape mode through an option of the interactive menu. Based on the selection to enter the escape mode, the ONIE startup file is obtained from the startup flash memory, the ONIE startup file is loaded into the RAM of the white box device, the ONIE startup file is run in the RAM to run the ONIE, and the running of the NOS is restored through the running of the ONIE. The RAM is not shown in FIG. 13.

[0086] S903, in the case that at least one of the loading of the ONIE startup file fails or the running of the ONIE startup file fails, the ONIE startup file in the third memory of the white box device is loaded into the first memory, and the ONIE startup file is run in the first memory to restore the running of the NOS, and the ONIE startup files in the second memory and the third memory are backups of each other.

[0087] That is, in the case that the ONIE startup file in the second memory cannot be loaded into the first memory, and / or the ONIE startup file loaded from the second memory cannot be run in the first memory, the method according to an embodiment of the present application can further attempt to obtain the ONIE startup file from the internal memory again, thereby improving the reliability of obtaining the ONIE startup file, and further improving the reliability of restoring the running of the NOS. The manner of loading the ONIE startup file into the first memory and the manner of running the ONIE startup file are the same as the related contents in S902, and will not be described herein again.

[0088] In the method provided by the embodiments of the present application, the multiple ONIE startup files that are mutually backed up are built in, so that the ONIE startup file can be obtained from the inside of the white box device in the case where the ONIE startup file cannot be obtained from the external network server and the U disk, and then the operation of the NOS is recovered based on the obtained ONIE startup file. The reliability of obtaining the ONIE startup file is high. In the case where the second memory stores the first-level startup program after the white box device is powered on, the second memory is usually a memory with high reliability. Therefore, in the case where the second memory also stores the ONIE startup file, the reliability of storing the ONIE startup file is high, and the reliability of obtaining the ONIE startup file from the second memory is high.

[0089] FIG. 14 is a structural schematic diagram of a recovery apparatus of a white box device provided by an embodiment of the present application. Based on the following multiple modules shown in FIG. 14, the apparatus can perform the recovery method of the white box device provided by the embodiments of the present application. It should be understood that the apparatus can include more additional modules than the shown modules or omit a part of the shown modules, and the embodiments of the present application do not limit this. As shown in FIG. 14, the apparatus includes a running module 1401 and a recovery module 1402.

[0090] The running module 1401 is configured to run the NOS in the first memory of the white box device. The recovery module 1402 is configured to, in the case where the NOS fails to run, load the ONIE startup file in the second memory of the white box device into the first memory, run the ONIE startup file in the first memory, and recover the operation of the NOS. The recovery module 1402 is further configured to, in the case where at least one of the loading of the ONIE startup file and the running of the ONIE startup file fails, load the ONIE startup file in the third memory of the white box device into the first memory, run the ONIE startup file in the first memory, and recover the operation of the NOS. The ONIE startup files in the second memory and the third memory are mutually backed up.

[0091] In a possible implementation, the recovery module 1402 is configured to, in the case where the NOS fails to run, display an interactive interface of the white box device, acquire an entering instruction generated based on selection of entering the escape mode on the interactive interface, and load the ONIE startup file in the second memory into the first memory based on the entering instruction.

[0092] In a possible implementation, the second memory is a memory that stores the first-level startup program after the white box device is powered on.

[0093] In a possible implementation, the first-stage starting program after the white box device is powered on is BIOS, and the second memory is used to run the BIOS; the running module 1401 is configured to run the BIOS in the second memory to load the NOS into the first memory; and the NOS is run in the first memory.

[0094] In a possible implementation, the ONIE starting file includes a kernel image and an initrd, and the initrd includes a root file system; the recovery module 1402 is configured to run the kernel image in the first memory to mount the initrd on the kernel image, to obtain the root file system from the initrd; to run the ONIE by running the root file system; to obtain the installation package of the NOS by running the ONIE; and to install the NOS based on the installation package of the NOS, and to run the NOS after the NOS is successfully installed.

[0095] In a possible implementation, at least one of the second memory or the third memory is a NOR flash memory.

[0096] In a possible implementation, at least one of the ONIE starting files in the second memory and the third memory is a read-only ONIE starting file.

[0097] The device provided by the embodiment of the present application has multiple ONIE starting files that are backed up to each other, so that the ONIE starting file can be obtained from the white box device in the case where the ONIE starting file cannot be obtained from the external network server and the U disk, and then the running of the NOS is recovered based on the obtained ONIE starting file. The reliability of the device for obtaining the ONIE starting file is high. In the case where the second memory stores the first-stage starting program after the white box device is powered on, the second memory is usually a memory with high reliability. Therefore, in the case where the second memory also stores the ONIE starting file, the reliability of storing the ONIE starting file is high, and the reliability of obtaining the ONIE starting file from the second memory is high.

[0098] It should be understood that the device provided by the above-described FIG. 14, when implementing the functions thereof, is only exemplified by the above-described division of functional modules, and in actual applications, the above-described functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided by the above-described embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be described here.

[0099] Referring to FIG. 15, FIG. 15 is a structural diagram of a recovery device of a white-box device according to an embodiment of the present application. As shown in FIG. 15, the recovery device of the white-box device is a recovery device 1500 of a white-box device. For ease of description, the recovery device 1500 of the white-box device is referred to as a device 1500. The device 1500 shown in FIG. 15 is configured to perform the white-box device recovery method shown in FIG. 9. The device 1500 can be implemented by a general bus architecture.

[0100] As shown in FIG. 15, the device 1500 includes at least one processor 1501, a memory 1503, and at least one communication interface 1504.

[0101] The processor 1501 is, for example, a central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits used to implement the schemes of the present application. For example, the processor 1501 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic device, transistor logic, a hardware component, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor can implement or execute various logical blocks, modules, and circuits described in connection with the disclosure of the embodiments of the present application. The processor can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0102] Optionally, device 1500 also includes a bus. The bus is used to transmit information between the components of device 1500. The bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. Buses can be categorized as address buses, data buses, control buses, and the like. For ease of illustration, FIG15 shows only one thick line, but this does not imply that there is only one bus or only one type of bus.

[0103] The memory 1503 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1503 is, for example, independent and connected to the processor 1501 via a bus. The memory 1503 can also be integrated with the processor 1501.

[0104] The communication interface 1504 uses any transceiver-type device for communicating with other devices or communication networks, which can be an Ethernet, a radio access network (RAN), a wireless local area networks (WLAN), etc. The communication interface 1504 can include a wired communication interface and also include a wireless communication interface. Specifically, the communication interface 1504 can be an Ethernet interface, a fast Ethernet (FE) interface, a gigabit Ethernet (GE) interface, an asynchronous transfer mode (ATM) interface, a WLAN interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In embodiments of the present application, the communication interface 1504 can be used for the device 1500 to communicate with other devices.

[0105] In particular implementations, as one example, the processor 1501 can include one or more CPUs, such as CPU0 and CPU1 as shown in FIG. 15. Each of these processors can be a single-CPU processor or a multi-CPU processor. A processor, as used herein, can refer to one or more devices, circuits, and / or processing cores for processing data, such as computer program instructions.

[0106] In particular implementations, as one example, the device 1500 can include multiple processors, such as the processor 1501 and the processor 1505 as shown in FIG. 15. Each of these processors can be a single-CPU processor or a multi-CPU processor. A processor, as used herein, can refer to one or more devices, circuits, and / or processing cores for processing data, such as computer program instructions.

[0107] In particular implementations, as one example, the device 1500 can also include an output device and an input device. The output device is in communication with the processor 1501 and can display information in various ways. For example, the output device can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, a projector, or the like. The input device is in communication with the processor 1501 and can receive user input in various ways. For example, the input device can be a mouse, a keyboard, a touch screen device, a sensor device, or the like.

[0108] In some embodiments, the memory 1503 is configured to store program codes 1510 for implementing the solutions of the present application, and the processor 1501 can execute the program codes 1510 stored in the memory 1503. One or more software modules can be included in the program codes 1510. Alternatively, the processor 1501 itself can also store program codes or instructions for implementing the solutions of the present application.

[0109] The device 1500 can also correspond to the apparatus shown in FIG. 14, and each functional module in the apparatus shown in FIG. 14 is implemented by a software or hardware module of the device 1500. The steps of the recovery method of the white-box device shown in FIG. 9 are completed by integrated logic circuits of hardware in the processor of the device 1500 or instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being completed by a hardware processor, or being completed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, or the like. The storage medium is located in the memory, and the processor reads information in the memory and combines hardware to complete the steps of the above method. To avoid repetition, details are not described here.

[0110] FIG. 16 is a structural schematic diagram of another recovery device of a white-box device provided by an embodiment of the present application, and the device is used to execute the recovery method of the white-box device shown in FIG. 9. Devices can have relatively large differences due to different configurations or performances. The device can include one or more processors 1601 and one or more memories 1602, wherein the one or more memories 1602 store at least one computer program, and the at least one computer program is loaded and executed by the one or more processors 1601. The device can also have a wired or wireless network interface, a keyboard, and an input and output interface, and the like, so as to perform input and output, and the device can also include other components for implementing the functions of the device, which are not described here.

[0111] The embodiments of the present application also provide a recovery device of a white-box device, which includes a processor, and when the processor executes program instructions or codes, the device implements the recovery method of the white-box device in the method embodiments. Exemplarily, the device further includes a memory, and the memory is configured to store the program instructions or codes.

[0112] The embodiments of the present application also provide a communication apparatus, which includes a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other through an internal connection path, the memory is configured to store instructions, and the processor is configured to execute the instructions stored in the memory to control the transceiver to transceive signals. When the processor executes the instructions stored in the memory, the processor executes the recovery method of the white-box device in the method embodiments.

[0113] It is to be understood that the above-described processor can be a CPU, and can also be other general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The general-purpose processor can be a microprocessor or any conventional processor, and the like. It is to be noted that the processor can be a processor supporting an advanced RISC machine (ARM) architecture.

[0114] Further, in an optional embodiment, the above-described memory can include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory can also include a non-volatile random access memory. For example, the memory can also store device type information.

[0115] The memory can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a ROM, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a RAM used as an external cache. By way of example and not limitation, many forms of RAM can be used. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0116] The embodiment of the present application also provides a computer readable storage medium, and at least one program instruction or code is stored in the computer readable storage medium. When the program instruction or code is executed by a computer, the computer implements the white box device recovery method in the above-described method embodiment.

[0117] The embodiment of the present application further provides a computer program or computer program product, which comprises computer program instructions or codes, and when the computer program instructions or codes are run by a computer, the computer executes the white-box device recovery method in the method embodiments.

[0118] The embodiment of the present application further provides a chip comprising a processor, which is used to run program instructions or codes, so that a device containing the chip executes the white-box device recovery method in the method embodiments. Exemplarily, the chip further comprises an input interface, an output interface and a memory, and the input interface, the output interface, the processor and the memory are connected through internal connection paths. The memory contains the program instructions or codes.

[0119] In the above embodiments, all or part of the embodiments can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part of the embodiments can be realized in the form of a computer program or computer program product. The computer program or computer program product comprises one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through a wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disc (digital video disc, DVD)) or a semiconductor medium (for example, a solid state disk (solid state disk, SSD)) and the like.

[0120] In order to clearly illustrate the interchangeability of hardware and software, the steps and components of the embodiments have been described in the above description in general terms. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0121] Computer program code for carrying out operations of the embodiments of the present application can be written in any combination of one or more programming languages. The computer program code can be provided to a processor of a general purpose computer, special purpose computer, or other programmable computing apparatus to produce a machine, such that the program code, when executed by the computer or other programmable computing apparatus, causes the machine to perform the functions / acts specified in the flowcharts and / or block diagrams. The program code can be entirely on the computer, partially on the computer, as a stand-alone software package, partially on the computer and partially on a remote computer, or entirely on a remote computer or server.

[0122] In the context of the embodiments of the present application, the computer program code or related data can be carried by any suitable carrier for enabling the device, apparatus or processor to perform the various processes and operations described above. Examples of the carrier include a signal, a computer readable medium, and the like. Examples of the signal can include an electrical, optical, radio, sound or other forms of propagated signals, such as a carrier wave, an infrared signal, and the like.

[0123] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and module can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.

[0124] In the several embodiments provided by the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the modules is only a logical function division. There can be another division manner in actual implementation. For example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the modules shown or discussed can be indirect coupling or communication connection through some interfaces, devices or modules, and can also be electrical, mechanical or other forms of connection.

[0125] The modules described as separate components can or can not be physically separate, and the components shown as modules can or can not be physical modules, i.e. they can be located in one place or distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0126] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically, or two or more modules can be integrated into one module. The above integrated module can be realized in the form of hardware or in the form of a software functional module.

[0127] The terms "first", "second", etc. are used to distinguish between similar items or items having substantially the same function, and it should be understood that there is no logical or chronological dependency between "first", "second", "nth", and that the quantity and execution order are not limited. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of various examples, a first memory can be referred to as a second memory, and similarly, a second memory can be referred to as a first memory.

[0128] It should also be understood that in various embodiments of the present application, the size of the serial number of various processes does not mean the order of execution, and the execution order of various processes should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0129] The term "at least one" in the present application means one or more, and the term "multiple" in the present application means two or more, for example, multiple memories refer to two or more memories. The terms "system" and "network" are often used interchangeably herein.

[0130] It should be understood that the terms used in the description of various examples herein are only for the purpose of describing specific examples and are not intended to be limiting. As used in the description of various examples and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0131] It should also be understood that the term "comprise" (also "includes", "including", "comprises" and / or "comprising") when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0132] It should also be understood that the phrase "if determined" or "if detected [stated condition or event]" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting" or "in response to detecting" [stated condition or event], depending on the context.

[0133] It should be understood that determining B according to A does not mean that B is determined only according to A, but B can also be determined according to A and / or other information.

[0134] It is also to be understood that the use of "an" or "the" article is not intended to specify how many of an entity are present, but rather is intended to be construed as "one or more" unless otherwise indicated by the context of the statement. It is further to be understood that the use of the term "about" in describing the disclosure is intended to mean that quantities, dimensions, values, and other parameters are not to be taken exactly, but are to be taken approximately. It is also to be understood that the use of the term "or" in the examples is intended to mean "and / or" unless otherwise indicated by the context of the statement.

[0135] The above description is merely that of optional embodiments of the application, and is not intended to limit the application. Any modification, equivalent replacements, improvements, and the like made within the principles of the application are to be included in the protection scope of the application.

Claims

1. A recovery method of a white-box device, characterized by, The method comprises: running a network operating system (NOS) in a first memory of a white box device; in the event of failure of running of the NOS, loading an open network installation environment (ONIE) startup file in a second memory of the white box device into the first memory, and running the ONIE startup file in the first memory to restore running of the NOS; in the event of at least one of failure of loading or failure of running of the ONIE startup file, loading an ONIE startup file in a third memory of the white box device into the first memory, and running the ONIE startup file in the first memory to restore running of the NOS, the ONIE startup files in the second memory and the third memory being backups of each other.

2. The method of claim 1, wherein, The loading of the ONIE startup file in the second memory into the first memory in the event of failure of running of the NOS comprises: in the event of failure of running of the NOS, displaying an interactive interface of the white box device; obtaining an entering instruction generated based on selection of entering an escape mode on the interactive interface; based on the entering instruction, loading the ONIE startup file in the second memory into the first memory.

3. The method according to claim 1 or 2, characterized in that, The second memory is a memory in which a first-level startup program after power-on of the white box device is stored.

4. The method according to any one of claims 1 to 3, characterized in that, The first-level startup program after power-on of the white box device is a basic input / output system (BIOS), and the second memory is configured to run the BIOS; The running of the NOS in the first memory of the white box device comprises: running the BIOS in the second memory to load the NOS into the first memory; and running the NOS in the first memory.

5. The method according to any one of claims 1 to 4, characterized in that, The ONIE startup file comprises a kernel image and a random access memory (RAM) disk initialized by a bootloader (initrd), and the initrd comprises a root file system; the running of the ONIE startup file in the first memory to restore running of the NOS comprises: running the kernel image in the first memory to mount the initrd on the kernel image, and obtaining the root file system from the initrd; running ONIE by running the root file system; obtaining an installation package of the NOS by running the ONIE; installing the NOS based on the installation package of the NOS, and running the NOS after successful installation of the NOS.

6. The method according to any one of claims 1 to 5, characterized in that, At least one of the second memory or the third memory is a not-OR (NOR) flash memory.

7. The method according to any one of claims 1 to 6, characterized in that, At least one of the ONIE startup files in the second memory and the third memory is a read-only ONIE startup file.

8. A recovery apparatus of a white-box device, characterized by comprising: The apparatus comprises: a running module configured to run a network operating system (NOS) in a first memory of a white box device; The recovery module is configured to, in a case where the NOS fails to run, load an open network installation environment (ONIE) startup file in a second memory of the white-box device into the first memory, and run the ONIE startup file in the first memory to recover running of the NOS. The recovery module is further configured to, in a case where at least one of loading or running of the ONIE startup file fails, load an ONIE startup file in a third memory of the white-box device into the first memory, and run the ONIE startup file in the first memory to recover running of the NOS, the ONIE startup files in the second memory and the third memory being backups of each other.

9. The apparatus of claim 8, wherein, The recovery module is configured to, in a case where the NOS fails to run, display an interactive interface of the white-box device, and acquire an entering instruction generated based on selection of entering an escape mode on the interactive interface. The recovery module is configured to, based on the entering instruction, load the ONIE startup file in the second memory into the first memory.

10. The apparatus of claim 8 or 9, wherein, The second memory is a memory in which a first-level startup program after power-on of the white-box device is stored.

11. The apparatus of any one of claims 8-10, wherein, The first-level startup program after power-on of the white-box device is a basic input / output system (BIOS), and the second memory is configured to run the BIOS. The running module is configured to run the BIOS in the second memory to load the NOS into the first memory.

12. The apparatus of any one of claims 8-11, wherein, The NOS is run in the first memory. The ONIE startup file includes a kernel image and a random access memory (RAM) disk initialized by a bootloader, and the RAM disk includes a root file system.

13. The apparatus of any one of claims 8-12, wherein, The recovery module is configured to run the kernel image in the first memory to mount the RAM disk on the kernel image, and acquire the root file system from the RAM disk.

14. The apparatus of any one of claims 8-13, wherein, The NOS is installed based on the installation package of the NOS, and the NOS is run after successful installation of the NOS.

15. A recovery device of a white-box device, characterized by, At least one of the second memory or the third memory is a not-and-or (NOR) flash memory.

16. The apparatus of claim 15, wherein, At least one of the ONIE startup files in the second memory and the third memory is a read-only ONIE startup file.

17. A computer-readable storage medium, characterized in that, The device includes a processor, and when the processor executes program instructions or codes, the device implements the method of any one of claims 1-7.

18. A computer program product, characterised in that, The device further includes a memory configured to store the program instructions or codes. The computer-readable storage medium stores at least one program instruction or code, which is loaded and executed by a processor to cause a computer to implement the method of any one of claims 1-7. The computer program product includes computer program codes, which, when executed by a computer, cause the computer to implement the method of any one of claims 1-7.

19. A chip, characterized by The chip comprises a processor configured to call and run instructions stored in a memory, so that a device installed with the chip performs the method as claimed in any one of claims 1-7.

20. The chip of claim 19, wherein, Also comprising: an input interface, an output interface, and the memory, which are connected through internal connection channels.

Citation Information

Patent Citations

  • Switch production line test method and system, terminal and storage medium

    CN114584499A

  • Methods and apparatus to manage workload domains in virtual server racks

    US20180157532A1

  • Network device measurements employing white boxes

    US20220247650A1

  • Boot method for embedded system

    US20230009689A1