Device upgrading method, storage device, network device and computer program product

CN122837869APending Publication Date: 2026-09-29HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510377931.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

当网络设备没有足够大的存储空间时,将无法下载合一包,而如果选择拓展网络设备的存储空间(一般要拓展到4G以上),现网中的网络设备数量众多,又会带来较高的扩容成本

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122837869A_ABST
    Figure CN122837869A_ABST
Patent Text Reader

Abstract

The application provides a device upgrading method, a storage device, a network device and a computer program product. The method comprises the following steps: a first device acquires attribute information of files in a first upgrading program package corresponding to a first network device; the first device comprises attribute information of files in an integrated program package and a plurality of upgrading program packages; the plurality of upgrading program packages correspond to a plurality of network devices including the first network device; the integrated program package comprises files in the plurality of upgrading program packages; and the attribute information comprises position information of corresponding files in the integrated program package; the first device acquires files in the first upgrading program package from the integrated program package according to the attribute information of the files in the first upgrading program package, and sends the acquired files to the first network device; and the first network device generates the first upgrading program package according to the files in the first upgrading program package, so as to be used for upgrading. Based on the scheme of the application, efficient upgrading can be realized in the case that the storage capacity of the network device is limited.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of equipment operation and maintenance, and in particular to a method for upgrading equipment, a storage device, a network device, and a computer program product. Background Technology

[0002] In network device maintenance scenarios, different network devices typically correspond to different software packages. These packages can be used to drive the hardware of the corresponding network device and implement specific business functions. However, the large number of network devices results in a large number of software packages. When a device needs an upgrade, maintenance personnel must search through a vast number of packages to find the corresponding one, then download and install it on the device, leading to low efficiency. To improve overall efficiency, multiple software packages can be merged into a single package, referred to as a unified package. Each network device can then upgrade itself by downloading and running this unified package. This eliminates the need for maintenance personnel to search through numerous packages, saving manpower and increasing efficiency.

[0003] As the services provided by network devices continue to evolve and the hardware of these devices iterates, bundled packages are becoming increasingly larger, placing higher demands on the storage capacity of these devices. When network devices do not have sufficient storage space, they will be unable to download bundled packages. On the other hand, if the storage space of the network devices is expanded (generally to 4GB or more), the large number of network devices in the existing network will lead to high expansion costs. Summary of the Invention

[0004] This application provides a device upgrade method, a storage device, a network device, and a computer program product, which can meet the high-efficiency upgrade needs of network devices with limited storage capacity.

[0005] In a first aspect, this application provides a device upgrade method, the method comprising: a first device obtaining attribute information of files in a first upgrade package corresponding to a first network device, wherein the first device includes an integration package and attribute information of files in multiple upgrade packages, the multiple upgrade packages corresponding to multiple network devices including the first network device, the integration package including files in the multiple upgrade packages, and the attribute information of files in the upgrade packages including the location information of the files in the upgrade packages within the integration package; then, the first device obtaining the files in the first upgrade package from the integration package according to the attribute information of the files in the first upgrade package, and sending the files in the first upgrade package to the first network device; the first network device generating a first upgrade package according to the files in the first upgrade package, and performing an upgrade according to the first upgrade package.

[0006] In the above scheme, the first network device can be any one of multiple network devices. When any of the multiple network devices needs to obtain a corresponding upgrade package for upgrading, the first device obtains the attribute information of the files in the upgrade package corresponding to that network device. The attribute information includes the location information of the corresponding files in the integration package. Based on the above attribute information, the first device can extract the files in the corresponding upgrade package of that network device from the integration package and then send the extracted files to that network device. After receiving the files in the required upgrade package, the network device assembles the received files into a complete upgrade package, and then performs the upgrade based on the upgrade package. Since the network device only obtains the files in the corresponding upgrade package from the first device on demand, without needing to obtain files from other upgrade packages, the storage space capacity requirement of the network device is low. Even if the storage space capacity of the network device is relatively limited, it can still support efficient upgrades for that network device without expanding the storage space capacity of the network device, thus saving costs. Moreover, the first device does not need to store multiple upgrade packages corresponding to multiple network devices. It only needs to store the integrated package that combines multiple upgrade packages. This can reduce the storage pressure on the first device and support the upgrade of multiple network devices based on the same integrated package, thereby improving the overall operation and maintenance efficiency.

[0007] Based on the first aspect, in a possible implementation, the first device further includes a mapping relationship between the attribute information of files in multiple upgrade packages and network device information. Thus, the first device can send the attribute information of files in multiple upgrade packages and the mapping relationship between the attribute information of files in multiple upgrade packages and network device information to the first network device. Then, based on the information of the first network device and the aforementioned mapping relationship, the first network device determines the attribute information of a target file from the attribute information of files in multiple upgrade packages as the attribute information of the file in the first upgrade package corresponding to the first network device, and then sends the attribute information of the file in the first upgrade package to the first device, wherein the network device information corresponding to the target file matches the information of the first network device.

[0008] In the above scheme, since the first device includes a mapping relationship between the attribute information of files in multiple upgrade packages and network device information, the first device can send the above mapping relationship and the attribute information of files in multiple upgrade packages to the first network device, so that the first network device can determine the attribute information of the required files in the first upgrade package. When the first network device receives the above information sent by the first device, the first network device can compare the information of the first network device with the network device information in the above mapping relationship. If the network device information corresponding to the attribute information of a certain file matches the information of the first network device, it means that the file is a file in the first upgrade package corresponding to the first network device, and then the attribute information of the file can be determined as the attribute information of the file in the first upgrade package. After the first network device sends the determined attribute information of the files in the first upgrade package to the first network device, the first device can extract the files in the first upgrade package from the integration package based on the received attribute information.

[0009] Based on the first aspect, in a possible implementation, the first device also includes a correspondence between the attribute information of files in multiple upgrade packages and network device information, as well as information of the first network device. In this case, the first device can determine the attribute information of the target file from the attribute information of the files in multiple upgrade packages based on the information of the first network device and the above correspondence, so as to use it as the attribute information of the file in the first upgrade package corresponding to the first network device, wherein the network device information corresponding to the target file matches the information of the first network device.

[0010] In the above scheme, since the first device includes the correspondence between the attribute information of files in multiple upgrade packages and network device information, as well as the information of multiple network devices (including the information of the first network device), the first device can extract the files in the first upgrade package from the integration package based on the above correspondence and the information of the first network device. That is, the first device compares the information of the first network device with the network device information in the above correspondence. If the network device information corresponding to the attribute information of a file matches the information of the first network device, it means that the file is a file in the first upgrade package corresponding to the first network device. Therefore, the attribute information of this file can be determined as the attribute information of the file in the first upgrade package. Based on the attribute information of the file in the first upgrade package, the file in the first upgrade package can be extracted from the integration package. Since this scheme allows the first device to determine the attribute information of the file in the first upgrade package corresponding to the first network device itself, without needing to delegate the determination to the first network device, the communication overhead between the first device and the first network device can be reduced, and the operational efficiency can be improved.

[0011] Based on the first aspect, in a possible implementation, the attribute information of the files in the upgrade package also includes the capacity of the upgrade package. Before the first device sends the files in the first upgrade package to the first network device, the first device may send the capacity of the first upgrade package corresponding to the first network device to the first network device. Then, the first network device allocates a first storage space in the first network device that meets the capacity of the first upgrade package. The first storage space is used to store the files in the first upgrade package sent by the first device.

[0012] In the above scheme, to confirm whether the first network device has sufficient storage space to store the first upgrade package, the first device can send the capacity of the first upgrade package to the first network device before sending the files in the first upgrade package to the first network device. If the first network device can allocate first storage space sufficient for the capacity of the first upgrade package, it indicates that the first network device has sufficient storage space, and the first storage space will be used to store the files in the first upgrade package subsequently sent by the first device. It should be understood that allocating the first storage space in advance (before receiving the corresponding files) can avoid insufficient storage space during the subsequent file reception process of the first network device, which would lead to file reception failure. File reception failure would prevent the first network device from generating the first upgrade package for upgrade. This application does not specifically limit the location of the first storage space in the first network device. If the first network device cannot allocate first storage space sufficient for the capacity of the first upgrade package, it indicates that the first network device has insufficient storage space, and the first network device can report insufficient space to the first network device to instruct the first network device to stop sending the corresponding files.

