CN114301781A - Wired router terminal upgrading method and device, computer equipment and storage medium - Google Patents

Wired router terminal upgrading method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114301781A
CN114301781A CN202111634140.0A CN202111634140A CN114301781A CN 114301781 A CN114301781 A CN 114301781A CN 202111634140 A CN202111634140 A CN 202111634140A CN 114301781 A CN114301781 A CN 114301781A
Authority
CN
China
Prior art keywords
server
packet
sending
upgrade
upgrading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111634140.0A
Other languages
Chinese (zh)
Inventor
汪光华
林伟强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Tongze Kangwei Intelligent Technology Co ltd
Original Assignee
Guangzhou Tongze Kangwei Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Tongze Kangwei Intelligent Technology Co ltd filed Critical Guangzhou Tongze Kangwei Intelligent Technology Co ltd
Priority to CN202111634140.0A priority Critical patent/CN114301781A/en
Publication of CN114301781A publication Critical patent/CN114301781A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a method and a device for upgrading a wired router terminal, computer equipment and a storage medium. The method comprises the following steps: creating a socket; starting a thread, creating a socket client, sending a broadcast packet, and calculating the sending times; judging whether a response packet from the server is received; if so, analyzing the response packet to obtain the target MAC and the IP distributed by the server; judging whether the target MAC is consistent with the local MAC; if yes, modifying the internet access IP; receiving a software upgrading package sent by a server; upgrading according to the software upgrading package; restarting when the upgrade is successful; judging whether the software version number of the local computer changes; if yes, sending an upgrade completion reply packet to the server, so that the server counts upgrade condition information according to the upgrade completion reply packet and recovers the distributed IP. By implementing the method of the embodiment of the invention, the upgrading efficiency of a plurality of wired router devices can be improved, and the test environment is simplified.

Description

