CN112104506A - Networking method, networking device, server and readable storage medium - Google Patents

Networking method, networking device, server and readable storage medium Download PDF

Info

Publication number
CN112104506A
CN112104506A CN202010998569.7A CN202010998569A CN112104506A CN 112104506 A CN112104506 A CN 112104506A CN 202010998569 A CN202010998569 A CN 202010998569A CN 112104506 A CN112104506 A CN 112104506A
Authority
CN
China
Prior art keywords
server
controller
notification message
gateway
networking
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.)
Granted
Application number
CN202010998569.7A
Other languages
Chinese (zh)
Other versions
CN112104506B (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.)
Beijing Zhizhangyi Technology Co ltd
Original Assignee
Beijing Zhizhangyi 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 Beijing Zhizhangyi Technology Co ltd filed Critical Beijing Zhizhangyi Technology Co ltd
Priority to CN202010998569.7A priority Critical patent/CN112104506B/en
Publication of CN112104506A publication Critical patent/CN112104506A/en
Application granted granted Critical
Publication of CN112104506B publication Critical patent/CN112104506B/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
    • 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/0893Assignment of logical groups to network elements
    • 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
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • 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/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a networking method, a networking device, a server and a readable storage medium. The method can comprise the following steps: receiving a first broadcast message sent by a second server in a local area network when the second server is started; sending a first notification message to a second server according to the first broadcast message, wherein the first notification message is used for controlling the second server to register in a designated role, and the designated role is a gateway and/or a controller; and when a second notification message of the second server is received and the second notification message represents that the second server is successfully registered in the appointed role, updating networking registration information, wherein the updated networking registration information comprises gateway list information and controller list information, the gateway list information comprises identity information of all servers currently used as gateways, and the controller list information comprises identity information of all servers currently used as controllers. In the scheme, automatic deployment of the SDP server can be realized, and the problems of misoperation risk and low efficiency caused by manual deployment can be reduced.

Description