[0013] Based on the first aspect, in a possible implementation, the attribute information of the files in the upgrade package also includes the location information of the files in the upgrade package within the upgrade package. In this case, the first device can send the location information of the files in the first upgrade package within the first upgrade package to the first network device, so that the first network device can generate the first upgrade package based on the received files in the first upgrade package and their location information within the first upgrade package. That is, to ensure that the first network device can correctly assemble the first upgrade package based on the received files, the first device can also send the location information of the files in the first upgrade package within the first upgrade package to the first network device.

[0014] Based on the first aspect, in a possible implementation, the upgrade package is either a software package corresponding to the network device corresponding to the upgrade package or a patch package corresponding to the software package.

[0015] Based on the first aspect, in a possible implementation, when the upgrade package is a patch package corresponding to a software package, the attribute information of the files in the upgrade package also includes the version information of the software package. The version information in the attribute information of the files in the first upgrade package matches the version information of the software package in the first network device. That is, when the first network device needs to obtain a patch package, it needs to combine the information of the first network device and the version information of the software package in the first network device to determine the files in the patch package corresponding to the first network device and matching the version information of the software package in the first network device from the integration package.

[0016] Based on the first aspect, in a possible implementation, the attribute information of the files in the first upgrade package also includes verification information. Before the first network device upgrades according to the first upgrade package, the first device can send the verification information of the files in the first upgrade package to the first network device. Then, the first network device verifies whether the files in the first upgrade package obtained by the first network device are valid based on the aforementioned verification information. If the obtained files are confirmed to be valid, the first network device generates the first upgrade package based on the obtained files. If the obtained files are invalid, the first network device can report that the files are invalid, and may even request the corresponding files again from the first network device.

[0017] Based on the first aspect, in a possible implementation, the size of the integrated package is less than the sum of the sizes of the multiple upgrade packages. That is, during the integration of multiple upgrade packages, files in these packages can be deduplicated, ensuring that the size of the integrated package is less than the sum of the sizes of the individual upgrade packages, thereby reducing the storage space occupied by the integrated package on the first device.

[0018] Based on the first aspect, in a possible implementation, the location information of the files in the first upgrade package within the integration package includes the starting location information of the files in the first upgrade package within the integration package and the size of the files in the first upgrade package.

[0019] Based on the first aspect, in possible implementations, the files in the first upgrade package include at least one of the following types of files:

[0020] Documents related to the hardware of the first network device;

[0021] Files related to the operating system of the first network device;

[0022] Documents related to fixed services provided by the first network device;

[0023] Documents related to optional services provided by the first network device.

[0024] Secondly, this application provides another device upgrade method, which includes: a first device obtaining attribute information of files in a first upgrade package corresponding to a first network device, wherein the first device includes attribute information of files in an integration package and multiple upgrade packages, the multiple upgrade packages corresponding to multiple network devices including the first network device, the integration package including files in the multiple upgrade packages, and the attribute information of files in the upgrade packages including the location information of the files in the upgrade packages within the integration package; the first device obtaining files in the first upgrade package from the integration package according to the attribute information of the files in the first upgrade package; and the first device sending the files in the first upgrade package to the first network device, wherein the first network device is used to generate a first upgrade package based on the files in the first upgrade package and perform an upgrade based on the first upgrade package.

[0025] Based on the second aspect, in a possible implementation, the first device sends attribute information of files in multiple upgrade packages and the correspondence between the attribute information of files in multiple upgrade packages and network device information to the first network device; the first device receives attribute information of files in the first upgrade package corresponding to the first network device sent by the first network device, wherein the attribute information of files in the first upgrade package is determined by the first network device from the attribute information of files in multiple upgrade packages based on the information of the first network device and the correspondence.

[0026] Based on the second aspect, in a possible implementation, the first device also includes the correspondence between the attribute information of files in multiple upgrade packages and network device information, as well as the information of the first network device. Thus, the first device can determine the attribute information of the target file from the attribute information of the files in multiple upgrade packages based on the information of the first network device and the correspondence, so as to use it as the attribute information of the file in the first upgrade package corresponding to the first network device, wherein the network device information corresponding to the target file matches the information of the first network device.

[0027] Based on the second aspect, in a possible implementation, the attribute information of the files in the upgrade package also includes the capacity of the upgrade package. Before the first device sends the files in the first upgrade package to the first network device, the first device may send the capacity of the first upgrade package corresponding to the first network device to the first network device. The first network device is used to allocate a first storage space in the first network device that meets the capacity of the first upgrade package. The first storage space is used to store the files in the first upgrade package sent by the first device.

[0028] Based on the second aspect, in a possible implementation, the upgrade package is the software package corresponding to the network device to which the upgrade package is located, or the patch package corresponding to the aforementioned software package.

[0029] Based on the second aspect, in a possible implementation, the attribute information of the files in the first upgrade package also includes verification information. Thus, the first device can send the verification information of the files in the first upgrade package to the first network device, wherein the first network device is used to verify whether the files in the first upgrade package obtained by the first network device are valid based on the verification information.

[0030] Based on the second aspect, in possible implementations, the size of the integration package is less than the sum of the sizes of the multiple upgrade packages.

[0031] Thirdly, this application provides another device upgrade method, which includes: a first network device receiving files from a first upgrade package corresponding to the first network device sent by the first device, wherein the first device includes an integration package and attribute information of files in multiple upgrade packages, the multiple upgrade packages correspond to multiple network devices including the first network device, the integration package includes files from multiple upgrade packages, the attribute information of files in the upgrade packages includes the location information of the files in the upgrade packages within the integration package, and the files in the first upgrade package sent by the first device are determined by the first device from the integration package based on the attribute information of the files in the first upgrade package; the first network device generates a first upgrade package based on the files in the first upgrade package, and performs an upgrade based on the first upgrade package.

[0032] Based on the third aspect, in a possible implementation, before the first network device receives the files in the first upgrade package corresponding to the first network device sent by the first device, the first network device receives attribute information of files in multiple upgrade packages sent by the first device, as well as the correspondence between the attribute information of the files in the multiple upgrade packages and the network device information; the first network device determines the attribute information of the target file from the attribute information of the files in the multiple upgrade packages according to the information of the first network device and the correspondence, so as to use it as the attribute information of the file in the first upgrade package corresponding to the first network device, wherein the network device information corresponding to the target file matches the information of the first network device; the first network device sends the attribute information of the files in the first upgrade package to the first device.

[0033] Based on the third aspect, in a possible implementation, the attribute information of the files in the upgrade package also includes the capacity of the upgrade package. Before the first network device receives the files in the first upgrade package corresponding to the first network device sent by the first device, the first network device may receive the capacity of the first upgrade package corresponding to the first network device sent by the first device. The first network device allocates a first storage space in the first network device that meets the capacity of the first upgrade package, and the first storage space is used to store the files in the first upgrade package sent by the first device.

[0034] Based on the third aspect, in a possible implementation, the attribute information of the files in the upgrade package also includes the location information of the files in the upgrade package within the upgrade package. Thus, the first network device can generate the first upgrade package based on the files in the first upgrade package and the location information of the files in the first upgrade package sent by the first device within the first upgrade package.

[0035] Based on the third aspect, in a possible implementation, the upgrade package is the software package corresponding to the network device corresponding to the upgrade package or the patch package corresponding to the aforementioned software package.

[0036] Based on the third aspect, in a possible implementation, the attribute information of the files in the first upgrade package also includes verification information. Before upgrading according to the first upgrade package, the first network device can verify whether the files in the first upgrade package obtained by the first network device are valid based on the verification information of the files in the first upgrade package sent by the first device.

[0037] Based on the third aspect, in possible implementations, the size of the integration package is less than the sum of the sizes of the multiple upgrade packages.

[0038] Fourthly, this application provides a storage device including a processor and a memory, the processor being configured to execute instructions in the memory to cause the storage device to perform the operation steps of the first device in the method as described in any one of claims 12-18.

[0039] Fifthly, this application provides a network device including a processor and a memory, the processor being configured to execute instructions in the memory to cause the network device to perform the operation steps of the first device in the method as described in any one of claims 19-25.

[0040] In a sixth aspect, this application provides a computer program product including instructions that, when executed by a storage device, cause the storage device to perform the operating steps of the first device as described in any possible embodiment of the second aspect.

[0041] In a seventh aspect, this application provides another computer program product, including instructions that, when executed by a network device, cause the network device to perform the operating steps of the first network device as described in any possible embodiment of the third aspect.

[0042] Eighthly, this application provides a computer-readable storage medium including computer program instructions that, when executed by a storage device, cause the storage device to perform the operating steps of the first device in any possible embodiment of the second aspect.