Wired router terminal upgrading method and device, computer equipment and storage medium
Technical Field
The invention relates to a terminal upgrading method, in particular to a wired router terminal upgrading method, a wired router terminal upgrading device, computer equipment and a storage medium.
Background
In order to make the functions of the terminal meet the requirements of users, the terminal needs to be upgraded at intervals, and two upgrading methods are available, one is that upgrading operation is performed manually, and the router equipment is connected with a PC (personal computer) through a network cable; and the browser accesses the router page to carry out software upgrading operation. The operation process takes about 180s, and if 10000 router devices need to be upgraded, one person needs about 500 hours to complete the operation. The process of manual upgrading operation needs the tester to use the computer operation promptly, and long-time work can consume a large amount of efforts of tester, easy misoperation, and the tester can only upgrade operation to an equipment at one time, and efficiency is lower. The second is to utilize an upgrade server, an IP/VLAN switching device and a multi-port switch to convert routers of the same IP into different IP addresses through the IP/VLAN switching device, and to send the converted different IP addresses of different network devices to the upgrade server, where the upgrade server is configured to upgrade different network devices in batches based on the converted different IP addresses, but the scheme needs to use the IP/VLAN switching device and the multi-port switch hardware device, has a high requirement on a test environment, needs to spend a large amount of time to deploy the environment, and has a certain requirement on the technical capability of a tester.
Therefore, it is necessary to design a new method for improving the upgrading efficiency of multiple wired router devices and simplifying the testing environment.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a method and a device for upgrading a wired router terminal, computer equipment and a storage medium.
In order to achieve the purpose, the invention adopts the following technical scheme: the method for upgrading the wired router terminal comprises the following steps:
creating a socket and connecting a server;
starting a thread, creating a socket client, sending a broadcast packet, and calculating the sending times;
judging whether a response packet from the server is received;
if receiving a response packet from the server, analyzing the response packet to obtain a target MAC and an IP distributed by the server;
judging whether the target MAC is consistent with the local MAC;
if the target MAC is consistent with the local MAC, modifying the internet access IP so as to enable the server and the internet access IP to carry out a network connectivity PING test, and sending a software upgrading packet when the test is passed;
receiving a software upgrading package sent by a server;
upgrading according to the software upgrading package;
restarting when the upgrade is successful;
judging whether the software version number of the local computer changes;
and if the software version number of the local computer changes, sending an upgrade completion reply packet to the server, so that the server counts upgrade condition information according to the upgrade completion reply packet and recovers the distributed IP.
The further technical scheme is as follows: the broadcast packet comprises a protocol header, a target MAC, a local MAC, a command, a version number, a length and a check code; the reply packet includes a protocol header, a target MAC, a native MAC, a command, an assigned IP, a length, and a check code.
The further technical scheme is as follows: the starting of the thread, the establishment of the socket client, the transmission of the broadcast packet and the calculation of the transmission times comprise the following steps:
starting a thread, creating a socket client and sending a broadcast packet, calculating the sending times of the broadcast packet so that a server receives the broadcast packet, inquiring an allocation IP table to obtain an idle IP, forming an allocated IP, assembling to form a response packet, and sending the response packet.
The further technical scheme is as follows: the starting of the thread, the creation of the socket client and the sending of the broadcast packet, the calculation of the sending times of the broadcast packet, the reception of the broadcast packet by the server, the query of the allocation IP table, the acquisition of the idle IP, the formation of the allocated IP, the assembly of the allocated IP and the formation of the response packet, and the sending of the response packet, include:
starting a thread, establishing a socket client, sending a broadcast packet, and calculating the sending times of the broadcast packet so that the server judges whether the IP of the local internet access is fixed to 192.168.10.2; and establishing an allocation IP table, receiving a broadcast packet, inquiring idle IP in the allocation IP table, marking the idle IP in a used state to form an allocated IP, assembling to form a response packet, and sending the response packet.
The further technical scheme is as follows: the sending of the upgrade completion reply packet to the server so that the server counts the upgrade condition information according to the upgrade completion reply packet and recovers the allocated IP, includes:
and sending an upgrade completion reply packet to the server so that the server counts upgrade condition information according to the upgrade completion reply packet, determines an allocated IP according to the upgrade completion reply packet, and marks the allocated IP in an idle state.
The invention also provides a method for upgrading the wired router terminal, which comprises the following steps:
the creating unit is used for creating a socket and connecting the socket with a server;
the thread starting unit is used for starting threads, creating a socket client, sending a broadcast packet and calculating the sending times;
a first judgment unit for judging whether a response packet from the server is received;
the analysis unit is used for analyzing the response packet to obtain a target MAC and an IP distributed by the server if the response packet from the server is received;
a second judging unit, configured to judge whether the target MAC is consistent with a local MAC;
the modification unit is used for modifying the internet access IP if the target MAC is consistent with the local MAC so as to enable the server and the internet access IP to carry out a network connectivity PING test, and when the test is passed, a software upgrading packet is sent;
the upgrade package receiving unit is used for receiving a software upgrade package sent by the server;
the upgrading unit is used for upgrading according to the software upgrading package;
the restarting unit is used for restarting when the upgrading is successful;
the third judging unit is used for judging whether the software version number of the local computer changes;
and the reply packet sending unit is used for sending the upgrade completion reply packet to the server if the software version number of the local computer changes, so that the server counts the upgrade condition information according to the upgrade completion reply packet and recovers the distributed IP.
The further technical scheme is as follows: the thread starting unit is used for starting a thread, creating a socket client and sending a broadcast packet, calculating the sending times of the broadcast packet so that the server receives the broadcast packet, inquiring the distribution IP table to obtain an idle IP, forming a distributed IP, assembling to form a response packet, and sending the response packet.
The further technical scheme is as follows: the thread starting unit is used for starting a thread, creating a socket client, sending a broadcast packet, and calculating the sending times of the broadcast packet so that the server judges whether the IP of the local internet access is fixed to 192.168.10.2; and establishing an allocation IP table, receiving a broadcast packet, inquiring idle IP in the allocation IP table, marking the idle IP in a used state to form an allocated IP, assembling to form a response packet, and sending the response packet.
The invention also provides computer equipment which comprises a memory and a processor, wherein the memory is stored with a computer program, and the processor realizes the method when executing the computer program.
The invention also provides a storage medium storing a computer program which, when executed by a processor, implements the method described above.
Compared with the prior art, the invention has the beneficial effects that: the invention establishes a socket to connect the server, sends a broadcast packet to the server to receive a response packet of the server, determines the IP allocated by the server, modifies the internet access IP of the terminal under the condition of ensuring that the target MAC is consistent with the local MAC, receives a software upgrading packet from the server, can upgrade, sends an upgrading completion reply packet to the server when the upgrading is successful, so that the server recovers the allocated IP, adopts the allocated IP to transmit and automatically upgrade the software upgrading packet, realizes the upgrading efficiency of a plurality of wired router devices, and simplifies the test environment.
The invention is further described below with reference to the accompanying drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a method for upgrading a wired router terminal according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for upgrading a wired router terminal according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of a wired router terminal upgrade apparatus 300 according to an embodiment of the present invention;
FIG. 4 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic view of an application scenario of a method for upgrading a wired router terminal according to an embodiment of the present invention. Fig. 2 is a schematic flowchart of a method for upgrading a wired router terminal according to an embodiment of the present invention. The wired router terminal upgrading method is applied to wired router terminals. The wired router terminal is connected with a switch net mouth through a net wire, the switch control net mouth is connected with a server net mouth, idle IP is distributed by the server through constructing connection with the server, transmission of an upgrading packet is carried out by means of the IP, so that the wired router terminal is upgraded, and after the upgrading is successful, an upgrading completion reply packet is sent to the server, so that the server recovers the IP.
Fig. 2 is a schematic flowchart of a method for upgrading a wired router terminal according to an embodiment of the present invention. As shown in fig. 2, the method includes the following steps S110 to S150.
S110, creating a socket and connecting a server.
In the present embodiment, socket refers to a channel for establishing a connection with a server.
Specifically, when the wired router terminal creates a socket and connects to the server, the server also creates the socket, waits for the wired router terminal to connect, and when the wired router terminal and the server are successfully connected, the server waits for receiving the broadcast packet.
S120, starting a thread, creating a socket client, sending a broadcast packet, and calculating the sending times.
In this embodiment, the broadcast packet includes a protocol header, a target MAC, a native MAC, a command, a version number, a length, and a check code, as shown in table 1.
TABLE 1 broadcast packet
Figure BDA0003427337900000051
Figure BDA0003427337900000061
The broadcast packet is sent to enable the server to carry out IP allocation so as to ensure that the upgrading end program can normally receive the upgrading packet software without using IP/VLAN conversion equipment.
Specifically, a thread is started, a socket client is created and a broadcast packet is sent, the sending times of the broadcast packet are calculated, so that a server receives the broadcast packet, an allocation IP table is inquired, an idle IP is obtained, an allocated IP is formed, a response packet is formed by assembling, and the response packet is sent.
Starting a thread, establishing a socket client, sending a broadcast packet, and calculating the sending times of the broadcast packet so that the server judges whether the IP of the local internet access is fixed to 192.168.10.2; and establishing an allocation IP table, receiving a broadcast packet, inquiring idle IP in the allocation IP table, marking the idle IP in a used state to form an allocated IP, assembling to form a response packet, and sending the response packet.
The server fixes the IP to be 192.168.10.2, the distributed IP is 192.168.10.3-192.168.10.255, and the server distributes the IP according to the IP table, so that the IP of a plurality of upgrading devices at the same time is different. The upgrading end program can normally receive the upgrading package software without using IP/VLAN conversion equipment; the upgrading efficiency of the router terminal is improved, and 253 devices are maximally supported to be upgraded at the same time.
S130, judging whether a response packet from the server is received or not;
s140, judging whether the sending times exceed a threshold value;
if the sending times does not exceed the threshold value, executing step S120;
in this embodiment, when the number of times of transmission exceeds 10 times, it indicates that the upgrade has failed, and at this time, there is an indication that the status indicator lamp is turned off.
S150, if the sending times exceed a threshold value, generating upgrading failure information, and turning off a state indicator lamp;
and S160, if the response packet from the server is received, analyzing the response packet to obtain the target MAC and the IP distributed by the server.
In this embodiment, the response packet includes a protocol header, a target MAC, a native MAC, a command, an allocated IP, a length, and a check code, as shown in table 2.
TABLE 2. response packet
Figure BDA0003427337900000062
Figure BDA0003427337900000071
And extracting the field corresponding to the response packet to obtain the IP distributed by the target MAC and the server.
S170, judging whether the target MAC is consistent with the local MAC;
if the target MAC is not consistent with the local MAC, the step S140 is executed;
s180, if the target MAC is consistent with the local MAC, modifying the internet access IP so as to enable the server and the internet access IP to carry out a network connectivity PING test, and sending a software upgrading package when the test is passed.
In this embodiment, the internet access IP is modified to be the allocated IP, and the software upgrade package sent by the server can be received by means of the allocated IP, so as to perform software upgrade.
S190, receiving a software upgrading package sent by a server;
and S200, upgrading according to the software upgrading package.
In this embodiment, if the target MAC is consistent with the local MAC, the wired router terminal starts to modify the internet protocol interface IP, receives a software upgrade package delivered by the server, and after successful reception, starts to flash the status light to indicate that the upgrade state is entered, and when successful software upgrade is performed, switches the status light to a normally on status to indicate that the upgrade is completed, and if the software upgrade fails, the status light goes off.
S210, restarting when upgrading is successful;
s220, judging whether the software version number of the local computer changes;
if the software version number of the computer is not changed, the step S140 is executed.
And S230, if the software version number of the local computer changes, sending an upgrade completion reply packet to the server, so that the server counts upgrade condition information according to the upgrade completion reply packet and recovers the distributed IP.
And after the wired router terminal is restarted, if the version number changes, the wired router terminal is connected with the server and then sends an upgrade completion reply packet.
In this embodiment, the upgrade completion reply packet is a data packet for informing the server that the software upgrade is successful, and the data packet includes the identification information of the corresponding wired router terminal and the corresponding allocated IP.
Specifically, an upgrade completion reply packet is sent to the server, so that the server counts upgrade condition information according to the upgrade completion reply packet, determines an allocated IP according to the upgrade completion reply packet, and marks the allocated IP in an idle state.
Upgrading is carried out by adopting an IP distribution mode, different IPs can be distributed to the wired router terminal by distributing the IP from 192.168.10.3 to 192.168.10.255, the maximum 253 equipment supported by the number of the IPs can be determined to be upgraded at the same time, and the efficiency is high. When upgrading, only a corresponding program is operated on the server, the IP address of the local internet access is modified, and the upgrading package software is uploaded; the wired router terminal can automatically run the upgrading program after being started, and only the router needs to be powered on.
According to the method for upgrading the wired router terminal, the socket is created to connect the server, the broadcast packet is sent to the server to receive the response packet of the server, the IP allocated by the server is determined, the internet access IP of the terminal is modified under the condition that the target MAC is consistent with the local MAC, the software upgrading packet from the server is received, the upgrading can be carried out, the upgrading completion reply packet is sent to the server when the upgrading is successful, the allocated IP is recycled by the server, the distributed IP is adopted to carry out the transmission and automatic upgrading of the software upgrading packet, the upgrading efficiency of a plurality of wired router devices is improved, and the testing environment is simplified.
Fig. 3 is a schematic block diagram of a wired router terminal upgrade apparatus 300 according to an embodiment of the present invention. As shown in fig. 3, the present invention also provides a wired router terminal upgrading apparatus 300 corresponding to the above wired router terminal upgrading method. The wired router terminal upgrade apparatus 300 includes a unit for performing the above-described wired router terminal upgrade method, and may be configured in a desktop computer, a tablet computer, a laptop computer, or the like. Specifically, referring to fig. 3, the wired router terminal upgrade apparatus 300 includes a creation unit 301, a thread starting unit 302, a first determination unit 303, a parsing unit 304, a second determination unit 305, a modification unit 306, an upgrade packet receiving unit 307, an upgrade unit 308, a restart unit 309, a third determination unit 310, and a reply packet sending unit 311.
A creating unit 301 for creating a socket and connecting to a server; a thread starting unit 302, configured to start a thread, create a socket client, send a broadcast packet, and calculate the sending times; a first judgment unit 303, configured to judge whether a response packet from the server is received; an analyzing unit 304, configured to, if a response packet from the server is received, analyze the response packet to obtain a target MAC and an IP allocated by the server; a second determining unit 305, configured to determine whether the target MAC is consistent with a native MAC; a modifying unit 306, configured to modify the internet access IP if the target MAC is consistent with the local MAC, so that the server and the internet access IP perform a PING test for network connectivity, and send a software upgrade package when the test is passed; an upgrade package receiving unit 307, configured to receive a software upgrade package sent by a server; an upgrade unit 308, configured to upgrade according to the software upgrade package; a restart unit 309 configured to restart when the upgrade is successful; a third determining unit 310, configured to determine whether a software version number of the local computer changes; and a reply packet sending unit 311, configured to send an upgrade completion reply packet to the server if the software version number of the local computer changes, so that the server counts upgrade condition information according to the upgrade completion reply packet, and recovers the allocated IP.
In an embodiment, the thread starting unit 302 is configured to start a thread, create a socket client and send a broadcast packet, calculate the sending times of the broadcast packet, so that the server receives the broadcast packet, queries an allocation IP table to obtain an idle IP, forms an allocated IP, assembles an acknowledgement packet, and sends the acknowledgement packet.
In an embodiment, the thread starting unit 302 is configured to start a thread, create a socket client, send a broadcast packet, and calculate the sending times of the broadcast packet, so that the server determines whether the local internet protocol IP is fixed to 192.168.10.2; and establishing an allocation IP table, receiving a broadcast packet, inquiring idle IP in the allocation IP table, marking the idle IP in a used state to form an allocated IP, assembling to form a response packet, and sending the response packet.
In an embodiment, the reply packet sending unit 311 is configured to send an upgrade complete reply packet to a server, so that the server counts upgrade condition information according to the upgrade complete reply packet, determines an allocated IP according to the upgrade complete reply packet, and marks the allocated IP in an idle state.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation process of the above-mentioned upgrading apparatus 300 for a wired router terminal and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The above-described wired router terminal upgrade apparatus 300 may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 4.
Referring to fig. 4, fig. 4 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 4, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer programs 5032 include program instructions that, when executed, cause the processor 502 to perform a wired router terminal upgrade method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be enabled to execute a wired router terminal upgrade method.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 4 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer device 500 to which the present application may be applied, and that a particular computer device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:
creating a socket and connecting a server; starting a thread, creating a socket client, sending a broadcast packet, and calculating the sending times; judging whether a response packet from the server is received; if receiving a response packet from the server, analyzing the response packet to obtain a target MAC and an IP distributed by the server; judging whether the target MAC is consistent with the local MAC; if the target MAC is consistent with the local MAC, modifying the internet access IP so as to enable the server and the internet access IP to carry out a network connectivity PING test, and sending a software upgrading packet to receive the software upgrading packet sent by the server when the test is passed; upgrading according to the software upgrading package; restarting when the upgrade is successful; judging whether the software version number of the local computer changes; and if the software version number of the local computer changes, sending an upgrade completion reply packet to the server, so that the server counts upgrade condition information according to the upgrade completion reply packet and recovers the distributed IP.
The broadcast packet comprises a protocol header, a target MAC, a local MAC, a command, a version number, a length and a check code; the reply packet includes a protocol header, a target MAC, a native MAC, a command, an assigned IP, a length, and a check code.
In an embodiment, when the processor 502 implements the step of starting the thread, creating a socket client, sending a broadcast packet, and calculating the sending times, the following steps are specifically implemented:
starting a thread, creating a socket client and sending a broadcast packet, calculating the sending times of the broadcast packet so that a server receives the broadcast packet, inquiring an allocation IP table to obtain an idle IP, forming an allocated IP, assembling to form a response packet, and sending the response packet.
In an embodiment, the processor 502 implements the thread starting, creates a socket client, sends a broadcast packet, calculates the number of times of sending the broadcast packet, so that the server receives the broadcast packet, queries an allocation IP table to obtain an idle IP, forms an allocated IP, and assembles the idle IP to form a response packet, and when sending the response packet, the following steps are specifically implemented:
starting a thread, establishing a socket client, sending a broadcast packet, and calculating the sending times of the broadcast packet so that the server judges whether the IP of the local internet access is fixed to 192.168.10.2; and establishing an allocation IP table, receiving a broadcast packet, inquiring idle IP in the allocation IP table, marking the idle IP in a used state to form an allocated IP, assembling to form a response packet, and sending the response packet.
In an embodiment, when the processor 502 implements the steps of sending the upgrade complete reply packet to the server, so that the server counts the upgrade condition information according to the upgrade complete reply packet, and recovers the allocated IP, the following steps are specifically implemented:
and sending an upgrade completion reply packet to the server so that the server counts upgrade condition information according to the upgrade completion reply packet, determines an allocated IP according to the upgrade completion reply packet, and marks the allocated IP in an idle state.
It should be understood that in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program includes program instructions, and the computer program may be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program, when executed by a processor, causes the processor to perform the steps of:
creating a socket and connecting a server; starting a thread, creating a socket client, sending a broadcast packet, and calculating the sending times; judging whether a response packet from the server is received; if receiving a response packet from the server, analyzing the response packet to obtain a target MAC and an IP distributed by the server; judging whether the target MAC is consistent with the local MAC; if the target MAC is consistent with the local MAC, modifying the internet access IP so as to enable the server and the internet access IP to carry out a network connectivity PING test, and sending a software upgrading packet when the test is passed; receiving a software upgrading package sent by a server; upgrading according to the software upgrading package; restarting when the upgrade is successful; judging whether the software version number of the local computer changes; and if the software version number of the local computer changes, sending an upgrade completion reply packet to the server, so that the server counts upgrade condition information according to the upgrade completion reply packet and recovers the distributed IP.
The broadcast packet comprises a protocol header, a target MAC, a local MAC, a command, a version number, a length and a check code; the reply packet includes a protocol header, a target MAC, a native MAC, a command, an assigned IP, a length, and a check code.
In an embodiment, when the processor executes the computer program to implement the thread opening, create a socket client, send a broadcast packet, and calculate the number of sending times, the following steps are specifically implemented:
starting a thread, creating a socket client and sending a broadcast packet, calculating the sending times of the broadcast packet so that a server receives the broadcast packet, inquiring an allocation IP table to obtain an idle IP, forming an allocated IP, assembling to form a response packet, and sending the response packet.
In an embodiment, the processor executes the computer program to implement the thread starting, creates a socket client and sends a broadcast packet, calculates the number of times of sending the broadcast packet, so that the server receives the broadcast packet, queries an allocation IP table to obtain an idle IP, forms an allocated IP, and assembles an acknowledgement packet, and when sending the acknowledgement packet, specifically implements the following steps:
starting a thread, establishing a socket client, sending a broadcast packet, and calculating the sending times of the broadcast packet so that the server judges whether the IP of the local internet access is fixed to 192.168.10.2; and establishing an allocation IP table, receiving a broadcast packet, inquiring idle IP in the allocation IP table, marking the idle IP in a used state to form an allocated IP, assembling to form a response packet, and sending the response packet.
In an embodiment, when the processor executes the computer program to implement the step of sending the upgrade complete reply packet to the server, so that the server counts the upgrade condition information according to the upgrade complete reply packet, and recovers the allocated IP, the following steps are specifically implemented:
and sending an upgrade completion reply packet to the server so that the server counts upgrade condition information according to the upgrade completion reply packet, determines an allocated IP according to the upgrade completion reply packet, and marks the allocated IP in an idle state.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. The method for upgrading the wired router terminal is characterized by comprising the following steps:
creating a socket and connecting a server;
starting a thread, creating a socket client, sending a broadcast packet, and calculating the sending times;
judging whether a response packet from the server is received;
if receiving a response packet from the server, analyzing the response packet to obtain a target MAC and an IP distributed by the server;
judging whether the target MAC is consistent with the local MAC;
if the target MAC is consistent with the local MAC, modifying the internet access IP so as to enable the server and the internet access IP to carry out a network connectivity PING test, and sending a software upgrading packet when the test is passed;
receiving a software upgrading package sent by a server;
upgrading according to the software upgrading package;
restarting when the upgrade is successful;
judging whether the software version number of the local computer changes;
and if the software version number of the local computer changes, sending an upgrade completion reply packet to the server, so that the server counts upgrade condition information according to the upgrade completion reply packet and recovers the distributed IP.
2. The cable router terminal upgrade method according to claim 1, wherein the broadcast packet includes a protocol header, a target MAC, a native MAC, a command, a version number, a length, and a check code; the reply packet includes a protocol header, a target MAC, a native MAC, a command, an assigned IP, a length, and a check code.
3. The method for upgrading a wired router terminal according to claim 1, wherein the starting of the thread, the creation of the socket client, the transmission of the broadcast packet, and the calculation of the number of transmissions comprise:
starting a thread, creating a socket client and sending a broadcast packet, calculating the sending times of the broadcast packet so that a server receives the broadcast packet, inquiring an allocation IP table to obtain an idle IP, forming an allocated IP, assembling to form a response packet, and sending the response packet.
4. The method for upgrading a wired router terminal according to claim 3, wherein the starting of the thread, creating a socket client and sending a broadcast packet, calculating the number of times of sending the broadcast packet, so that a server receives the broadcast packet, querying an allocation IP table to obtain an idle IP, forming an allocated IP, assembling the allocated IP to form a response packet, and sending the response packet includes:
starting a thread, establishing a socket client, sending a broadcast packet, and calculating the sending times of the broadcast packet so that the server judges whether the IP of the local internet access is fixed to 192.168.10.2; and establishing an allocation IP table, receiving a broadcast packet, inquiring idle IP in the allocation IP table, marking the idle IP in a used state to form an allocated IP, assembling to form a response packet, and sending the response packet.
5. The method for upgrading a wired router terminal according to claim 1, wherein the sending an upgrade complete reply packet to the server so that the server counts upgrade status information according to the upgrade complete reply packet and recovers the allocated IP includes:
and sending an upgrade completion reply packet to the server so that the server counts upgrade condition information according to the upgrade completion reply packet, determines an allocated IP according to the upgrade completion reply packet, and marks the allocated IP in an idle state.
6. The method for upgrading the wired router terminal is characterized by comprising the following steps:
the creating unit is used for creating a socket and connecting the socket with a server;
the thread starting unit is used for starting threads, creating a socket client, sending a broadcast packet and calculating the sending times;
a first judgment unit for judging whether a response packet from the server is received;
the analysis unit is used for analyzing the response packet to obtain a target MAC and an IP distributed by the server if the response packet from the server is received;
a second judging unit, configured to judge whether the target MAC is consistent with a local MAC;
the modification unit is used for modifying the internet access IP if the target MAC is consistent with the local MAC so as to enable the server and the internet access IP to carry out a network connectivity PING test, and when the test is passed, a software upgrading packet is sent;
the upgrade package receiving unit is used for receiving a software upgrade package sent by the server;
the upgrading unit is used for upgrading according to the software upgrading package;
the restarting unit is used for restarting when the upgrading is successful;
the third judging unit is used for judging whether the software version number of the local computer changes;
and the reply packet sending unit is used for sending the upgrade completion reply packet to the server if the software version number of the local computer changes, so that the server counts the upgrade condition information according to the upgrade completion reply packet and recovers the distributed IP.
7. The upgrading device for a wired router terminal according to claim 6, wherein the thread starting unit is configured to start a thread, create a socket client and send a broadcast packet, calculate the sending times of the broadcast packet, so that the server receives the broadcast packet, queries an allocation IP table to obtain an idle IP, forms an allocated IP, assembles the allocated IP to form a response packet, and sends the response packet.
8. The upgrading device for a wired router terminal according to claim 6, wherein the thread starting unit is configured to start a thread, create a socket client, send a broadcast packet, and calculate the sending times of the broadcast packet, so that the server determines whether the local portal IP is fixed to 192.168.10.2; and establishing an allocation IP table, receiving a broadcast packet, inquiring idle IP in the allocation IP table, marking the idle IP in a used state to form an allocated IP, assembling to form a response packet, and sending the response packet.
9. A computer arrangement, characterized in that the computer arrangement comprises a memory having stored thereon a computer program and a processor implementing the method according to any of claims 1-5 when executing the computer program.
10. A storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.
CN202111634140.0A 2021-12-22 2021-12-22 Wired router terminal upgrading method and device, computer equipment and storage medium Pending CN114301781A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111634140.0A CN114301781A (en) 2021-12-22 2021-12-22 Wired router terminal upgrading method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111634140.0A CN114301781A (en) 2021-12-22 2021-12-22 Wired router terminal upgrading method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114301781A true CN114301781A (en) 2022-04-08

