A method, system, storage medium and switch for configuration update

By reading preset fields in DHCP messages during communication between the switch and the DHCP server, the ZTP process status is automatically detected and adjusted, solving the automation problem of switch configuration updates, realizing configuration updates without manual intervention, and improving deployment efficiency.

CN116633779BActive Publication Date: 2026-04-10INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2023-05-26
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

After the switch runs the ZTP process, the ZTP process is disabled and cannot be automatically enabled and the configuration updated, which requires on-site deployment personnel to operate manually, which violates the logic of automated deployment and increases the difficulty of the work.

Method used

By establishing a communication connection between the switch and the DHCP server, the switch reads preset fields in DHCP messages, detects whether the ZTP process is disabled, and automatically enables it if it is disabled. The switch then runs the ZTP process based on the preset fields and automatically updates the switch configuration.

Benefits of technology

It enables automatic adjustment and configuration update of the switch ZTP process, eliminating the need for manual operation, improving deployment efficiency and convenience, and reducing the workload of on-site deployment personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116633779B_ABST
    Figure CN116633779B_ABST
Patent Text Reader

Abstract

The application relates to the field of switch communication, in particular to a configuration updating method and system, a storage medium and a switch, which comprises multiple switches and a DHCP server in communication connection; a DHCP message sent by the DHCP server is read to determine whether the DHCP message contains a preset field; in the case that the DHCP message contains the preset field, it is detected whether a ZTP process of the switch is disabled; in the case that the ZTP process is detected to be disabled, the ZTP process is adjusted to be available; and the ZTP process is run according to the preset field to update the configuration of the switch. According to the technical scheme, the ZTP process of the switch can be automatically adjusted to be available, and the ZTP process can be automatically run to update the configuration of the switch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of switch communication, and specifically to a method, system, storage medium, and switch for configuration updates. Background Technology

[0002] When deploying network devices, the devices run the ZTP (Zero Touch Provisioning) function, which can automatically obtain and load the initial configuration file, enabling on-site configuration and deployment of the devices without the need for on-site setup, thereby reducing labor costs and improving deployment efficiency.

[0003] In practical applications, after a switch completes the ZTP process upon power-up, the ZTP process remains disabled. If the switch has been used for a period of time and its configuration needs to be updated, the ZTP process cannot be started directly. It requires manually executing commands to run the ZTP process via serial port or SSH connection. However, manually operating each device sequentially violates the logic of automation and causes significant inconvenience to on-site deployment personnel. Therefore, how to automatically switch the switch's ZTP process to be available and automatically run the ZTP process to update the switch's configuration remains a pressing problem to be solved. Summary of the Invention

[0004] One objective of this application is to provide a configuration update method to solve, or at least partially solve, the problem that after a switch runs the ZTP process, the ZTP process is disabled and cannot be automatically enabled and the configuration updated. A second objective of this application is to provide a configuration update system; a third objective is to provide a storage medium; and a fourth objective is to provide a switch.

[0005] To achieve the above objectives, the technical solution of this application is as follows:

[0006] A configuration update method, applied to switches, wherein multiple switches are communicatively connected to a DHCP server, includes:

[0007] Read the DHCP message sent by the DHCP server and determine whether the DHCP message contains a preset field; if the DHCP message contains the preset field, check whether the ZTP process of the switch is disabled; if the ZTP process is detected to be disabled, adjust the ZTP process to be available; according to the preset field, run the ZTP process and update the configuration of the switch.

[0008] Optionally, the preset field is option 67, and the step of running the ZTP process and updating the switch configuration according to the preset field includes:

[0009] reading the content of the option 67 field, obtaining the URL address and the file name in the content of the option 67 field; downloading the configuration file corresponding to the file name according to the URL address; running the ZTP process, loading the configuration file, and updating the configuration of the switch.

[0010] Optionally, before downloading the configuration file corresponding to the file name according to the URL address, the method further comprises:

[0011] detecting the communication state between the switch and the server corresponding to the URL address; and in the case that the switch and the server corresponding to the URL address are in normal communication, downloading the configuration file corresponding to the file name from the URL address.

[0012] Optionally, the configuration file is provided with a detection program, the detection program includes parameter information indicating whether the update result needs to be detected and a storage path of a specified server; and after loading the configuration file and updating the configuration of the switch, the method further comprises:

[0013] in the case that the parameter information indicates that the update result needs to be detected, running the detection program to detect the update result to obtain a detection result; generating a detection file according to the detection result; and sending the detection file to the specified server, so that the specified server records the update result according to the detection file according to the storage path.

