CN113259468B - Network equipment configuration method and device - Google Patents

Network equipment configuration method and device Download PDF

Info

Publication number
CN113259468B
CN113259468B CN202110615122.1A CN202110615122A CN113259468B CN 113259468 B CN113259468 B CN 113259468B CN 202110615122 A CN202110615122 A CN 202110615122A CN 113259468 B CN113259468 B CN 113259468B
Authority
CN
China
Prior art keywords
target
software function
thread
target thread
configuration
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.)
Active
Application number
CN202110615122.1A
Other languages
Chinese (zh)
Other versions
CN113259468A (en
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.)
Xinhuasan Intelligent Terminal Co ltd
Original Assignee
Xinhuasan Intelligent Terminal 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 Xinhuasan Intelligent Terminal Co ltd filed Critical Xinhuasan Intelligent Terminal Co ltd
Priority to CN202110615122.1A priority Critical patent/CN113259468B/en
Publication of CN113259468A publication Critical patent/CN113259468A/en
Application granted granted Critical
Publication of CN113259468B publication Critical patent/CN113259468B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/2807Exchanging configuration information on appliance services in a home automation network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a network equipment configuration method and device. In the method, network equipment is divided according to software functions, and each software function is realized by a corresponding thread. When the configuration of the network equipment needs to be updated, the cloud server firstly determines a target thread corresponding to the function of the software to be configured; and then, sending a configuration update message to the network equipment, wherein the configuration update message comprises the identification of the target thread and the enabling information, so that the network equipment executes corresponding enabling operation on the corresponding software function of the target thread by using the target thread. Therefore, the configuration updating of the network equipment is realized by directly operating the thread corresponding to the software function. The process does not involve updating the configuration file, and the network equipment does not need to be restarted, so that the influence on the network equipment can be effectively reduced.

Description