[0043] Ninthly, this application provides another computer-readable storage medium, including computer program instructions that, when executed by a network device, cause the network device to perform the operating steps of the first network device in any possible embodiment of the third aspect. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments are briefly introduced below.

[0045] Figure 1 This is a schematic flowchart of a device upgrade method provided in an embodiment of this application;

[0046] Figure 2 This is a schematic diagram illustrating the relationship between the multiple software packages and the integration package provided in the embodiments of this application;

[0047] Figure 3 This is a schematic diagram illustrating the relationship between the multiple patch packages and the integration package provided in the embodiments of this application;

[0048] Figure 4 This is a schematic diagram illustrating a scenario of downloading files from a software package on demand, as provided in an embodiment of this application.

[0049] Figure 5 This is a schematic diagram illustrating a scenario of downloading files in a patch package on demand, as provided in an embodiment of this application.

[0050] Figure 6 This is a schematic diagram of the structure of a storage device provided in an embodiment of this application;

[0051] Figure 7 This is a schematic diagram of the structure of a network device provided in an embodiment of this application. Detailed Implementation

[0052] Please see Figure 1 , Figure 1 This is a flowchart illustrating a device upgrade method provided in an embodiment of this application, including steps S101 to S103.

[0053] S101. The first device obtains the attribute information of the files in the first upgrade package corresponding to the first network device. The first device includes the attribute information of the files in the integration package and multiple upgrade packages. The multiple upgrade packages correspond to multiple network devices including the first network device. The integration package includes the files in the multiple upgrade packages. The attribute information of the files in the upgrade packages includes the location information of the files in the upgrade packages in the integration package.

[0054] The first device described above is a device with storage capabilities, capable of storing the aforementioned integrated program package. This application does not specifically limit the type of the first device. For example, the first device could be a server (such as a file server or other storage server), a desktop computer, a storage array, or a network management system, etc.

[0055] This application does not specifically limit the type of each of the aforementioned network devices. For example, a network device can be a router, switch, or gateway. The first network device is one of these network devices and can be a specific or arbitrary one.

[0056] The aforementioned network devices correspond to multiple upgrade packages, including the first upgrade package corresponding to the first network device. It should be understood that the upgrade package corresponding to a network device refers to a collection of program code used to upgrade (update) that network device, which is encapsulated into a program package.

[0057] This application does not specify the type of upgrade package. For example, an upgrade package can be a software package for a network device or a patch package corresponding to that software package. A software package for a network device refers to a package that performs a (comprehensive / extensive) update to the operating system or functions of the network device, which may include adding or removing service functions, performance optimization, user interface improvements, etc. A patch package corresponding to a network device software package refers to files used to update and fix problems or vulnerabilities in the corresponding software package, typically containing content for partial (small-scale) updates to the software package, fixing security vulnerabilities, and improving stability or security. The size of a patch package is usually much smaller than the size of the software package. Upgrading through patch packages allows for quick fixing of problems in the software package and the release of a new version without having to re-release the entire software package. Patch packages are usually based on the overlay principle, applying smaller patches to existing software packages, thus avoiding the need to download the entire software package.

[0058] Optionally, the network device's software package includes multiple components, such as a hardware package, an operating system (OS) package, a basic service package, and a value-added service package, each package undertaking different functions. The hardware package provides hardware-related functions, such as hardware drivers; the operating system provides functions such as process management and memory management; the basic service package provides the network device's basic service functions (fixed functions); and the value-added service package provides the network device's optional service functions. This application does not specifically limit the aforementioned basic and optional services.

[0059] Optionally, the aforementioned multiple network devices and multiple upgrade packages can correspond one-to-one, meaning each upgrade package corresponds to one network device; or, each upgrade package corresponds to at least two network devices. This application does not specifically limit the number of upgrade packages corresponding to each upgrade package. For example, suppose there are three series (or types / models) of routers: A, B, and C. Each series of routers corresponds to one upgrade package, and routers in the same series can be upgraded based on the same upgrade package. This application does not specifically limit how the series are divided.

[0060] This application does not impose specific limitations on the format of the upgrade package. For example, the upgrade package can be a source code file written in C++ (programming language) with a .cc extension or other binary file formats. Each upgrade package may include one or more files that work together to implement the functionality provided by the upgrade package. This application does not impose specific limitations on the number of files in the upgrade package.

[0061] This application does not specifically limit the types of files in the upgrade package. For example, the upgrade package may include files of at least one of the following types:

[0062] 1. Hardware-related files for the network device corresponding to the upgrade package;

[0063] 2. OS-related files for the network device corresponding to the upgrade package;

[0064] 3. Files related to fixed services provided by the network device corresponding to the upgrade package;

[0065] 4. Files related to optional services provided by the network device corresponding to the upgrade package.

[0066] The aforementioned integrated package refers to a single package formed by merging (integrating / merging) multiple upgrade packages corresponding to multiple network devices. The integrated package includes files from the multiple upgrade packages. For ease of description, the package size will be referred to as the package capacity. The capacity of the integrated package can be less than the sum of the capacities of the multiple upgrade packages. For example, assuming that both the first and second upgrade packages contain a first file, the integrated package can contain only one copy of the first file, eliminating the need to store two copies, thus achieving deduplication and reducing the size of the integrated package.

[0067] The attribute information of files in the upgrade package includes the location information of the files in the upgrade package within the integration package. Each file in the upgrade package can have corresponding location information, which is used to indicate the location of the corresponding file within the integration package, so as to obtain / locate the file from the integration package.

[0068] Optionally, the location information of a file in the upgrade package within the integration package includes the file's starting position within the integration package and the file's size within the upgrade package. The file size refers to the file's actual size, i.e., the amount of data it contains, typically measured in bytes. For ease of description, the file size will be referred to as the file's capacity below. For example, for a file in the first upgrade package corresponding to the first network device, its location information within the integration package includes the file's starting position within the integration package and the file's capacity. The starting position information can be represented by the offset of the file's starting position relative to the starting position of the integration package.

[0069] This application does not impose specific limitations on the positional relationship between the attribute information of files in the integration package and multiple upgrade packages. For example, the attribute information of files in multiple upgrade packages may be located outside the integration package, but the binding relationship between the attribute information of files in multiple upgrade packages and the integration package needs to be recorded so that the required files in the upgrade package can be found in the integration package based on the attribute information of files in multiple upgrade packages. Alternatively, the attribute information of files in multiple upgrade packages may be located within the integration package, thus the required files in the upgrade package can be found in the integration package based on the attribute information of files within the integration package.

[0070] Optionally, when the upgrade package is a patch package corresponding to a software package, the attribute information of the files within the upgrade package may also include the version information of the software package corresponding to the patch package. When a network device needs to obtain a patch package, the first device can extract the files in the patch package that correspond to the version information of the software package in the network device from the integration package. If the version information in the attribute information of the files in the patch package matches the version information of the software package in the network device, the first device can then send the files in the patch package to the network device.

[0071] Optionally, the attribute information of the files in the upgrade package may also include the size of the upgrade package. Before the first device sends the files in the corresponding upgrade package to the network device, the first device may send the size of the corresponding upgrade package to the network device so that the network device can allocate storage space that meets the size of the corresponding upgrade package. This storage space is used to store the files in the corresponding upgrade package that the first device subsequently sends to the network device. If the network device cannot allocate storage space that meets the size of the corresponding upgrade package, the network device may send a failure message to the first device to indicate that the network device cannot allocate storage space that meets the size of the corresponding upgrade package. When the first device receives the failure message, it stops / pauses sending the files in the corresponding upgrade package to the network device.

[0072] Optionally, the attribute information of files in the upgrade package may also include the location information of the files within the upgrade package, so that the network device that obtains the files in the upgrade package can generate (assemble) the upgrade package based on the location information. For example, for a certain file in the first upgrade package corresponding to the first network device, the location information of the file in the upgrade package includes the file's starting position information in the upgrade package and the file's size. The starting position information can be represented by the offset of the file's starting position relative to the starting position of the upgrade package. The first device sends the file and its location information in the upgrade package to the first network device, which can then assemble the file and other files according to the location information to obtain a complete upgrade package.

[0073] Optionally, the attribute information of the files in the upgrade package may also include verification information, which is used to verify whether the files in the upgrade package obtained by the network device are valid. This application does not specifically limit the type of verification information or the corresponding verification method.