[0014] Optionally, detecting the update result to obtain a detection result comprises:

[0015] obtaining the configuration version of the current switch and the version of the configuration file; in the case that the configuration version of the current switch and the version of the configuration file are consistent, the detection result is update success; and in the case that the configuration version of the current switch and the version of the configuration file are inconsistent, the detection result is update failure.

[0016] Optionally, the name of the detection file includes the detection result and the serial number of the switch, so that after the specified server records the update result, an administrator can query the update result of the switch from the specified server according to the serial number of the switch.

[0017] A configuration updating method applied to a DHCP server, the DHCP server being in communication connection with a plurality of switches; the method comprising:

[0018] The DHCP message is sent to multiple switches, and the DHCP message includes the preset field; the switch detects whether the ZTP process of the switch is disabled when it is determined that the DHCP message includes the preset field; the ZTP process is adjusted to be available when it is detected that the ZTP process is disabled; and the ZTP process of the switch is run according to the preset field, and the configuration of the switch is updated.

[0019] A configuration updating system applied to a switch, multiple switches are in communication connection with a DHCP server; the system comprises:

[0020] A determining module is configured to read a DHCP message sent by the DHCP server and determine whether the DHCP message includes a preset field; a detecting module is configured to detect whether the ZTP process of the switch is disabled when it is determined that the DHCP message includes the preset field; an adjusting module is configured to adjust the ZTP process to be available when it is detected that the ZTP process is disabled; and a configuration module is configured to run the ZTP process according to the preset field and update the configuration of the switch.

[0021] A non-volatile storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the configuration updating method as described above.

[0022] A switch having the configuration updating system as described above configured thereon.

[0023] The application has the following beneficial effects:

[0024] In the application, multiple switches are in communication connection with a DHCP server, a DHCP message sent by the DHCP server is read to determine whether the DHCP message includes a preset field; the ZTP process of the switch is detected to be disabled when it is determined that the DHCP message includes the preset field; the ZTP process is adjusted to be available when it is detected that the ZTP process is disabled; and the ZTP process is run according to the preset field and the configuration of the switch is updated. In this way, the ZTP process running command does not need to be manually executed, and the ZTP process is automatically adjusted from being disabled to being available and automatically run to update the configuration of the switch when the configuration of the switch needs to be updated. BRIEF DESCRIPTION OF DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.

[0026] Figure 1 is a flow chart of the configuration updating method in an embodiment of the present application;

[0027] Figure 2 is an architecture diagram of the configuration updating method in an embodiment of the present application;

[0028] Figure 3 is yet another architecture diagram of the configuration updating method in an embodiment of the present application;

[0029] Figure 4 is a framework diagram of the configuration updating system in an embodiment of the present application. DETAILED DESCRIPTION

[0030] Other advantages and effects of the present application can be easily understood by those skilled in the art from the above description of the embodiments of the present application. The present application can also be implemented or applied in other different specific embodiments, and the details in the description can be modified or changed based on different views and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, but not for limiting the protection scope of the present application.

[0031] The DHCP server is a server providing DHCP service according to the DHCP (Dynamic Host Configuration Protocol) protocol, which can automatically allocate IP addresses to devices.

[0032] The FTP server is a server providing file storage and access service on the Internet according to the FTP (File Transfer Protocol) protocol.

[0033] The ZTP process can be widely applied to software operating system upgrade, configuration file loading, custom script execution, etc. In the embodiment, a new functional module for optimizing the ZTP process is set in the switch, which can capture the DHCP message received by the switch and read the fields therein; the ZTP process of the local machine can be detected, and the ZTP process is adjusted to be available according to actual needs, so that the switch can automatically run the ZTP process, load the target configuration file, and update the configuration of the switch.

[0034] Specifically, refer to Figure 1 and Figure 2 , Figure 1 is a flow chart of the configuration updating method in an embodiment of the present application; Figure 2 is an architecture diagram of the configuration updating method in an embodiment of the present application, in which Figure 2In the embodiment, the plurality of switches are in communication connection with the DHCP server, and the DHCP server can send the DHCP message in batches, and the switch can receive the DHCP message sent by the DHCP server.

[0035] As shown in Figure 1 In the present application, the method for configuration updating can be executed according to the following steps:

[0036] In step S1, the DHCP message sent by the DHCP server is read, and it is determined whether the DHCP message contains a preset field.