Network equipment configuration method and device
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a method and an apparatus for configuring a network device.
Background
To meet the advent of the smart home era, operators are beginning to extend the business to smart home networks. In the intelligent home network, network devices such as a router are connected to an operator network through a home gateway, and provide services for accessing the operator network for terminal devices (e.g., a notebook computer, etc.) in a home.
Different operators (for example, china mobile, china unicom, china telecom, etc.), even different regions of the same operator, have different configuration requirements for network devices, and in the actual use process, the configuration may need to be continuously updated according to the actual use condition. For this reason, network devices commonly support network configuration functions.
The main configuration method at present is to update the configuration file of the network device. However, after the configuration file is updated, the network device needs to be restarted to take effect of the new configuration, which inevitably affects the operation of the network device and may even result in poor user experience such as network outage.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for configuring a network device, so as to reduce the influence on the network device while implementing configuration update.
In order to achieve the purpose of the application, the application provides the following technical scheme:
in a first aspect, the present application provides a network device configuration method applied to a cloud server, where the network device includes at least one software function, and each software function is implemented by a corresponding thread, where the method includes:
determining the identifier of a target thread corresponding to the software function to be configured according to the corresponding relation between the locally recorded software function and the identifier of the thread;
and sending a first configuration updating message to the network equipment, wherein the first configuration updating message comprises the identification of the target thread and enabling information, so that the network equipment executes corresponding enabling operation on the software function corresponding to the target thread by using the target thread.
Optionally, after sending the first configuration update packet to the network device, the method further includes:
receiving a heartbeat message sent by the network equipment, wherein the heartbeat message comprises the current enabling state of the software function corresponding to the target thread;
and if the current enabling state of the software function corresponding to the target thread is consistent with the enabling state which is required to be achieved by the software function corresponding to the target thread and indicated by the enabling information to execute the corresponding enabling operation, determining that the configuration of the software function corresponding to the target thread is successful.
Optionally, when the enabling information included in the first configuration update packet indicates to start the software function corresponding to the target thread, the first configuration update packet further includes a resource occupation upper limit value of the target thread, and the method further includes:
if abnormal logs of the target threads reported by more than a preset number of network devices are received in a preset time period, determining the target network devices needing to close the corresponding software functions of the target threads according to the target areas to which the network devices reporting the abnormal logs belong, wherein the abnormal logs are generated and reported when the network devices monitor that the actual resource occupation values of the target threads exceed the resource occupation upper limit values;
and sending a second configuration updating message to the target network device, wherein the second configuration updating message comprises the identifier of the target thread and enabling information for indicating to close the software function corresponding to the target thread, so that the target network device closes the software function corresponding to the target thread by using the target thread.
Optionally, the determining, according to the target area to which the network device that reports the abnormal log belongs, the target network device that needs to close the target thread includes:
respectively determining the models, the target areas and the operators of the network equipment with the number exceeding the preset number;
and determining the network equipment in the target area, which has the same model as the network equipment of the reported abnormal log and belongs to the same operator, as the target network equipment.
Optionally, the first configuration update packet is a Transmission Control Protocol (TCP) data packet, and before the first configuration update packet is sent to the network device, the method further includes:
adding an identification of the software function to be configured to an Option (Option) field of the first configuration update message;
adding configuration parameters of the software function to be configured to a data field of the first configuration update message, wherein the configuration parameters include but are not limited to identification and enabling information of the target thread.
In a second aspect, the present application provides another network device configuration method, applied to a network device, where the network device includes at least one software function, and each software function is implemented by a corresponding thread, where the method includes:
receiving a first configuration updating message sent by a cloud server, wherein the first configuration updating message comprises an identifier of a target thread and enabling information;
detecting whether the current enabling state of the software function corresponding to the target thread is consistent with the enabling state which is required to be achieved by the software function corresponding to the target thread and indicated by the enabling information when executing the corresponding enabling operation;
and if not, executing corresponding enabling operation on the software function corresponding to the target thread by using the target thread.
Optionally, when the enabling information included in the first configuration update packet indicates to start the software function corresponding to the target thread, the first configuration update packet further includes a resource occupation upper limit value of the target thread, and the method further includes:
if the actual resource occupation value of the target thread exceeds the resource occupation upper limit value, generating an abnormal log corresponding to the target thread;
reporting the abnormal logs to the cloud server, so that when the cloud server receives the abnormal logs reported by more than a preset number of network devices in a preset time period, a second configuration update message for indicating to close the software function corresponding to the target thread is issued to the target network devices determined based on the preset number of network devices.
In a third aspect, the present application provides a network device configuration apparatus, which is disposed in a cloud server, where the network device includes at least one software function, and each software function is implemented by a corresponding thread, where the apparatus includes:
the thread determining unit is used for determining the identifier of the target thread corresponding to the software function to be configured according to the corresponding relation between the locally recorded software function and the identifier of the thread;
a message sending unit, configured to send a first configuration update message to the network device, where the first configuration update message includes an identifier of the target thread and enabling information, so that the network device executes, by using the target thread, a corresponding enabling operation on a software function corresponding to the target thread.
Optionally, the apparatus further comprises:
a message receiving unit, configured to receive a heartbeat message sent by the network device, where the heartbeat message includes a current enabling state of a software function corresponding to the target thread;
and the configuration confirming unit is used for determining that the configuration of the software function corresponding to the target thread is successful if the current enabling state of the software function corresponding to the target thread is consistent with the enabling state which is required by the software function corresponding to the target thread and indicated by the enabling information to execute the corresponding enabling operation.
Optionally, when the enabling information included in the first configuration update packet indicates to start the software function corresponding to the target thread, the first configuration update packet further includes a resource occupation upper limit value of the target thread, and the apparatus further includes:
the device determining unit is used for determining target network devices needing to close the corresponding software functions of the target threads according to the target areas of the network devices reporting the abnormal logs if the abnormal logs of the target threads reported by more than a preset number of network devices are received in a preset time period, wherein the abnormal logs are generated and reported when the network devices monitor that the actual resource occupation values of the target threads exceed the resource occupation upper limit value;
the message sending unit is further configured to send a second configuration update message to a target network device, where the second configuration update message includes an identifier of the target thread and enabling information used to instruct to close the software function corresponding to the target thread, so that the target network device closes the software function corresponding to the target thread by using the target thread.
Optionally, the determining, by the device determining unit, a target network device that needs to close the target thread according to a target area to which the network device that reports the abnormal log belongs includes:
respectively determining the models, the target areas and the operators of the network equipment with the number exceeding the preset number;
and determining the network equipment in the target area, which has the same model as the network equipment of the reported abnormal log and belongs to the same operator, as the target network equipment.
Optionally, the first configuration update packet is a TCP data packet, and the apparatus further includes:
an information adding unit, configured to add the identifier of the software function to be configured to the Option field of the first configuration update packet; adding configuration parameters of the software function to be configured to a data field of the first configuration update message, wherein the configuration parameters include but are not limited to identification and enabling information of the target thread.
In a fourth aspect, the present application provides another network device configuration apparatus, configured in a network device, where the network device includes at least one software function, and each software function is implemented by a corresponding thread, where the apparatus includes:
the message receiving unit is used for receiving a first configuration updating message issued by a cloud server, wherein the first configuration updating message comprises an identifier of a target thread and enabling information;
a state detection unit, configured to detect whether a current enable state of the software function corresponding to the target thread is consistent with an enable state to be reached by the software function corresponding to the target thread indicated by the enable information when executing the corresponding enable operation;
and the enabling operation unit is used for executing corresponding enabling operation on the software function corresponding to the target thread by using the target thread if the detection result of the state detection unit is inconsistent.
Optionally, when the enabling information included in the first configuration update packet indicates to start the software function corresponding to the target thread, the first configuration update packet further includes a resource occupation upper limit value of the target thread, and the apparatus further includes:
the log generation unit is used for generating an abnormal log corresponding to the target thread if the actual resource occupation value of the target thread exceeds the resource occupation upper limit value;
and the log reporting unit is used for reporting the abnormal logs to the cloud server so that when the cloud server receives the abnormal logs reported by more than a preset number of network devices in a preset time period, a second configuration update message for indicating to close the software function corresponding to the target thread is issued to the target network devices determined based on the preset number of network devices.
As can be seen from the above description, in the embodiment of the present application, the network devices are divided according to software functions, and each software function is implemented by a corresponding thread. When the software function needs to be configured (started or closed), the software function is configured by directly utilizing the thread corresponding to the software function. The process does not involve updating the configuration file of the network equipment, so that the network equipment does not need to be restarted to take effect of configuration, and the influence on the network equipment can be effectively reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 only some embodiments of the present application, 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 flowchart illustrating a network device configuration method according to an embodiment of the present application;
fig. 2 is a schematic networking diagram according to an embodiment of the present application;
fig. 3 illustrates a TCP data packet format according to an embodiment of the present application;
FIG. 4 is a flow chart illustrating a configuration validation method according to an embodiment of the present application;
FIG. 5 is a flow chart illustrating exception handling according to an embodiment of the present application;
fig. 6 is a flowchart illustrating another network device configuration method according to an embodiment of the present application;
FIG. 7 is a flow diagram illustrating another exception handling according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a network device configuration apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another network device configuration apparatus according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of the present application. As used in the embodiments of the present application, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the negotiation information may also be referred to as second information, and similarly, the second information may also be referred to as negotiation information without departing from the scope of the embodiments of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The application provides a network equipment configuration method, in the method, network equipment is divided according to software functions, and each software function is realized by a corresponding thread. And when configuration is needed, directly utilizing the thread corresponding to the software function to configure the software function. The process does not involve updating the configuration file of the network equipment, so that the network equipment does not need to be restarted to take effect configuration, and the influence on the network equipment can be effectively reduced.
For the purpose of making the objects, aspects and advantages of the present application more apparent, the following detailed description of the present application is made with reference to the accompanying drawings and specific embodiments:
referring to fig. 1, a flowchart of a network device configuration method according to an embodiment of the present application is shown, where the flowchart is applied to a cloud server. In the embodiment of the application, the network equipment is divided according to software functions, and each software function is realized by a corresponding thread.
As shown in fig. 2, the network includes a network device and a cloud server, and terminal devices (terminal 1 and terminal 2) that access an operator network through the network device.
The cloud server may be composed of one or more servers, and may be specifically deployed according to actual service requirements, which is not limited in the present application.
The cloud server and the network device may be connected through a gateway, and a gateway function may also be implemented on the network device, which is not limited in this application.
In a local area network formed by network equipment, terminal equipment can access the network equipment in a wired or wireless mode. The network device can be a router, a switch and the like; the terminal device may be a handheld device, a computer, or the like, which is not limited in this application.
After the network device is powered on, the initialization and the starting process of the device can be completed through a boot loader (Bootloader).
After the Network device normally operates for the first time, the current state of a Wide Area Network (WAN) port of the Network device needs to be determined. If the current state of the WAN port is the enabling state, controlling the WAN port to start according to a default Dynamic Host Configuration Protocol (abbreviated as DHCP) mode; and if the current state of the WAN port is the non-enabled state, controlling the WAN port to start according to a default relay (Repeat) mode.
After a WAN port of the network device obtains an Internet Protocol Address (IP), the network device can run a detection process IP _ check through a background and regularly trigger a ping program to detect whether the IP Address of the cloud server is accessible by a route. If the route is reachable, the Internet is considered to be normally accessed.
On this basis, a connection can be established between the cloud server and the network device through TCP three-way handshake, and an encryption tunnel for message transmission, for example, an encryption tunnel based on a secure Transport Layer protocol (TLS), is negotiated, so as to encrypt the transmitted message in an asymmetric manner, thereby ensuring the Security of message transmission.
In the embodiment of the application, after the network device is connected with the cloud server, the heartbeat message is sent to the cloud server at regular time to report the latest state of the network device. The latest status includes, but is not limited to, an IP address of a network device, a device model, a Media Access Control (MAC) address, a Serial Number (SN) electronic tag, a software version Number, log information, and the like.
Here, it should be noted that, since the Network device may be located in a Network Address Translation (NAT) intranet, and an IP Address of the WAN port is not necessarily an internet IP Address, the cloud server may use a source IP Address of the heartbeat packet (an IP Address after NAT Translation) as the IP Address of the Network device.
In order to further ensure data security, in this embodiment of the application, the cloud server may previously import information such as a device model, an MAC address, and an SN electronic tag when the network device leaves a factory. When the cloud server receives the latest state reported by the network equipment, the equipment model, the MAC address and the SN electronic tag in the latest state can be compared with the equipment model, the MAC address and the SN electronic tag of the network equipment, which are pre-imported into the cloud server, if the three are consistent, the authentication is considered to be passed, and the subsequent operation is allowed to be executed on the network equipment; otherwise, the authentication is not passed, and the subsequent operation is forbidden to be executed.
The cloud server generates registration information of each network device according to the state information reported by the network device, wherein the registration information includes but is not limited to the device model, the geographical position, the operator type and the like of the network device. The geographic location and the operator type can be obtained by positioning according to the IP address of the network equipment.
The cloud server may issue an initial configuration for the network device to the network device according to the device model, the geographic location, and the operator to which the network device belongs (here, it should be noted that the corresponding configurations of the network devices of the same model, different geographic locations, and different operators may be different), so that the network device updates the local CFG configuration file according to the initial configuration issued by the cloud server, and the CFG configuration file is validated after the network device is restarted, so as to start a corresponding software function.
After the network device is run (online) based on the CFG profile, the configuration of the network device may be updated online through the following configuration flow.
As shown in fig. 1, the network device configuration process may include the following steps:
step 101, the cloud server determines an identifier of a target thread corresponding to a software function to be configured according to a correspondence between a locally recorded software function and an identifier of a thread.
Here, it should be noted that the cloud server locally preset a correspondence between a software function and an identifier of a thread that implements the software function. See table 1 for an example of the correspondence of software functions to the identification of threads.
Figure 373608DEST_PATH_IMAGE002
The function code is a software function corresponding number and is used for uniquely identifying the software function. The function codes shown in table 1 are all represented by four-bit strings. Taking an E-link configuration function as an example, the corresponding function code of the software function is 0001, and the name (identifier) of the thread specifically implementing the software function is elink _ status.
When the configuration of a certain software function needs to be updated, the cloud server may determine the identifier of the thread corresponding to the software function to be configured according to the locally recorded correspondence between the software function and the identifier of the thread.
Here, the thread corresponding to the software function to be configured is referred to as a target thread. It is to be understood that the reference to a target thread is merely a nomenclature for ease of distinction and is not intended to be limiting.
Step 102, the cloud server sends a first configuration update message to the network device, where the first configuration update message includes an identifier of a target thread and enabling information.
Here, the identification of the target thread may be the name of the target thread; the enable information is used to indicate whether to turn on or off the target thread corresponding to the software function, and may be represented by a binary bit (bit), for example, 0 represents off and 1 represents on.
As an embodiment, the first configuration update message may be constructed based on a TCP data message. As shown in fig. 3, is a TCP data message format.
The cloud server may add an identifier of a software function to be configured, for example, a function code, to an Option field of a TCP data packet (first configuration update packet); the configuration parameters of the software function to be configured are added to the data field of the TCP data message (first configuration update message), including but not limited to the identification of the target thread and the enabling information.
It should be noted that, in one configuration update message, configurations for a plurality of software functions may be carried. The network device can sequentially acquire the configuration parameters of the software functions in the data field according to the sequence of the function codes in the option field. And the configuration parameters can also comprise the character length of the configuration parameters so as to accurately and quickly distinguish the configuration parameters corresponding to the software functions.
It should be understood that, in this step, the first configuration update message is only named for convenience of distinguishing and is not limited.
After receiving the first configuration update message, the network device obtains the identifier of the target thread and the enabling information included in the first configuration update message, finds the target thread in the device according to the identifier of the target thread, and then executes corresponding enabling operation on the corresponding software function of the target thread by using the target thread.
For example, if the identifier of the target thread included in the configuration update packet is elink _ status and the enable information is 1, the network device finds the target thread elink _ status in the device according to the identifier of the target thread, and then starts the target thread elink _ status according to the enable information (1, indicating start) configured by the cloud server. The method and the device achieve starting of the software function (E-link configuration) by starting the target thread (elink _ status).
Thus, the flow shown in fig. 1 is completed.
As can be seen from the flow shown in fig. 1, in the embodiment of the present application, the network device is divided according to software functions, and each software function is implemented by a corresponding thread. And when configuration is needed, directly utilizing the thread corresponding to the software function to configure the software function. The process does not involve updating the configuration file of the network equipment, so that the network equipment does not need to be restarted to take effect configuration, and the influence on the online network equipment can be effectively reduced.
For an embodiment, after performing step 102, the cloud server may determine whether the software function corresponding to the target thread is successfully configured by receiving a heartbeat message sent by the network device.
Referring to fig. 4, a flow chart of a configuration confirmation method according to an embodiment of the present application is shown. As shown in fig. 4, the process may include the following steps:
step 401, the cloud server receives a heartbeat message sent by the network device, where the heartbeat message includes a current enabling state of a software function corresponding to a target thread.
As described above, the network device periodically sends heartbeat messages, and reports the latest state of the network device to the cloud server. The latest state may include an enabled state of the software function currently corresponding to each thread in the network device.
The cloud server acquires the actual enabling state of the software function corresponding to the target thread in the network equipment through the heartbeat message of the network equipment.
Step 402, if the current enabling state of the software function corresponding to the target thread is consistent with the enabling state to be achieved when the software function corresponding to the target thread indicated by the enabling information executes the corresponding enabling operation, the cloud server determines that the software function corresponding to the target thread is successfully configured.
If the actual enabling state of the software function corresponding to the target thread in the network equipment is the same as the enabling state which the cloud server expects to reach, the configuration of the software function corresponding to the target thread is effective, and the configuration is successful; otherwise, the configuration is failed.
After determining that the configuration of the software function corresponding to the target thread fails, the cloud server may attempt to issue the first configuration update message to the network device again. And if the configuration is still unsuccessful after the preset issuing times are reached, stopping issuing to avoid the influence on the normal operation of the network equipment caused by frequent issuing.
The flow shown in fig. 4 is completed.
Through the flow shown in fig. 4, the cloud server may sense the configuration result and then take corresponding processing measures, such as reconfiguration, etc.
Referring to fig. 5, an exception handling flow shown in the embodiment of the present application is provided as an embodiment. As shown in fig. 5, the process may include the following steps:
step 501, if abnormal logs of the target threads reported by more than a preset number of network devices are received within a preset time period, the cloud server determines the target network device needing to close the software function corresponding to the target thread according to the target area to which the network device reporting the abnormal logs belongs.
Here, the abnormal log is generated and reported to the cloud server by the network device when the network device monitors that the actual resource occupation value of the target thread exceeds the preset upper limit value of the resource occupation of the target thread.
The resource occupation upper limit value can be predetermined by the cloud server and the network equipment, is marked by the cloud server, is carried by the first configuration update message, and is issued to the network equipment.
Referring to table 2, an example of adding the limitation of the resource upper limit value occupied by each thread on the basis of table 1 is shown.
Figure DEST_PATH_IMAGE004
Taking the example of the E-link configuration software function, if the upper limit of CPU resource occupation of the software function corresponding to the thread elink _ status is 5% and the upper limit of memory resource occupation is 200KB, when the network device detects that the CPU resource occupation value of the elink _ status thread exceeds 5% and/or the memory resource occupation value exceeds 200KB, reporting an abnormal log to the cloud server. The exception log includes, but is not limited to, the identity of the elink _ status thread and the actual resource occupancy value.
In the embodiment of the application, the cloud server counts the received abnormal logs. When receiving abnormal logs aiming at the same thread (target thread) reported by a plurality of (more than a preset number of) network devices in a short time (within a preset time period), the abnormal logs indicate that a large quantity of software functions corresponding to the target thread exist in the network. Such large-scale anomalies are usually not caused by the equipment itself, but are often caused by the operator's erroneous operation, such as modifying configuration parameters, modifying operating mechanisms, etc., over-range.
For the large batch of exception problems, the embodiment of the present application provides an exception handling mechanism:
firstly, the cloud server determines target network equipment which needs to close the software function corresponding to the target thread. Here, the target network device is named for convenience of distinction and is not intended to be limiting.
As an implementation manner, the cloud server may use all the network devices that report the abnormal log as target network devices.
As another embodiment, the cloud server may determine the model, the target area (e.g., hang in zhejiang), and the carrier (e.g., chinese telecom) of the network device that reports the exception log, respectively. Here, the target region is named for convenience of distinction and is not intended to be limiting.
Specifically, the cloud server may obtain the model and the IP address of the network device from locally recorded registration information of the network device; then, the target area and the operator of the network equipment are located according to the IP address of the network equipment. As one example, the cloud server may query the network device for detailed geographic location (target area) and operator attribution information by calling a third party API interface. Since it is a mature technology to call the third party API to query the geographic location and the operator affiliation, it is not described in detail in this application.
After the target area and the operator are determined, the cloud server can use network devices in the target area, which have the same model as the network devices reporting the abnormal logs and belong to the same operator, as the target network devices.
This is because the configuration and operation of the same area and the same operator for the same model of network device are generally the same, even though the exception log of the target thread reported by other network devices has not been received yet, these network devices have the same risk.
Step 502, sending a second configuration update message to the target network device, where the second configuration update message includes an identifier of the target thread and enabling information for indicating to close the software function corresponding to the target thread.
Here, the second configuration update message is only named for convenience of distinguishing and is not intended to be limiting.
It can be seen that, in this step, the target network device is triggered to close the software function corresponding to the target thread by issuing the configuration update message.
The flow shown in fig. 5 is completed.
As can be seen from the flow shown in fig. 5, the embodiment of the present application can automatically detect an exception, automatically alarm, and automatically trigger an exception handling mechanism, so as to effectively avoid a large area of serious faults.
Referring to fig. 6, a flowchart of another network device configuration method according to an embodiment of the present application is shown, and the flowchart is applied to a network device. The network device is divided according to software functions, and each software function is realized by a corresponding thread.
As shown in fig. 6, the process may include the following steps:
step 601, the network device receives a first configuration update message sent by the cloud server, where the first configuration update message includes an identifier of a target thread and enabling information.
Specifically, refer to the description of step 101 and step 102 on the cloud server side, which is not described herein again.
Step 602, the network device detects whether the current enabled state of the software function corresponding to the target thread is consistent with the enabled state to be achieved by the software function corresponding to the target thread indicated by the enabling information when executing the corresponding enabling operation.
Specifically, the network device may start a detection process status _ check through a background to detect a running state of a target thread in the network device, where the running state of the target thread directly reflects an enabling state of a corresponding software function. For example, if it is detected that the target thread is running, it is indicated that the software function corresponding to the target thread is in an open state; otherwise, if the target thread is detected not to be operated, the target thread is in a closed state corresponding to the software function.
And the network equipment compares the detected enabling state of the software function corresponding to the target thread with the enabling state which the cloud server sends the first configuration updating message and expects the software function to reach.
If the configuration information is consistent with the enabling information, the corresponding enabling operation is not required to be executed according to the enabling information included in the first configuration updating message. For example, if the enabling state of the software function corresponding to the current target thread is on, and the enabling information configured by the cloud server is on, the network device does not need to perform an opening operation on the software function corresponding to the target thread.
If not, go to step 603.
Step 603, if not, the network device executes corresponding enabling operation on the software function corresponding to the target thread by using the target thread.
For example, if the enabling state of the software function corresponding to the current target thread is on, and the enabling information configured by the cloud server is off, the network device turns off the target thread, so as to implement turning off the software function corresponding to the target thread.
The flow shown in fig. 6 is completed.
As can be seen from the flow shown in fig. 6, in the embodiment of the present application, the network devices are divided according to software functions, and each software function is implemented by a corresponding thread. And when the configuration is needed, configuring the software function by using the thread corresponding to the software function. The process does not involve updating the configuration file of the network equipment, so that the network equipment does not need to be restarted to take effect configuration, and the influence on the online network equipment can be effectively reduced.
Referring to fig. 7, another exception handling flow shown in the embodiment of the present application is applied to a network device. As shown in fig. 7, the process may include the following steps:
step 701, if the actual resource occupation value of the target thread exceeds the preset upper limit value of resource occupation, the network device generates an abnormal log corresponding to the target thread.
Specifically, refer to the description of the foregoing step 501 on the cloud server side, which is not described herein again.
Step 702, the network device reports the abnormal log to the cloud server, so that when the cloud server receives the abnormal log of the target thread reported by more than a preset number of network devices in a preset time period, the cloud server issues a second configuration update message for instructing to close the software function corresponding to the target thread to the target network device determined based on the preset number of network devices.
Specifically, refer to the description of the foregoing step 501 on the cloud server side, which is not described herein again.
The flow shown in fig. 7 is completed.
As can be seen from the flow shown in fig. 7, the embodiment of the present application can automatically detect an exception, automatically alarm, and automatically trigger an exception handling mechanism, so as to effectively avoid a large area of serious faults.
The method provided by the embodiment of the present application is described above, and the network device configuration apparatus provided by the embodiment of the present application is described below:
referring to fig. 8, a schematic structural diagram of a network device configuration apparatus provided in an embodiment of the present application is disposed in a cloud server. The network device comprises at least one software function, each software function being implemented by a corresponding thread, the apparatus comprising: a thread determining unit 801 and a message sending unit 802, wherein:
a thread determining unit 801, configured to determine, according to a correspondence between a locally recorded software function and an identifier of a thread, an identifier of a target thread corresponding to a software function to be configured;
a message sending unit 802, configured to send a first configuration update message to the network device, where the first configuration update message includes an identifier of the target thread and enabling information, so that the network device executes, by using the target thread, a corresponding enabling operation on a software function corresponding to the target thread.
As an embodiment, the apparatus further comprises:
a message receiving unit, configured to receive a heartbeat message sent by the network device, where the heartbeat message includes a current enabling state of a software function corresponding to the target thread;
and the configuration confirming unit is used for determining that the configuration of the software function corresponding to the target thread is successful if the current enabling state of the software function corresponding to the target thread is consistent with the enabling state which is required by the software function corresponding to the target thread and indicated by the enabling information to execute the corresponding enabling operation.
As an embodiment, when the enabling information included in the first configuration update packet indicates to start the software function corresponding to the target thread, the first configuration update packet further includes a resource occupation upper limit value of the target thread, and the apparatus further includes:
the device determining unit is used for determining target network devices needing to close the corresponding software functions of the target threads according to the target areas of the network devices reporting the abnormal logs if the abnormal logs of the target threads reported by more than a preset number of network devices are received in a preset time period, wherein the abnormal logs are generated and reported when the network devices monitor that the actual resource occupation values of the target threads exceed the resource occupation upper limit value;
the message sending unit 802 is further configured to send a second configuration update message to a target network device, where the second configuration update message includes an identifier of the target thread and enabling information used for indicating to close a software function corresponding to the target thread, so that the target network device closes the software function corresponding to the target thread by using the target thread.
As an embodiment, the determining, by the device, a target network device that needs to close the target thread according to a target area to which the network device that reports the abnormal log belongs includes:
respectively determining the models, the target areas and the operators of the network equipment with the number exceeding the preset number;
and determining the network equipment in the target area, which has the same model as the network equipment of the reported abnormal log and belongs to the same operator, as the target network equipment.
As an embodiment, the first configuration update packet is a TCP data packet, and the apparatus further includes:
an information adding unit, configured to add the identifier of the software function to be configured to the Option field of the first configuration update packet; adding configuration parameters of the software function to be configured to a data field of the first configuration update message, wherein the configuration parameters include but are not limited to identification and enabling information of the target thread.
The description of the apparatus shown in fig. 8 is thus completed. In the embodiment of the application, the network equipment is divided according to software functions, and each software function is realized by a corresponding thread. And when the configuration is needed, configuring the software function by using the thread corresponding to the software function. The process does not involve updating the configuration file of the network equipment, so that the network equipment does not need to be restarted to take effect of configuration, and the influence on the network equipment can be effectively reduced.
Referring to fig. 9, a schematic structural diagram of another network device configuration apparatus provided in this embodiment of the present application is arranged in a network device, where the network device includes at least one software function, and each software function is implemented by a corresponding thread, and the apparatus includes: a message receiving unit 901, a state detecting unit 902 and an enabling operation unit 903, wherein:
a message receiving unit 901, configured to receive a first configuration update message sent by a cloud server, where the first configuration update message includes an identifier of a target thread and enabling information;
a state detecting unit 902, configured to detect whether a current enable state of the software function corresponding to the target thread is consistent with an enable state to be reached when the software function corresponding to the target thread indicated by the enable information executes a corresponding enable operation;
an enabling operation unit 903, configured to, if the detection result of the state detection unit 902 is inconsistent, execute a corresponding enabling operation on the software function corresponding to the target thread by using the target thread.
As an embodiment, when the enabling information included in the first configuration update packet indicates to start the software function corresponding to the target thread, the first configuration update packet further includes a resource occupation upper limit value of the target thread, and the apparatus further includes:
the log generation unit is used for generating an abnormal log corresponding to the target thread if the actual resource occupation value of the target thread exceeds the resource occupation upper limit value;
and the log reporting unit is used for reporting the abnormal logs to the cloud server so that when the cloud server receives the abnormal logs reported by more than a preset number of network devices in a preset time period, a second configuration update message for indicating to close the software function corresponding to the target thread is issued to the target network devices determined based on the preset number of network devices.
The description of the apparatus shown in fig. 9 is thus completed. In the embodiment of the application, the network equipment is divided according to software functions, and each software function is realized by a corresponding thread. And when the configuration is needed, configuring the software function by using the thread corresponding to the software function. The process does not involve updating the configuration file of the network equipment, so that the network equipment does not need to be restarted to take effect of configuration, and the influence on the network equipment can be effectively reduced.
The above description is only a preferred embodiment of the present application, and should not be taken as limiting the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application shall be included in the scope of the present application.