[0074] For example, the verification information can be signature information, hash digest (hash value), etc. Suppose a first network device receives a file sent by another device, which carries a corresponding hash value (calculated based on a certain hash algorithm). The first network device uses the same hash algorithm to calculate the hash value of the file, and then compares the calculated hash value with the hash value of the file sent by the first device. If the two hash values ​​match, the file verification is successful, indicating that the file has not been tampered with during transmission. This application does not specifically limit the type of hash algorithm mentioned above.

[0075] Optionally, the attribute information of the files in the upgrade package may also include one or more of the following: the file name (or other information that can be used to identify the file), the name of the upgrade package in which the file is located (or other information that can be used to identify the upgrade package), etc.

[0076] Regarding how the first device obtains the attribute information of the files in the first upgrade package corresponding to the first network device, the following explanation uses Scheme 1 and Scheme 2 as examples:

[0077] Option 1: The first device sends attribute information of files in multiple upgrade packages and the correspondence between the attribute information of the files in the multiple upgrade packages and the network device information to the first network device. Then, the first network device determines the attribute information of the target file from the attribute information of the files in the multiple upgrade packages based on the information of the first network device and the correspondence, so as to use it as the attribute information of the file in the first upgrade package corresponding to the first network device. There may be one or more target files. The network device information corresponding to the target file matches (is consistent with) the information of the first network device. Then, the target file sends the attribute information of the file in the first upgrade package to the first device. At this time, the first device obtains the attribute information of the file in the first upgrade package corresponding to the first network device.

[0078] Specifically, the integration package in the first device contains files from multiple upgrade packages. The first device also possesses attribute information for these files and the correspondence between these files and network device information. Specifically, the network device information corresponding to the attribute information of a file refers to the information of the network device corresponding to the upgrade package containing that file. When the first network device needs to upgrade, it can send the attribute information of the files in the multiple upgrade packages and the correspondence between these file attribute information and network device information to itself, so that the first network device can determine the attribute information of the file in its corresponding first upgrade package. When the first network device receives the attribute information of the files in the multiple upgrade packages, it combines it with the information recorded in the first network device to extract the attribute information of the file in the first upgrade package corresponding to the first network device. In other words, for the attribute information of any file in the multiple upgrade packages, if the network device information corresponding to the attribute information of that file matches (is consistent with) the information of the first network device, then it is determined that the file is a file in the first upgrade package corresponding to the first network device, and the attribute information of that file is extracted as the attribute information of the file in the first upgrade package. Subsequently, the first network device sends the attribute information of the files in the first upgrade package to the first device, so that the first device can extract the files in the first upgrade package from the integration package.

[0079] As mentioned above, file attribute information includes not only the file's location within the integration package but may also include other information. In Scheme 1, the first device can send all attribute information of files in multiple upgrade packages, along with the correspondence between these file attribute information and network device information, to the first network device. This allows the first network device to determine all attribute information of files in the first upgrade package corresponding to the first network device (including the location information of files in the first upgrade package within the integration package). The first network device then sends the attribute information of files in the first upgrade package (at least including the location information of files in the first upgrade package within the integration package) to the first device. Finally, the first device can extract the files from the first upgrade package from the integration package based on the location information of the files in the first upgrade package within the integration package.

[0080] Alternatively, the first device may send only partial attribute information of the files in the multiple upgrade packages, as well as the correspondence between these file attribute information and network device information, to the first network device. The aforementioned partial attribute information includes at least the location information of the corresponding file in the integration package. Then, the first network device determines the attribute information of the files in the first upgrade package (including at least the location information of the files in the first upgrade package in the integration package) based on the received information and the information of the first network device, and then sends the determined attribute information to the first device. The first device can then extract the files in the first upgrade package from the integration package based on the location information of the files in the first upgrade package in the integration package.

[0081] Option 2: The first device also includes the mapping relationship between the attribute information of files in multiple upgrade packages and network device information, as well as the information of the first network device. In this case, the first device can determine the attribute information of the target file from the attribute information of files in multiple upgrade packages based on the information of the first network device and the mapping relationship, and use this as the attribute information of the file in the first upgrade package corresponding to the first network device. Here, the network device information corresponding to the attribute information of a file refers to the information of the network device corresponding to the upgrade package containing that file. There may be one or more target files, and the network device information corresponding to the target file matches (is consistent with) the information of the first network device.

[0082] In this solution, since the first device has information about the first network device, the first device can determine the attribute information of the file in the first upgrade package corresponding to the first network device from the attribute information of the file in the multiple upgrade packages based on the information of the first network device and the above correspondence, instead of the first network device determining the attribute information of the file in its own corresponding first upgrade package and sending it to the first device as in Solution 1.

[0083] This application does not specify how to record the correspondence between file attribute information and network device information in Schemes 1 and 2. For example, the correspondence between file attribute information and network device information can be recorded within or outside the integration package. Alternatively, the correspondence can be recorded in a configuration file, which can be placed within or outside the integration package. However, the binding relationship between the integration package and the configuration file needs to be recorded so that the corresponding file can be extracted from the integration package based on the attribute information found in the configuration file.

[0084] The following examples illustrate the files in the upgrade package and integration package.

[0085] Taking the upgrade package as an example, Figure 2 This diagram illustrates the relationship between multiple software packages and integrated packages provided in this application embodiment. For simplicity, two software packages, a.cc and b.cc, are used as examples. a.cc is 400MB in size. The files in a.cc can be categorized into five types based on function: Operating System (OS), Hardware Information 1, Basic Services, Value-Added Services 1, and Value-Added Services 2. Each type may contain one or more files used together to implement the corresponding function. b.cc is 200MB in size. The files in b.cc can be categorized into four types based on function: Operating System (OS), Hardware Information 2, Basic Services, and Value-Added Services 1. Each type may contain one or more files used together to implement the corresponding function. It can be seen that the common parts of the two software packages are the files corresponding to OS, Basic Services, and Value-Added Services 1. The files in Hardware Information 1 and Hardware Information 2 are related to the network devices corresponding to the software packages; the files related to hardware information are generally different in different software packages. The files related to OS, Basic Services, Value-Added Services 1, and Value-Added Services 2 are unrelated to the hardware of the network devices.

[0086] The two software packages mentioned above are integrated to obtain an integrated package a&b.zip. This integrated package includes files from both packages and has a size of 450MB, smaller than the combined size of a.cc and b.cc. Specifically, a&b.zip includes the operating system (OS), hardware information 1, hardware information 2, basic services, value-added services 1, and value-added services 2. It also includes a device file list (this name is just an example and does not constitute a limitation). This device file list records the attribute information of the files in both packages and the correspondence between these file attributes and network device information. For the common parts of the two packages, only one copy needs to be retained in a&b.zip to reduce the storage space occupied by a&b.zip.

[0087] The above list of device files can be a configuration file, denoted here as desc.xml, the contents of which can be exemplified in Table 1:

[0088] Table 1

[0089]

[0090] Here, we assume that a.cc corresponds to router model A and b.cc corresponds to router model B. Therefore, the network device information corresponding to a.cc is that of router model A, and the network device information corresponding to b.cc is that of router model B. The information for router model A can be its model identifier or other information; this application does not specifically limit this. The same applies to the information for router model B.

[0091] Taking the first row of Table 1 as an example, the first column of the first row contains information about the network device corresponding to the software package a.cc. The second column of the second row includes the attribute information of each file in a.cc, as well as information such as the name and size of a.cc. Here, a.cc contains n files, and filename1 to filenamen in Table 1 are the filenames of these n files. Taking the filename1 in a.cc as an example, the attribute information of this file includes its corresponding filename (i.e., filename1), checksum information (hash value in Table 1), offset in the integration package, file size, offset in a.cc, etc. The order of these attribute information is only for example and does not constitute a limitation. Of course, the information of the network device corresponding to a.cc can also be used as part of the attribute information of the files in a.cc, as described above.

[0092] The attribute information of the other files shown in Table 1 can be found in the descriptions of the files mentioned above, and will not be discussed further here.

[0093] It should be noted that, Figure 2 The names, formats, sizes, and file types of the software packages and integration packages mentioned are just examples and do not constitute specific limitations. In actual application scenarios, more software packages can be integrated to obtain integration packages. Software packages can also include more types of files, such as files used to implement other business functions.