Family

ID=80971514

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111634140.0A Pending CN114301781A (en) 2021-12-22 2021-12-22 Wired router terminal upgrading method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114301781A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116032755A (en) * 2022-12-09 2023-04-28 广州通则康威智能科技有限公司 Router terminal batch upgrading method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478429A (en) * 2009-02-10 2009-07-08 杭州华三通信技术有限公司 Method, system and equipment for version upgrade
CN105939405A (en) * 2016-06-12 2016-09-14 杭州迪普科技有限公司 DHCP service processing method and device
CN107291520A (en) * 2017-08-14 2017-10-24 深圳市兆驰数码科技股份有限公司 A kind of software automatic updating method
WO2018086478A1 (en) * 2016-11-08 2018-05-17 深圳创维数字技术有限公司 Method and device for upgrading wifi module in set top box, set top box and system
CN108063836A (en) * 2017-12-19 2018-05-22 深圳市创鑫激光股份有限公司 Automatically configure method, laser marking system, terminal and the medium of IP address
CN113641451A (en) * 2021-08-13 2021-11-12 济南浪潮数据技术有限公司 Method, device, equipment and readable medium for upgrading container in local area network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478429A (en) * 2009-02-10 2009-07-08 杭州华三通信技术有限公司 Method, system and equipment for version upgrade
CN105939405A (en) * 2016-06-12 2016-09-14 杭州迪普科技有限公司 DHCP service processing method and device
WO2018086478A1 (en) * 2016-11-08 2018-05-17 深圳创维数字技术有限公司 Method and device for upgrading wifi module in set top box, set top box and system
CN107291520A (en) * 2017-08-14 2017-10-24 深圳市兆驰数码科技股份有限公司 A kind of software automatic updating method
CN108063836A (en) * 2017-12-19 2018-05-22 深圳市创鑫激光股份有限公司 Automatically configure method, laser marking system, terminal and the medium of IP address
CN113641451A (en) * 2021-08-13 2021-11-12 济南浪潮数据技术有限公司 Method, device, equipment and readable medium for upgrading container in local area network

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116032755A (en) * 2022-12-09 2023-04-28 广州通则康威智能科技有限公司 Router terminal batch upgrading method and device
CN116032755B (en) * 2022-12-09 2023-09-29 广州通则康威智能科技有限公司 Router terminal batch upgrading method and device

