Movatterモバイル変換


[0]ホーム

URL:


CN113472875B - Connection multiplexing method and device, electronic equipment and storage medium - Google Patents

Connection multiplexing method and device, electronic equipment and storage medium
Download PDF

Info

Publication number
CN113472875B
CN113472875BCN202110721982.3ACN202110721982ACN113472875BCN 113472875 BCN113472875 BCN 113472875BCN 202110721982 ACN202110721982 ACN 202110721982ACN 113472875 BCN113472875 BCN 113472875B
Authority
CN
China
Prior art keywords
connection
server
client
request
proxy server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110721982.3A
Other languages
Chinese (zh)
Other versions
CN113472875A (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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies 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 Sangfor Technologies Co LtdfiledCriticalSangfor Technologies Co Ltd
Priority to CN202110721982.3ApriorityCriticalpatent/CN113472875B/en
Publication of CN113472875ApublicationCriticalpatent/CN113472875A/en
Application grantedgrantedCritical
Publication of CN113472875BpublicationCriticalpatent/CN113472875B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The application discloses a connection multiplexing method, a device, electronic equipment and a storage medium, wherein the method is applied to a proxy server and comprises the following steps: acquiring a request message sent by at least one client to a destination server; grouping the request messages based on a preset grouping rule, and determining grouping attribute of each group of request messages; determining available established TCP connections corresponding to each group of packet attributes according to the group attributes of each group of request messages, wherein each established TCP connection corresponds to one group of packet attribute; based on the connection multiplexing of the available established TCP connection, the request message of each packet attribute is sent to a corresponding back-end server which can realize the partial function of the destination server.

Description

Connection multiplexing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to the field of communication, in particular to a connection multiplexing method, a device, electronic equipment and a storage medium.
Background
At present, a proxy server can support connection multiplexing with clients, but the existing connection multiplexing mode is simpler, and as long as a TCP connection exists between the proxy server and a certain back-end server, the back-end server processes a plurality of requests sent by one or more clients, so that the information processed by the back-end server is very complicated, and the development of the back-end server is not facilitated.
Disclosure of Invention
In order to solve the technical problems, the embodiment of the application provides a connection multiplexing method, a device, electronic equipment and a storage medium.
The embodiment of the application provides a connection multiplexing method which is applied to a proxy server and comprises the following steps:
Acquiring a request message sent by at least one client to a destination server;
Grouping the request messages based on a preset grouping rule, and determining grouping attribute of each group of request messages;
Determining available established TCP connections corresponding to each group of packet attributes according to the group attributes of each group of request messages, wherein each established TCP connection corresponds to one group of packet attribute;
Based on the connection multiplexing of the available established TCP connection, the request message of each packet attribute is sent to a corresponding back-end server which can realize the partial function of the destination server.
In an optional embodiment of the present application, the determining, according to the packet attribute of each group of request packets, the available established TCP connection corresponding to each packet attribute includes:
Determining whether TCP connections corresponding to each group of grouping attributes are stored in a connection pool according to the grouping attributes of each group of request messages;
And if the corresponding TCP connection is stored in the connection pool, acquiring the available established TCP connection from the connection pool.
In an optional embodiment of the present application, if the corresponding TCP connection is stored in the connection pool, obtaining the available established TCP connection from the connection pool includes:
If the corresponding TCP connection is stored in the connection pool, determining whether the bandwidth of the TCP connection does not exceed a bandwidth threshold;
And if the bandwidth threshold is not exceeded, acquiring available established TCP connection from the connection pool.
In an alternative embodiment of the present application, the method further includes:
If the available established TCP connection corresponding to the packet attribute cannot be determined, the TCP connection is established with the corresponding back-end server.
In an alternative embodiment of the present application, the method further includes:
And recording the corresponding relation between the client and the request message to ensure that the corresponding client can be determined when the response information of the back-end server is received.
In an alternative embodiment of the present application, the method further includes:
in the event of a disconnection from the client, a TCP connection is maintained with each back-end backend server.
In an alternative embodiment of the present application, a communication protocol between the proxy server and the client, and between the proxy server and the backend server is HTTP2.
The embodiment of the application also provides a connection multiplexing device which is applied to the proxy server, and the device comprises:
The acquisition unit is used for acquiring a request message sent by at least one client to a destination server;
The grouping unit is used for grouping the request messages based on a preset grouping rule and determining grouping attributes of each group of request messages;
A determining unit, configured to determine, according to the packet attribute of each group of request packets, an available established TCP connection corresponding to each packet attribute, where each established TCP connection corresponds to one packet attribute;
and the sending unit is used for sending the request message of each packet attribute to a corresponding back-end server capable of realizing the partial function of the destination server based on the connection multiplexing of the available established TCP connection.
In an optional embodiment of the present application, the determining unit is specifically configured to: determining whether TCP connections corresponding to each group of grouping attributes are stored in a connection pool according to the grouping attributes of each group of request messages; and if the corresponding TCP connection is stored in the connection pool, acquiring the available established TCP connection from the connection pool.
In an optional embodiment of the present application, the determining unit is specifically configured to: if the corresponding TCP connection is stored in the connection pool, determining whether the bandwidth of the TCP connection does not exceed a bandwidth threshold; and if the bandwidth threshold is not exceeded, acquiring available established TCP connection from the connection pool.
In an alternative embodiment of the present application, the apparatus further includes:
And the connection unit is used for establishing TCP connection with the corresponding back-end server if the available established TCP connection corresponding to the packet attribute cannot be determined.
In an alternative embodiment of the present application, the apparatus further includes:
The recording unit is used for recording the corresponding relation between the client and the request message so as to ensure that the corresponding client can be determined when the response information of the back-end server is received.
In an alternative embodiment of the present application, the apparatus further includes:
And the maintaining unit is used for maintaining TCP connection with each back-end server under the condition that the connection with the client is disconnected.
In an alternative embodiment of the present application, a communication protocol between the proxy server and the client, and between the proxy server and the backend server is HTTP2.
The embodiment of the application also provides electronic equipment, which comprises: the connection multiplexing method described in the above embodiment can be implemented when the processor executes the computer executable instructions on the memory.
The embodiment of the application also provides a computer storage medium, and executable instructions are stored on the storage medium, and when the executable instructions are executed by a processor, the connection multiplexing method described in the embodiment is realized.
According to the technical scheme, the proxy server acquires a request message sent by at least one client to the destination server; grouping the request messages based on a preset grouping rule, and determining grouping attribute of each group of request messages; determining available established TCP connections corresponding to each group of packet attributes according to the group attributes of each group of request messages, wherein each established TCP connection corresponds to one group of packet attribute; based on the connection multiplexing of the available established TCP connection, the request message of each packet attribute is sent to a corresponding back-end server which can realize the partial function of the destination server. According to the technical scheme, on one hand, the number of connections between the proxy server and the back-end servers is guaranteed, the proxy server is prevented from maintaining more TCP connections, and on the other hand, the request message sent to each back-end server for processing is guaranteed to be of one type or only achieves one purpose, so that development, maintenance and upgrading of the back-end service are facilitated.
Drawings
Fig. 1 is a schematic flow chart of a connection multiplexing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a combination of request messages according to an embodiment of the present application;
Fig. 3 is a schematic diagram of information interaction between a proxy server, a client and a backend server according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a connection multiplexing device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For a more complete understanding of the nature and the technical content of the embodiments of the present application, reference should be made to the following detailed description of embodiments of the application, taken in conjunction with the accompanying drawings, which are meant to be illustrative only and not limiting of the embodiments of the application.
The following is an explanation of key terms related to the embodiments of the present application:
HTTP2 (HyperText Transfer Protocol 2.0.0): the hypertext transfer protocol version 2, initially named HTTP 2.0, abbreviated as h2 (encrypted connection based on transport layer security protocol (i.e., TLS) 1.2 or more) or h2c (non-encrypted connection), is the second major version of the HTTP protocol, used on the world wide web.
HTTP2 multiplexing, a characteristic of HTTP2 protocol, namely that when the client sends a message to the server, the client does not need to wait for receiving the response of the last request message and then send the next request message, and can send a plurality of request messages to the back-end server at the same time, and each request message has no dependency relationship and no dependency relationship between response information.
Fig. 1 is a flow chart of a connection multiplexing method provided by an embodiment of the present application, and as shown in fig. 1, the connection multiplexing method provided by the embodiment of the present application includes the following steps:
step 101: and acquiring a request message sent by at least one client to the destination server.
In the embodiment of the application, the client is also called a client, and refers to a program corresponding to a back-end server for providing local service for the client. Except for some locally running applications, which are typically installed on a common client, it is necessary to work with the backend server. In the internet technology, more commonly used clients include web browsers such as those used by the world wide web, email clients when receiving emails, and client software for instant messaging. For various application programs of the client, corresponding back-end servers and service programs are required to provide corresponding services in the network, such as database services, email services and the like, and specific communication connection needs to be established between the client and the back-end servers to ensure the normal operation of the client application programs.
The destination server includes one or more back-end servers, which are one type of computer that operates faster, is more loaded, and is more expensive than a conventional computer. The backend server provides computing or application services for other clients (such as PC, smart phone, ATM, etc. terminals and even large devices such as train systems) in the network. The back-end server has high-speed CPU operation capability, long-time reliable operation, strong I/O external data throughput capability and better expansibility. According to the services provided by the back-end server, the back-end server generally has the capabilities of bearing response service requests, bearing services and guaranteeing services.
The proxy server is an intermediate device in communication connection between the client and the back-end server, and is responsible for forwarding the request message Wen Heying reply information between the client and the back-end server.
In the embodiment of the application, the proxy server can simultaneously receive a plurality of request messages sent by a plurality of clients, wherein the number of the request messages sent by each client is one or more.
As shown in fig. 2, the proxy server can simultaneously receive the request messages A1, A2, A3 sent by the client 1, the request messages B1, B2, B3 sent by the client 2, and the request messages C1, C2, C3 sent by the client 3.
The request message sent by each of the plurality of clients may include multiple types, and as illustrated in fig. 2, the client 1 sends three request messages A1, A2, and A3, where the request messages A1 and A2 are requests for sending an email, and the request message A3 is a request for performing picture processing.
Step 102: and grouping the request messages based on a preset grouping rule, and determining grouping attributes of each group of request messages.
In the embodiment of the application, the preset rule is specifically a rule according to which a plurality of request messages are grouped, the preset rule can be selected into a plurality of forms, and grouping attributes corresponding to all the request messages in the same group of request messages are the same after the request messages are grouped according to the preset rule. According to different preset rules, specific attributes contained in the grouping attributes are different.
In one embodiment, the preset rule specifically groups the plurality of request messages according to the type of the resource of the request message sent by the client, for example, groups the request messages sent by the clients and belonging to the type of receiving and sending e-mails, and groups the request messages sent by the clients and belonging to the type of processing pictures. In this case, the packet attribute is specifically the requested resource type.
Here, if the packet attribute is specifically the requested resource type, the TCP connection corresponding to the packet attribute may be understood as a backend server corresponding to the packet attribute. For example, a set of request messages belonging to the type of e-mail may be sent to a back-end server dedicated to handling e-mail tasks, and a set of request messages belonging to the type of picture processing may be sent to a back-end server dedicated to picture processing tasks.
In another embodiment, the preset rule specifically groups the plurality of request messages according to a level of a priority corresponding to the request message sent by the client, for example, groups the request messages belonging to the first priority sent by each client, and groups the request messages belonging to the second priority sent by each client, where the first priority is higher than the second priority. In this case, the packet attribute is specifically the priority type of the request. Here, if the packet attribute is specifically the priority type of the request, the TCP connection corresponding to the packet attribute may be understood as a backend server corresponding to the packet attribute. For example, the proxy server may send a set of request messages belonging to a first priority to a first backend server and a set of request messages belonging to a second priority to a second backend server, where the processing speed of the first backend server is greater than the processing speed of the second backend server.
In addition, the preset rule can also be to group the request message according to different types of the client, in which case, the grouping attribute is specifically the type of the client; or the preset rule is to group the request message according to the security level of the request message, and the like, and in this case, the grouping attribute is specifically the type of the security level of the request. The embodiment of the application does not specifically limit the preset rules and grouping attributes, and the preset rules and the grouping attributes are several specific rules listed in the embodiment of the application and grouping attributes corresponding to the specific rules, and it can be understood that the preset rules and grouping attributes in the embodiment of the application can also be in other forms.
In fig. 2, after receiving the request messages A1, A2, A3, B1, B2, B3, C1, C2 and C3 sent by the client 1, the client 2 and the client 3, the proxy server groups the 9 requests according to a preset rule to obtain A1 st group of request messages consisting of A1, B2, C3 and A2 nd group of request messages consisting of C1, A3, B1, B3 and C2. Wherein, each request message in the 1 st group request message corresponds to the group attribute 1, and the 2 nd group request message corresponds to the group attribute 2. According to the determined two grouping attributes, the TCP connection corresponding to the two grouping attributes can be determined, and the method can be understood as determining 3 back-end servers corresponding to each group of request messages according to the determined two grouping attributes.
Step 103: and determining available established TCP connections corresponding to each packet attribute according to the packet attribute of each group of request messages, wherein each established TCP connection corresponds to one packet attribute.
In the embodiment of the application, the grouping attribute of each request message included in the same group of request messages is the same, and the grouping attribute is the same, which can be understood that each request message in the same group of request messages corresponds to the same TCP connection, and can also be understood that each message in the same group of request messages corresponds to the same back-end server.
In an alternative embodiment of the present application, the step 103 may be specifically implemented by the following process:
Step 3-1): determining whether TCP connections corresponding to each group of grouping attributes are stored in a connection pool according to the grouping attributes of each group of request messages;
Step 3-2): and if the corresponding TCP connection is stored in the connection pool, acquiring the available established TCP connection from the connection pool.
In order to reduce the number of times of establishing connection with the back-end server, the proxy server can maintain a connection pool, when the connection between the client and the back-end server is disconnected, the corresponding connection between the proxy server and the back-end server is not disconnected, but the proxy server is put into a connection pool maintained by the proxy server, and when a new request message of the client meeting the condition is dispatched to the same back-end server, the proxy server can take out the connection with the back-end server from the maintained connection pool to process the request message.
For the determined grouping attribute corresponding to each group of request messages, the proxy server firstly determines whether TCP connection corresponding to the grouping attribute of the group of request messages exists from a connection pool maintained by the proxy server, and if so, the proxy server can directly utilize the existing TCP connection corresponding to the grouping attribute to send the group of request messages.
In an alternative embodiment of the present application, the step 3-2) may be implemented by:
step 3-2-1): if the corresponding TCP connection is stored in the connection pool, determining whether the bandwidth of the TCP connection does not exceed a bandwidth threshold;
Step 3-2-2): and if the bandwidth threshold is not exceeded, acquiring available established TCP connection from the connection pool.
After determining that the TCP connection corresponding to the packet attribute of each group of request messages exists in the connection pool maintained by the proxy server, the proxy server also needs to judge whether the bandwidth of the TCP connection corresponding to each group of request messages exceeds a bandwidth threshold value, and the step is to realize load balancing, so as to avoid the influence on the processing speed of the request messages or the loss of response information due to overlarge load between the proxy server and the corresponding back-end server.
In an alternative embodiment of the present application, if the available established TCP connection corresponding to the packet attribute cannot be determined, the TCP connection is established with the corresponding backend server.
For the packet attribute corresponding to each group of request messages, if the proxy server cannot determine the available established TCP connection corresponding to the packet attribute, or it may be understood that if the proxy server determines that the TCP connection is not established with the backend server corresponding to the packet attribute, the proxy server needs to first perform an operation of establishing the TCP connection with the backend server corresponding to the packet attribute.
As shown in fig. 2, before sending the 1 st group request message to the server 1, the proxy server needs to confirm whether a TCP connection is established between the proxy server and the server 1, and if not, needs to establish a TCP connection with the server 1 first, and then sends the 1 st group request message. Similarly, before sending the 2 nd group request message to the server 2, the proxy server needs to confirm whether a TCP connection is established between the proxy server and the server 2, and if not, needs to establish a communication connection with the server 2 first, and then sends the 2 nd group request message.
Step 104: based on the connection multiplexing of the available established TCP connection, the request message of each packet attribute is sent to a corresponding back-end server which can realize the partial function of the destination server.
In the embodiment of the application, for each group of request messages, after each group of request messages is required to be encapsulated according to a communication protocol between a proxy server and a back-end server, each encapsulated group of request messages is sent to the back-end server corresponding to the grouping attribute of the group of request messages.
In an alternative embodiment of the present application, a communication protocol between the proxy server and the client, and between the proxy server and the backend server is HTTP2.
In the embodiment of the application, the HTTP2 communication protocol between the proxy server client and the back-end server supports parallel processing of a plurality of request messages and a plurality of response messages, and the request messages have no dependency relationship and the response messages have no dependency relationship.
In an optional embodiment of the present application, the proxy server records a correspondence between the client and the request message, so as to ensure that when receiving the response information of the backend server, the proxy server can determine the corresponding client.
The proxy server not only sends the request message of each grouping attribute to the corresponding back-end server based on the established TCP connection, but also records the connection information between each request message and the client, wherein the connection information can be specifically understood as the corresponding relation between the request message and the client; or the proxy server records the connection information between the request message and the client and the back-end server, and at this time, the connection information can be specifically understood as the corresponding relation between the request message and the client and the back-end server.
After receiving each request message, the back-end server can generate corresponding response based on the specific content of the request message. Based on the record of the connection information, the proxy server firstly determines a request message corresponding to the response information after receiving the response information sent by the back-end server, so as to determine which client needs to be specifically sent with the response information based on the recorded connection information.
For example, after receiving the response information sent by the back-end server 1 or the back-end server 2, the proxy server can determine that the response information is specific to the response information corresponding to the request message, for example, after receiving the response information a11 sent by the back-end server 1, the proxy server determines that the response information a11 is the response information corresponding to the request message A1, and further, based on the recorded client corresponding to the request message A1, the proxy server can determine that the response information a11 needs to be sent to the client 1.
In an alternative embodiment of the present application, the proxy server encapsulates each response message corresponding to each received request message according to a transmission protocol between the proxy server and the client, and then sends each response message to the corresponding client.
In an alternative embodiment of the application, the proxy server maintains a TCP connection with each back-end server in the event that the connection with the client is broken.
Taking the client 1 shown in fig. 2 as an example, after the request messages A1, A2 and A3 sent by the client 1 each receive corresponding response information, the client 1 disconnects from the proxy server, but the TCP connection between the proxy server and the back-end server 1 and the back-end server 2 is not disconnected, and the proxy server still maintains the TCP connection between the proxy server and the back-end server 1 and the back-end server 2in the connection pool. When the client 1 sends a request message to the back-end server 1 or the back-end server 2 again, the proxy server can directly take out the connection with the back-end server 1 or the back-end server 2 from the connection pool and use the connection.
The technical scheme of the embodiment of the application can enable the same connection between the proxy server and the back-end server to be used by a plurality of clients, realize the processing of a plurality of request messages sent by the plurality of clients, realize the multi-to-multi connection multiplexing effect between the plurality of clients and the plurality of back-end servers under the condition that the plurality of clients and the plurality of back-end servers exist simultaneously, remarkably improve the utilization rate of the connection between the proxy server and the server and improve the response speed of the request messages sent by the plurality of clients.
According to the technical scheme, on one hand, the number of connections between the proxy server and the back-end server is guaranteed, the proxy server is prevented from maintaining more TCP connections, and on the other hand, the request message sent to a certain back-end server for processing can be guaranteed to be of one type or only achieve one purpose, so that development, maintenance and upgrading of back-end service are facilitated.
Fig. 3 is a schematic diagram of information interaction between a proxy server and a client and a back-end server according to an embodiment of the present application, and a specific processing procedure of a request message sent by the proxy server to the client and response information returned by the back-end server is illustrated by taking fig. 3 as an example.
The client sends a plurality of requests to the proxy server in parallel S301.
The same client may send multiple requests to the proxy server at the same time, or different clients may send multiple requests to the proxy server at the same time.
S302, the proxy server analyzes the requests, groups the requests according to preset rules, and determines grouping attributes corresponding to each group of requests.
After receiving a plurality of request messages, the proxy server determines the grouping attribute corresponding to each request according to preset rules (such as the type of the resource, the security level, the priority level and the like) or understands the grouping attribute as a corresponding back-end server.
S303, checking whether TCP connection corresponding to each packet attribute exists, if so, directly using the TCP connection, and if not, establishing the TCP connection with a back-end server corresponding to the packet attribute.
When sending a request message to a target back-end server, the proxy server determines whether to establish TCP connection with the back-end server, and if the TCP connection is not established, the proxy server firstly executes the operation of establishing the TCP connection with the back-end server.
S304, establishing connection with a back-end server.
The proxy server sends a connection request to the back-end server requesting to establish a communication connection with the back-end server.
And S305, establishing connection with a proxy server.
And the back-end server establishes TCP connection with the proxy server after receiving the connection request sent by the proxy server.
And S306, recording the connection information between the client corresponding to each request and the back-end server.
After determining the back-end server corresponding to each request message, the proxy server can record the connection information between the request message and the corresponding client and the corresponding back-end server.
S307 rewrites/encapsulates the original request, generating a new request.
For the received request message, the proxy server encapsulates the request message according to a transmission protocol between the proxy server and the back-end server, so that the format of the request message accords with the transmission protocol between the proxy server and the back-end server.
And S308, sending a request to a back-end server.
After the proxy server encapsulates the request message, the encapsulated request message is sent to the corresponding back-end server.
S309, the back-end server receives the request and replies.
After receiving the request message forwarded by the proxy server, the back-end server responds to the request message according to the specific content of the request message request, and generates response information corresponding to the request message.
S310, receiving a back-end server response.
The proxy server receives the response information corresponding to the request message.
And S311, determining the client corresponding to the response according to the recorded connection information.
After receiving the response information, the proxy server determines which request message the response information specifically corresponds to, and determines which client needs to forward the response information to based on the original client corresponding to the request message.
And S312, repackaging the response information and sending the response information to the client.
After determining the client corresponding to the response information, the proxy server encapsulates the response information according to a transmission protocol between the proxy server and the client and sends the response information to the client.
And S313, sending response information to the client.
The proxy server sends the encapsulated response information to the client.
And S314, disconnecting the client from the proxy server after confirming the responses of all the requests.
And the client side disconnects the connection with the proxy server after confirming that all the request messages are responded according to whether all the received request messages sent by each response information determiner receive corresponding responses.
And S315, disconnecting the client from the proxy server.
The client determines that all the request messages are responded and then disconnects the proxy server.
S316, disconnect from the client, but still maintain the connection with the backend server.
After the proxy server is disconnected with the client, the connection with the back-end server is still maintained, the connection information is maintained in a connection pool of the proxy server, and when the client sends a request message to the back-end server again, the proxy server can directly utilize the communication connection with the back-end server to send the request message and receive response information.
Fig. 4 is a schematic structural diagram of a connection multiplexing device according to an embodiment of the present application, where the connection multiplexing device is applied to a proxy server, and as shown in fig. 4, the connection multiplexing device according to the embodiment of the present application includes:
An obtaining unit 401, configured to obtain a request packet sent by at least one client to a destination server;
A grouping unit 402, configured to group the request messages based on a preset grouping rule, and determine a grouping attribute of each group of request messages;
a determining unit 403, configured to determine, according to the packet attribute of each group of request packets, an available established TCP connection corresponding to each packet attribute, where each established TCP connection corresponds to one packet attribute;
and a sending unit 404, configured to send, based on connection multiplexing of the available established TCP connection, a request packet of each packet attribute to a corresponding backend server that can implement a function of the destination server portion.
In an alternative embodiment of the present application, the determining unit 403 is specifically configured to: determining whether TCP connections corresponding to each group of grouping attributes are stored in a connection pool according to the grouping attributes of each group of request messages; and if the corresponding TCP connection is stored in the connection pool, acquiring the available established TCP connection from the connection pool.
In an alternative embodiment of the present application, the determining unit 403 is specifically configured to: if the corresponding TCP connection is stored in the connection pool, determining whether the bandwidth of the TCP connection does not exceed a bandwidth threshold; and if the bandwidth threshold is not exceeded, acquiring available established TCP connection from the connection pool.
In an alternative embodiment of the present application, the apparatus further includes:
A connection unit 405, configured to, if the available established TCP connection corresponding to the packet attribute cannot be determined, establish a TCP connection with the corresponding backend server.
In an alternative embodiment of the present application, the apparatus further includes:
and the recording unit 406 is configured to record a correspondence between the client and the request message, so as to ensure that when the response information of the backend server is received, the corresponding client can be determined.
In an alternative embodiment of the present application, the apparatus further includes:
A maintaining unit 407, configured to maintain a TCP connection with each back-end server in a case where a connection with a client is disconnected.
In an alternative embodiment of the present application, a communication protocol between the proxy server and the client, and between the proxy server and the backend server is HTTP2.
Those skilled in the art will appreciate that the implementation functions of the units in the connection multiplexing apparatus shown in fig. 4 can be understood with reference to the foregoing description of the connection multiplexing method. The functions of the units in the connection multiplexing apparatus shown in fig. 4 may be realized by a program running on a processor or by a specific logic circuit.
The embodiment of the application also provides electronic equipment. Fig. 5 is a schematic hardware structure of an electronic device according to an embodiment of the present application, as shown in fig. 5, the electronic device includes: a communication component 503 for data transmission, at least one processor 501 and a memory 502 for storing a computer program capable of running on the processor 501. The various components in the terminal are coupled together by a bus system 504. It is to be appreciated that bus system 504 is employed to enable connected communications between these components. The bus system 504 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration, the various buses are labeled as bus system 504 in fig. 5.
Wherein the processor 501, when executing the computer program, performs at least the steps of the method shown in fig. 1.
It is to be appreciated that memory 502 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. The non-volatile Memory may be, among other things, a Read Only Memory (ROM), a programmable Read Only Memory (PROM, programmable Read-Only Memory), erasable programmable Read-Only Memory (EPROM, erasable Programmable Read-Only Memory), electrically erasable programmable Read-Only Memory (EEPROM, ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory), Magnetic random access Memory (FRAM, ferromagnetic random access Memory), flash Memory (Flash Memory), magnetic surface Memory, optical disk, or compact disk-Only (CD-ROM, compact Disc Read-Only Memory); The magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be random access memory (RAM, random Access Memory) which acts as external cache memory. by way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM, static Random Access Memory), synchronous static random access memory (SSRAM, synchronous Static Random Access Memory), dynamic random access memory (DRAM, dynamic Random Access Memory), synchronous dynamic random access memory (SDRAM, synchronous Dynamic Random Access Memory), and, double data rate synchronous dynamic random access memory (DDRSDRAM, double Data Rate Synchronous Dynamic Random Access Memory), enhanced synchronous dynamic random access memory (ESDRAM, enhanced Synchronous Dynamic Random Access Memory), synchronous link dynamic random access memory (SLDRAM, syncLink Dynamic Random Access Memory), direct memory bus random access memory (DRRAM, direct Rambus Random Access Memory). the memory 502 described in embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the above embodiment of the present application may be applied to the processor 501 or implemented by the processor 501. The processor 501 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware or instructions in software in the processor 501. The processor 501 may be a general purpose processor, DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 501 may implement or perform the methods, steps and logic blocks disclosed in embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiment of the application can be directly embodied in the hardware of the decoding processor or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium in memory 502 and processor 501 reads information in memory 502 to perform the steps of the method described above in connection with its hardware.
In an exemplary embodiment, the electronic device may be implemented by one or more Application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs, programmable Logic Device), complex programmable logic devices (CPLDs, complex Programmable Logic Device), FPGAs, general purpose processors, controllers, MCUs, microprocessors, or other electronic elements for performing the foregoing methods of traveling.
An embodiment of the application also provides a computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, is at least adapted to carry out the steps of the method shown in fig. 1. The computer readable storage medium may be a memory in particular. The memory may be the memory 502 shown in fig. 5.
The technical schemes described in the embodiments of the present application may be arbitrarily combined without any collision.
In several embodiments provided by the present application, it should be understood that the disclosed method and intelligent device may be implemented in other manners. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one second processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application.