[0037] Specifically, whether the ZTP process needs to be run to update the configuration can be determined according to whether the received DHCP message contains a preset field. Therefore, the DHCP message sent by the DHCP server is read first, and the content thereof is parsed. If it is determined that the received DHCP message contains a preset field, it can be further determined that the demand for running the ZTP process occurs.

[0038] In the embodiment, before reading the DHCP message sent by the DHCP server, the plurality of switches in communication connection with the DHCP server receive the DHCP message sent by the DHCP server at intervals of a preset time period. If the DHCP message contains a preset field, it indicates that the switch needs to update the configuration and needs to run the ZTP process.

[0039] It can be understood that if the configuration of the switch needs to be updated, the preset field can be set in the DHCP message to make the switch update the configuration.

[0040] If the received DHCP message contains a preset field, step S2 is executed.

[0041] In step S2, in the case where it is determined that the DHCP message contains a preset field, it is detected whether the ZTP process of the switch is disabled.

[0042] At present, the ZTP process will be in a disabled state after the device is powered on for the first time, and the ZTP process cannot be automatically started when it needs to be updated again. Therefore, in order to make the switch automatically run the ZTP process, the ZTP process of the local machine is detected first to determine whether the ZTP process needs to be adjusted.

[0043] In the present application, the switch is provided with a new function module for detecting the ZTP process of the switch. First, it is detected whether the ZTP process of the switch is available. The ZTP process of the switch can be in a disabled (ztp disabled) or available (ztp enable) state. Generally, if the ZTP process is in a running (ztp running) state, the new function module will not proceed to the next step, and the ZTP process of the switch does not need to be adjusted to avoid affecting the normal operation of the ZTP process. If the ZTP process is in a disabled state, step S3 is continued.

[0044] Step S3, in the case of detecting that the ZTP process is disabled, the ZTP process is adjusted to be available.

[0045] Specifically, in the present application, the ZTP process is adjusted to be available by the new function module described above. Assuming that the configuration of the switch needs to be updated after the switch has been used for a period of time, the self-configuration initialization can be updated to disable the ZTP process, which is adjusted to be available to provide a guarantee for the subsequent automatic operation of the ZTP process to update the configuration.

[0046] Step S4, according to the preset field, the ZTP process is run to update the configuration of the switch.

[0047] Specifically, if it is detected that the DHCP message contains the preset field, it indicates that the configuration of the switch should be updated, and the preset field carries the relevant information of the configuration of the update task this time. When the ZTP process is available, the switch automatically runs the ZTP process according to the relevant information of the preset field to perform the corresponding update.

[0048] In the present embodiment, by reading the DHCP message sent by the DHCP server, it is determined whether the DHCP message contains the preset field. In the case where it is determined that the DHCP message contains the preset field, the ZTP process of the switch is detected. If the ZTP process is disabled, the ZTP process is adjusted to be available. After the ZTP process is available, the ZTP process is automatically run according to the preset field to update the configuration of the switch. In this way, the ZTP process running command of the switch does not need to be manually executed, and the ZTP process of the switch is automatically adjusted to be available, and the configuration is automatically updated according to the preset field of the DHCP message.

[0049] In a possible implementation, the preset field is an option 67 field, and the ZTP process is run to update the configuration of the switch, including:

[0050] The content of the option 67 field is read to obtain the URL address and the file name in the content of the option 67 field; the configuration file corresponding to the file name is downloaded according to the URL address; the ZTP process is run to load the configuration file and update the configuration of the switch.

[0051] The DHCP message can add an option additional field to carry some information to be conveyed and then be sent. In the embodiment, the option 67 field is used as a criterion for judging whether the configuration of the switch is updated, and if it is detected that the DHCP message contains the option 67 field, it is determined that the local machine needs to update the configuration. The configuration file can be downloaded according to the content contained in the option 67 field, and the ZTP process is automatically run to load the configuration file to update the configuration of the switch after the ZTP process is available.

[0052] Specifically, the URL address and the file name are included in the option 67 field of the DHCP message, so that the switch can determine the configuration file to be loaded for this update according to the URL address and the file name, and then run the ZTP process to update the configuration.

[0053] In the embodiment, the information of whether the configuration is updated and the files according to which the configuration is updated is determined by the DHCP message sent by the DHCP server, and the administrator can specifically set the option 67 field of the DHCP message according to actual needs. After the URL address and the file name are written in the option 67 field, the DHCP server sends the DHCP message with the added option 67 field to multiple switches in communication connection with the DHCP server, so that the switches find the configuration file corresponding to the file name according to the URL address in the option 67 field, and automatically run the ZTP process to load the configuration file to complete the update of the configuration after the ZTP process is available. In this way, the original DHCP message is used to conveniently update the configuration of the switch.

