Network equipment upgrading method and system, computer equipment and storage medium
The network device upgrade method addresses inefficiencies and costs in existing upgrade methods by implementing a secure and efficient message-based upgrade process, ensuring legitimacy and tracking upgrade status, thereby enhancing efficiency and reducing costs.
Patent Information
- Application Number
- CN202411185391.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-20
AI Technical Summary
Current network device upgrade methods, such as returning to the factory for manual upgrades or using wide area network management servers, are inefficient and costly, especially for non-traditional Ethernet uplink devices, and disrupt business continuity or require complex network configurations.
A network device upgrade method that establishes an efficient message sending and receiving mechanism between network devices and an upgrade server, using a virtual machine to authenticate and distribute upgrade data, ensuring legitimacy and authority, and tracking upgrade status through work logs.
Enables batch upgrades of network devices efficiently and securely, reducing costs and maintaining business continuity by verifying identity and authority, and outputting upgrade status to work logs for traceability.
Smart Images

Figure CN119172243A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a network device upgrading method, system, computer device and storage medium. Background Art
[0002] In the information age of the Internet of Everything, network devices such as routers and gateways are the cornerstones. Their stable operation and excellent performance are directly related to the health and vitality of the entire network ecosystem. However, with the increasing complexity and rapid evolution of the field of communication technology, the demand for software updates and security patches has emerged frequently. When faced with a large number of equipment groups, the traditional manual single-device upgrade method seems to be stretched and inefficient. At present, there are two main batch upgrade strategies popular in the market. The first is to return to the factory for upgrade, that is, to send the equipment back to the original factory and go through a tedious disassembly and re-burning process. Although this method can ensure the thoroughness and accuracy of the upgrade, it undoubtedly adds an additional cost burden, and the equipment cannot provide services during the upgrade, which seriously affects the continuity of the business. The second is to rely on the wide area network management server for remote batch upgrades. This method is incapable of non-traditional Ethernet uplink devices (such as PON, DSL and wireless devices, etc.), and requires additional configuration of complex network equipment to support it. It also faces the problems of inefficiency and high cost.
[0003] Therefore, how to implement a batch upgrade solution that is both efficient and low-cost has become an important issue that needs to be urgently addressed in the current field of network technology. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a network device upgrade method, system, computer device and storage medium, which can effectively solve the problems of low efficiency and high cost in the prior art.
[0005] In a first aspect, an embodiment of the present application provides a network device upgrade method, which is applied to an upgrade server running a virtual machine, and the virtual machine executes the method, including:
[0006] Sending a first message to the network device to be upgraded, wherein the first message is used to instruct the network device to determine the legal status of the upgrade server;
[0007] receiving a second message returned by the network device, wherein the second message includes the device information of the network device itself fed back after confirming that the upgrade server is legitimate;
[0008] A third message including version upgrade configuration information is generated according to the device information and sent to the network device; the third message is used by the network device to determine whether to upgrade and obtain upgrade data from the upgrade server for upgrading when upgrading is required;
[0009] receiving a fourth message returned by the network device, wherein the fourth message includes a current upgrade status of the network device;
[0010] In some embodiments, the sending of a first message to the network device to be upgraded, wherein the first message is used to instruct the network device to determine a legal status of the upgrade server, includes:
[0011] The first message includes a first field and a second field; the first field is used by the network device to verify the identity status of the upgrade server, and the second field is used by the network device to verify the authority status of the upgrade server; when the identity status and the authority status meet the preset status, the upgrade server is confirmed to be legal.
[0012] In some embodiments, generating a third message including version upgrade configuration information according to the device information and sending it to the network device; the third message is used by the network device to determine whether to upgrade and obtain upgrade data from the upgrade server for upgrading when upgrading is required, including:
[0013] Parsing the second message, extracting from the second message the device information of the network device itself fed back after confirming that the upgrade server is legitimate, the device information including the product model and version number;
[0014] According to the product model, query and obtain version upgrade configuration information corresponding to the product model;
[0015] The version upgrade configuration information is filled into a preset field to generate a third message, and the third message is sent to the network device so that the network device determines whether to upgrade and obtains upgrade data from the upgrade server for upgrading when upgrading is required.
[0016] In some embodiments, outputting the current upgrade status of the network device to a work log comprises:
[0017] Parsing the fourth message to extract the current upgrade status of the network device;
[0018] The current upgrade status is output to a work log, and the work log is used for a user to check the upgrade status of the network device after the network device is restarted.
[0019] The embodiment of the present application provides a network device upgrade method, which is applied to a network device, and the network device executes the method, including:
[0020] receiving a first message sent by an upgrade server running a virtual machine, and determining a legal status of the upgrade server according to the first message;
[0021] When the upgrade server is in a legal state, generating a second message according to its own device information and sending it to the upgrade server;
[0022] receiving a third message returned by the upgrade server, determining whether to upgrade according to the third message, and obtaining upgrade data from the upgrade server for upgrading when upgrading is required;
[0023] A fourth message is sent to the upgrade server, where the fourth message includes a current upgrade status of the network device.
[0024] In some embodiments, determining the legal status of the upgrade server according to the first message includes:
[0025] Parsing the first message to extract a first field and a second field in the first message;
[0026] Determine the identity status of the upgrade server according to the first field, and determine the authority status of the upgrade server according to the second field;
[0027] When the identity status and the authority status of the upgrade server meet the preset status, the upgrade server is confirmed to be legitimate.
[0028] In some embodiments, determining whether to upgrade according to the third message and obtaining upgrade data from the upgrade server for upgrading when upgrading is required includes:
[0029] Parsing the third message to extract version upgrade configuration information of the third message;
[0030] Extracting the upgrade flag in the version upgrade configuration information according to the version upgrade configuration information;
[0031] When the upgrade mark is the first mark, the current upgrade state is confirmed as a pending upgrade state;
[0032] When the upgrade mark is the second mark, obtain the update status of the upgrade version number and the current version number in the version upgrade configuration information; if the upgrade version number is the update status, confirm the current upgrade status as the to-be-upgraded status; if the current version number is the update status, confirm the current upgrade status as the non-upgrade status.
[0033] In a second aspect, an embodiment of the present application provides a network device upgrade system, including:
[0034] An upgrade server running a virtual machine, wherein the virtual machine is used to send a first message to a network device to be upgraded through the upgrade server;
[0035] A network device, configured to determine the legal status of the upgrade server according to the first message, and after confirming that the upgrade server is in a legal status, generate a second message according to its own device information and send the second message to the upgrade server;
[0036] The upgrade server is further configured to generate a third message including version upgrade configuration information according to the own device information, and send the third message to the network device;
[0037] The network device is further used to determine whether to upgrade according to the third message and obtain upgrade data from the upgrade server for upgrading when upgrading is required;
[0038] The network device is further used to send a fourth message to the upgrade server, where the fourth message includes a current upgrade status of the network device;
[0039] The upgrade server is further configured to output the current upgrade status of the network device to a work log.
[0040] In a third aspect, an embodiment of the present application provides a computer device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the network device upgrade method of the first aspect.
[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, and when the computer program is executed on a processor, the network device upgrade method of the first aspect described above is implemented.
[0042] The embodiments of the present application have the following beneficial effects:
[0043] A network device upgrade method, system, computer device and storage medium of the present application establish an efficient message sending and receiving mechanism between the network device and the upgrade server, so that the network devices can be upgraded in batches efficiently and safely using only low-cost equipment, thereby significantly improving the efficiency and security of the upgrade process and reducing production and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 An application scenario diagram of a network device upgrade method according to an embodiment of the present application is shown;
[0046] Figure 2 A flow chart of a network device upgrade method according to an embodiment of the present application is shown;
[0047] Figure 3 A flowchart of a network device upgrade method according to an embodiment of the present application, which is applied to an upgrade server running a virtual machine, is shown;
[0048] Figure 4 A schematic diagram of a network device upgrade method applied to a network device in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0050] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0051] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0052] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0053] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0054] Taking into account the increased cost burden of "returning to the factory for upgrading" in the prior art, the equipment cannot provide services during the upgrading period, which seriously affects the continuity of business; "relying on a wide area network management server for remote batch upgrading" for non-traditional Ethernet uplink devices, it is necessary to additionally configure complex network equipment to support the problems, therefore, a network equipment upgrading method is proposed, which establishes an efficient message sending and receiving mechanism between the network equipment and the upgrade server, so that the network equipment can be efficiently and safely upgraded in batches using only low-cost equipment, thereby significantly improving the efficiency and security of the upgrading process, and reducing production and maintenance costs.
[0055] The present application provides a network device upgrade method, which can be applied in the following situations: Figure 1 In the application environment, specifically, the network device upgrade method of the present application is applied in a computer system, the system includes: Figure 1 The network device, switch, and server shown in the figure, the network device and the switch communicate through the network, the switch and the server communicate through the network, the network device refers to the communication device to be upgraded, and the server includes the upgrade server and the virtual machine running on the upgrade server. The switch is used to connect the server or other network devices in the local area network to realize data forwarding and communication.
[0056] Before the upgrade process, the staff logs in to the upgrade server through an appropriate authentication mechanism, opens the upgrade management main program in the upgrade server, and uploads the upgrade information to the designated location or directory on the upgrade server. The upgrade information usually includes: product model, version number, version file name, upgrade flag, download method, etc. For example, the upgrade information of network device a is set as follows: product model is aaa, version number is aaa_v1, version file name is aaa_v1.bin, upgrade flag is set to "true", and download method is tftp; the upgrade information of network device b is set as follows: product model is bbb, version number is bbb_v3, version file name is bbb_v3.bin, upgrade flag is set to "false", and download method is tftp; the upgrade information of network device c is set as follows: product model is ccc, version number is ccc_v2, version file name is ccc_v2.bin, forced upgrade flag is set to "false", and download method is tftp.
[0057] It is worth noting that the above-mentioned product models, version numbers, version file names, and upgrade flag names are only examples and can be adaptively adjusted according to specific circumstances.
[0058] It is worth noting that each network device can only communicate with one virtual machine on the upgrade server. To achieve this, the LAN interface of the network device needs to be connected to the switch via an Ethernet cable. At the same time, the upgrade server needs to be connected to the switch via Ethernet. Subsequently, VLAN is configured on the switch interface to ensure that each network device is isolated from each other and does not affect each other when the upgrade work is carried out at the same time, thereby ensuring the smooth progress of the upgrade process. For example, the interface of the first network device is configured as VLAN101, and the interface of the second network device is configured as VLAN102, etc.; the interface of the switch connected to the upgrade server is configured as VLAN101, VLAN102, etc., so that the upgrade server can communicate with all network devices; the interface of the first virtual machine server of the upgrade server is configured with VLAN101, which can communicate with the first network device. This not only achieves mutual isolation between network devices, but also ensures that the upgrade server can communicate with each network device efficiently and orderly, thereby supporting the smooth progress of network device upgrade work.
[0059] Figure 2 A schematic diagram of a flow chart of a network device upgrade method according to an embodiment of the present application is shown, and the network device upgrade method comprises the following steps:
[0060] Step S100: The upgrade server runs a virtual machine, and the virtual machine sends a first message to the network device to be upgraded through the upgrade server;
[0061] Exemplarily, during the upgrade process, the upgrade server is the party that actively initiates communication and sends a first message to the network device to be upgraded, and the first message is a DHCP Discover message. The network device to be upgraded is the recipient in the upgrade process and receives the first message. The upgrade server is a server responsible for managing and distributing upgrade data, and a virtual machine runs on it for processing tasks related to network device upgrades. The first message includes a first field and a second field; the first field is an option 12 field, and the second field is an option 60 field.
[0062] In step S200, the network device determines the legal status of the upgrade server according to the first message, and after confirming that the upgrade server is in a legal status, generates a second message according to its own device information and sends it to the upgrade server.
[0063] For example, the host name of the upgrade server is filled in the option 12 field, which is used by the network device to determine whether the device that sends the DHCP Discover message is the expected upgrade server, that is, it is used for the network device to verify the identity status of the upgrade server. The encrypted authentication key is filled in the option 60 field, which is used by the network device to verify whether the device that sends the DHCP Discover message has a legitimate upgrade authority, that is, it is used for the network device to verify the authority status of the upgrade server.
[0064] For example, when the verification is a legitimate server, the DHCP Offer message replied by the network device contains the Option 43 field, in which the product model and current version number of the network device are filled, so that the upgrade server can query the product model and current version number of the network device; conversely, when the verification is an illegal upgrade server, the Option 43 field of the DHCP Offer message replied by the network device does not contain the product model and current version number of the network device, so as to avoid leakage of network device information.
[0065] Exemplarily, the second message is a DHCP Offer message. The second message includes the network device's own device information fed back after confirming that the upgrade server is legitimate, such as product model, current version number, serial number, current firmware version, etc.
[0066] Step S300: The upgrade server generates a third message including version upgrade configuration information according to its own device information, and sends the third message to the network device.
[0067] Exemplarily, a third message containing version upgrade configuration information is generated according to the device information itself, and the third message is a DHCP Request message. The version upgrade configuration information contained in the third message may include but is not limited to: product model, version number, version file name, download method, mandatory upgrade flag, target software version, download link of the upgrade package, upgrade steps, precautions, compatibility information, etc. After generating the third message, the upgrade server will send it to the network device.
[0068] Step S400: The network device determines whether to upgrade according to the third message and obtains upgrade data from the upgrade server for upgrading when upgrading is required.
[0069] Exemplarily, the third message is a DHCP Request message, and the DHCP Request message is parsed to extract the version upgrade configuration information in the option 43 field. The version upgrade configuration information may include but is not limited to: product model, version number, version file name, download method, mandatory upgrade flag, target software version, download link of the upgrade package, upgrade steps, precautions, compatibility information, etc. According to the version upgrade configuration information, the upgrade mark in the version upgrade configuration information is extracted. In this application, the upgrade mark includes a "first mark" and a "second mark". The first mark is "true" and the second mark is "false". When the first mark is "true", it indicates that the network device to be upgraded should be upgraded to the specified version in the upgrade information, and the upgrade status is set to the "to be upgraded" status. When the second mark is "false", it indicates that the network device to be upgraded should compare the current version number with the version number in the upgrade information before deciding whether to upgrade.
[0070] Step S500: The network device sends a fourth message to the upgrade server, where the fourth message includes the current upgrade status of the network device.
[0071] Exemplarily, a fourth message is sent to the upgrade server, and the fourth message is a DHCP Ack message. The fourth message includes the current upgrade status of the network device, such as information such as to be upgraded or not upgraded. Understanding the current upgrade status helps the upgrade server track and manage the upgrade process and provide necessary support or intervention.
[0072] It is worth noting that the above current upgrade status is only an example and can be adaptively adjusted according to the specific situation.
[0073] Step S600: The upgrade server outputs the current upgrade status of the network device to the work log.
[0074] Exemplarily, after receiving and parsing the fourth message returned by the network device and understanding the current upgrade status of the network device, the upgrade server will record the status information in its work log to retain the historical record of the upgrade process, ensure the traceability of the upgrade process and the convenience of problem diagnosis. Output the current upgrade status of the network device to the work log, that is, write the current upgrade status to the work log in an appropriate format and manner. For example, if the work log displays "to be upgraded" to indicate waiting for upgrade, at this time, the network device will log in to the upgrade server according to the download method in the upgrade information, download the specified target version, perform version upgrade, and then the network device to be upgraded will automatically restart. After the automatic restart, check the upgrade status of the network device to be upgraded. If the upgrade status is "to be upgraded", compare the current version with the specified target version. When the two are consistent, it means that the upgrade is successful, and change "to be upgraded" to "upgrade success"; when the two are inconsistent, it means that the upgrade failed, and change "to be upgraded" to "upgrade failure".
[0075] It is worth noting that when the network device is restarted, the upgrade server will re-initiate the upgrade process, obtain the upgrade status of the network device, and send the upgrade status to the upgrade server. After receiving the upgrade status and upgrade mark, the upgrade server outputs it to the work log so that the user can check the upgrade status of the network device to be upgraded according to the work log after logging into the upgrade server. If the work log shows "upgrade successful", replace the next network device to be upgraded. If the work log shows "upgrade failed", investigate the cause of the failure.
[0076] The network equipment upgrade method of the embodiment of the present application establishes an efficient message sending and receiving mechanism between the network equipment and the upgrade server, so that even if low-cost equipment is used, the network equipment can be upgraded in batches efficiently and safely, thereby significantly improving the efficiency and safety of the upgrade process and reducing production and maintenance costs.
[0077] In another embodiment, Figure 3 A flow chart of a network device upgrade method according to an embodiment of the present application is shown, which is applied to an upgrade server running a virtual machine. The virtual machine executes the network device upgrade method, including the following steps:
[0078] Step S310: Send a first message to the network device to be upgraded, where the first message is used to instruct the network device to determine the legal status of the upgrade server.
[0079] Exemplarily, the first message is a data or message packet sent by the upgrade server to the network device. In network communication, a message is a basic unit of data transmission and can contain various types of information. For example, the first message DHCPDiscover message is sent by broadcasting.
[0080] In an optional embodiment, the first message includes a first field and a second field; the first field is used by the network device to verify the identity status of the upgrade server, and the second field is used by the network device to verify the authority status of the upgrade server; when the identity status and the authority status meet the preset status, the upgrade server is confirmed to be legal.
[0081] Exemplarily, for example, the network device can be a router, a switch, an intelligent device, etc., and the identity, authority, source, etc. of the upgrade server are verified according to the first field and the second field to ensure its legitimacy, thereby preventing illegal or malicious upgrade operations from causing damage to the network device. When the network device simultaneously verifies the identity status and authority status of the upgrade server and finds that both match the preset status in the network device (such as the authentication information and authority list stored in the configuration file, database or security chip), the upgrade server is confirmed to be legitimate.
[0082] Step S320: receiving a second message returned by the network device, where the second message includes the network device's own device information fed back after confirming that the upgrade server is legitimate.
[0083] Exemplarily, the second message is generated after the network device completes the verification of the legitimacy of the upgrade server, and contains the network device's own device information fed back after confirming the legitimacy of the upgrade server. The device information may include but is not limited to the product model, serial number, current software version, hardware configuration, etc. of the network device, and the device information helps the upgrade server determine which upgrade data or configuration is applicable to the network device.
[0084] Step S330, generate a third message containing version upgrade configuration information according to its own device information and send it to the network device; the third message is used by the network device to determine whether to upgrade and obtain upgrade data from the upgrade server for upgrading when upgrading is required.
[0085] Exemplarily, the version upgrade configuration information includes, but is not limited to: product model, version number, version file name, download method, forced upgrade flag, target software version, download link of the upgrade package, upgrade steps, precautions, compatibility information, etc.
[0086] In an optional embodiment, the second message is parsed, and the device information of the network device itself fed back after confirming that the upgrade server is legitimate is extracted from the second message, where the device information includes a product model and a version number;
[0087] Exemplarily, after receiving the DHCP Offer message from the network device, the upgrade server parses the option 43 field in the DHCP Offer message to obtain the device information of the network device, such as the product model and version number.
[0088] Then, the product model is extracted from the DHCP Offer message, and then the version upgrade configuration information of the corresponding product model is queried, such as the product model, version number, version file name, download method, mandatory upgrade flag, etc.
[0089] Next, the upgrade server fills the version upgrade configuration information into the preset field to generate a third message, and sends the third message to the network device, so that the network device determines whether to upgrade and obtains upgrade data from the upgrade server for upgrading when upgrading is required.
[0090] Exemplarily, the preset field is the option 43 field, and the upgrade server fills the queried version upgrade configuration information into the option 43 field to generate a third message, namely, a DHCP Request message. The DHCP Request message contains all the key information required for the network device upgrade. Subsequently, the upgrade server sends the DHCP Request message back to the network device.
[0091] Step S340: receiving a fourth message returned by the network device, where the fourth message includes a current upgrade status of the network device.
[0092] Exemplarily, the fourth message is actively sent by the network device to the upgrade server during or after the upgrade, and is used to indicate the current upgrade status, for example, "to be upgraded" or "not upgraded".
[0093] For example, by receiving and analyzing the upgrade status information in the fourth message, the upgrade server can monitor the upgrade progress of the network device in real time and confirm whether the upgrade is proceeding as expected. If any abnormality or problem is found, the upgrade server can take timely measures, such as resending the upgrade data, providing technical support, or guiding the user to troubleshoot. Depending on the current upgrade status of the network device, the upgrade server may decide whether to send additional messages or perform other operations. For example, if the upgrade fails, the upgrade server may send a message containing error diagnostic information to the network device to help the user locate the problem and solve it.
[0094] Step S350: output the current upgrade status of the network device to the work log.
[0095] For example, the work log may include key information such as timestamp, network device identification, and upgrade status description to facilitate subsequent query and analysis. By regularly checking the work log, the staff can understand the overall situation of the upgrade process, discover potential problems in a timely manner, and take appropriate measures to solve them.
[0096] In an optional embodiment, the fourth message is parsed to extract the current upgrade status of the network device.
[0097] Exemplarily, the fourth message refers to a DHCP Ack message, and the DHCP Ack message is parsed to obtain the upgrade status.
[0098] Exemplarily, after receiving the upgrade status, the upgrade server outputs the upgrade status to a work log, and the work log allows the user to check the upgrade status of the network device after the network device is restarted.
[0099] The network device upgrade method of the embodiment of the present application is an important part of ensuring the security of the network device upgrade process by verifying identity and authority, which can effectively prevent unauthorized or malicious upgrade attempts. The self-device information fed back after confirming the legitimacy of the upgrade server helps the upgrade server determine which upgrade data or configuration is applicable to the network device to decide whether to upgrade, obtain the current upgrade status of the network device, and output the current upgrade status to the work log. Through the work log, the overall situation of the upgrade process can be understood, potential problems can be discovered in time, and corresponding measures can be taken to solve them. That is, data is exchanged between the upgrade server and the network device through messages, which realizes the transmission of upgrade information and the control of the upgrade process, ensures that the network device can be upgraded safely and effectively, and even if low-cost equipment is used, the network device can be upgraded in batches with high efficiency and security, thereby significantly improving the efficiency and security of the upgrade process and reducing production and maintenance costs.
[0100] In yet another embodiment, Figure 4 A flowchart of a network device upgrade method according to an embodiment of the present application is shown, which is applied to a network device and includes the following steps:
[0101] Step S410: receiving a first message sent by an upgrade server running a virtual machine, and determining a legal status of the upgrade server according to the first message.
[0102] Exemplarily, the main purpose of the first message is to instruct the network device to determine the legal status of the upgrade server to prevent a malicious server from impersonating a legal server to perform illegal operations and ensure that the network device only interacts with a trusted upgrade server.
[0103] In an optional embodiment, the first message is parsed to extract the first field and the second field in the first message.
[0104] Exemplarily, the first message refers to a DHCP Discover message, the first field is an option 12 field, and the second field is an option 60 field.
[0105] The network device determines the identity status of the upgrade server according to the first field, and determines the authority status of the upgrade server according to the second field. Exemplarily, it determines whether it is an upgrade server according to the host name in the option 12 field, and parses the ciphertext in the option 60 field to obtain the authentication key to determine whether it is a legitimate upgrade server.
[0106] Exemplarily, if the identity status and permission status of the upgrade server match the preset status, the verification is successful and the upgrade server is confirmed to be legitimate; otherwise, the upgrade server is confirmed to be illegitimate.
[0107] Step S420: When the upgrade server is in a legal state, a second message is generated according to its own device information and sent to the upgrade server.
[0108] Exemplarily, after the network device verifies the legal status of the upgrade server, for example, by verifying the digital certificate, domain name or other authentication mechanism of the server, a second message is generated and sent to the upgrade server.
[0109] Step S430: receiving a third message returned by the upgrade server, determining whether to upgrade according to the third message, and obtaining upgrade data from the upgrade server for upgrading when upgrading is required.
[0110] Exemplarily, the third message includes version upgrade configuration information required for the network device to determine whether to upgrade. The network device decides whether to upgrade based on the version upgrade configuration information and prepares to obtain upgrade data for upgrading.
[0111] In an optional embodiment, the network device parses the third message and extracts the version upgrade configuration information of the third message.
[0112] Exemplarily, after receiving the third message, the network device will determine whether to upgrade based on the version upgrade configuration information therein.
[0113] When an upgrade is required, the upgrade flag bit in the version upgrade configuration information is extracted according to the version upgrade configuration information.
[0114] For example, an "upgrade flag" generally refers to a variable or flag that stores upgrade-related information, which is used to indicate the current system or software version status, whether an upgrade is required, upgrade progress, etc. For example, a flag can be a simple Boolean value (for example, true indicates that an upgrade is required, and false indicates that an upgrade is not required), or it can be a complex structure containing more information (such as version number, upgrade progress, upgrade source, etc.).
[0115] In the present application, the upgrade mark bit includes a “first mark bit” and a “second mark bit.” When the upgrade mark bit is the first mark bit, the current upgrade state is confirmed as a pending upgrade state, so as to obtain upgrade data from the upgrade server for upgrading.
[0116] Exemplarily, when the first flag bit is "true", it indicates that the network device to be upgraded should be upgraded to a specified version in the upgrade information, and the upgrade state is set to a "to be upgraded" state.
[0117] When the upgrade mark bit is the second mark bit, the upgrade version number and the update status of the current version number in the upgrade version configuration information are obtained.
[0118] Exemplarily, when the second flag bit is "false", it indicates that the network device to be upgraded should compare the current version number with the version number in the upgrade information before deciding whether to upgrade;
[0119] If the upgrade version number is in the update state, the current upgrade state is confirmed as the pending upgrade state to obtain upgrade data from the upgrade server for upgrading; if the current version number is in the update state, the upgrade state is confirmed as the non-upgrade state.
[0120] Exemplarily, if after comparison it is found that the upgrade version number in the version upgrade configuration information has been updated, it means that the network device to be upgraded needs to be upgraded to the specified version in the version upgrade configuration information, and at this time, the network device to be upgraded sets its upgrade status to "to be upgraded". If after comparison it is found that the current version number of the network device to be upgraded has been updated or is consistent with the version number of the upgrade information, it means that the network device to be upgraded does not need to be upgraded; at this time, the current upgrade status of the network device to be upgraded is set to "not upgraded".
[0121] Step S440: Send a fourth message to the upgrade server, where the fourth message includes the current upgrade status of the network device.
[0122] Exemplarily, the fourth message is a DHCP Ack message. The fourth message includes the current upgrade status of the network device, which helps the upgrade server track and manage the upgrade process and provide necessary support or intervention.
[0123] The network device upgrade method of the embodiment of the present application ensures the security of the network device upgrade process by verifying the identity and authority, effectively preventing unauthorized or malicious upgrade attempts, and confirming that the upgrade server's own device information fed back after the legitimacy of the upgrade server helps the upgrade server determine which upgrade data or configuration is applicable to the network device to decide whether to upgrade, obtain the current upgrade status of the network device, and output the current upgrade status to the work log. Through the work log, the overall situation of the upgrade process can be understood, potential problems can be discovered in time, and corresponding measures can be taken to solve them. That is, data is exchanged between the upgrade server and the network device through messages, which realizes the transmission of upgrade information and the control of the upgrade process, ensures that the network device can be upgraded safely and effectively, and even if low-cost equipment is used, the network device can be upgraded in batches with high efficiency and security, thereby significantly improving the efficiency and security of the upgrade process and reducing production and maintenance costs.
[0124] It can be understood that the method of this embodiment corresponds to the network device upgrade system of the above embodiment, and the optional items in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0125] The present application also provides a computer device. Exemplarily, the computer device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the functions of each module in the above-mentioned network device upgrade method or the above-mentioned network device upgrade system.
[0126] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0127] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0128] The present application also provides a computer-readable storage medium for storing the computer program used in the above-mentioned terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0129] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0130] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0131] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0132] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A network device upgrade method, characterized in that: Applied to an upgrade server running a virtual machine, the virtual machine executes the method, including: Sending a first message to the network device to be upgraded, wherein the first message is used to instruct the network device to determine the legal status of the upgrade server; receiving a second message returned by the network device, wherein the second message includes the device information of the network device itself fed back after confirming that the upgrade server is legitimate; A third message including version upgrade configuration information is generated according to the own device information, and sent to the network device; the third message is used by the network device to determine whether to upgrade and obtain upgrade data from the upgrade server for upgrading when upgrading is required; receiving a fourth message returned by the network device, wherein the fourth message includes a current upgrade status of the network device; The current upgrade status of the network device is output to a work log.
2. The network device upgrade method according to claim 1, characterized in that: The sending a first message to the network device to be upgraded, wherein the first message is used to instruct the network device to determine the legal status of the upgrade server, includes: The first message includes a first field and a second field; the first field is used by the network device to verify the identity status of the upgrade server, and the second field is used by the network device to verify the authority status of the upgrade server; when the identity status and the authority status meet the preset status, the upgrade server is confirmed to be legal.
3. The network device upgrade method according to claim 1, characterized in that: generating a third message including version upgrade configuration information according to the device information and sending the message to the network device; The third message is used by the network device to determine whether to upgrade and obtain upgrade data from the upgrade server for upgrading when upgrading is required, including: Parsing the second message, extracting the device information of the network device after confirming the legitimacy of the upgrade server from the second message, wherein the device information of the network device includes a product model and a version number; According to the product model, query and obtain version upgrade configuration information corresponding to the product model; The version upgrade configuration information is filled into a preset field to generate a third message, and the third message is sent to the network device so that the network device determines whether to upgrade and obtains upgrade data from the upgrade server for upgrading when upgrading is required.
4. The network device upgrade method according to claim 1, characterized in that: Outputting the current upgrade status of the network device to a work log includes: Parsing the fourth message to extract the current upgrade status of the network device; The current upgrade status is output to a work log, and the work log is used for a user to check the upgrade status of the network device after the network device is restarted.
5. A network device upgrade method, characterized in that: Applied in a network device, the network device executes the method, including: receiving a first message sent by an upgrade server running a virtual machine, and determining a legal status of the upgrade server according to the first message; When the upgrade server is in a legal state, generating a second message according to its own device information and sending it to the upgrade server; receiving a third message returned by the upgrade server, determining whether to upgrade according to the third message, and obtaining upgrade data from the upgrade server for upgrading when upgrading is required; A fourth message is sent to the upgrade server, where the fourth message includes a current upgrade status of the network device.
6. The network device upgrade method according to claim 5, characterized in that: The determining, according to the first message, a legal status of the upgrade server includes: Parsing the first message to extract a first field and a second field in the first message; Determine the identity status of the upgrade server according to the first field, and determine the authority status of the upgrade server according to the second field; When the identity status and the authority status of the upgrade server meet the preset status, the upgrade server is confirmed to be legitimate.
7. The network device upgrade method according to claim 5, characterized in that: The determining whether to upgrade according to the third message and obtaining upgrade data from the upgrade server for upgrading when upgrading is required includes: Parsing the third message to extract version upgrade configuration information of the third message; Extracting the upgrade flag in the version upgrade configuration information according to the version upgrade configuration information; When the upgrade mark is the first mark, the current upgrade state is confirmed as a pending upgrade state; When the upgrade mark is the second mark, obtain the update status of the upgrade version number and the current version number in the version upgrade configuration information; if the upgrade version number is the update status, confirm the current upgrade status as the to-be-upgraded status; if the current version number is the update status, confirm the current upgrade status as the non-upgrade status.
8. A network equipment upgrade system, characterized in that: The network equipment upgrading system comprises: An upgrade server running a virtual machine, wherein the virtual machine is used to send a first message to a network device to be upgraded through the upgrade server; A network device, configured to determine the legal status of the upgrade server according to the first message, and after confirming that the upgrade server is in a legal status, generate a second message according to its own device information and send the second message to the upgrade server; The upgrade server is further configured to generate a third message including version upgrade configuration information according to the own device information, and send the third message to the network device; The network device is further used to determine whether to upgrade according to the third message and obtain upgrade data from the upgrade server for upgrading when upgrading is required; The network device is further used to send a fourth message to the upgrade server, where the fourth message includes a current upgrade status of the network device; The upgrade server is further configured to output the current upgrade status of the network device to a work log.
9. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the network device upgrading method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer program is stored therein, and when the computer program is executed on a processor, the network device upgrading method according to any one of claims 1 to 7 is implemented.