Similar Documents

Publication Publication Date Title
CN101102288B (en) A method and system for realizing large-scale instant message
CN110519409B (en) Domain name dynamic configuration method, device, equipment and storage medium
CN110119350B (en) Software development kit testing method, device and equipment and computer storage medium
CN111917562B (en) Broadcast message forwarding method, device, equipment and storage medium
CN112152828B (en) Game acceleration method and device, VPN terminal and storage medium
CN109756401B (en) Test method, test device, electronic equipment and storage medium
CN114301781A (en) Wired router terminal upgrading method and device, computer equipment and storage medium
CN111405059B (en) Cloud device data transmission method, electronic device and Internet of things system
CN112596406A (en) Control method and device of intelligent equipment, control panel and storage medium
CN111083204B (en) File transmission method, device and storage medium
CN112423322A (en) Model information sending method, device, storage medium and electronic device
CN112491630A (en) Bare computer automatic deployment method and device and cloud environment platform
WO2014040566A1 (en) Method of establishing a network socket with a data server
CN113038499B (en) Terminal Wi-Fi compatibility testing method, device, system, equipment and medium
CN112272244B (en) Router WAN end IPv6 internet mode configuration method and device
CN112333013B (en) Self-adaptive networking method, device, router and storage medium
CN111901395A (en) Multi-cluster switching method and device
CN110809045A (en) Data communication method and related equipment thereof
CN112866309B (en) Communication method and device
WO2013000287A1 (en) Method and device for configuring cell parameters
CN106488494A (en) A kind of method of monitoring network connection state
CN116527539B (en) Data consistency verification method and device and computer equipment
CN112165465B (en) Data processing method and device for outgoing third-party platform and electronic device
CN113364865B (en) Resource acquisition method, device, readable medium and equipment
CN114172899B (en) OTA (over the air) upgrading method and system based on ZigBee network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20220408