[0054] In a possible implementation, before the configuration file corresponding to the file name is downloaded according to the URL address, the following steps are further included:

[0055] The communication state between the switch and the server corresponding to the URL address is detected; and the configuration file corresponding to the file name is downloaded from the URL address in the case that the switch and the server corresponding to the URL address are in normal communication.

[0056] Specifically, the server corresponding to the URL address in the preset field can be any available file server, and the configuration file is stored for the switch to download. Therefore, before the configuration file is obtained, it is necessary to determine whether the local and the server corresponding to the URL address can normally communicate. For example, the ping command is used to confirm whether the communication state of the switch and the server corresponding to the URL address is normal, and in the case that the switch and the server corresponding to the URL address normally communicate, the configuration file corresponding to the file name can be downloaded from the URL address.

[0057] In the embodiment, after the URL address of the option 67 field is obtained, the communication state of the local and the server corresponding to the URL address is detected, and after it is determined that the local and the server corresponding to the URL address normally communicate, the configuration file is obtained from the URL address. In this way, it is ensured that the switch can normally obtain the configuration file to be loaded and updated.

[0058] In an available implementation, the configuration file is further provided with a detection program, the detection program includes parameter information indicating whether the update result needs to be detected and a storage path of the server, and after the configuration file is loaded and the configuration of the switch is updated, the following is further included:

[0059] In the case that the parameter information indicates that the update result needs to be detected, the detection program is run to detect the update result to obtain a detection result;

[0060] According to the detection result, a detection file is generated, and the detection file is sent to the specified server to make the specified server record the update result according to the detection file according to the storage path.

[0061] Specifically, the configuration file specifies the task to be upgraded, and in the related application, the ZTP process only realizes the function of automatically uploading the ZTP.log file after the process is completed, and the file carries some related records of the entire ZTP process. In the process of batch updating the configuration of the switch, due to various conditions, some switches do not successfully update the configuration after running the ZTP process, and further processing may be needed. However, the administrator cannot conveniently know the actual result of each device after executing the ZTP process.

[0062] Therefore, in the embodiment, the detection program is set in the configuration file, the detection program includes parameter information indicating whether the update result needs to be detected, for example, “show version = 0 / 1” and “show platform firmware = 0 / 1” are set to judge whether the current configuration version of the switch after running the ZTP process is checked, and if “show version = 1”, the configuration version is checked.

[0063] The configuration file further includes a storage path of a specified server, and the specified server can store and record the update status of each switch. The specified server can be any available FTP server (File Transfer Protocol Server). Specifically, an URL parameter can be added to the configuration file to set the address and storage path of the specified server.

[0064] For example, when the parameter information indicating whether the update result needs to be detected is "show version = 1", that is, the update result needs to be detected, after the update configuration according to the configuration file is performed, the detection program is run to detect the update result and obtain a detection result; after the detection file is generated according to the detection result, the detection file is sent to the specified server according to the URL parameter of the specified server in the configuration file, so that the specified server records the update result according to the detection file according to the storage path.

[0065] In the embodiment, the detection function is added to the ZTP process, the actual update status of the switch after the ZTP process is run is detected, and the detected result is fed back to the specified server, so that the administrator can understand the actual update status of the batch of updated switches through the specified server.

[0066] In a feasible implementation, the name of the detection file can include the detection result and the serial number of the switch, so that after the specified server records the update result, the administrator can query the update result of the switch from the specified server according to the serial number of the switch.

[0067] Specifically, when the detection file is generated, the detection file is named as the detection result (pass / fail) + device SN (serial number). When the specified server stores the detection files sent by each switch under a preset folder, the actual update result of each switch can be directly seen through the file name. For example, when the specified server records the detection files sent by a batch of switches, the file directory is pass-11111111111, fail-11111111112, pass-11111111113, pass-11111111114,..., and the update result corresponding to each switch can be conveniently obtained by checking the name of the file. The administrator can also perform batch query on the specified server to understand which switches are successfully updated and which switches are failed to be updated.

[0068] Optionally, according to the detected update result, it can be further selected whether to run the ZTP process again to load the configuration file and perform update configuration, so that the switch is successfully updated.

[0069] In an implementation, the update result is detected to obtain a detection result, which includes:

[0070] The configuration version of the current switch and the version of the configuration file are obtained.

[0071] In a case where the configuration version of the current switch and the version of the configuration file are consistent, the detection result is update success; in a case where the configuration version of the current switch and the version of the configuration file are inconsistent, the detection result is update failure.

[0072] Specifically, in the embodiment, by comparing the configuration version of the current switch with the version of the configuration file to be loaded this time, it can be determined whether the update of the switch is successful. Therefore, the configuration version of the current switch and the version of the configuration file are obtained first, if the configuration version of the current switch and the version of the configuration file are consistent, it is determined that the detection result of the switch is update success; if the configuration version of the current switch and the version of the configuration file are inconsistent, it is determined that the detection result is update failure.

[0073] In the embodiment, by setting parameter information indicating whether the update result needs to be detected in the configuration file, the switch can perform a detection task after running the ZTP process to update the configuration, detect the actual update result of the local machine, obtain the detection result, generate a detection file, and send the detection file to a specified server for recording. Not only the automatic update configuration of the switches in batches is realized, but also the update result of the switches can be detected in batches, the ZTP process of the switch is further optimized, and the successful update configuration of the switch is promoted. The management personnel can query the update configuration of the switches in batches on the specified server, which is also conducive to the unified management of the switches.

[0074] In the present application, the DHCP server not only provides the DHCP service, but also indicates the switch in communication connection therewith to update the configuration through the DHCP message.

[0075] Specifically, referring to Figure 2 , Figure 2 is a schematic diagram of the architecture of the configuration update method in an embodiment of the present application. In an embodiment of the present application, the configuration update method is applied to the DHCP server, the DHCP server is in communication connection with multiple switches, and includes the following steps.

[0076] sending a DHCP message to the multiple switches, the DHCP message including a preset field; so that the switch detects whether the ZTP process of the switch is disabled in a case where the DHCP message contains the preset field; in a case where it is detected that the ZTP process is disabled, the ZTP process is adjusted to be available; and running the ZTP process of the switch according to the preset field to update the configuration of the switch.

[0077] In the embodiment, the DHCP message is changed by the DHCP server. For example, a URL address and a file name are added in an option 67 field of the DHCP message. After receiving the DHCP message containing the option 67 field, the switch can download a configuration file corresponding to the file name according to the URL address in the option 67 field, normally run the ZTP process, and update the configuration.

[0078] Specifically, the switch is configured with a new function module. The ZTP process of the switch is detected first. When it is detected that the ZTP process of the switch is in a running state, the related steps are not executed, so as not to affect the normal running of the ZTP process. When it is detected that the ZTP process of the switch is in a disabled state, the ZTP process is automatically adjusted, the control right of the ZTP process is acquired, and the ZTP process is adjusted to be available. After the ZTP process is available, the ZTP process is automatically run according to a preset field contained in the DHCP message received by the switch, and the configuration of the switch is updated.

[0079] In the embodiment, the switch can be instructed by the DHCP server to update the configuration. The DHCP server sends a DHCP message to multiple switches. The DHCP message contains a preset field. The switch determines whether the DHCP message contains the preset field. If the DHCP message contains the preset field, the switch detects whether the ZTP process of the switch is disabled. If the ZTP process is disabled, the ZTP process is adjusted to be available. The ZTP process of the switch is run according to the preset field, and the configuration of the switch is updated. In this way, the ZTP process of the switch can be automatically started and automatically updated according to needs.

[0080] Reference Figure 3 , Figure 3 is another architecture diagram of the configuration updating method described in an embodiment of the application. In an embodiment of the application, the DHCP server sends a DHCP message to the switch, so that the switch determines whether to update the configuration according to the received DHCP message. The switch is configured with a new function module as a supplementary module of the original ZTP process. The new function module can detect the state of the ZTP process, adjust the ZTP process from disabled to available, and check the actual result after the ZTP process is run. The FTP server receives a check file sent by the switch, so as to record the actual situation after the configuration of each switch is updated, for the administrator to query. The configuration updating method of the application can not only automatically adjust the ZTP process of the switch to be available, automatically run the ZTP process to update the configuration of the switch, but also check the actual result after the ZTP process of the switch is run.