[0094] Taking the upgrade package as an example, Figure 2This is a schematic diagram illustrating the relationship between multiple patch packages and integration packages provided in this application embodiment. For simplicity, two patch packages, a.pat and b.pat, are used as examples. a.pat is 2MB in size. The files in a.pat can be divided into two categories based on function and target software package version (including version V1 and version V2): basic services and value-added services 1 for version V1. Each category may contain one or more files used together to implement the corresponding function. b.pat is 20MB in size. The files in b.pat can be divided into five categories based on function and target software package version: operating system (OS), hardware information 2, basic services, value-added services 1, and value-added services 2 for version V2. Each category may contain one or more files used together to implement the corresponding function.

[0095] The two patch packages are integrated to obtain the integrated package a&b.zip. This integrated package includes the files from both patch packages, and its size is 21MB, less than the combined size of a.pat and b.pat. Specifically, a&b.zip includes patch files for the OS corresponding to version V2, hardware information 1 corresponding to version V2, basic services corresponding to version V1, basic services corresponding to version V2, value-added services 1 corresponding to version V1, value-added services 1 corresponding to version V2, and value-added services 2 corresponding to version V2. It also includes device file lists for version V1 and version V2. The device file list for version V1 records the attribute information of the files corresponding to version V1 in both patch packages and the correspondence between these attributes and network device information. The device file list for version V2 records the attribute information of the files corresponding to version V2 in both patch packages and the correspondence between these attributes and network device information. For the common parts of the two patch packages, only one copy needs to be retained in a&b.zip to reduce its storage space usage.

[0096] The device file manifest lists for versions V1 and V2 mentioned above can be the same configuration file (i.e., combined into one device file manifest list) or two different configuration files. Here, we assume they are the same configuration file, denoted as desc.xml. The contents of this configuration file can be exemplified in Table 2:

[0097] Table 2

[0098]

[0099] Here, we assume that a.pat corresponds to router model A and b.pat corresponds to router model B. Therefore, the network device information corresponding to a.pat is the information of router model A, and the network device information corresponding to b.pat is the information of router model B. The information for router model A can be its model identifier or other information; this application does not specifically limit this. The same applies to the information for router model B.

[0100] Taking the first row of Table 2 as an example, the first column of the first row contains information about the network device corresponding to the patch package a.pat. The second column of the second row includes the attribute information of each file in a.pat, as well as the name, size, and target software package version of a.pat. Here, a.pat consists of n files, and filename1 to filenamen in Table 1 are the filenames of these n files. Taking the filename1 in a.pat as an example, the attribute information of this file includes its corresponding filename (i.e., filename1), checksum information (hash value in Table 1), offset in the integration package, file size, offset in a.pat, etc. Of course, the information about the network device corresponding to a.pat and the target software package version can also be included as part of the attribute information of the files in a.pat, as described above.

[0101] The attribute information of the other files shown in Table 2 can be found in the descriptions of the files mentioned above, and will not be discussed further here.

[0102] It should be noted that, Figure 3 The names, formats, sizes, file types, and versions of the patch packages and integration packages described above are merely examples and do not constitute specific limitations. In real-world applications, there may be more patch packages, each corresponding to a network device and software package version. Since the software package for the same (series / model) network device may have one or more different versions, different patch packages may exist for different versions of the same network device. The example above only integrates two patch packages; more patch packages can be integrated to obtain an integration package. Each patch package may also include more types of files, such as files used to implement other business functions. This application does not impose specific limitations on this.

[0103] It should also be noted that, Figure 3This involves integrating patch packages for different software package versions (V1 and V2) into a single integrated package. However, in practical applications, patch packages for different software package versions can also be integrated into separate integrated packages. For example, multiple patch packages for different network devices, all targeting software package version V1, can be integrated into a first integrated package. This first integrated package includes the files in the corresponding patch packages and may also include the attribute information of these files and the correspondence between these attribute information and network device information. Similarly, multiple patch packages for different network devices, all targeting software package version V2, can be integrated into a second integrated package. This second integrated package includes the files in the corresponding patch packages and may also include the attribute information of these files and the correspondence between these attribute information and network device information.

[0104] S102. The first device retrieves the files in the first upgrade package from the integration package based on the file attribute information in the first upgrade package, and sends the files in the first upgrade package to the first network device.

[0105] As described above, the attribute information of the files in the first upgrade package includes the location information of the files in the first upgrade package within the integration package. Therefore, based on the attribute information of the files in the first upgrade package, the first device can extract the files in the first upgrade package corresponding to the first network device from the integration package, and then send the extracted files in the first upgrade package to the first network device.

[0106] This application does not specify the communication protocol used by the first device when sending corresponding files to various network devices. For example, the first device and the network devices may communicate using protocols such as File Transfer Protocol (FTP), Secure File Transfer Protocol (SFTP), and Hypertext Transfer Protocol Secure (HTTPS) to transfer files in the upgrade package corresponding to the network device to that network device.

[0107] As described above, the first upgrade package corresponding to the first network device may include multiple files. Optionally, the first device can send these multiple files to the first network device one by one, or it can send these multiple files to the first network device in parallel (batch). The first network device can send each file extracted from the first upgrade package to the first network device, or it can send all the files to the first network device at once after extracting all the files from the first upgrade package.

[0108] S103. The first network device generates a first upgrade package based on the files in the first upgrade package, and performs an upgrade based on the first upgrade package.

[0109] When the first network device receives the files in the first upgrade package sent by the first device, it can generate (assemble) the first upgrade package based on the files in the first upgrade package, and then run the first upgrade package to perform the upgrade.

[0110] Accept Figure 2 Continuing with the example of the upgrade package, the integration package a&b.zip is obtained by integrating the packages a.cc and b.cc. a&b.zip includes the files from a.cc and b.cc, and the size of a&b.zip is less than the sum of the sizes of a.cc and b.cc. The integration package also includes a device file list, which records the attribute information of the files in the two packages and the correspondence between these file attributes and network device information. See Table 1 for details, which will not be elaborated here.

[0111] like Figure 4 As shown, assuming the first device is a file server, which includes the aforementioned integrated package, device A and device B are two different network devices. The software package corresponding to device A is a.cc, and the software package corresponding to device B is b.cc.

[0112] Taking device A as an example, when device A needs to obtain a.cc, it can send a download request to the file server. This application does not specifically limit the content of this download request. For example, the download request may include the file server's access address (such as an Internet Protocol (IP) address), the identifier of the communication protocol (such as FTP, HTTPS, or SFTP), the identifier of the integration package (such as its name or other information indicating the integration package), and so on. This application does not specifically limit the triggering conditions for device A to send the download request to the file server. For example, a user or other device may send an upgrade command to device A, and device A will send a download request to the file server based on the upgrade command. This application also does not specifically limit the method by which the user sends the upgrade command to the device. For example, the user may input the upgrade command to device A via command line, specifying the file server's access address, communication protocol, and the identifier of the integration package.

[0113] In response to a download request from device A, the file server sends the aforementioned device file list to device A. Device A determines the attribute information of the files in a.cc from the device file list based on its own information. In other words, device A queries the device file list based on its own information, identifying the file attributes that match its network device information as the attribute information of the files in a.cc. Then, device A sends the attribute information of the files in a.cc to the file server, indicating that it needs to download the files from a.cc within the integrated package. The file server extracts the files from a.cc based on their attribute information and sends them to device A, thus enabling on-demand downloading for device A. The files in a.cc received by device A are categorized into five types based on function: OS, Hardware Information 1, Basic Services, Value-Added Services 1, and Value-Added Services 2. Each type includes one or more files. The total size of these downloaded files does not exceed the size of the a.cc software package. Device A assembles these downloaded files into a complete software package a.cc, which can then be used for upgrades.

[0114] Similarly, device B can download files from the file server as needed, and then assemble the complete software package b.cc based on the files in b.cc, which can then be used for upgrades. It should be understood that since the above network devices do not need to download the integration package from the file server, but only download files from their own corresponding software packages, the storage space requirements for the network devices are not high. Even if the storage capacity of the network devices is relatively limited, it can still support upgrades.

[0115] Accept Figure 3 Continuing with the example of an upgrade package as a patch package, the integration package a&b.zip is obtained by integrating patch packages a.pat and b.pat. a&b.zip includes the files in a.pat and b.pat, and the size of a&b.zip is less than the sum of the sizes of a.pat and b.pat. The integration package also includes a device file list, which records the software package versions targeted by the two patch packages, the attribute information of the files in the two patch packages, and the correspondence between the attribute information of these files and the network device information. For details, please refer to Table 2, which will not be elaborated here.

[0116] like Figure 5 As shown, assuming the first device is a file server, which includes the aforementioned integrated package, devices A and B are two different network devices. The patch package corresponding to the software package version in device A is a.pat, and the patch package corresponding to the software package version in device B is b.pat.