Claims (10)

1. A network device configuration method is applied to a cloud server, and is characterized in that the network device comprises at least one software function, each software function is realized by a corresponding thread, and the method comprises the following steps:
determining the identifier of a target thread corresponding to the software function to be configured according to the corresponding relation between the locally recorded software function and the identifier of the thread;
and sending a first configuration updating message to the network equipment, wherein the first configuration updating message comprises the identification of the target thread and enabling information, so that the network equipment executes corresponding enabling operation on the software function corresponding to the target thread by using the target thread.
2. The method of claim 1, wherein after sending the first configuration update message to the network device, the method further comprises:
receiving a heartbeat message sent by the network equipment, wherein the heartbeat message comprises the current enabling state of the software function corresponding to the target thread;
and if the current enabling state of the software function corresponding to the target thread is consistent with the enabling state which is required to be achieved by the software function corresponding to the target thread and indicated by the enabling information to execute the corresponding enabling operation, determining that the configuration of the software function corresponding to the target thread is successful.
3. The method of claim 1, wherein when the enable information included in the first configuration update message indicates to start the software function corresponding to the target thread, the first configuration update message further includes a resource occupation upper limit value of the target thread, and the method further comprises:
if abnormal logs of the target threads reported by more than a preset number of network devices are received in a preset time period, determining the target network devices needing to close the corresponding software functions of the target threads according to the target areas to which the network devices reporting the abnormal logs belong, wherein the abnormal logs are generated and reported when the network devices monitor that the actual resource occupation values of the target threads exceed the resource occupation upper limit values;
and sending a second configuration updating message to the target network device, wherein the second configuration updating message comprises the identifier of the target thread and enabling information for indicating to close the software function corresponding to the target thread, so that the target network device closes the software function corresponding to the target thread by using the target thread.
4. The method of claim 3, wherein the determining, according to the target area to which the network device that reports the exception log belongs, the target network device that needs to close the target thread comprises:
respectively determining the models, the target areas and the operators of the network equipment with the number exceeding the preset number;
and determining the network equipment in the target area, which has the same model as the network equipment of the reported abnormal log and belongs to the same operator, as the target network equipment.
5. The method of claim 1, wherein the first configuration update message is a Transmission Control Protocol (TCP) data message, and wherein prior to sending the first configuration update message to the network device, the method further comprises:
adding the identifier of the software function to be configured to an Option field of the first configuration updating message;
and adding the configuration parameters of the software function to be configured to the data field of the first configuration update message, wherein the configuration parameters comprise the identification and the enabling information of the target thread.
6. A network device configuration method is applied to a network device, and is characterized in that the network device comprises at least one software function, each software function is realized by a corresponding thread, and the method comprises the following steps:
receiving a first configuration updating message sent by a cloud server, wherein the first configuration updating message comprises an identifier of a target thread and enabling information;
detecting whether the current enabling state of the software function corresponding to the target thread is consistent with the enabling state which is required to be achieved by the software function corresponding to the target thread and indicated by the enabling information when executing the corresponding enabling operation;
and if not, executing corresponding enabling operation on the software function corresponding to the target thread by using the target thread.
7. The method of claim 6, wherein when the enable information included in the first configuration update message indicates to start the software function corresponding to the target thread, the first configuration update message further includes a resource occupation upper limit value of the target thread, and the method further comprises:
if the actual resource occupation value of the target thread exceeds the resource occupation upper limit value, generating an abnormal log corresponding to the target thread;
reporting the abnormal logs to the cloud server, so that when the cloud server receives the abnormal logs reported by more than a preset number of network devices in a preset time period, a second configuration update message for indicating to close the software function corresponding to the target thread is issued to the target network devices determined based on the preset number of network devices.
8. A network equipment configuration device is arranged in a cloud server, and is characterized in that the network equipment comprises at least one software function, each software function is realized by a corresponding thread, and the device comprises:
the thread determining unit is used for determining the identifier of the target thread corresponding to the software function to be configured according to the corresponding relation between the locally recorded software function and the identifier of the thread;
a message sending unit, configured to send a first configuration update message to the network device, where the first configuration update message includes an identifier of the target thread and enabling information, so that the network device executes, by using the target thread, a corresponding enabling operation on a software function corresponding to the target thread.
9. The apparatus of claim 8, wherein when the enable information included in the first configuration update message indicates to start the software function corresponding to the target thread, the first configuration update message further includes a resource occupation upper limit value of the target thread, the apparatus further comprising:
the device determining unit is used for determining target network devices needing to close the corresponding software functions of the target threads according to the target areas of the network devices reporting the abnormal logs if the abnormal logs of the target threads reported by more than a preset number of network devices are received in a preset time period, wherein the abnormal logs are generated and reported when the network devices monitor that the actual resource occupation values of the target threads exceed the resource occupation upper limit value;
the message sending unit is further configured to send a second configuration update message to a target network device, where the second configuration update message includes an identifier of the target thread and enabling information used to instruct to close the software function corresponding to the target thread, so that the target network device closes the software function corresponding to the target thread by using the target thread.
10. A network device configuration apparatus, configured in a network device, where the network device includes at least one software function, and each software function is implemented by a corresponding thread, the apparatus comprising:
the message receiving unit is used for receiving a first configuration updating message issued by a cloud server, wherein the first configuration updating message comprises an identifier of a target thread and enabling information;
a state detection unit, configured to detect whether a current enable state of the software function corresponding to the target thread is consistent with an enable state to be reached by the software function corresponding to the target thread indicated by the enable information when executing the corresponding enable operation;
and the enabling operation unit is used for executing corresponding enabling operation on the software function corresponding to the target thread by using the target thread if the detection result of the state detection unit is inconsistent.
CN202110615122.1A 2021-06-02 2021-06-02 Network equipment configuration method and device Active CN113259468B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110615122.1A CN113259468B (en) 2021-06-02 2021-06-02 Network equipment configuration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110615122.1A CN113259468B (en) 2021-06-02 2021-06-02 Network equipment configuration method and device

Publications (2)

Publication Number Publication Date
CN113259468A CN113259468A (en) 2021-08-13
CN113259468B true CN113259468B (en) 2021-09-21

Family

ID=77186059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110615122.1A Active CN113259468B (en) 2021-06-02 2021-06-02 Network equipment configuration method and device

Country Status (1)

Country Link
CN (1) CN113259468B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116032619B (en) * 2022-12-30 2024-06-04 北京欣博电子科技有限公司 State inspection method and device of intelligent safety networking equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929661A (en) * 2012-10-09 2013-02-13 北京奇虎科技有限公司 Method and device for processing functional component, and server
CN105591819A (en) * 2015-12-24 2016-05-18 杭州华三通信技术有限公司 Method and device of configuring network equipment
CN107947981A (en) * 2017-11-23 2018-04-20 锐捷网络股份有限公司 A kind of network device management method and device
CN110995481A (en) * 2019-11-25 2020-04-10 深圳前海达闼云端智能科技有限公司 Configuration method, server and computer-readable storage medium
CN111427692A (en) * 2020-03-26 2020-07-17 中国平安财产保险股份有限公司 Function configuration method, device, electronic equipment and medium
CN112583639A (en) * 2020-11-30 2021-03-30 新华三大数据技术有限公司 Configuration method and device of network equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929661A (en) * 2012-10-09 2013-02-13 北京奇虎科技有限公司 Method and device for processing functional component, and server
CN105591819A (en) * 2015-12-24 2016-05-18 杭州华三通信技术有限公司 Method and device of configuring network equipment
CN107947981A (en) * 2017-11-23 2018-04-20 锐捷网络股份有限公司 A kind of network device management method and device
CN110995481A (en) * 2019-11-25 2020-04-10 深圳前海达闼云端智能科技有限公司 Configuration method, server and computer-readable storage medium
CN111427692A (en) * 2020-03-26 2020-07-17 中国平安财产保险股份有限公司 Function configuration method, device, electronic equipment and medium
CN112583639A (en) * 2020-11-30 2021-03-30 新华三大数据技术有限公司 Configuration method and device of network equipment