[0081] Specifically, the switch acquires a DHCP message received by the local machine, determines whether the DHCP message contains an option 67 field, and when the DHCP message contains the option 67 field, downloads a configuration file according to content of the option 67 field under the condition that communication between the local machine and a server corresponding to a url address in the option 67 is determined to be normal, and the switch detects a ZTP process of the local machine to determine whether the ZTP process is disabled, controls the ZTP process if the ZTP process of the local machine is disabled, and adjusts the ZTP process to be available; then the switch can automatically execute a command ztp enable, ztp run-y, load the configuration file, and update the local machine; after the ZTP process completes the update or the switch is restarted, the switch runs a checking program to acquire a current local machine configuration version and a configuration file version downloaded this time. If the current local machine configuration version is consistent with the configuration file version, a checking file named a serial number of the local machine+success / pass is generated and sent to a specified server; if the current local machine configuration version is inconsistent with the configuration file version, a checking file named the serial number of the local machine+failure / fail is generated and sent to the specified server. In the embodiment, the specified server is an available FTP server. A user can query update conditions of the switches in batch update configuration through the FTP server.

[0082] In the embodiment, the ZTP process of the switch is optimized, whether the ZTP process needs to be run is determined according to whether the DHCP message contains the option 67 field, the ZTP process is detected to be available if the ZTP process needs to be run, the ZTP process is automatically run to update configuration according to the option 67 field after the ZTP process is adjusted to be available, and the actual update result of each switch is checked after the configuration of the switch is updated, so that the ZTP process is automatically adjusted from disabled to available, the ZTP process is automatically run to update configuration, the convenience and accuracy of batch deployment of devices by using the ZTP process are improved, the work difficulty of a field deployment personnel is reduced, and management of the switch is facilitated.

[0083] In an embodiment of the present application, the ZTP process is used to upgrade the software system of the switch.

[0084] Specifically, a plurality of switches in communication connection with a DHCP server are configured with a new function module, which can detect whether a ZTP process of the local machine is disabled, and automatically adjusts the ZTP process to be available when the ZTP process of the local machine is disabled, and controls the ZTP process to start running according to actual needs.

[0085] Acquire a DHCP message received by the local machine, and determine whether the DHCP message contains an option 67 field;

[0086] When it is determined that the DHCP message contains the option 67 field, it is detected whether the ZTP process of the local machine is disabled, and in the case that the ZTP process of the local machine is disabled, the ZTP process is adjusted to be available;

[0087] It is judged whether the local machine communicates normally with the server corresponding to the URL address in the option 67 field, and in the case that the local machine communicates normally with the server corresponding to the URL address in the option 67 field, the corresponding upgrade file is obtained, the ZTP process of the local machine is automatically run, and the corresponding software system upgrade is performed;

[0088] After the ZTP process completes the software system upgrade, according to the parameter information indicating detection of the upgrade result set in the upgrade file, the software system upgrade is detected to confirm whether the software system version of the current switch is consistent with the version to be upgraded this time, if the software system version of the current switch is consistent with the version to be upgraded this time, the detection result is upgrade success, and if the software system version of the current switch is not consistent with the version to be upgraded this time, the detection result is upgrade failure;

[0089] According to the detection result, a detection file is generated, and the detection file is named in the manner of SN+pass / fail (i.e. sequence number+success / failure);

[0090] The detection file is synchronously uploaded to the FTP server.

[0091] For specific details, refer to the above embodiments.

[0092] In this embodiment, when the ZTP process of the switch is used for software system upgrade of the switch, when it is determined that the DHCP message contains the option 67 field, it is detected whether the ZTP process of the local machine is disabled, if it is detected that the ZTP process of the local machine is disabled, the ZTP process is adjusted to switch the ZTP process from disabled to available, the ZTP process is automatically run according to the option 67 field, and the corresponding software system upgrade is performed; finally, the software system upgrade result of the switch is checked, and the detection result is fed back. In this way, when the ZTP process is disabled, the ZTP process is adjusted to be available, so that the switch automatically runs the ZTP process according to the option 67 field of the DHCP message to complete the upgrade task, batch upgrade and batch check of the switch are realized, and the management of the switch is facilitated.

[0093] Refer to Figure 4 , Figure 4Fig. 1 is a schematic diagram of a framework of a configuration updating system according to an embodiment of the present application. In an embodiment of the present application, based on the same inventive concept, a configuration updating system is also proposed, which is applied to a switch, and a plurality of switches are in communication connection with a DHCP server; the system comprises:

[0094] a determining module configured to read a DHCP message sent by the DHCP server and determine whether the DHCP message contains a preset field;

[0095] a detecting module configured to, in a case where the DHCP message contains the preset field, detect whether a ZTP process of the switch is disabled;