[0117] Taking device A as an example, when device A needs to obtain a.pat, it can send a download request to the file server. This application does not specifically limit the content of this download request. For example, the download request may include the file server's access address, the identifier of the communication protocol, the identifier of the integration package, etc. This application also does not specifically limit the triggering conditions for device A to send the download request to the file server. For example, a user or other device may send an upgrade command to device A, and device A will send a download request to the file server based on the upgrade command. This application also does not specifically limit the method by which the user sends the upgrade command to the device. For example, the user can input the upgrade command to device A via command line, specifying the file server's access address, the communication protocol, and the identifier of the integration package.

[0118] In response to a download request from device A, the file server sends the aforementioned device file list to device A. Device A, based on its own information and the version information of the software packages within it, determines the attribute information of the files in a.pat from the device file list. In other words, device A queries the device file list based on its own information and the version information of the software packages within it, identifying the attribute information of files whose network device information matches its own information and whose corresponding software package version matches the aforementioned version information. Device A then sends the attribute information of the files in a.pat to the file server. The file server extracts the files from the integration package based on the attribute information of the files in a.pat and sends them to device A, thus enabling on-demand downloading for device A. The files in a.pat downloaded by device A include two types of patch files: basic services and value-added services 1 corresponding to version V1. Each type of patch file may have one or more files used together to implement the corresponding function. The total size of these downloaded files does not exceed the size of the patch package a.pat. Device A assembles these downloaded files into a complete patch package a.pat, which can then be run as needed to achieve an upgrade.

[0119] Similarly, device B can download the files in b.pat from the file server as needed, and then assemble the complete patch package b.pat based on the files in b.pat. It can then run b.pat as needed to achieve the upgrade. It should be understood that since the above network devices do not need to download the integration package from the file server, but only the files in the patch package corresponding to the software package within the network device, the storage space requirements of the network devices are not high. Even if the storage capacity of the network devices is relatively limited, it can still support upgrades for the network devices.

[0120] Next, let's combine Examples 1, 2, and 3 to... Figure 1The provided equipment upgrade methods are illustrated with specific examples.

[0121] Example 1: Suppose the first device is a file server, the upgrade package is a software package, and the first network device needs to obtain the corresponding software package.

[0122] When the first network device receives the first upgrade command, it establishes a communication connection with the file server according to the command and downloads a device file list from the file server. The device file list includes the sizes of multiple software packages, attribute information of files within those packages, and the correspondence between these attribute information and the network device information. Optionally, the device file list includes signature information. The first network device can verify the signature information in the device file list (signature verification) to determine the validity of the downloaded device file list and prevent tampering with the file server's device file list. The first network device parses the device file list and, based on its own information, determines the attribute information of files within the corresponding software package, including the file's location within the integration package, file size, file location within the corresponding software package, file verification information, and file name. The first network device can also determine the size of the corresponding software package from the device file list and allocate sufficient storage space on the device to store files from that software package downloaded subsequently from the file server, preventing insufficient storage space during the download process. Of course, if the first network device cannot allocate storage space sufficient for the size of the software package, it can send a failure message to the file server. Upon receiving the failure message, the file server will not send the corresponding file to the first network device. This application does not specifically limit the type of storage medium; for example, it can be a disk, hard disk, flash memory, RAM, or other storage media.

[0123] After the first network device determines the attribute information of the files in the software package corresponding to the first network device, the first network device sends the attribute information of the files in the software package corresponding to the first network device to the file server. The file server can extract the files from the software package corresponding to the first network device based on the received attribute information and then transmit the extracted files to the first network device. The first network device can write the received files to the corresponding location in the allocated storage space according to the location information of the files in the corresponding software package indicated in the attribute information. The first network device can also calculate a hash digest of the received file and then compare the calculated hash digest with the hash digest of the file in the attribute information. If the comparison finds a match, it is determined that the file received by the first network device is valid and matches the content of the file in the software package. If the comparison finds a mismatch, it is determined that the file received by the first network device is invalid and does not match the content of the file in the software package. In this case, the first network device can indicate to the file server that the file download failed, and may even re-download the file from the file server.

[0124] Once the first network device has finished downloading all the files in the corresponding software package, it can disconnect from the file server. The first network device then assembles the downloaded files to obtain a complete software package. It can then perform a signature check on the assembled software package to determine its validity. After confirming the software package is valid, the first network device can run the software package to perform an upgrade.

[0125] It should be noted that the aforementioned first network device can be any or a specific network device, and this application does not impose any specific limitations on it. Other network devices can also obtain the files from the required software package from the file server, and then assemble the software package required by this device. The aforementioned first device is a file server, which stores the integrated program package. It does not rely on network management, and each network device can download the files from the corresponding software package from the file server as needed. It has low requirements for the storage space capacity of network devices, can support large-scale network device upgrades, and has a wide range of applications.

[0126] Example 2: Suppose the first device is a file server and the upgrade package is a patch package. The first network device needs to obtain the patch package corresponding to its own software package.

[0127] When the first network device receives the second upgrade instruction, it establishes a communication connection with the file server according to the instruction and downloads a device file manifest list from the server. The device file manifest list includes the size of multiple patch packages, the software package version each patch package targets, the attribute information of the files within the patch packages, and the correspondence between these attribute information and the network device information. Optionally, the device file manifest list includes signature information. The first network device can verify the signature information in the device file manifest list (signature verification) to determine the validity of the downloaded device file manifest list and prevent tampering with the file server's device file manifest list. The first network device parses the device file manifest list and, based on its own information and the version information of the software packages within it, determines the attribute information of the files in the patch packages corresponding to its own network device. This attribute information includes the file's location within the integration package, file size, file location within the patch package corresponding to the first network device, file verification information, and file name. The first network device can also determine the size of the patch package corresponding to it from the device file list, and then allocate storage space on the first network device that meets the size of the patch package to store the files in the patch package downloaded from the file server later, thus avoiding insufficient storage space during subsequent downloads. Of course, if the first network device cannot allocate storage space that meets the size of the patch package, it can send a failure message to the file server, and the file server will not send the corresponding files to the first network device upon receiving the failure message. Regarding the media type of the aforementioned storage space, this application does not specifically limit it; for example, it can be a disk, hard disk, flash memory, memory, or other storage media.

[0128] After the first network device determines the attribute information of the files in the patch package corresponding to the first network device, the first network device sends the attribute information of the files in the patch package corresponding to the first network device and specific to the software package version in the first network device to the file server. Based on the received attribute information, the file server can extract the files from the patch package corresponding to the first network device and specific to the software package version in the first network device from the integration package, and then transmit the extracted files to the first network device. The first network device can write the received files to the corresponding location in the allocated storage space according to the location information of the files in the corresponding patch package indicated in the attribute information. The first network device can also calculate a hash digest of the received file and then compare the calculated hash digest with the hash digest of the file in the attribute information. If the comparison finds a match, it is determined that the file received by the first network device is valid and matches the content of the file in the integration package. If the comparison finds a mismatch, it is determined that the file received by the first network device is invalid and does not match the content of the file in the integration package. In this case, the first network device can indicate to the file server that the file download failed, and may even re-download the file from the file server.

[0129] Once the first network device has finished downloading all the files in the corresponding patch package, it can disconnect from the file server. The first network device then assembles the downloaded files to obtain a complete patch package. It can then perform a signature check on the assembled patch package to determine its validity. After confirming the patch package is valid, the first network device can run it as needed to perform the upgrade.

[0130] It should be noted that the aforementioned first network device can be any or a specific network device. This application does not make any specific limitation in this regard. Other network devices can also obtain the files in the required patch package from the file server and then assemble the patch package required by this device.

[0131] Example 3: Assume the first device is a network management system and the upgrade package is a software package. The first network device needs to obtain the corresponding software package.

[0132] The network management system is responsible for managing multiple network devices and has information about these devices. The network management system also has an integration package, which can be obtained from a file server or other storage device; this application does not specifically limit this. When a first network device needs to obtain a corresponding software package, the network management system can determine the file attribute information of the corresponding software package from the device file list based on the first network device's information. This includes the file's location information within the integration package, the file size, the file's location information within the corresponding software package of the first network device, the file's verification information, and the file name. This application does not specifically limit how the network management system determines that the first network device needs to obtain the corresponding software package. For example, the first network device sends an upgrade / download request to the network management system, and the network management system determines that the first network device needs to obtain the corresponding software package based on this request; or, upon reaching a set time or receiving an upgrade instruction, the network management system determines that the first network device needs to obtain the corresponding software package.

[0133] When the attribute information of files in the software package corresponding to the first network device is determined, the network administrator extracts the files from the integration package based on this attribute information. Then, it sends these files to the first network device, along with their verification information and location within the software package. The first network device verifies the validity of the received files based on the verification information and places them in the appropriate locations based on their location information for assembly into the corresponding software package. Before sending the files, the network administrator can first send the size of the software package to the first network device to ensure sufficient storage space is allocated for storing subsequent files distributed from the network administrator, preventing storage shortages during distribution. If the first network device cannot allocate sufficient storage space, it can send a failure message to the network administrator, who will then refrain from sending the corresponding files.

[0134] Once the first network device has retrieved all the files from the corresponding software package, it assembles them into a complete package. The first network device can then perform a signature check on the assembled package to determine its validity. After confirming the package's validity, the first network device can run the package to perform an upgrade.

[0135] In summary, the device upgrade method provided in this application can support the upgrade of multiple network devices using a single integrated package. When any of the multiple network devices needs to obtain a corresponding upgrade package, the first device obtains the attribute information of the files in the upgrade package corresponding to that network device. The attribute information includes the location information of the corresponding files in the integrated package. Based on the aforementioned attribute information, the first device can extract the files from the integrated package corresponding to that network device's upgrade package and then send the extracted files to that network device. After receiving the required files from the upgrade package, the network device assembles them into a complete upgrade package, and then performs an upgrade based on the upgrade package. Since the network device only obtains the files from the corresponding upgrade package on demand from the first device, without needing to obtain files from other upgrade packages, the storage space requirements for the network device are low. Even if the network device's storage space is limited, it can still support efficient upgrades without needing to expand the network device's storage space, thus saving costs.

[0136] Based on the device upgrade method described above, the relevant devices used to implement this method are introduced below.

[0137] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a storage device 600 provided in an embodiment of this application, including a bus 602, a processor 604, a memory 606, and a communication interface 608. The processor 604, the memory 606, and the communication interface 608 communicate with each other via the bus 602. The storage device 600 can be a server, desktop computer, storage array, hard disk enclosure, or other device with storage capabilities. This application does not specifically limit this type of device, nor does it limit the number of processors and memories in the fault location device 600.

[0138] Bus 602 can be a Peripheral Component Interconnect Express (PCIe) bus, or an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (Ubus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), etc. Bus 602 can be divided into address bus, data bus, control bus, etc. In addition to the data bus, bus 602 can also include a power bus, control bus, and status signal bus. However, for clarity, in... Figure 6The general designated all buses as Bus 602.

[0139] Processor 604 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0140] Memory 606 may include volatile memory, such as random access memory (RAM). Processor 604 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0141] The memory 606 stores executable program code. The processor 604 executes the executable program code to implement this application. Figure 1 The operational steps involved in the first device in the equipment upgrade method.

[0142] The communication interface 608 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between the storage device 600 and other devices or communication networks.

[0143] As one possible implementation, the storage device 600 may also include a chip, which includes a processor and a power supply circuit. The power supply circuit provides power to the processor, which performs operations. Figure 1 The operational steps involved in the first device upgrade method are described below. For simplicity, they will not be elaborated here. The processor can be a CPU or other processors.

[0144] As one possible implementation, the storage device 600 may include multiple types of processors 604, meaning the storage device 600 is a heterogeneous device. For example, the storage device 600 may include a CPU and a GPU, and can be executed by at least one of the processors 604. Figure 1 The operational steps involved in the first device in the equipment upgrade method.

[0145] Please see Figure 7 , Figure 7This is a schematic diagram of the structure of a network device 700 provided in an embodiment of this application, including a bus 702, a processor 704, a memory 706, and a communication interface 708. The processor 704, the memory 706, and the communication interface 708 communicate with each other via the bus 702. The network device 700 can be a router or a switch, etc. This application does not specifically limit the type of network device 700, nor does it limit the number of processors and memories in the network device 700.

[0146] Bus 702 can be a Peripheral Component Interconnect Express (PCIe) bus, or an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (Ubus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), etc. Bus 702 can be divided into address bus, data bus, control bus, etc. In addition to the data bus, bus 702 can also include a power bus, control bus, and status signal bus. However, for clarity, ... Figure 7 The general designated all buses as Bus 702.

[0147] Processor 704 may include any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), data processing unit (DPU), or digital signal processor (DSP).

[0148] The memory 706 may include volatile memory, such as random access memory (RAM). The processor 704 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0149] The memory 706 stores executable program code. The processor 704 executes the executable program code to implement this application. Figure 1 The operational steps involved in the first network device in the device upgrade method.

[0150] The communication interface 708 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between the network device 700 and other devices or communication networks.

[0151] As one possible implementation, the network device 700 may also include a chip, which includes a processor and a power supply circuit. The power supply circuit provides power to the processor, which performs operations. Figure 1 The operational steps involved in the first network device upgrade method are described below. For simplicity, they will not be elaborated here. The processor can be implemented using a CPU, or it can be implemented using a DPU, System on Chip (SoC), offloading card, accelerator card, etc.

[0152] As one possible implementation, the network device 700 may include multiple types of processors 704, meaning the network device 700 is a heterogeneous device. For example, the network device 700 may include a CPU and a GPU, and can be executed by at least one of the processors 704. Figure 1 The operational steps involved in the first network device in the device upgrade method.

[0153] This application also provides a chip, including a processor and a power supply circuit, the power supply circuit being used to supply power to the processor, the processor being used to execute... Figure 1 The operational steps involved in the device upgrade method for the first device or the first network device.

[0154] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a storage device can store. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc. The computer-readable storage medium includes instructions that, when executed on the storage device, cause the storage device to perform... Figure 1 The specific operational steps involved in the first device in the device upgrade method can be found in the previous text and will not be repeated here.

[0155] This application also provides another computer-readable storage medium. The computer-readable storage medium can be any available medium that the network device can store. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives), etc. The computer-readable storage medium includes instructions that, when executed on the network device, cause the network device to perform... Figure 1 The operational steps involved in the first network device in the device upgrade method.

[0156] This application also provides a computer program product, which may be a software or program product containing instructions capable of running on a storage device or stored on any usable medium. When the instructions in the aforementioned computer program product are executed on the storage device, the storage device is caused to perform... Figure 1 The operational steps involved in the first device in the equipment upgrade method.

[0157] This application also provides a computer program product, which may be a software or program product containing instructions that can run on a network device or be stored on any usable medium. When the instructions in the aforementioned computer program product are executed on the network device, the network device performs... Figure 1 The operational steps involved in the first network device in the device upgrade method.

[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application. The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. In addition, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. The terminology used in the embodiments of this application is only for the purpose of describing specific embodiments, and is not intended to limit this application. The singular forms "a," "described," and "the" used in the embodiments of this application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.

Claims

1. A method for upgrading equipment, characterized in that, The method includes: The first device obtains attribute information of files in the first upgrade package corresponding to the first network device. The first device includes attribute information of files in an integration package and multiple upgrade packages. The multiple upgrade packages correspond to multiple network devices including the first network device. The integration package includes files in the multiple upgrade packages. The attribute information of files in the upgrade packages includes the location information of the files in the upgrade packages within the integration package. The first device retrieves the files in the first upgrade package from the integration package based on the file attribute information in the first upgrade package, and sends the files in the first upgrade package to the first network device; The first network device generates the first upgrade package based on the files in the first upgrade package, and performs the upgrade based on the first upgrade package.

2. The method according to claim 1, characterized in that, The first device also includes the correspondence between the attribute information of files in the plurality of upgrade packages and the network device information. The first device obtains the location information of the file in the first upgrade package corresponding to the first network device in the integration package, including: The first device sends the attribute information of the files in the plurality of upgrade packages and the correspondence between the attribute information of the files in the plurality of upgrade packages and the network device information to the first network device; The first network device determines the attribute information of the target file from the attribute information of the files in the plurality of upgrade packages based on the information of the first network device and the correspondence relationship, so as to use the attribute information of the file in the first upgrade package corresponding to the first network device, wherein the network device information corresponding to the target file matches the information of the first network device; The first network device sends attribute information of the files in the first upgrade package to the first device.

3. The method according to claim 1, characterized in that, The first device also includes the correspondence between the attribute information of the files in the plurality of upgrade packages and the network device information, as well as the information of the first network device; The first device obtains attribute information of files in the first upgrade package corresponding to the first network device, including: The first device determines the attribute information of the target file from the attribute information of the files in the plurality of upgrade packages based on the information of the first network device and the correspondence, so as to use the attribute information of the file in the first upgrade package corresponding to the first network device, wherein the network device information corresponding to the target file matches the information of the first network device.

4. The method according to any one of claims 1 to 3, characterized in that, The attribute information of the files in the upgrade package also includes the capacity of the upgrade package. Before sending the files in the first upgrade package to the first network device, the method further includes: The first device sends the capacity of the first upgrade package corresponding to the first network device to the first network device; The first network device allocates a first storage space within itself that is sufficient to accommodate the capacity of the first upgrade package. This first storage space is used to store files within the first upgrade package sent by the first device.

5. The method according to any one of claims 1 to 4, characterized in that, The attribute information of the files in the upgrade package also includes the location information of the files in the upgrade package within the upgrade package. The first network device generates the first upgrade package based on the files in the first upgrade package, including: The first network device generates the first upgrade package based on the files in the first upgrade package and the location information of the files in the first upgrade package sent by the first device within the first upgrade package.

6. The method according to any one of claims 1 to 5, characterized in that, The upgrade package is either the software package corresponding to the network device or the patch package corresponding to the software package.

7. The method according to claim 6, characterized in that, When the upgrade package is a patch package corresponding to the software package, the attribute information of the files in the upgrade package also includes the version information of the software package, and the version information in the attribute information of the files in the first upgrade package matches the version information of the software package in the first network device.

8. The method according to any one of claims 1 to 7, characterized in that, The file attribute information in the first upgrade package also includes verification information. Before upgrading according to the first upgrade package, the method further includes: The first network device verifies whether the files in the first upgrade package obtained by the first network device are valid based on the verification information of the files in the first upgrade package sent by the first device.

9. The method according to any one of claims 1 to 8, characterized in that, The size of the integration package is less than the sum of the sizes of the multiple upgrade packages.

10. The method according to any one of claims 1 to 9, characterized in that, The location information of the files in the first upgrade package within the integration package includes the starting location information of the files in the first upgrade package within the integration package and the size of the files in the first upgrade package.

11. The method according to any one of claims 1 to 10, characterized in that, The files in the first upgrade package include at least one of the following types: Files related to the hardware of the first network device; Files related to the operating system of the first network device; Documents related to the fixed services provided by the first network device; Documents related to the optional services provided by the first network device.

12. A method for upgrading equipment, characterized in that, The method includes: The first device obtains attribute information of files in the first upgrade package corresponding to the first network device. The first device includes attribute information of files in an integration package and multiple upgrade packages. The multiple upgrade packages correspond to multiple network devices including the first network device. The integration package includes files in the multiple upgrade packages. The attribute information of files in the upgrade packages includes the location information of the files in the upgrade packages within the integration package. The first device retrieves the files from the integration package based on the attribute information of the files in the first upgrade package; The first device sends the files in the first upgrade package to the first network device, wherein the first network device is used to generate the first upgrade package based on the files in the first upgrade package and to perform an upgrade based on the first upgrade package.

13. The method according to claim 12, characterized in that, The first device obtains attribute information of files in the first upgrade package corresponding to the first network device, including: The first device sends the attribute information of the files in the plurality of upgrade packages and the correspondence between the attribute information of the files in the plurality of upgrade packages and the network device information to the first network device; The first device receives attribute information of files in a first upgrade package corresponding to the first network device, sent by the first network device. The attribute information of the files in the first upgrade package is determined by the first network device from the attribute information of the files in the plurality of upgrade packages based on the information of the first network device and the correspondence.

14. The method according to claim 12, characterized in that, The first device also includes the correspondence between the attribute information of the files in the plurality of upgrade packages and the network device information, as well as the information of the first network device; The first device obtains attribute information of files in the first upgrade package corresponding to the first network device, including: The first device determines the attribute information of the target file from the attribute information of the files in the plurality of upgrade packages based on the information of the first network device and the correspondence, so as to use the attribute information of the file in the first upgrade package corresponding to the first network device, wherein the network device information corresponding to the target file matches the information of the first network device.

15. The method according to any one of claims 12 to 14, characterized in that, The attribute information of the files in the upgrade package also includes the capacity of the upgrade package. Before sending the files in the first upgrade package to the first network device, the method further includes: The first device sends the capacity of the first upgrade package corresponding to the first network device to the first network device, wherein the first network device is used to allocate a first storage space in the first network device that meets the capacity of the first upgrade package, and the first storage space is used to store the files in the first upgrade package sent by the first device.

16. The method according to any one of claims 12 to 15, characterized in that, The upgrade package is either the software package corresponding to the network device or the patch package corresponding to the software package.

17. The method according to any one of claims 12 to 16, characterized in that, The file attribute information in the first upgrade package also includes verification information, and the method further includes: The first device sends verification information of the files in the first upgrade package to the first network device, wherein the first network device verifies whether the files in the first upgrade package obtained by the first network device are valid based on the verification information.

18. The method according to any one of claims 12 to 17, characterized in that, The size of the integration package is less than the sum of the sizes of the multiple upgrade packages.

19. A method for upgrading equipment, characterized in that, The method includes: A first network device receives files from a first upgrade package corresponding to the first network device, wherein the first device includes an integration package and attribute information of files in multiple upgrade packages, the multiple upgrade packages correspond to multiple network devices including the first network device, the integration package includes files in the multiple upgrade packages, the attribute information of files in the upgrade packages includes the location information of files in the upgrade packages in the integration package, and the files in the first upgrade package sent by the first device are determined by the first device from the integration package based on the attribute information of files in the first upgrade package; The first network device generates the first upgrade package based on the files in the first upgrade package, and performs the upgrade based on the first upgrade package.

20. The method according to claim 19, characterized in that, Before the first network device receives the files in the first upgrade package corresponding to the first network device sent by the first device, the method further includes: The first network device receives attribute information of files in the plurality of upgrade packages sent by the first device, as well as the correspondence between the attribute information of the files in the plurality of upgrade packages and network device information; The first network device determines the attribute information of the target file from the attribute information of the files in the plurality of upgrade packages based on the information of the first network device and the correspondence relationship, so as to use the attribute information of the file in the first upgrade package corresponding to the first network device, wherein the network device information corresponding to the target file matches the information of the first network device; The first network device sends attribute information of the files in the first upgrade package to the first device.

21. The method according to claim 19 or 20, characterized in that, The attribute information of the files in the upgrade package also includes the capacity of the upgrade package. Before the first network device receives the files in the first upgrade package corresponding to the first network device sent by the first device, the method further includes: The first network device receives the capacity of the first upgrade package corresponding to the first network device sent by the first device; The first network device allocates a first storage space within itself that is sufficient to accommodate the capacity of the first upgrade package. This first storage space is used to store files within the first upgrade package sent by the first device.

22. The method according to any one of claims 19 to 21, characterized in that, The attribute information of the files in the upgrade package also includes the location information of the files in the upgrade package within the upgrade package. The first network device generates the first upgrade package based on the files in the first upgrade package, including: The first network device generates the first upgrade package based on the files in the first upgrade package and the location information of the files in the first upgrade package sent by the first device within the first upgrade package.

23. The method according to any one of claims 19 to 22, characterized in that, The upgrade package is either the software package corresponding to the network device or the patch package corresponding to the software package.

24. The method according to any one of claims 19 to 23, characterized in that, The file attribute information in the first upgrade package also includes verification information. Before upgrading according to the first upgrade package, the method further includes: The first network device verifies whether the files in the first upgrade package obtained by the first network device are valid based on the verification information of the files in the first upgrade package sent by the first device.

25. The method according to any one of claims 19 to 24, characterized in that, The size of the integration package is less than the sum of the sizes of the multiple upgrade packages.

26. A storage device, characterized in that, It includes a processor and a memory, the processor being configured to execute instructions in the memory to cause the storage device to perform the operational steps of the first device in the method as described in any one of claims 12-18.

27. A network device, characterized in that, It includes a processor and a memory, the processor being configured to execute instructions in the memory to cause the network device to perform the operational steps of the first network device in the method as described in any one of claims 19-25.

28. A computer program product, characterized in that, Includes instructions that, when executed by the storage device, cause the storage device to perform the operation steps of the first device in the method as described in any one of claims 12-18.

29. A computer program product, characterized in that, The instruction includes, when executed by the network device, causing the network device to perform the operation steps of the first network device in the method as described in any one of claims 19-25.