Networking method, networking device, server and readable storage medium
Technical Field
The present invention relates to the field of data communication technologies, and in particular, to a networking method, an apparatus, a server, and a readable storage medium.
Background
When deploying servers of a Software Defined Perimeter (SDP), an engineer usually makes a plan first, for example, several servers are required as controllers, several servers are required as gateways, and the like. At present, when an SDP server is deployed, when a system is expanded or adjusted, a networking deployment scheme is complex, manual intervention is needed, misoperation risks exist, and efficiency is low.
Disclosure of Invention
The application provides a networking method, a networking device, a server and a readable storage medium, which can solve the problems of misoperation risk and low efficiency when an SDP server is deployed.
In order to achieve the above purpose, the technical solutions provided in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present application provides a networking method applied to a first server serving as a controller in a software-defined boundary, where the method includes:
receiving a first broadcast message sent by a second server in a local area network when the second server is started;
sending a first notification message to the second server according to the first broadcast message, wherein the first notification message is used for controlling the second server to register in a designated role, and the designated role is a gateway and/or a controller;
and updating networking registration information when a second notification message of the second server is received and the second notification message represents that the second server is successfully registered in the appointed role, wherein the updated networking registration information comprises gateway list information and controller list information, the gateway list information comprises identity information of all servers currently used as gateways, and the controller list information comprises identity information of all servers currently used as controllers.
In the foregoing embodiment, the second server may automatically send the broadcast message when being started, so that the first server serving as the controller receives the broadcast message, and then the first server controls the second server to perform networking registration in a designated role. Based on the method, the automatic deployment of the SDP server can be realized, and the problems of misoperation risk and low efficiency caused by manual deployment are reduced.
With reference to the first aspect, in some optional implementations, when a second notification packet of the second server is received and the second notification packet indicates that the second server is successfully registered in the designated role, updating networking registration information includes:
when a second notification message of the second server is received and the second notification message represents that the second server is successfully registered in the designated role, adding the identity information of the second server to networking registration information stored by the first server so as to update the networking registration information;
and broadcasting a second broadcast message to the local area network, wherein the second broadcast message is used for controlling each server corresponding to the networking registration information to update the networking registration information stored by the server.
In the foregoing embodiment, the first server may update its own networking registration information, and in addition, may control other servers in the local area network to update their own networking registration information, so that the second server completes networking.
With reference to the first aspect, in some optional embodiments, the method further comprises:
acquiring a third notification message sent by each server in the networking in a preset period, wherein the third notification message comprises load information of each server;
when the third notification message sent by the designated server is not acquired within a preset time length, deleting the identity information of the designated server from the networking registration information of the first server, and notifying the server in the local area network to update the networking registration information of the server, wherein the preset time length is longer than the preset period, and the designated server is any server excluding the first server from the networking registration information.
In the above embodiment, each server may transmit the third notification message as a heartbeat message. If the first service is overtime and does not receive the third notification message sent by the corresponding server, the specified server which needs to send the third notification message is considered to be abnormal, and at this time, the identity information of the specified server can be removed from the main network registration information, so that the specified server can be removed from the networking.
With reference to the first aspect, in some optional embodiments, the method further comprises:
receiving a third broadcast message sent by the appointed server when the appointed server is started;
sending a fourth notification message to the designated server according to the third broadcast message, wherein the fourth notification message is used for controlling the designated server to register in a designated role;
and updating networking registration information when a fifth notification message of the designated server is received and the fifth notification message represents that the designated server successfully registers the gateway.
With reference to the first aspect, in some optional implementations, sending a first notification packet to the second server according to the first broadcast packet, where the first notification packet is used to control the second server to register in a designated role, where the sending includes:
acquiring a first average load of a server serving as a controller in all servers in a current network and a second average load of a server serving as a gateway;
when the first average load is smaller than the second average load, sending the first notification message to the second server for controlling the second server to register in a gateway role;
and when the first average load is greater than or equal to the second average load, sending the first notification message to the second server for controlling the second server to register in a controller role.
With reference to the first aspect, in some optional embodiments, the method further comprises:
when the load of a server serving as a controller in the local area network is greater than or equal to a first specified load, selecting a server with the minimum load and less than or equal to a second specified load to be switched to the controller from the gateway according to the load information of each server currently serving as the gateway, wherein the second specified load is less than the first specified load;
when the load of a server serving as a gateway is larger than or equal to a third specified load and at least two servers serving as controllers exist in the local area network, selecting the server with the minimum load and smaller than or equal to a fourth specified load to be switched to the gateway by the controller according to the load information of each server currently serving as the controller, wherein the fourth specified load is smaller than the third specified load.
In the above embodiment, by analyzing the load of the gateway and the load of the controller in the local area network, it is helpful to balance the load and to solve the problem of an excessive load of the gateway or the controller.
In a second aspect, an embodiment of the present application further provides a networking method, which is applied to a second server serving as a gateway in a software-defined boundary, where the method includes:
when the second server is started, sending a first broadcast message to a server in the local area network;
receiving a first notification message sent by a first server according to the first broadcast message, wherein the first server is a server serving as a controller in the local area network;
controlling the second server to register in a designated role according to the first notification message, wherein the designated role is a gateway and/or a controller;
and when the second server is successfully registered in the designated role, sending a second notification message to the first server for updating networking registration information, wherein the updated networking registration information comprises gateway list information and controller list information, the gateway list information comprises identity information of all servers currently used as gateways, and the controller list information comprises identity information of all servers currently used as controllers.
In a third aspect, an embodiment of the present application further provides a networking apparatus, applied to a first server serving as a controller in a software-defined boundary, where the apparatus includes:
the receiving unit is used for receiving a first broadcast message sent by a second server in the local area network when the second server is started;
a sending unit, configured to send a first notification packet to the second server according to the first broadcast packet, and configured to control the second server to register in a designated role, where the designated role is a gateway and/or a controller;
and the networking updating unit is used for updating networking registration information when a second notification message of the second server is received and the second notification message represents that the second server is successfully registered in the designated role, wherein the updated networking registration information comprises gateway list information and controller list information, the gateway list information comprises identity information of all servers currently used as gateways, and the controller list information comprises identity information of all servers currently used as controllers.
In a fourth aspect, embodiments of the present application further provide a server, where the server includes a memory and a processor coupled to each other, and the memory stores a computer program, and when the computer program is executed by the processor, the server is caused to perform the method described above.
In a fifth aspect, the present invention also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the above method.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below. It is appreciated that the following drawings depict only certain embodiments of the application and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 is a schematic diagram of communication connection of a network system according to an embodiment of the present application.
Fig. 2 is a flowchart of a networking method according to an embodiment of the present application.
Fig. 3 is a networking device according to an embodiment of the present application.
Fig. 4 is a second flowchart of a networking method according to an embodiment of the present application.
Icon: 10-a first server; 20-a second server; 200-a networking device; 210-a receiving unit; 220-a transmitting unit; 230-networking update unit.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. It should be noted that the terms "first," "second," and the like are used merely to distinguish one description from another, and are not intended to indicate or imply relative importance.
In view of the above problems, the present application proposes the following embodiments to solve the above problems. The embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
First embodiment
Referring to fig. 1, a network system provided by an embodiment of the present application may include a plurality of Software Defined Perimeter (SDP) servers. Some of the plurality of SDP servers may operate in the role of controllers and the remaining servers may operate in the role of gateways. In addition, a plurality of SDP servers can be automatically networked to form an SDP network architecture.
The operating role of one SDP server may be a gateway, or a controller, or both a gateway and a controller. The server operating as a gateway role can be used as gateway equipment for realizing network interconnection above a network layer and for interconnecting two networks with different high-level protocols. The server operating as the controller role can be used for detecting and analyzing the operating conditions of each server in the network and performing switching control on the operating roles of the servers.
The user terminal can realize corresponding data access through the SDP network architecture. For example, an enterprise deploys an SDP network architecture for storing business or network resources related to the enterprise, and employees of the enterprise can access the corresponding business or network resources through the SDP network architecture.
The user terminal may be, but is not limited to, a smart phone, a Personal Computer (PC), a tablet PC, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and the like.
The application also provides a server which can comprise a processing module, a storage module and a communication module. Wherein the storage module may store therein a computer program that, when executed by the processing module, may enable the server to perform the steps of the networking method described below. The communication module is used for establishing communication connection between the server and other servers and the user terminal.
Referring to fig. 1 again, the servers may be a first server 10 and a second server 20 described below. Both the first server 10 and the second server 20 are SDP servers, which may operate in the role of a controller, or a gateway, or both. Each server is allowed access.
Referring to fig. 2, an embodiment of the present application further provides a networking method, which can be applied to the network system, and each step in the method is executed by a corresponding server. The method may comprise the steps of:
step S110, when the second server is started, the second server sends a first broadcast message to a server in the local area network;
step S120, the first server receives a first broadcast message sent by a second server in the local area network when the second server is started;
step S130, the first server sends a first notification message to the second server according to the first broadcast message;
step S140, the second server controls the second server to register in a designated role according to the first notification message sent by the first server, wherein the designated role is a gateway and/or a controller;
step S150, the second server sends a second notification message to the first server;
step S160, when the first server receives a second notification packet of the second server, and the second notification packet indicates that the second server is successfully registered in the designated role, updating networking registration information, where the updated networking registration information includes gateway list information and controller list information, the gateway list information includes identity information of all servers currently serving as gateways, and the controller list information includes identity information of all servers currently serving as controllers.
In the foregoing embodiment, the second server may automatically send the broadcast message when being started, so that the first server serving as the controller receives the broadcast message, and then the first server controls the second server to perform networking registration in a designated role. Based on the method, the automatic deployment of the SDP server can be realized, and the problems of misoperation risk and low efficiency caused by manual deployment are reduced.
The individual steps of the process are explained in detail below, as follows:
in step S110, the second server is one or more servers that currently need to be networked, and is not limited to one server. For example, when the load of the current SDP network framework is large and a new SDP server needs to be accessed to share the processing pressure, one or more SDP servers are started for networking. And the started SDP server needing networking is the second server.
And the second server physical line is connected in the set local area network in advance. The set local area network can be deployed according to the actual situation. For example, the configured lan may be a lan of an enterprise. When the second server is started, the first broadcast message can be automatically broadcast to all servers in the local area network to be sent. The first broadcast message is used for requesting the second server to perform SDP networking.
The first broadcast message may include, but is not limited to, identity information of the second server itself, hardware parameters, and the like. The identity information includes, but is not limited to, an IP address, a MAC address, etc. of the second server for identifying the identity of the second server. The hardware parameter information may include, but is not limited to, a capacity size of a storage space of the second server, a CPU (Central Processing Unit) parameter, a GPU (Graphics Processing Unit) parameter, and the like.
The mode of the second server for transmitting the first broadcast message can be selected according to actual conditions. For example, the second server may broadcast the first broadcast packet in a UDP (User Datagram Protocol).
In step S120, since the second server transmits the first broadcast packet in a broadcast manner, the first broadcast packet may be received by the first server. The first server is an SDP server running in a controller role.
In step S130, after receiving the first broadcast packet, the first server may analyze and process the request information and the identity information carried in the first broadcast packet. For example, when the first broadcast message includes a request content for networking, the first server sends a first notification message to the second server, where the first notification message is used to control the second server to register in a designated role and then operate in the designated role. If the broadcast message does not include the request content for networking, the first server does not need to send the first notification message to the second server.
In step S140, after receiving the first notification message, the second server may parse the first notification message. For example, if the first notification message includes content that permits the second server to perform networking registration in a designated role, the second server controls itself to perform networking registration in the designated role. The designated role can be a gateway, or a controller, or both.
When the second server registers in the gateway role, the second server starts the service process corresponding to the gateway. When the second server registers in the controller role, the second server starts the corresponding service process of the controller. When the second server registers with the controller and the gateway, the second server starts the gateway and the service process corresponding to the controller at the same time. And presetting service processes corresponding to the gateway and the controller in the second server and other SDP servers in the local area network.
In step S150, after the second server completes the networking registration (e.g., the second server starts a service process corresponding to the designated role), the second server may send a second notification message to the second server, where the second notification message is used to indicate that the second server is successfully registered in the designated role.
In step S160, after receiving the second notification packet of the second server, the first server may parse the second notification packet. For example, if the second notification message includes content indicating that the second server has successfully registered in the designated role, the group network registration information is updated. If the second notification message does not include the content indicating that the second server is successfully registered in the designated role, the networking registration information does not need to be updated.
After the networking registration information is updated, the successful networking of the second server to the SDP network architecture is indicated, and the second server can provide corresponding services in a designated role. For example, if the designated role is gateway, the second server may provide gateway services. If the designated role is controller, the second server may provide control services.
It should be noted that, in the process of networking in the SDP network architecture, the first networked server generally designates a server for an administrator. The server may act as both a controller and a gateway. Then, the administrator starts other servers in the network, and the started other servers perform the networking operation as the second server.
As an alternative implementation, step S160 may include: when a second notification message of the second server is received and the second notification message represents that the second server is successfully registered in the designated role, adding the identity information of the second server to networking registration information stored by the first server so as to update the networking registration information; and broadcasting a second broadcast message to the local area network, wherein the second broadcast message is used for controlling each server corresponding to the networking registration information to update the networking registration information stored by the server.
Understandably, when the networking registration information is updated, the first server may add the identity of the second server to the networking registration information stored in advance to obtain the updated networking registration information. After the first server finishes updating the local networking registration information, the first server can also send the identity information of the second server to other networked services in the local area network in a broadcasting mode so that the other servers update the networking registration information of the first server. Or, the first server may send the updated networking registration information to a server already networked in the local area network in a broadcast manner.
For example, when the designated role is a gateway, the first server may add the identity information of the second server in the gateway list information. Then, the first server sends the identity information of the second server and the gateway role to other servers in a broadcasting mode, so that the other servers add the identity information of the second server to respective gateway list information to indicate that the second server successfully performs networking in the gateway role.
When the designated role is the controller, the second server may add the identity information of the second server in the controller list information. Then, the first server sends the identity information of the second server and the controller role to other servers in a broadcast mode, so that the other servers add the identity information of the second server to respective controller list information to indicate that the second server successfully performs networking in the controller role.
Understandably, each server in the networking stores the networking registration information. The networking registration information needs to be updated synchronously with the networking registration information of the server operated by the controller. When there are multiple servers operated by the controller, the multiple controller servers may negotiate one server as a master control server, and the other servers as slave control servers, and the first server may be the master control server, and the negotiation manner is well known to those skilled in the art and will not be described here. The networking registration information of the master control server can be used as source information of synchronous update.
As an alternative embodiment, the first step S130 may include:
acquiring a first average load of a server serving as a controller in all servers in a current network and a second average load of a server serving as a gateway;
when the first average load is smaller than the second average load, sending the first notification message to the second server for controlling the second server to register in a gateway role;
and when the first average load is greater than or equal to the second average load, sending the first notification message to the second server for controlling the second server to register in a controller role.
In this embodiment, the load may be a load of the server during operation. For example, the load may include, but is not limited to, CPU usage, GPU usage, memory occupancy, and the like. For example, when the load is the utilization rate of the CPU, the first average load may be calculated by: the sum of the CPU utilization rates of the service processes providing the controller in each server among the servers serving as the controller, divided by the number of servers serving as the controller, can be calculated by the following equation (1):
CPU_controller=(CPU_controller_1+…+CPU_controller_m)/m (1)
in formula (1), CPU _ controller refers to the first average load, CPU _ controller _ m is the CPU usage of the mth server, and m is the total number of servers operating as controllers, and is an integer greater than 0.
The second average load may be calculated by: the sum of the CPU utilization rates of the service processes providing the gateway in each server among the servers serving as the gateway, divided by the number of servers serving as the gateway, can be calculated by the following equation (1):
CPU_gateway=(CPU_gateway_1+…+CPU_gateway_n)/n (2)
in formula (1), CPU _ gateway refers to the second average load, CPU _ gateway _ n is the CPU usage of the nth server, and n is the total number of servers operating as the controller, and is an integer greater than 0.
When the first average load is smaller than the second average load, it indicates that the processing load of the gateway is greater than the processing load of the controller, so that more servers are currently required to serve as gateways to share the current gateway load, and at this time, the second server needs to register in a gateway role. I.e. the designated role is gateway.
When the first average load is greater than or equal to the second average load, it indicates that the processing load of the gateway is smaller than the processing load of the controller, and therefore, more servers are currently required to serve as the controller to share the current controller load, and at this time, the second server needs to register in a controller role. I.e. the role is designated as controller.
Based on the design, the load balance between the server serving as the controller and the server serving as the gateway can be ensured as much as possible, and the average load difference between the server serving as the controller and the server serving as the gateway is reduced, so that the stability of the SDP network architecture is improved.
As an optional implementation, the method may further include:
acquiring a third notification message sent by each server in the networking in a preset period, wherein the third notification message comprises load information of each server;
when the third notification message sent by the designated server is not acquired within a preset time length, deleting the identity information of the designated server from the networking registration information of the first server, and notifying the server in the local area network to update the networking registration information of the server, wherein the preset time length is longer than the preset period, and the designated server is any server excluding the first server from the networking registration information.
In this embodiment, after each server successfully networks, the third notification message may be periodically sent to the first server. The third notification message may be a heartbeat message, and is used to notify load information of each current server in the first server networking. The load information includes, but is not limited to, the CPU utilization, the memory occupancy, and the like. The preset time length and the preset period may be set according to actual conditions, and are not specifically limited herein.
When the third notification message sent by the designated server is not received by the first server within the preset time length, the first server usually indicates that the designated server is abnormal. At this time, the identity of the designated server needs to be deleted from the networking registration information to remove the designated server from networking. Therefore, the SDP network architecture can automatically delete the abnormal server so as to improve the stability of the network architecture. The designated server may be any server in the networking, and is not particularly limited herein.
As an optional implementation, the method may further include:
receiving a third broadcast message sent by the appointed server when the appointed server is started;
sending a fourth notification message to the designated server according to the third broadcast message, wherein the fourth notification message is used for controlling the designated server to register in a designated role;
and updating networking registration information when a fifth notification message of the designated server is received and the fifth notification message represents that the designated server successfully registers the gateway.
After the specified server is abnormal, the first server may send a prompt indicating that the specified server is abnormal to the management terminal. The administrator can restart the designated server according to the exception prompt. Or the first server can automatically control the designated server to restart after the designated server is abnormal.
After the designated server is restarted, the designated server and the first server may cooperate with each other, and step S110 to step S160 are re-executed to re-network the restarted designated server. The function of the third broadcast message is similar to that of the first broadcast message, the function of the fourth notification message is similar to that of the first notification message, and the function of the feature notification message is similar to that of the second notification message, which are not described herein again.
As an optional implementation, the method may further include:
when the load of a server serving as a controller in the local area network is greater than or equal to a first specified load, selecting a server with the minimum load and less than or equal to a second specified load to be switched to the controller from the gateway according to the load information of each server currently serving as the gateway, wherein the second specified load is less than the first specified load;
when the load of a server serving as a gateway is larger than or equal to a third specified load and at least two servers serving as controllers exist in the local area network, selecting the server with the minimum load and smaller than or equal to a fourth specified load to be switched to the gateway by the controller according to the load information of each server currently serving as the controller, wherein the fourth specified load is smaller than the third specified load.
The first specified load represents that the load of the server as a controller exceeds a normal load value, and the second specified load represents that the load of the server is at a relatively idle value. The third specified load represents that the load of the server as the gateway exceeds a normal load value, and the fourth specified load represents that the load of the server is at a relatively idle value. The first and third specified loads may be the same or different, and the second and fourth specified loads may be the same or different.
For example, the first specified load may be 2 times the average load of the servers as gateways. If the load of the server serving as the controller is greater than or equal to 2 times of the average load of the gateway servers, the load of the server is considered to be too large, and a server serving as the controller needs to be added to share the load of the controller.
The mode of the server of the newly added controller can be as follows: the server with the load which is the smallest and is less than or equal to the second specified load is selected as the target server from the servers which are currently used as the gateway, and then the target server is switched from the gateway role to the controller role, namely, the target server is switched from the gateway service process to the controller service process, so that the processing load of the server which is used as the controller and has the overlarge load can be shared.
For another example, the third specified load may be 2 times the average load of the server as the controller. If the load of the server serving as the gateway is greater than or equal to 2 times of the average load of the controller servers, the load of the server is considered to be overlarge, and a server serving as the gateway needs to be added to share the load of the gateway.
The method for adding the server of the gateway can be as follows: if the number of servers as controllers in the local area network is greater than or equal to 2, a server with the minimum load and less than or equal to a second specified load is selected as a target server from the servers currently serving as the controllers, and then the target server is switched from the controller role to the gateway role, that is, the target server is switched from the controller service process to the gateway service process, so that the processing load of the server which serves as a gateway and has an excessive load can be shared.
It should be noted that, in the local area network, each server in the networking periodically reports its own load information to the first server, which is beneficial for the first server to grasp the load condition of each server in time, so as to switch the roles of the servers according to the load condition, or add a new server or stop a part of the servers started, so as to dynamically allocate the resources of the servers.
For example, when the load of the server as the controller is too large and one server cannot be switched from the gateway to the controller among the servers as the gateway, a new server is required to be added as the controller. When the load of the server as the gateway is too large and one server cannot be switched from the controller to the gateway in the server as the controller, a new server is required to be added as the gateway. If the idle resources of the plurality of servers as the controller are too much, one or more servers can be stopped according to the actual situation, and the tasks are intensively distributed to one or more servers to execute the related tasks of the controller.
Referring to fig. 3, an embodiment of the present application further provides a networking apparatus 200, which can be applied in a first server, for executing or implementing the steps of the method. The networking device 200 includes at least one software function module which can be stored in a storage module in the form of software or Firmware (Firmware) or solidified in a server Operating System (OS). The processing module is used for executing executable modules stored in the storage module, such as software functional modules and computer programs included in the networking device 200.
In this embodiment, the networking device 200 may include a receiving unit 210, a sending unit 220, and a networking updating unit 230, and the following operations are executed:
a receiving unit 210, configured to receive a first broadcast packet sent by a second server in a local area network when the second server is started;
a sending unit 220, configured to send a first notification packet to the second server according to the first broadcast packet, and configured to control the second server to register in a designated role, where the designated role is a gateway and/or a controller;
and a networking updating unit 230, configured to update networking registration information when a second notification message of the second server is received and the second notification message indicates that the second server is successfully registered in the designated role, where the updated networking registration information includes gateway list information and controller list information, the gateway list information includes identity information of all servers currently serving as gateways, and the controller list information includes identity information of all servers currently serving as controllers.
Optionally, the networking update unit 230 is further configured to: when a second notification message of the second server is received and the second notification message represents that the second server is successfully registered in the designated role, adding the identity information of the second server to networking registration information stored by the first server so as to update the networking registration information; and broadcasting a second broadcast message to the local area network, wherein the second broadcast message is used for controlling each server corresponding to the networking registration information to update the networking registration information stored by the server.
Optionally, the networking device 200 may further include an obtaining unit. The acquisition unit is used for acquiring a third notification message sent by each server in the networking in a preset period, wherein the third notification message comprises load information of each server. The networking update unit 230 is further configured to: when the third notification message sent by the designated server is not acquired within a preset time length, deleting the identity information of the designated server from the networking registration information of the first server, and notifying the server in the local area network to update the networking registration information of the server, wherein the preset time length is longer than the preset period, and the designated server is any server excluding the first server from the networking registration information.
Optionally, the receiving unit 210 is further configured to receive a third broadcast packet sent by the designated server when the designated server is started; the sending unit 220 is further configured to send a fourth notification packet to the designated server according to the third broadcast packet, and is configured to control the designated server to register in a designated role; the networking updating unit 230 is further configured to update the networking registration information when the fifth notification message of the specified server is received and the fifth notification message represents that the specified server successfully registers the gateway.
Optionally, the sending unit 220 may further be configured to:
acquiring a first average load of a server serving as a controller in all servers in a current network and a second average load of a server serving as a gateway;
when the first average load is smaller than the second average load, sending the first notification message to the second server for controlling the second server to register in a gateway role;
and when the first average load is greater than or equal to the second average load, sending the first notification message to the second server for controlling the second server to register in a controller role.
Optionally, the networking device 200 may further include a load control unit, configured to:
when the load of a server serving as a controller in the local area network is greater than or equal to a first specified load, selecting a server with the minimum load and less than or equal to a second specified load to be switched to the controller from the gateway according to the load information of each server currently serving as the gateway, wherein the second specified load is less than the first specified load;
when the load of a server serving as a gateway is larger than or equal to a third specified load and at least two servers serving as controllers exist in the local area network, selecting the server with the minimum load and smaller than or equal to a fourth specified load to be switched to the gateway by the controller according to the load information of each server currently serving as the controller, wherein the fourth specified load is smaller than the third specified load.
It should be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the server and the networking device 200 described above may refer to the corresponding process of each step in the foregoing method, and redundant description is not repeated here.
Second embodiment
Referring to fig. 4, an embodiment of the present application further provides another networking method, which may be applied to a server that needs networking currently. The steps of the method are executed or realized by the server to be networked. The server to be networked is the second server. The method may comprise the steps of:
step S310, when the second server is started, a first broadcast message is sent to a server in the local area network;
step S320, receiving a first notification packet sent by a first server according to the first broadcast packet, where the first server is a server in the local area network as a controller;
step S330, controlling the second server to register in a designated role according to the first notification message, wherein the designated role is a gateway and/or a controller;
step S340, when the second server successfully registers in the designated role, sending a second notification packet to the first server for updating networking registration information, where the updated networking registration information includes gateway list information and controller list information, the gateway list information includes identity information of all servers currently serving as gateways, and the controller list information includes identity information of all servers currently serving as controllers.
Understandably, the method provided in the second embodiment is similar to the method provided in the first embodiment, except that the method in the second embodiment is executed by the second server, and the method in the first embodiment is executed by the first server and the second server cooperating with each other to execute the corresponding steps. The method in the second embodiment may further comprise other steps, for example, further comprising, performed by the second server:
for brevity, the detailed operation process of each step of the method provided in the second embodiment may refer to the description of the operation step performed by the second server in the first embodiment, and is not described herein again.
In this embodiment, the processing module may be an integrated circuit chip having signal processing capability. The processing module may be a general purpose processor. For example, the Processor may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Network Processor (NP), or the like; the method, the steps and the logic block diagram disclosed in the embodiments of the present Application may also be implemented or executed by a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
The communication module is used for establishing communication connection between the server and other servers in the local area network through the network and receiving and transmitting data through the network.
The memory module may be, but is not limited to, a random access memory, a read only memory, a programmable read only memory, an erasable programmable read only memory, an electrically erasable programmable read only memory, and the like. In this embodiment, the storage module may be configured to store networking registration information, a preset duration, a specified load, and the like. Of course, the storage module may also be used to store a program, and the processing module executes the program after receiving the execution instruction.
The embodiment of the application also provides a computer readable storage medium. The readable storage medium has stored therein a computer program which, when run on a computer, causes the computer to execute the networking method as described in the above embodiments.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by hardware, or by software plus a necessary general hardware platform, and based on such understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments of the present application.
In summary, the present application provides a networking method, device, server and readable storage medium. The method can comprise the following steps: receiving a first broadcast message sent by a second server in a local area network when the second server is started; sending a first notification message to a second server according to the first broadcast message, wherein the first notification message is used for controlling the second server to register in a designated role, and the designated role is a gateway and/or a controller; and when a second notification message of the second server is received and the second notification message represents that the second server is successfully registered in the appointed role, updating networking registration information, wherein the updated networking registration information comprises gateway list information and controller list information, the gateway list information comprises identity information of all servers currently used as gateways, and the controller list information comprises identity information of all servers currently used as controllers. In the scheme, when the second server is started, the broadcast message can be automatically sent, so that the first server serving as the controller receives the broadcast message, and then the first server controls the second server to perform networking registration with the designated role. Based on the method, the automatic deployment of the SDP server can be realized, and the problems of misoperation risk and low efficiency caused by manual deployment are reduced.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus, system, and method may be implemented in other ways. The apparatus, system, and method embodiments described above are illustrative only, as the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A networking method applied to a first server as a controller in a software defined boundary, the method comprising:
receiving a first broadcast message sent by a second server in a local area network when the second server is started;
sending a first notification message to the second server according to the first broadcast message, wherein the first notification message is used for controlling the second server to register in a designated role, and the designated role is a gateway and/or a controller;
and updating networking registration information when a second notification message of the second server is received and the second notification message represents that the second server is successfully registered in the appointed role, wherein the updated networking registration information comprises gateway list information and controller list information, the gateway list information comprises identity information of all servers currently used as gateways, and the controller list information comprises identity information of all servers currently used as controllers.
2. The method of claim 1, wherein updating networking registration information when a second notification message is received from the second server and the second notification message indicates that the second server is successfully registered in the designated role comprises:
when a second notification message of the second server is received and the second notification message represents that the second server is successfully registered in the designated role, adding the identity information of the second server to networking registration information stored by the first server so as to update the networking registration information;
and broadcasting a second broadcast message to the local area network, wherein the second broadcast message is used for controlling each server corresponding to the networking registration information to update the networking registration information stored by the server.
3. The method of claim 1, further comprising:
acquiring a third notification message sent by each server in the networking in a preset period, wherein the third notification message comprises load information of each server;
when the third notification message sent by the designated server is not acquired within a preset time length, deleting the identity information of the designated server from the networking registration information of the first server, and notifying the server in the local area network to update the networking registration information of the server, wherein the preset time length is longer than the preset period, and the designated server is any server excluding the first server from the networking registration information.
4. The method of claim 3, further comprising:
receiving a third broadcast message sent by the appointed server when the appointed server is started;
sending a fourth notification message to the designated server according to the third broadcast message, wherein the fourth notification message is used for controlling the designated server to register in a designated role;
and updating networking registration information when a fifth notification message of the designated server is received and the fifth notification message represents that the designated server successfully registers the gateway.
5. The method of claim 1, wherein sending a first notification message to the second server according to the first broadcast message for controlling the second server to register in a designated role comprises:
acquiring a first average load of a server serving as a controller in all servers in a current network and a second average load of a server serving as a gateway;
when the first average load is smaller than the second average load, sending the first notification message to the second server for controlling the second server to register in a gateway role;
and when the first average load is greater than or equal to the second average load, sending the first notification message to the second server for controlling the second server to register in a controller role.
6. The method of claim 1, further comprising:
when the load of a server serving as a controller in the local area network is greater than or equal to a first specified load, selecting a server with the minimum load and less than or equal to a second specified load to be switched to the controller from the gateway according to the load information of each server currently serving as the gateway, wherein the second specified load is less than the first specified load;
when the load of a server serving as a gateway is larger than or equal to a third specified load and at least two servers serving as controllers exist in the local area network, selecting the server with the minimum load and smaller than or equal to a fourth specified load to be switched to the gateway by the controller according to the load information of each server currently serving as the controller, wherein the fourth specified load is smaller than the third specified load.
7. A networking method applied to a second server acting as a gateway in a software defined boundary, the method comprising:
when the second server is started, sending a first broadcast message to a server in a local area network;
receiving a first notification message sent by a first server according to the first broadcast message, wherein the first server is a server serving as a controller in the local area network;
controlling the second server to register in a designated role according to the first notification message, wherein the designated role is a gateway and/or a controller;
and when the second server is successfully registered in the designated role, sending a second notification message to the first server for updating networking registration information, wherein the updated networking registration information comprises gateway list information and controller list information, the gateway list information comprises identity information of all servers currently used as gateways, and the controller list information comprises identity information of all servers currently used as controllers.
8. A networking apparatus for use with a first server acting as a controller within a software defined boundary, the apparatus comprising:
the receiving unit is used for receiving a first broadcast message sent by a second server in the local area network when the second server is started;
a sending unit, configured to send a first notification packet to the second server according to the first broadcast packet, and configured to control the second server to register in a designated role, where the designated role is a gateway and/or a controller;
and the networking updating unit is used for updating networking registration information when a second notification message of the second server is received and the second notification message represents that the second server is successfully registered in the designated role, wherein the updated networking registration information comprises gateway list information and controller list information, the gateway list information comprises identity information of all servers currently used as gateways, and the controller list information comprises identity information of all servers currently used as controllers.
9. A server, characterized in that the server comprises a memory, a processor, coupled to each other, in which memory a computer program is stored which, when executed by the processor, causes the server to carry out the method according to any one of claims 1-7.
10. A computer-readable storage medium, in which a computer program is stored which, when run on a computer, causes the computer to carry out the method according to any one of claims 1 to 7.
CN202010998569.7A 2020-09-21 2020-09-21 Networking method, networking device, server and readable storage medium Active CN112104506B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010998569.7A CN112104506B (en) 2020-09-21 2020-09-21 Networking method, networking device, server and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010998569.7A CN112104506B (en) 2020-09-21 2020-09-21 Networking method, networking device, server and readable storage medium