[0096] an adjusting module configured to, in a case where the ZTP process is detected to be disabled, adjust the ZTP process to be available;

[0097] a configuring module configured to run the ZTP process according to the preset field and update a configuration of the switch.

[0098] In the present application, the configuration updating system reads a DHCP message sent by a DHCP server to determine whether the DHCP message contains a preset field; in a case where the DHCP message contains the preset field, detects whether a ZTP process of the switch is disabled; in a case where the ZTP process is detected to be disabled, adjusts the ZTP process to be available; and according to the preset field, runs the ZTP process to update the configuration of the switch. When updating the configuration of the switch, a manual ZTP process running command is not required, and in a case where the ZTP process of the switch is disabled, the ZTP process of the switch is automatically adjusted to be available, and the switch can be automatically updated.

[0099] In a feasible implementation, the preset field is an option 67 field; the above-mentioned configuring module comprises:

[0100] an obtaining sub-module configured to read content of the option 67 field and obtain a URL address and a file name in the content of the option 67 field;

[0101] a downloading sub-module configured to download a configuration file corresponding to the file name according to the URL address;

[0102] a configuring sub-module configured to run the ZTP process, load the configuration file, and update the configuration of the switch.

[0103] In an implementation, the configuration module further comprises a detection submodule, configured to detect a communication state between the switch and a server corresponding to the URL address before downloading the configuration file corresponding to the file name, so that the downloading submodule downloads the configuration file corresponding to the file name from the URL address when the switch and the server corresponding to the URL address are in normal communication.

[0104] In an implementation, the configuration file is provided with a detection program, the detection program comprises parameter information indicating whether the update result needs to be detected and a storage path of the specified server; the system further comprises:

[0105] A detection program module is configured to run the detection program to detect the update result and obtain a detection result when the parameter information indicates that the update result needs to be detected.

[0106] A generation module is configured to generate a detection file according to the detection result.

[0107] A sending module is configured to send the detection file to the specified server, so that the specified server records the update result according to the detection file according to the storage path.

[0108] In an implementation, the detection program module is further configured to obtain a configuration version of the current switch and a version of the configuration file; the detection result is success when the configuration version of the current switch and the version of the configuration file are consistent; and the detection result is failure when the configuration version of the current switch and the version of the configuration file are inconsistent.

[0109] In an implementation, the name of the detection file generated in the system comprises the detection result and a serial number of the switch, so that the administrator queries the update result of the switch from the specified server according to the serial number of the switch after the specified server records the update result.

[0110] In an embodiment of the present application, based on the same inventive concept, a non-volatile storage medium is provided, on which a computer program is installed, and the computer program is executed by a processor to implement the configuration update method described in the above embodiments.

[0111] In an embodiment of the present application, based on the same inventive concept, a switch is provided, on which the configuration update system described in the above embodiments is configured.

[0112] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts between the embodiments can be referred to each other.

[0113] Those skilled in the art will appreciate that embodiments of the application can be provided as methods, apparatus, or computer program products. Accordingly, embodiments of the application can be embodied in a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the application can be embodied in a computer program product on one or more computer readable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage media, etc.) having computer usable program code embodied thereon.

[0114] Embodiments of the application are described herein with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing device, or other programmable data processing terminal devices to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal devices, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 Figure 1

[0115] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart illustrations and / or block diagrams. Figure 1 Figure 1

