CN115361268A - Redirection method, redirection device, electronic equipment and computer-readable storage medium - Google Patents

Redirection method, redirection device, electronic equipment and computer-readable storage medium Download PDF

Info

Publication number
CN115361268A
CN115361268A CN202210999319.4A CN202210999319A CN115361268A CN 115361268 A CN115361268 A CN 115361268A CN 202210999319 A CN202210999319 A CN 202210999319A CN 115361268 A CN115361268 A CN 115361268A
Authority
CN
China
Prior art keywords
server
client
servers
determining
redirection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210999319.4A
Other languages
Chinese (zh)
Inventor
李慧玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Hubei Topsec Network Security Technology Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Hubei Topsec Network Security 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 Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd, Hubei Topsec Network Security Technology Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202210999319.4A priority Critical patent/CN115361268A/en
Publication of CN115361268A publication Critical patent/CN115361268A/en
Pending legal-status Critical Current

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/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • 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/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering

Abstract

The application provides a redirection method, a redirection device, electronic equipment and a computer readable storage medium, and belongs to the field of computer computing. The redirection method is applied to a server, the server is connected with other servers in a network, and the method comprises the following steps: under the condition of receiving a request message sent by a client, determining a target server from the other servers, wherein the overhead between the target server and the client is minimum and the load of the target server is normal; and sending a redirection message to the client, wherein the redirection message comprises the address of the target server. Due to the fact that the cost between the target server and the client is the minimum, after the target server selected by the scheme is connected with the client, the time delay of data transmission can be the minimum. In addition, the load of the target server is normal, the target server can be ensured to be an available server, and the client is prevented from receiving repeated redirection messages.

Description

Redirection method, redirection device, electronic equipment and computer-readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a redirection method, a redirection device, an electronic device, and a computer-readable storage medium.
Background
In the network environment of today, a plurality of servers are often deployed, so that the pressure of a single server is reduced. When the load of one server is overlarge, the client is redirected to the appointed server by using a redirection method, so that the pressure of the single server is reduced, and the condition that a single point of failure causes service interruption can be avoided.
After the client establishes a transmission channel with a designated server selected by the existing redirection method, the delay of data transmission may be increased, and more network resources need to be consumed.
Disclosure of Invention
The application provides a redirection method, a redirection device, an electronic device and a computer-readable storage medium, so as to solve the problems that after a transmission channel is established by a designated server selected by the existing redirection method, the time delay of data transmission may be increased, and more network resources need to be consumed.
In a first aspect, the present application provides a redirection method, applied to a server, where the server is connected to other servers in a network, and the method includes: under the condition of receiving a request message sent by a client, determining a target server from the other servers, wherein the overhead between the target server and the client is minimum and the load of the target server is normal; and sending a redirection message to the client, wherein the redirection message comprises the address of the target server.
In the embodiment of the application, due to the fact that the overhead between the target server and the client is minimum, after the target server selected by the scheme is connected with the client, the time delay of data transmission can be minimum. In addition, the load of the target server is normal, the target server can be ensured to be an available server, and the client is prevented from receiving repeated redirection messages.
With reference to the technical solution provided by the first aspect, in some possible implementations, before the determining the target server from the other servers, the method further includes: and determining that the load of the self equipment exceeds a preset threshold value.
In the embodiment of the application, after the load of the self equipment is determined to exceed the preset threshold value, the target server is determined, so that the load of the server can be ensured not to be overlarge, and the server is prevented from being broken down.
With reference to the technical solution provided by the first aspect, in some possible implementations, determining a target server from the other servers includes: and determining a target server from other servers in the network based on the load conditions of the other servers and path information representing path overhead between the client and each server in the network.
In the embodiment of the application, the cost of each server can be accurately determined by using the path information representing the path cost between the client and each server in the network, and meanwhile, whether the load of each server is normal or not can be determined by using the load condition of other servers. Therefore, the target server can be accurately determined based on the load condition and the path information of other servers.
With reference to the technical solution provided by the first aspect, in some possible implementations, the path information that characterizes the path cost between the client and each server in the network is obtained through the following steps: for each server in the network, determining a minimum overhead between the server and the client; and sequencing according to the minimum cost based on the minimum cost between each server and the client to obtain the path information.
In the embodiment of the application, the path information can be obtained by sequencing the minimum cost between each server and the client according to the minimum cost, so that the server with the minimum cost between the network and the client can be accurately obtained subsequently based on the path information, and the finally obtained target server is more accurate.
With reference to the technical solution provided by the first aspect, in some possible implementations, the connecting, by the client, each server through at least one intermediate node, and the determining the minimum overhead between the server and the client includes: acquiring respective link information of each intermediate node and each server in the network, wherein the link information comprises the cost between the intermediate node or the server and each intermediate node or server directly connected with the intermediate node or the server; and determining the minimum cost between each server and the client based on the link information of each intermediate node and each server.
In the embodiment of the application, since the link information includes the overhead between the intermediate node or the server and each intermediate node or server directly connected to the intermediate node or the server, the minimum overhead between each server and the client can be accurately obtained by obtaining the respective link information of each intermediate node and each server in the network.
With reference to the technical solution provided by the first aspect, in some possible implementations, the determining a target server from other servers in the network based on the load conditions of the other servers and path information representing path costs between the client and each server in the network includes: determining a first server with the minimum overhead with the client from the path information; determining whether the first server load is normal, if the first server load is normal, the first server is the target server; and if the first server is not normally loaded, determining a second server with the minimum overhead with the client from the rest servers from the path information until a target server with normal load is found.
In the embodiment of the application, a first server with the minimum overhead with a client in path information is determined, and when the load of the first server is normal, the first server is a target server; and if the first server is abnormal in load, determining a second server with the minimum cost with the client from the rest servers, and repeating the steps until a server with a normal load is found, wherein the server is the target server with the minimum cost and the normal load with the client.
With reference to the technical solution provided by the first aspect, in some possible implementations, the method further includes: analyzing the request message to obtain a request purpose corresponding to the request message; calling a function corresponding to the request destination for processing, and generating a reply message based on a result obtained by processing; and sending the reply message to the client.
In the embodiment of the application, different functions can be realized by calling the function corresponding to the request purpose of the request message for processing, and the application range of the scheme is widened.
In a second aspect, the present application provides a redirection device, deployed in a server, where the server is connected to other servers in a network, and the redirection device includes a determining module and a sending module, where the determining module is configured to determine a target server from the other servers under the condition that a request packet sent by a client is received, where overhead between the target server and the client is minimum and a load of the target server is normal; the sending module is used for sending a redirection message to the client, wherein the redirection message comprises the address of the target server.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a memory and a processor, the memory and the processor connected; the memory is used for storing programs; the processor is configured to invoke a program stored in the memory to perform a method as provided in the foregoing first aspect embodiment and/or in combination with any possible implementation manner of the foregoing first aspect embodiment.
In a fourth aspect, embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a computer to perform the method as described in the foregoing first aspect embodiment and/or in connection with any one of the possible implementations of the foregoing first aspect embodiment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart illustrating a redirection method according to an embodiment of the present application;
fig. 2 is a schematic connection diagram of a network according to an embodiment of the present application;
fig. 3 is a schematic flowchart illustrating another redirection method according to an embodiment of the present application;
fig. 4 is a block diagram illustrating a structure of a redirection device according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present disclosure.
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: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures. Meanwhile, relational terms such as "first," "second," and the like may be used solely in the description to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
Further, the term "and/or" in the present application is only one kind of association relationship describing the associated object, and means that three kinds of relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The technical solution of the present application will be described in detail below with reference to the accompanying drawings.
RTSP (Real Time Streaming Protocol) is a mature Streaming media Protocol with a wide application range, and can add more functions to a Streaming process, such as pause, resume, play, fast forward, fast backward, etc., and can control the sending process of Streaming media data. And has a message format similar to an HTTP (Hyper Text Transfer Protocol) Protocol, and is also well compatible with the HTTP Protocol.
The RTSP has a redirection method, which can inform the client end to establish a streaming media transmission channel with another appointed server, thereby realizing the pressure reduction of a single server and avoiding the condition of service interruption caused by single point of failure. However, in the current redirection method, the RFC (Request For Comments; is a series of files scheduled by numbers) document does not explain how to select the other server, so that after the client establishes a transmission channel with the specified server selected by the existing redirection method, the delay of data transmission may be increased, and more network resources may be consumed.
Based on this, the inventor proposes a redirection method to solve the problems that after a transmission channel is established by a designated server selected by the existing redirection method, the delay of data transmission may be increased, and more network resources need to be consumed.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a redirection method according to an embodiment of the present application, and steps included in the redirection method will be described with reference to fig. 1.
The redirection method is applied to a server, and the server is connected with other servers in a network. It will be appreciated that the server may be directly connected to other servers in the network, or the server may be connected to other servers in the network through intermediate nodes such as gateways, routers, etc. Similarly, the client may also be directly connected to a server in the network, or the client may also be connected to a server in the network through an intermediate node such as a gateway or a router.
S100: and under the condition of receiving a request message sent by the client, determining a target server from other servers.
The overhead between the target server and the client is minimum, and the load of the target server is normal. Due to the fact that the cost between the target server and the client is the minimum, after the target server selected by the scheme is connected with the client, the time delay of data transmission can be the minimum. In addition, the load of the target server is normal, so that the target server can be ensured to be an available server, and the client is prevented from receiving repeated redirection messages.
In one embodiment, the specific process of determining the target server from the other servers may be: and determining the target server from other servers in the network based on the load conditions of the other servers and path information representing path overhead between the client and each server in the network.
The path information representing the path overhead between the client and each server in the network can be obtained in advance and stored in a storage medium, and can be directly called when needed; alternatively, the path information may be acquired in real time as needed.
The load conditions of other servers can also be obtained in advance and stored in a storage medium, and the servers can be directly called when needed; alternatively, the path information may be acquired in real time as needed.
In order to obtain more accurate load conditions of the servers, in one embodiment, the load conditions of the servers may be requested from other servers at regular time intervals.
Or the servers in the network send the self load conditions to other servers at regular time, so that each server or the accurate load conditions of other servers can be obtained.
In one embodiment, the load may be represented by the usage of resources such as a Central Processing Unit (CPU) and a memory of the server, and when the usage of the resources such as the CPU and the memory of the server exceeds a preset threshold, the load of the server may be considered to be abnormal; and when the utilization rate of resources such as a CPU (central processing unit), a memory and the like of the server is smaller than a preset threshold value, the server is considered to be normally loaded. The preset threshold value here should be greater than 0 and less than 1.
Alternatively, the load of the server may be characterized by the amount of requests currently processed by the server in real time. At the moment, when the request quantity processed by the server in real time is larger than a preset threshold value, the server load is considered to be abnormal; and when the real-time processing request amount of the server is smaller than a preset threshold value, the server is considered to be in normal load. The preset threshold value here can be set according to actual requirements, and the specific value of the preset threshold value is not limited here.
There may be two following embodiments for obtaining path information characterizing path costs between a client and servers in the network.
In a first embodiment, the path information characterizing the path cost between the client and each server in the network may be obtained by: first, for each server in the network, a minimum overhead between the server and the client is determined. And then sorting according to the minimum cost based on the minimum cost between each server and the client to obtain the path information.
The path information may only include servers ordered according to the minimum overhead size; or, the path information may further include a specific value of the minimum cost of each server.
When the path information includes the specific numerical value of the minimum cost of each server, the path information may not need to be sorted according to the size of the minimum cost, that is, the process of obtaining the path information is as follows: first, for each server in the network, a minimum overhead between the server and the client is determined. And then, based on the minimum cost between each server and the client, obtaining path information, wherein the path information comprises a specific numerical value of the minimum cost of each server.
When the client is connected to the respective server through at least one intermediate node. In order to accurately obtain the minimum overhead between each server and each client, in an embodiment, the specific process of determining the minimum overhead between the server and the client may be: the method comprises the steps of firstly obtaining respective link information of each intermediate node and each server in the network, wherein the link information comprises overhead between the intermediate node or the server and each intermediate node or the server directly connected with the intermediate node or the server. A minimum overhead between each intermediate node and each server is then determined based on the link information for that server and the client.
Specifically, based on the link information of each intermediate node and each server, the process of determining the minimum overhead between the server and the client may be: the method comprises the steps of firstly determining the cost of each path for connecting the server and the client, wherein the minimum cost is the minimum cost between the server and the client.
For easy understanding, please refer to fig. 2, and fig. 2 is a schematic connection diagram of a network shown in the present application, where a value on a connection line between any two devices in the network is an overhead between the two devices, where the devices may be the intermediate nodes or the servers. A specific process of acquiring the path information in the first embodiment will be described below by taking the network shown in fig. 2 as an example.
When the client accesses the second server firstly and the second server needs to send the redirection message to the client, the minimum overhead between the first server and the client and the third server is determined firstly.
As can be seen from fig. 2, the path with the minimum overhead between the first server and the client is: the client, the first intermediate node, the third intermediate node, the fourth intermediate node, the second server, and the first server, the cost corresponding to the path is 1+2+3+3=9, and then the minimum cost between the first server and the client is 9.
Similarly, as can be seen from fig. 2, the path with the minimum overhead between the third server and the client is: client-first intermediate node-third intermediate node-fourth intermediate node-seventh intermediate node-third server, the cost corresponding to the path is 1+ 2=7, and then the minimum cost between the third server and the client is 7.
It can be seen that the third server overhead is less than the first server. The foregoing examples are provided merely for the purpose of explanation and are in no way to be construed as limiting of the present application.
In a second embodiment, a specific process of obtaining path information characterizing path costs between a client and each server in the network may be to first determine a first node, where the first node is an intermediate node directly connected to the client. And then determining a second node with the minimum overhead with the client from intermediate nodes directly connected with the first node based on the link information of the first node. And then determining a third node with the minimum overhead between the third node and the client from intermediate nodes directly connected with the first node and/or the second node based on the link information of the first node and the link information of the second node, and repeating the steps until each intermediate node and each server in the network are traversed, so that path information can be obtained. At this time, the understanding information includes all intermediate nodes and servers sorted according to the overhead size.
For convenience of understanding, a specific process of acquiring the path information in the second embodiment will be described by taking the network shown in fig. 2 as an example.
When the client accesses the second server firstly and the second server needs to send a redirection message to the client, a first intermediate node directly connected with the client is determined as a first node firstly.
In the second intermediate node and the third intermediate node directly connected with the first intermediate node, the overhead from the third intermediate node to the first intermediate node is less than the overhead from the second intermediate node to the first intermediate node, so that the second node is the third intermediate node.
In the second intermediate node, the fourth intermediate node and the fifth intermediate node which are directly connected with the first node and the second node in the network, the cost of the fourth intermediate node and the first node is minimum, so that the third node is the fourth intermediate node. And repeating the steps until each intermediate node and each server in the network are traversed, and obtaining the path information.
The manner of calculating the overhead between the intermediate node and the client is the same as the aforementioned manner of determining the minimum overhead between the server and the client, and is not described herein again for the sake of brief description.
The path information corresponding to the network shown in fig. 2 is [ first intermediate node; a third intermediate node; a fourth intermediate node; a fifth intermediate node; a seventh intermediate node; a second intermediate node; a second server; a third server; a first server ]. The path information is sorted from small to large according to the overhead, and the overhead between the first intermediate node and the client is minimum. The foregoing examples are provided merely for the purpose of explanation and are in no way to be construed as limiting of the present application.
In order to enable each server to obtain accurate path information, in one embodiment, the redirection method further includes: and sending the link information of the self equipment to each server in the network.
The following two embodiments may be implemented to determine the target server from the other servers in the network based on the load conditions of the other servers and the path information representing the path overhead between the client and each server in the network.
In a first implementation manner, based on the load condition of other servers and path information representing path costs between the client and each server in the network, a specific process of determining the target server from the other servers in the network may be: the method comprises the steps of firstly determining a first server with the minimum overhead with a client from path information, then determining whether the load of the first server is normal, and if the load of the first server is normal, determining that the first server is the target server. And if the first server is not normally loaded, determining a second server with the minimum overhead with the client from the path information until a target server with normal load is found. At this time, the server that performs this step is not included in the path information.
For example, the path information includes a server 1, a server 2, a server 3, and a server 4, and the overhead between the server 1 and the client < the overhead between the server 2 and the client < the overhead between the server 3 and the client < the overhead between the server 4 and the client, and the load condition of the server 1 is abnormal, the load condition of the server 2 is abnormal, the load condition of the server 3 is normal, and the load condition of the server 3 is abnormal, the procedure of the first embodiment is as follows.
Firstly, the server 1 with the minimum cost with the client is determined from the path information, and because the load condition of the server 1 is abnormal, the server 1 is excluded from the path information, and then the server 2 with the minimum cost with the client is determined from the path information.
Since the load condition of the server 2 is not normal, the server 2 is excluded from the path information, and then the server 3 with the smallest overhead with respect to the client among the remaining servers is determined from the path information.
Since the load condition of the server 3 is normal, the server 3 is the target server. The foregoing examples are provided merely for the purpose of explanation and are in no way to be construed as limiting of the present application.
In a second implementation manner, based on the load conditions of other servers and the path information representing the path overhead between the client and each server in the network, the specific process of determining the target server from the other servers in the network may be: firstly, based on the load conditions of other servers, a server with normal load is determined from other servers in the network except the server. And then determining a server with the minimum overhead from the servers with normal load based on the path information, wherein the server with the minimum overhead is the target server.
For example, the path information includes a server 1, a server 2, a server 3, and a server 4, and the overhead between the server 1 and the client < the overhead between the server 2 and the client < the overhead between the server 3 and the client < the overhead between the server 4 and the client, and the load condition of the server 1 is abnormal, the load condition of the server 2 is normal, the load condition of the server 3 is normal, and the load condition of the server 3 is abnormal, the process of the second embodiment is as follows.
Firstly, the server 2 and the server 3 with normal load conditions can be determined based on the load conditions of other servers, and then based on the path information, the overhead between the server 2 and the client is smaller than that between the server 3 and the client, so that the server 2 is the target server. The foregoing examples are provided for ease of understanding only and are not intended to be limiting of the present application.
In order to ensure that the load of the server is not too large and prevent the server from failing, in an embodiment, before the target server is determined from other servers, it may be determined that the load of the device itself exceeds a preset threshold.
Here, the load and the preset threshold are consistent with the meaning and determination manner of the load and the preset threshold described above, and are not described herein again for the sake of brief description.
S200: and sending a redirection message to the client, wherein the redirection message comprises the address of the target server.
In an embodiment, when the server does not need to perform redirection operation, the request message may be analyzed first to obtain a request destination corresponding to the request message when the request message sent by the client is received. Then calling a function corresponding to the request purpose for processing, and generating a reply message based on a result obtained by processing; and finally, sending the reply message to the client.
The functions corresponding to different request messages may be different, and the request messages may include a SETUP request message, a PLAY request message, a RECORD request message, and the like.
Taking the example of the SETUP request message, if the received SETUP request message is a SETUP request message, when the server replies to the SETUP request message, a session header field is added to the reply message, the value of the session header field is a randomly generated character string for identifying a session, and subsequent messages of the session carry the session to distinguish different sessions. The reply message may also carry a Transport header field, values in the Transport header field conform to a format specified in an RFC document, so that the client can accurately parse the reply message, and the header field may carry Transport-related parameters, such as a Transport Protocol and a media type of the Transport, a Transport layer Protocol, a network layer Transport format, a client RTP (Real-time Transport Protocol)/RTCP (Real-time Transport Control Protocol) port pair, a server RTP/RTCP port pair, and an SSRC (synchronous source) identifier, and finally send the reply message.
The foregoing examples are provided merely for the purpose of explanation and are in no way to be construed as limiting of the present application.
In order to ensure that the request message can be accurately analyzed, in an embodiment, before the request message is analyzed, whether the message format of the request message is correct or not can be detected. If the format of the request message is correct, the subsequent steps are executed, and if the format of the request message is wrong, the request message is discarded.
Because the request message has a fixed format and different fields of the request message have different meanings, the request message can be analyzed according to the format of the request message to obtain the purpose of the request message. At this time, a session ID (Identity document) may be created to be associated with the address of the client for identifying a session. The session is maintained until the client stops obtaining data from the server.
The format of the request message may be detected to determine whether the format of the request message conforms to the request message format specified in the RFC document.
It can be understood that after the complete content of the request message is obtained, the format of the request message is detected.
In order to prevent sending RTP (Real-time Transport Protocol) data during processing the request message or sending a response message to the client without processing the request message, in an embodiment, a locking operation may be performed during processing the request message. Correspondingly, after the reply message is sent to the client, the unlocking operation is executed.
The specific implementation manner of the locking operation is well known to those skilled in the art, and is not described herein again for the sake of brevity.
Because each request message corresponds to a timeout time, the timeout time is used for keeping alive between the server and the client, and if the server does not receive the request message of the client within the specified timeout time, the client is considered to be inactivated. If the request sent by the client is received within the specified timeout period, the timeout period is refreshed to 0s, and the timer is restarted. Therefore, after the locking operation is performed on the process of processing the request message, the timeout may be refreshed to 0s.
For a further understanding of the redirection method described above, please refer to fig. 3. It should be noted that the principle shown in fig. 3 is one of many embodiments of the redirection method of the present application, and therefore, the manner shown in fig. 3 should not be construed as a limitation to the present application.
As shown in fig. 3, the link information of each intermediate node and each server in the network, and the load condition of other servers are obtained first. And under the condition of receiving a request message sent by the client, judging that the load of the self equipment exceeds a preset threshold value.
And if the load of the self equipment exceeds a preset threshold value, determining a target server which has the minimum overhead with the client and has a normal load with the target server from other servers. And sends a redirect message including the address of the target server to the client.
If the load of the self equipment does not exceed a preset threshold value, acquiring the complete content of the request message; detecting whether the message format of the request message is correct or not; if the format of the request message is correct, locking the process of processing the request message; then refreshing the overtime time corresponding to the request message; then, analyzing the request message to obtain a request purpose corresponding to the request message; finally, calling a function corresponding to the request target for processing, and generating a reply message based on a result obtained by processing; and sending the reply message to the client, and executing unlocking operation.
The specific implementation manner and principle of each step shown in fig. 3 are already described clearly in the foregoing, and are not described herein again for brevity.
Referring to fig. 4, fig. 4 is a block diagram of a redirection device 100 according to an embodiment of the present disclosure, where the redirection device 100 is deployed in a server, and the server is connected to other servers in a network, and the redirection device 100 includes a determining module 110 and a sending module 120.
A determining module 110, configured to determine a target server from the other servers under the condition that a request packet sent by a client is received, where overhead between the target server and the client is minimal and a load of the target server is normal.
A sending module 120, configured to send a redirection packet to the client, where the redirection packet includes an address of the target server.
The determining module 110 is further configured to determine that the load of the device itself exceeds a preset threshold before the target server is determined from the other servers.
The determining module 110 is specifically configured to determine the target server from the other servers in the network based on the load conditions of the other servers and the path information representing the path overhead between the client and each server in the network.
A determining module 110, further configured to determine, for each server in the network, a minimum overhead between the server and the client; and sequencing according to the minimum cost based on the minimum cost between each server and the client to obtain the path information.
A determining module 110, configured to specifically acquire respective link information of each intermediate node and each server in the network, where the link information includes an overhead between the intermediate node or the server and each intermediate node or server directly connected to the intermediate node or the server; and determining the minimum cost between each server and the client based on the link information of each intermediate node and each server.
A determining module 110, configured to determine, from the path information, a first server with a minimum overhead to the client; determining whether the first server load is normal, if the first server load is normal, the first server is the target server; and if the first server is not loaded normally, determining a second server with the minimum overhead with the client from the path information until a target server with normal load is found.
The sending module 120 is further configured to parse the request packet to obtain a request destination corresponding to the request packet; calling a function corresponding to the request destination for processing, and generating a reply message based on a result obtained by processing; and sending the reply message to the client.
In an embodiment, the sending module 120 may be an RTSP module in the server, where the RTSP module is responsible for receiving, processing, and sending RTSP messages, and the RTSP state machine describes protocol behaviors from an RTSP session initialization to an RTSP session termination.
The determining module 110 may be a redirection module, and the redirection module is responsible for sending a RTSP redirection message to notify the client to establish communication with other servers. Before redirection, the redirection module searches for a target server with the minimum overhead and normal load with the client, and fills the address of the target server into an RTSP redirection message.
The implementation principle and the resulting technical effect of the redirection device 100 provided in the embodiment of the present application are the same as those of the aforementioned redirection method embodiment, and for a brief description, reference may be made to corresponding contents in the aforementioned redirection method embodiment where no part of the embodiment of the device is mentioned.
Please refer to fig. 5, which is an electronic device 200 according to an embodiment of the present disclosure. The electronic device 200 includes: a transceiver 210, a memory 220, a communication bus 230, and a processor 240.
The elements of the transceiver 210, the memory 220, and the processor 240 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, the components may be electrically coupled to each other via one or more communication buses 230 or signal lines. The transceiver 210 is used for transceiving data. The memory 220 is used for storing a computer program, such as the software functional module shown in fig. 4, i.e., the redirection device 100. The redirection device 100 includes at least one software function module, which may be stored in the memory 220 in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the electronic device 200. The processor 240 is configured to execute an executable module stored in the memory 220, for example, a software functional module or a computer program included in the redirection device 100. At this time, the processor 240 is configured to determine a target server from the other servers under the condition that a request message sent by a client is received, where overhead between the target server and the client is minimum and a load of the target server is normal; and sending a redirection message to the client, wherein the redirection message comprises the address of the target server.
The Memory 220 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Read Only Memory (EPROM), an electrically Erasable Read Only Memory (EEPROM), and the like.
The processor 240 may be an integrated circuit chip having signal processing capabilities. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor 240 may be any conventional processor or the like.
The electronic device 200 includes, but is not limited to, a personal computer, a server, and the like.
The present embodiment also provides a non-volatile computer-readable storage medium (hereinafter, referred to as a storage medium), where the storage medium stores a computer program, and when the computer program is executed by the electronic device 200 as described above, the computer program performs the redirection method described above. The computer-readable storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
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, or improvement 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 redirection method applied to a server, wherein the server is connected with other servers in a network, and the method comprises:
under the condition of receiving a request message sent by a client, determining a target server from the other servers, wherein the overhead between the target server and the client is minimum and the load of the target server is normal;
and sending a redirection message to the client, wherein the redirection message comprises the address of the target server.
2. The method of claim 1, wherein prior to said determining a target server from said other servers, said method further comprises:
and determining that the load of the self equipment exceeds a preset threshold value.
3. The method of claim 1, wherein determining the target server from the other servers comprises:
and determining a target server from other servers in the network based on the load conditions of the other servers and path information representing path overhead between the client and each server in the network.
4. The method of claim 3, wherein the path information characterizing the path cost between the client and each server in the network is obtained by:
determining, for each server in the network, a minimum overhead between the server and the client;
and sequencing according to the minimum cost based on the minimum cost between each server and the client to obtain the path information.
5. The method of claim 4, wherein the client is connected to each server through at least one intermediate node, and wherein determining the minimum overhead between the server and the client comprises:
acquiring respective link information of each intermediate node and each server in the network, wherein the link information comprises the cost between the intermediate node or the server and each intermediate node or the server directly connected with the intermediate node or the server;
and determining the minimum cost between each server and the client based on the link information of each intermediate node and each server.
6. The method of claim 3, wherein determining the target server from the other servers in the network based on the load conditions of the other servers and path information representing path costs between the client and the servers in the network comprises:
determining a first server with the minimum overhead with the client from the path information;
determining whether the first server load is normal, if the first server load is normal, the first server is the target server;
and if the first server is not normally loaded, determining a second server with the minimum overhead with the client from the rest servers from the path information until a target server with normal load is found.
7. The method of claim 1, further comprising:
analyzing the request message to obtain a request purpose corresponding to the request message;
calling a function corresponding to the request destination for processing, and generating a reply message based on a result obtained by processing;
and sending the reply message to the client.
8. A redirection device disposed in a server, wherein the server is connected to other servers in a network, the redirection device comprising:
the determining module is used for determining a target server from the other servers under the condition of receiving a request message sent by a client, wherein the overhead between the target server and the client is minimum and the load of the target server is normal;
and the sending module is used for sending a redirection message to the client, wherein the redirection message comprises the address of the target server.
9. An electronic device, comprising: a memory and a processor, the memory and the processor connected;
the memory is used for storing programs;
the processor to invoke a program stored in the memory to perform the method of any of claims 1-7.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a computer, performs the method of any one of claims 1-7.
CN202210999319.4A 2022-08-19 2022-08-19 Redirection method, redirection device, electronic equipment and computer-readable storage medium Pending CN115361268A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210999319.4A CN115361268A (en) 2022-08-19 2022-08-19 Redirection method, redirection device, electronic equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210999319.4A CN115361268A (en) 2022-08-19 2022-08-19 Redirection method, redirection device, electronic equipment and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN115361268A true CN115361268A (en) 2022-11-18

Family

ID=84002844

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210999319.4A Pending CN115361268A (en) 2022-08-19 2022-08-19 Redirection method, redirection device, electronic equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN115361268A (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1529460A (en) * 2003-10-14 2004-09-15 北京邮电大学 Whole load equalizing method based on global network positioning
CN101127632A (en) * 2006-08-15 2008-02-20 腾讯科技(深圳)有限公司 A method, system and redirector for server traffic control
CN103067292A (en) * 2012-12-26 2013-04-24 华为技术有限公司 Websocket-transmission-based load balancing method and device
US20140258705A1 (en) * 2013-03-07 2014-09-11 Google Inc. Low latency server-side redirection of udp-based transport protocols traversing a client-side nat firewall
WO2015061938A1 (en) * 2013-10-28 2015-05-07 华为技术有限公司 Method, device and system for redirecting data service proxy
KR101518470B1 (en) * 2014-06-16 2015-05-07 주식회사 플랜티넷 Method for detecting a number of the devices of a plurality of client terminals selected by a web server from the internet request traffics sharing the public IP address and System for detecting selectively the same
CN105991347A (en) * 2015-04-30 2016-10-05 杭州迪普科技有限公司 Redirection method of DNS request message and device
CN108123888A (en) * 2016-11-29 2018-06-05 中兴通讯股份有限公司 Load-balancing method, the apparatus and system of message
WO2019114830A1 (en) * 2017-12-14 2019-06-20 北京金山云网络技术有限公司 Network quality detection method and apparatus, electronic device, and storage medium
WO2019138415A1 (en) * 2018-01-12 2019-07-18 Telefonaktiebolaget Lm Ericsson (Publ) Mechanism for control message redirection for sdn control channel failures
CN112689017A (en) * 2020-12-28 2021-04-20 咪咕文化科技有限公司 Redirection processing method and device, electronic equipment and storage medium
CN113824642A (en) * 2018-03-09 2021-12-21 华为技术有限公司 Method for sending message, network equipment and computer readable storage medium
CN114024898A (en) * 2021-11-09 2022-02-08 湖北天融信网络安全技术有限公司 Message transmission method, device, equipment and storage medium
CN114518956A (en) * 2021-12-29 2022-05-20 北京邮电大学 Load balancing method and device based on queue overhead under edge streaming media

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1529460A (en) * 2003-10-14 2004-09-15 北京邮电大学 Whole load equalizing method based on global network positioning
CN101127632A (en) * 2006-08-15 2008-02-20 腾讯科技(深圳)有限公司 A method, system and redirector for server traffic control
CN103067292A (en) * 2012-12-26 2013-04-24 华为技术有限公司 Websocket-transmission-based load balancing method and device
US20140258705A1 (en) * 2013-03-07 2014-09-11 Google Inc. Low latency server-side redirection of udp-based transport protocols traversing a client-side nat firewall
WO2015061938A1 (en) * 2013-10-28 2015-05-07 华为技术有限公司 Method, device and system for redirecting data service proxy
KR101518470B1 (en) * 2014-06-16 2015-05-07 주식회사 플랜티넷 Method for detecting a number of the devices of a plurality of client terminals selected by a web server from the internet request traffics sharing the public IP address and System for detecting selectively the same
CN105991347A (en) * 2015-04-30 2016-10-05 杭州迪普科技有限公司 Redirection method of DNS request message and device
CN108123888A (en) * 2016-11-29 2018-06-05 中兴通讯股份有限公司 Load-balancing method, the apparatus and system of message
WO2018099384A1 (en) * 2016-11-29 2018-06-07 中兴通讯股份有限公司 Packet load balancing method, apparatus and system
WO2019114830A1 (en) * 2017-12-14 2019-06-20 北京金山云网络技术有限公司 Network quality detection method and apparatus, electronic device, and storage medium
WO2019138415A1 (en) * 2018-01-12 2019-07-18 Telefonaktiebolaget Lm Ericsson (Publ) Mechanism for control message redirection for sdn control channel failures
CN113824642A (en) * 2018-03-09 2021-12-21 华为技术有限公司 Method for sending message, network equipment and computer readable storage medium
CN112689017A (en) * 2020-12-28 2021-04-20 咪咕文化科技有限公司 Redirection processing method and device, electronic equipment and storage medium
CN114024898A (en) * 2021-11-09 2022-02-08 湖北天融信网络安全技术有限公司 Message transmission method, device, equipment and storage medium
CN114518956A (en) * 2021-12-29 2022-05-20 北京邮电大学 Load balancing method and device based on queue overhead under edge streaming media

Similar Documents

Publication Publication Date Title
US20210036907A1 (en) Methods and apparatuses for pushing a message
US8374079B2 (en) Proxy server, communication system, communication method and program
CN111106976B (en) Detection method and device for CDN network, electronic equipment and readable storage medium
CN115516840A (en) Information processing method, device, system, medium, chip and program
CN107979539A (en) Message processing method and device
CN112769652A (en) Node service monitoring method, device, equipment and medium
US20150067066A1 (en) Provisioning Communication Services using Proxy Server in a Cloud
CN110442506B (en) Log acquisition method, device, service server, system and storage medium
CN108235800B (en) Network fault detection method, control center equipment and computer storage medium
CN107819754B (en) Anti-hijacking method, monitoring server, terminal and system
CN111064729B (en) Message processing method and device, storage medium and electronic device
CN115361268A (en) Redirection method, redirection device, electronic equipment and computer-readable storage medium
CN109120541B (en) Method, device, terminal equipment and storage medium for limiting network speed
CN110474807B (en) Log processing method and device
CN113055193B (en) Data multicast transmission method, device, equipment and storage medium
US10623983B2 (en) Service aware overload handling in a communication network
CN114553730A (en) Application identification method and device, electronic equipment and storage medium
CN112235271A (en) Content Delivery Network (CDN) equipment and self-adaptive safe source returning method thereof
CN110855785B (en) Data processing method and device
CN114143127B (en) Data broadcasting method and device and electronic equipment
CN114095576B (en) Call request sending method and device
US20230216938A1 (en) Application-based data transport apparatus and method
CN116828022B (en) Method, device, equipment and medium for managing connection relation with server
CN112118273B (en) Data interaction method, system and first client
CN115714805A (en) Cross-platform communication connection method and system and electronic equipment

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