Publications (2)

Publication Number Publication Date
CN112104506A true CN112104506A (en) 2020-12-18
CN112104506B CN112104506B (en) 2023-07-18

Family

ID=73755186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010998569.7A Active CN112104506B (en) 2020-09-21 2020-09-21 Networking method, networking device, server and readable storage medium

Country Status (1)

Country Link
CN (1) CN112104506B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1543167A (en) * 2002-12-02 2004-11-03 ���ǵ�����ʽ���� Terminal registration method using session initiation protocol
US20080256251A1 (en) * 2007-04-13 2008-10-16 Nokia Corporation Mechanism for executing server discovery
US7881268B1 (en) * 2005-02-17 2011-02-01 Sprint Spectrum L.P. Group list update system and method
CN107317887A (en) * 2017-08-23 2017-11-03 北京知道创宇信息技术有限公司 A kind of load-balancing method, device and system
CN109495477A (en) * 2018-11-19 2019-03-19 迈普通信技术股份有限公司 A kind of authentication method, equipment and system
CN109618002A (en) * 2019-01-11 2019-04-12 武汉斗鱼鱼乐网络科技有限公司 A kind of micro services gateway optimization method, device and storage medium
US20190379580A1 (en) * 2018-06-07 2019-12-12 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Managing server nodes on a management network with modified service discovery protocol messages
CN111586025A (en) * 2020-04-30 2020-08-25 广州市品高软件股份有限公司 SDN-based SDP security group implementation method and security system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1543167A (en) * 2002-12-02 2004-11-03 ���ǵ�����ʽ���� Terminal registration method using session initiation protocol
US7881268B1 (en) * 2005-02-17 2011-02-01 Sprint Spectrum L.P. Group list update system and method
US20080256251A1 (en) * 2007-04-13 2008-10-16 Nokia Corporation Mechanism for executing server discovery
CN107317887A (en) * 2017-08-23 2017-11-03 北京知道创宇信息技术有限公司 A kind of load-balancing method, device and system
US20190379580A1 (en) * 2018-06-07 2019-12-12 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Managing server nodes on a management network with modified service discovery protocol messages
CN109495477A (en) * 2018-11-19 2019-03-19 迈普通信技术股份有限公司 A kind of authentication method, equipment and system
CN109618002A (en) * 2019-01-11 2019-04-12 武汉斗鱼鱼乐网络科技有限公司 A kind of micro services gateway optimization method, device and storage medium
CN111586025A (en) * 2020-04-30 2020-08-25 广州市品高软件股份有限公司 SDN-based SDP security group implementation method and security system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
沈连丰,朱亚萍,丁兆明,燕锋,邓曙光: "软件定义传感器网络重配置算法研究", 《通信学报》 *

Also Published As

Publication number Publication date
CN112104506B (en) 2023-07-18

Similar Documents

Publication Publication Date Title
CN107135279B (en) Method and device for processing long connection establishment request
CN110933137B (en) Data synchronization method, system, equipment and readable storage medium
CN110958281B (en) Data transmission method and communication device based on Internet of things
US8738775B1 (en) Managing resource dependent workflows
CN102957623B (en) A kind of maintaining method of neighborhood of border gate protocol and equipment
KR101139836B1 (en) Method and system for two-phase mechanism for discovering web services based management service
CN108989476B (en) Address allocation method and device
EP3402123B1 (en) Method and apparatus for transmitting request message
CN110932876B (en) Communication system, method and device
CN114138500B (en) Resource scheduling system and method
CN102123105A (en) Method and equipment for switching between standard VRRP (Virtual Router Redundancy Protocol) and load balancing VRRP
US20140101320A1 (en) Information processing system, control method, management apparatus and computer-readable recording medium
CN106506717A (en) A kind of automatic discovering method and equipment
CN107786350B (en) Method and device for restoring factory configuration of network equipment and network equipment
CN111901395B (en) Multi-cluster switching method and device
CN106790354B (en) Communication method and device for preventing data congestion
RU2693903C1 (en) Method, apparatus and processing system for expanded port
IL294745A (en) Method for processing discontinuous reception parameter, storage medium, and processor
CN116048538B (en) Service grid deployment method and device for DPU
CN112104506B (en) Networking method, networking device, server and readable storage medium
CN108028773B (en) Method and mobility management entity pool for enhancing telecommunication network performance
WO2021254466A1 (en) Method, apparatus and system for configuring edge side device
CN112437146B (en) Equipment state synchronization method, device and system
JPWO2006043411A1 (en) Communication device and terminal existence confirmation method
CN116860382A (en) Container-based method and device for achieving micro-service cluster

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