[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device to cause a series of operational steps to be performed on the computer or other programmable terminal device to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal device provide steps for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 Figure 1

[0117] ​​​​​​Finally, it is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting; it is not intended to exclude any other embodiments of the present application that do not fall within the scope of a patentably distinct claim. It is also noted that, as used in the specification, the singular form "a", "an" and "the" include plural references unless the context clearly dictates otherwise. It is to be understood that the terms "comprising", "including", "containing", and "having" are to be construed open-ended terms (i.e., meaning "including, but not limited to"), unless otherwise noted. It is also to be understood that all numerical ranges set forth herein are inclusive of the numbers recited and endpoints between the numbers.

[0118] The above detailed description merely describes preferred embodiments of a method for updating a configuration, a system, a storage medium and a switch. The specific example is applied herein to set forth the principles and embodiments of the present application. The above description of the embodiments is only to help understand the method and its core idea of the present application; meanwhile, for those skilled in the art, the specific embodiments and application scope can be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.

[0119] The above embodiments are only preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Any equivalent replacement or transformation of the present application made by those skilled in the art based on the present application is within the protection scope of the present application.

Claims

1. A method of configuration update, characterized by, The application is applied to a switch, a plurality of switches are in communication connection with a DHCP server, and the method comprises the following steps: reading a DHCP message sent by the DHCP server to determine whether the DHCP message contains a preset field; if it is determined that the DHCP message contains the preset field, detecting whether a ZTP process of the switch is disabled; if it is detected that the ZTP process is disabled, adjusting the ZTP process to be available; running the ZTP process according to the preset field, loading a configuration file, and updating the configuration of the switch; the configuration file is provided with a detection program, the detection program comprises parameter information indicating whether the update result needs to be detected and a storage path of a specified server; after the configuration file is loaded and the configuration of the switch is updated, the method further comprises the following steps: if the parameter information indicates that the update result needs to be detected, running the detection program to detect the update result to obtain a detection result; generating a detection file according to the detection result; and sending the detection file to the specified server so that the specified server records the update result according to the detection file according to the storage path.

2. The method of configuring updates according to claim 1, wherein, The preset field is an option 67 field, and the running of the ZTP process, the loading of the configuration file, and the updating of the configuration of the switch according to the preset field comprise the following steps: reading the content of the option 67 field to obtain a URL address and a file name in the content of the option 67 field; downloading the configuration file corresponding to the file name according to the URL address.

3. The method of configuring updates according to claim 2, wherein, Before the downloading of the configuration file corresponding to the file name according to the URL address, the method further comprises the following steps: detecting the communication state between the switch and a server corresponding to the URL address; if the switch and the server corresponding to the URL address are in normal communication, downloading the configuration file corresponding to the file name from the URL address.

4. The method of configuring updates of claim 1, wherein, The detection of the update result to obtain a detection result comprises the following steps: obtaining the configuration version of the current switch and the version of the configuration file; if the configuration version of the current switch and the version of the configuration file are consistent, the detection result is successful update; if the configuration version of the current switch and the version of the configuration file are inconsistent, the detection result is failed update.

5. The method of configuring updates of claim 1, wherein, The name of the detection file comprises the detection result and the serial number of the switch, so that after the specified server records the update result, an administrator can query the update result of the switch from the specified server according to the serial number of the switch.

6. A method of configuration update, characterized by, The application is applied to a DHCP server, the DHCP server is in communication connection with a plurality of switches, and the method comprises the following steps: The method comprises the following steps: sending a DHCP message to multiple switches, wherein the DHCP message comprises a preset field; detecting whether a ZTP process of the switch is disabled when the DHCP message comprises the preset field; adjusting the ZTP process to be available when it is detected that the ZTP process is disabled; running the ZTP process of the switch, loading a configuration file, and updating the configuration of the switch according to the preset field; the configuration file is provided with a detection program, wherein the detection program comprises parameter information indicating whether the update result needs to be detected and a storage path of a specified server; after the configuration file is loaded and the configuration of the switch is updated, the method further comprises the following steps: running the detection program to detect the update result and obtain a detection result when the parameter information indicates that the update result needs to be detected; generating a detection file according to the detection result; and sending the detection file to the specified server so that the specified server records the update result according to the detection file according to the storage path.

7. A configuration updating system characterized by comprising: The system is applied to switches, and multiple switches are in communication connection with a DHCP server; the system comprises: A determination module is configured to read a DHCP message sent by the DHCP server and determine whether the DHCP message comprises a preset field; A detection module is configured to detect whether a ZTP process of the switch is disabled when the DHCP message comprises the preset field; An adjustment module is configured to adjust the ZTP process to be available when it is detected that the ZTP process is disabled; A configuration module is configured to run the ZTP process, load a configuration file, and update the configuration of the switch according to the preset field; the configuration file is provided with a detection program, wherein the detection program comprises parameter information indicating whether the update result needs to be detected and a storage path of a specified server; after the configuration file is loaded and the configuration of the switch is updated, the system further comprises: a running detection program module configured to run the detection program to detect the update result and obtain a detection result when the parameter information indicates that the update result needs to be detected; a generation module configured to generate a detection file according to the detection result; and a sending module configured to send the detection file to the specified server so that the specified server records the update result according to the detection file according to the storage path.

8. A non-volatile storage medium, characterized by A computer program is stored on the computer program, and the computer program is executed by a processor to implement the configuration updating method according to any one of claims 1-6.

9. A switch, characterized by The configuration updating system according to claim 7 is configured.

Citation Information

Patent Citations

  • System and method for zero contact configuration through convergence / LACP port

    CN115277403A