Claims (10)

CN202110721982.3A2021-06-282021-06-28Connection multiplexing method and device, electronic equipment and storage mediumActiveCN113472875B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110721982.3ACN113472875B (en)2021-06-282021-06-28Connection multiplexing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110721982.3ACN113472875B (en)2021-06-282021-06-28Connection multiplexing method and device, electronic equipment and storage medium

Publications (2)

Publication NumberPublication Date
CN113472875A CN113472875A (en)2021-10-01
CN113472875Btrue CN113472875B (en)2024-10-22

Family

ID=77873414

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110721982.3AActiveCN113472875B (en)2021-06-282021-06-28Connection multiplexing method and device, electronic equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN113472875B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115834655B (en)*2022-10-262025-01-03支付宝(杭州)信息技术有限公司 Method and device for accessing a server in a private network
CN116668514A (en)*2023-06-272023-08-29福建天泉教育科技有限公司 A TCP connection multiplexing method and terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105743812A (en)*2014-12-262016-07-06英特尔公司Multiplexing many client streams over a single connection
CN111314434A (en)*2020-01-202020-06-19山东汇贸电子口岸有限公司Request processing method and server
CN112910793A (en)*2019-12-042021-06-04中国电信股份有限公司Method for connection multiplexing in seven-layer load balancing and load balancer

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8996657B2 (en)*2010-09-012015-03-31Canon Kabushiki KaishaSystems and methods for multiplexing network channels
US8806043B1 (en)*2011-06-242014-08-12Juniper Networks, Inc.Server selection during retransmit of a request
CN109088892B (en)*2018-10-192021-02-12网宿科技股份有限公司Data transmission method, system and proxy server
CN112583874B (en)*2019-09-302024-02-20中兴通讯股份有限公司Message forwarding method and device of heterogeneous network
CN110784553B (en)*2019-11-052021-12-21南京亚信智网科技有限公司Message encapsulation method, device and domain name resolution system
CN112104744B (en)*2020-03-302022-09-09厦门网宿有限公司Traffic proxy method, server and storage medium
CN112422609A (en)*2020-08-312021-02-26上海哔哩哔哩科技有限公司Programming device and service request connection method
CN112839087A (en)*2021-01-062021-05-25深圳市芯中芯科技有限公司Cluster-based multi-terminal control method and system
CN112968945B (en)*2021-02-012023-01-24北京字跳网络技术有限公司 Current limiting method, device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105743812A (en)*2014-12-262016-07-06英特尔公司Multiplexing many client streams over a single connection
CN112910793A (en)*2019-12-042021-06-04中国电信股份有限公司Method for connection multiplexing in seven-layer load balancing and load balancer
CN111314434A (en)*2020-01-202020-06-19山东汇贸电子口岸有限公司Request processing method and server