Also Published As

Publication number Publication date
CN113259468A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
CN103906087A (en) Access point upgrading method, device and system
KR101139836B1 (en) Method and system for two-phase mechanism for discovering web services based management service
CN106993043B (en) Data communication system and method based on agency
CN112583639B (en) Configuration method and device of network equipment
US11983522B2 (en) Edge-based intelligence for over the air update
CN112423322B (en) Model information sending method, device, storage medium and electronic device
US12009986B2 (en) Proactive inspection technique for improved classification
CN108471372B (en) State control method, device and message transmission method
CN113259468B (en) Network equipment configuration method and device
US9961163B2 (en) Method and system for notifying subscriber devices in ISP networks
CN112491603A (en) Equipment configuration method, device, equipment and storage medium
CN112039708A (en) Network equipment operation and maintenance method
CN114024759B (en) Security policy management and control method, device, computer equipment and medium
CN111405059A (en) Data transmission method of cloud equipment, electronic equipment and Internet of things system
CN110876117A (en) Method and device for recovering lost connection of terminal
US8239930B2 (en) Method for controlling access to a network in a communication system
EP2891299B1 (en) Systems and methods for efficient remote security panel configuration and management
CN117641327A (en) Network connection method, electronic device, and computer-readable storage medium
CN110351729B (en) Method, system, terminal and storage medium for automatically matching authentication parameters
CN112751706A (en) Target data transmission method and device
US20190312929A1 (en) Information synchronization method and device
CN107528714B (en) Script processing method, device and system and router
CN114125843B (en) Intelligent equipment network distribution method, device and equipment
CN105323088A (en) Springboard processing method and springboard processing device
US12088458B1 (en) Controller device management of peripheral devices

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
GR01 Patent grant
GR01 Patent grant