Also Published As

Publication numberPublication date
CN113472875A (en)2021-10-01

Similar Documents

PublicationPublication DateTitle
CN110401592B (en)Method and equipment for data transfer in message channel
US11907700B2 (en)Upgrading method and system, server, and terminal device
CN114124929B (en) Cross-network data processing methods and devices
CN111371892A (en)High-concurrency distributed message pushing system and method
CN105991412B (en)Information push method and device
CN113472875B (en)Connection multiplexing method and device, electronic equipment and storage medium
CN109857572B (en)Method, device and equipment for realizing remote calling and computer readable storage medium
CN112187903B (en)Message pushing method and device and message service system
US9906626B2 (en)Resource demand-based network page generation
CN115225706B (en) Data transmission method, device, vehicle and storage medium
CN113315706B (en)Private cloud flow control method, device and system
CN109271259B (en) Enterprise service bus system, data processing method, terminal and storage medium
CN113746851B (en)Proxy system and method supporting real-time analysis of GRPC request
US8825735B2 (en)Public BOT management in private networks
CN113965628B (en)Message scheduling method, server and storage medium
CN113765871B (en)Method and device for managing fort machine
EP3276914A1 (en)Data sharing method and device for virtual desktop
CN112929453A (en)Method and device for sharing session data
CN112865927B (en)Message delivery verification method, device, computer equipment and storage medium
CN111988283A (en)Data transmission method, system, device and computer readable storage medium
CN112769960B (en)Active flow control method and system based on Nginx server
CN112835728B (en)Message processing method, device, computer equipment and storage medium
CN119996483B (en) Business processing method, device, business system and equipment, computer program product
CN113419878B (en)Data operation method and device
CN114116258B (en)Queue manager hot standby method, system, terminal and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp