Data request processing method, device, computer equipment and storage medium
By establishing a quick connection between the front-end server and the client and the back-end server, directly migrating data requests to the back-end server and establishing a pseudo-connection, the problem that the back-end server does not have response data is solved, and the transmission performance and throughput are improved.
Patent Information
- Application Number
- CN202310150980.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-07
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-02-07
AI Technical Summary
In the prior art, when a client requests data from the front-end server, the back-end server may not have response data, resulting in high bandwidth requirements, long latency and low transmission performance.
By establishing a first quick connection between the front-end server and the client, determining the back-end server and creating a second quick connection with the back-end server, the data request is migrated to the back-end server, and the back-end server directly establishing a pseudo connection with the client and sending data packets.
Reduces latency and communication overhead between servers, improves transmission performance, reduces downlink traffic pressure on front-end servers, and improves uplink throughput.
Smart Images

Figure CN118474103B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer network technology, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for processing data requests. Background Art
[0002] With the development of the internet, users are increasingly demanding higher transmission performance. In related technologies, a client initiates a request to a front-end server. The front-end server uses load balancing to determine the back-end server that should respond to the request. The back-end server then sends the response data to the front-end server, which then sends the response data to the client. Determining the back-end server through load balancing can easily lead to situations where the back-end server does not have the response data corresponding to the request. Consequently, the back-end server needs to retrieve the response data through a back-end connection, resulting in high bandwidth requirements, long latency, and poor transmission performance. Summary of the Invention
[0003] Based on this, it is necessary to provide a data request processing method, device, computer equipment, computer-readable storage medium and computer program product to address the above technical problems, which can reduce latency and improve transmission performance.
[0004] In a first aspect, the present application provides a method for processing a data request. The method comprises:
[0005] A data request sent by a client is received through a first quick connection; a back-end server to be scheduled is determined based on the data request, and a second quick connection is created; the second quick connection is a quick connection between the back-end server and the back-end server; the data request is migrated to the back-end server based on the second quick connection to instruct the back-end server to create a pseudo connection between the client and the back-end server, and a data packet corresponding to the data request is sent to the client based on the pseudo connection.
[0006] In a second aspect, the present application provides a method for processing a data request. The method comprises:
[0007] Receive a data request for migration from the front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection; in response to the data request, create a pseudo connection with the client, and obtain target data corresponding to the data request; send a data packet encapsulating the target data to the client through the pseudo connection.
[0008] In a third aspect, the present application further provides a device for processing data requests. The device includes:
[0009] A data request receiving module is used to receive a data request sent by a client through a first quick connection; a back-end server scheduling module is used to determine the back-end server to be scheduled based on the data request and create a second quick connection; the second quick connection is a quick connection between the back-end server and the back-end server; a first data request migration module is used to migrate the data request to the back-end server based on the second quick connection, so as to instruct the back-end server to create a pseudo connection between the client and the back-end server, and send a data packet corresponding to the data request to the client based on the pseudo connection.
[0010] In a fourth aspect, the present application further provides a data request processing device. The device includes:
[0011] The second data request migration module is used to receive the data request for migration from the front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection; the target data acquisition module is used to create a pseudo connection with the client in response to the data request, and obtain the target data corresponding to the data request; the data packet sending module is used to send a data packet encapsulating the target data to the client through the pseudo connection.
[0012] In a fifth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0013] Receive a data request sent by a client through a first fast connection; determine a backend server to be scheduled based on the data request and create a second fast connection; the second fast connection is a fast connection between the backend server and the client; migrate the data request to the backend server based on the second fast connection to instruct the backend server to create a pseudo connection between the client and the client, and send a data packet corresponding to the data request to the client based on the pseudo connection; or
[0014] Receive a data request for migration from the front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection; in response to the data request, create a pseudo connection with the client, and obtain target data corresponding to the data request; send a data packet encapsulating the target data to the client through the pseudo connection.
[0015] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0016] Receive a data request sent by a client through a first fast connection; determine a backend server to be scheduled based on the data request and create a second fast connection; the second fast connection is a fast connection between the backend server and the client; migrate the data request to the backend server based on the second fast connection to instruct the backend server to create a pseudo connection between the client and the client, and send a data packet corresponding to the data request to the client based on the pseudo connection; or
[0017] Receive a data request for migration from the front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection; in response to the data request, create a pseudo connection with the client, and obtain target data corresponding to the data request; send a data packet encapsulating the target data to the client through the pseudo connection.
[0018] In a seventh aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0019] Receive a data request sent by a client through a first fast connection; determine a backend server to be scheduled based on the data request and create a second fast connection; the second fast connection is a fast connection between the backend server and the client; migrate the data request to the backend server based on the second fast connection to instruct the backend server to create a pseudo connection between the client and the client, and send a data packet corresponding to the data request to the client based on the pseudo connection; or
[0020] Receive a data request for migration from the front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection; in response to the data request, create a pseudo connection with the client, and obtain target data corresponding to the data request; send a data packet encapsulating the target data to the client through the pseudo connection.
[0021] The above-mentioned data request processing method, device, computer equipment, storage medium and computer program product are as follows: the front-end server receives the data request sent by the client through a first fast connection between the front-end server and the client, determines the back-end server to be scheduled according to the data request, and the front-end server migrates the data request to the back-end server through a second fast connection between the front-end server and the back-end server, so that the back-end server creates a pseudo connection between the back-end server and the client, and the back-end server directly sends the data packet corresponding to the data request to the client based on the pseudo connection. The front-end server performs request-level scheduling and determines that the back-end server to be scheduled has data to respond to the data request, so that the back-end server can directly respond to the data request without returning to the source to obtain the data to respond to the data request, thereby reducing latency and communication overhead between servers; the back-end server directly sends the data packet to the client through the pseudo connection, rather than the back-end server sending the data packet to the front-end server, and then the front-end server sending the data packet to the client, thereby reducing bandwidth consumption between the back-end server and the front-end server, reducing the pressure on the downstream traffic of the front-end server, improving the upstream throughput of the front-end server, reducing latency, and improving transmission performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 FIG. 1 is an application environment diagram of a method for processing a data request in one embodiment;
[0023] Figure 2 1 is a flow chart of a method for processing a data request in one embodiment;
[0024] Figure 3 A schematic diagram of a loop duration corresponding to delayed confirmation in one embodiment;
[0025] Figure 4 A schematic diagram of a front-end server delaying a response to a first confirmation frame in one embodiment;
[0026] Figure 5 A schematic diagram of a method for processing a data request in one scenario embodiment;
[0027] Figure 6 is a flowchart of a method for processing a data request in another embodiment;
[0028] Figure 7 1 is a flow chart of a method for processing a data request in yet another embodiment;
[0029] Figure 8 1 is a flow chart of a method for processing a data request in yet another embodiment;
[0030] Figure 9 A schematic diagram of a process of sending a second data packet and a third data packet by a back-end server in one embodiment;
[0031] Figure 10 A schematic diagram of a backend server sending a retransmitted data packet in one embodiment;
[0032] Figure 11 A schematic diagram of a method for processing a data request in another scenario embodiment;
[0033] Figure 12 1 is a flow chart of a method for processing a data request in yet another embodiment;
[0034] Figure 13 is a structural block diagram of a data request processing device in one embodiment;
[0035] Figure 14 A structural block diagram of a data request processing device in another embodiment;
[0036] Figure 15 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0038] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0039] Cloud technology is a general term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies based on the cloud computing business model. It can form a resource pool that can be used flexibly and conveniently on demand. Cloud computing technology will become a crucial support. Backend services for technical network systems, such as video websites, image websites, and more portals, require extensive computing and storage resources. With the rapid development and application of the internet industry, every item will likely have its own unique identifier, requiring transmission to backend systems for logical processing. Different levels of data will be processed separately, and data from various industries will require a strong system backend, which can only be achieved through cloud computing.
[0040] In some embodiments, the data request processing method provided in the embodiments of the present application can be applied to Figure 1In the application environment shown, the client 102, the front-end server 104, and the back-end server 106 communicate via a network. The data storage system of the front-end server 104 can store data that the front-end server 104 needs to process. The data storage system of the front-end server 104 can be integrated on the front-end server 104, or it can be located in the cloud or on another network server. The data storage system of the back-end server 106 can store data that the back-end server 106 needs to process. The data storage system of the back-end server 106 can be integrated on the back-end server 106, or it can be located in the cloud or on another network server.
[0041] The front-end server 104 receives the data request sent by the client 102 through the first fast connection between the front-end server 104 and the client 102. The front-end server 104 determines the back-end server 106 to be scheduled based on the data request, and creates a second fast connection between the front-end server 104 and the back-end server 106. Based on the second fast connection, the data request is migrated to the back-end server 106. The back-end server 106 responds to the data request, creates a pseudo connection between the back-end server 106 and the client 102, obtains the target data corresponding to the data request, and sends a data packet encapsulating the target data to the client 102 through the pseudo connection.
[0042] The client 102 may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, IoT device, or portable wearable device. IoT device may be a smart speaker, smart TV, smart air conditioner, or smart car device. Portable wearable device may be a smart watch, smart bracelet, or head-mounted device.
[0043] The front-end server 104 and the back-end server 106 can be independent physical servers or service nodes in a blockchain system. The service nodes in the blockchain system form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP).
[0044] In addition, the front-end server 104 and the back-end server 106 can also be a server cluster composed of multiple physical servers, which can be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0045] The client 102 can be connected to the front-end server 104 and the back-end server 106 via Bluetooth, USB (Universal Serial Bus) or network communication connection methods, and this application does not impose any restrictions on this.
[0046] In some embodiments, as Figure 2 As shown, a method for processing data request is provided. Figure 1 The client, front-end server, or back-end server in Figure 1 The client, front-end server and back-end server in the method are executed in collaboration. Figure 1 The front-end server in the example is used to illustrate the following steps:
[0047] Step 202: Receive a data request sent by a client via a first fast connection.
[0048] Among them, the fast connection is the QUIC (Quick UDP Internet Connection) connection, which is a connection created based on the QUIC protocol. QUIC is a low-latency Internet transport layer protocol based on UDP (User Datagram Protocol); the first fast connection is a fast connection between the front-end server and the client, which is used to realize data transmission between the front-end server and the client.
[0049] The data request may be a request for obtaining data. It is understood that in different application scenarios, the data required by the client may vary. For example, in a webpage loading scenario, the data request is used to obtain data for loading the webpage; in a video playback scenario, the data request is used to obtain video data for playback. There may be multiple data requests, i.e., the front-end server receives multiple concurrent data requests from the client via the first fast connection.
[0050] In some embodiments, when the client and the front-end server are quickly connected for the first time, the client initiates a connection message to the front-end server, and the front-end server responds to the connection message and sends key configuration information to the client. Through this round trip, a quick connection is created between the client and the front-end server. The client sends a data request and a key to the front-end server through the quick connection between the client and the front-end server, and the front-end server receives the data request and the key sent by the client through the quick connection between the client and the front-end server.
[0051] The front-end server can determine the session key based on the key and key configuration information, facilitating subsequent communication between the client and the front-end server based on the session key. It should be noted that when the client and the front-end server quickly connect for the first time, the client can send a data request to the front-end server in a single round trip. This means that the time cost of sending a data request is 1 RTT (Round-Trip Time).
[0052] When the client is not connected to the front-end server for the first time quickly, the client saves the key configuration information obtained during the first quick connection. When the client is not connected for the first time quickly, the client can directly send data requests and key configuration information to the front-end server. That is to say, when the client is not connected for the first time quickly, the client can directly send data requests to the front-end server, that is, the time cost of sending data requests is 0RTT.
[0053] In related technologies, most connections require at least 2RTT to establish a connection, resulting in higher latency. However, through QUIC connection, when it is not the first quick connection, 0RTT can be achieved to establish a QUIC connection, which reduces latency and reduces the traffic consumption of the front-end server and client during the handshake phase.
[0054] Step 204: Determine the backend server to be scheduled based on the data request, and create a second fast connection; the second fast connection is a fast connection with the backend server.
[0055] The backend server is a server that provides services to the client, and stores data that responds to data requests.
[0056] Among them, the second fast connection is the QUIC connection between the front-end server and the back-end server, which is used to realize data transmission between the front-end server and the back-end server.
[0057] In some embodiments, the front-end server forwards the received data request to the dispatch center. The dispatch center determines the address of the back-end server that responds to the data request based on the data request. The front-end server obtains the address of the back-end server sent by the dispatch center to determine the back-end server to be scheduled. The front-end server establishes a second fast connection between the back-end servers corresponding to the addresses of the back-end servers.
[0058] After creating a second quick connection between the front-end server and the back-end server, the second quick connection can be associated with the flow identifier corresponding to the data request, so as to facilitate the subsequent determination of the second quick connection based on the flow identifier corresponding to the data request, and through the second quick connection, data transmission related to the data request can be performed between the front-end server and the back-end server.
[0059] In some embodiments, the front-end server may forward data requests to the dispatch center using the QUIC protocol, or may forward data requests to the dispatch center using the HTTP / 2 protocol or the HTTP / 3 protocol. The HTTP / 2 protocol is the Hypertext Transfer Protocol version 2, and the HTTP / 3 protocol is the Hypertext Transfer Protocol version 3. The dispatch center may or may not be located in the same physical device as the front-end server.
[0060] In some embodiments, when a client sends multiple data requests to a front-end server concurrently, the front-end server forwards the multiple data requests to a scheduling center to obtain the back-end servers corresponding to the multiple data requests. The back-end servers corresponding to each data request have data to respond to the corresponding data requests; the front-end server creates a second quick connection between the back-end servers corresponding to the multiple data requests to achieve request-level scheduling; it should be noted that when there are at least two data requests corresponding to the same back-end server among the multiple data requests, the at least two data requests correspond to the same second quick connection.
[0061] In the embodiment of the present application, the address of the back-end server that actually responds to the data request is determined by the scheduling center to perform request-level scheduling, rather than determining the server address through load balancing. The back-end server determined based on the data request has the data to respond to the data request, and there is no need to return to the source to obtain the data to respond to the data request, thereby reducing latency and communication overhead between servers. Without changing the existing logic of the client, fine-grained scheduling at the request level can be performed, thereby improving disaster recovery capabilities.
[0062] Step 206: Migrate the data request to the backend server based on the second fast connection, instruct the backend server to create a pseudo connection with the client, and send a data packet corresponding to the data request to the client based on the pseudo connection.
[0063] A pseudo-connection is a fast connection between a backend server and a client. The backend server acts as a pseudo-server for the frontend server, transmitting data to the client over the pseudo-connection. A data packet encapsulates the target data in response to a data request. Multiple data packets are sent from the backend server to the client.
[0064] In some embodiments, the front-end server uses the HTTP / 3 protocol to send a data request carrying initial signaling to the back-end server through a first fast connection to achieve migration of the data request. The back-end server performs context recovery based on the data request and the initial signaling, and creates a pseudo connection with the client to disguise the back-end server as a front-end server that directly communicates with the client. The back-end server obtains the target data in response to the data request and sends a data packet corresponding to the target data to the client based on the pseudo connection. The back-end server directly sends the data packet corresponding to the target data in response to the data request to the client, which implements the DSR (Direct Server Return) method of sending data packets, rather than the back-end server sending the data packet to the front-end server, and then the front-end server sending the data packet to the client. This reduces bandwidth consumption between the back-end server and the front-end server, reduces the pressure on the downstream traffic of the front-end server, improves the upstream throughput of the front-end server, reduces latency, and improves transmission performance.
[0065] Among them, the initial signaling includes initial information for creating a pseudo connection; the initial signaling includes but is not limited to: a connection identifier, a flow identifier and a four-tuple; the connection identifier is the identifier of the first fast connection, the flow identifier is the identifier of the data flow corresponding to the data request, and the four-tuple includes: the Internet Protocol address (IP address) and port (PORT) of the client, and the IP address and PORT of the front-end server. If the data request and the initial signaling are sent separately, when head-of-line blocking occurs, the back-end server will need to continue to wait for the initial signaling after receiving the data request, resulting in a higher delay. Forwarding the data request carrying the initial signaling to the back-end server allows the back-end server to receive the data request and the initial signaling at the same time, reducing the delay.
[0066] In actual applications, the front-end server extends the HTTP / 3 header field and forwards the data request carrying the initial signaling to the back-end server; the HTTP / 3 header field can be extended to multiple lines, and the initial signaling and data request are sent to the back-end server together through the extended header field.
[0067] It should be noted that other protocols may also be used to send the data request carrying the initial signaling to the backend server through the first fast connection to achieve migration of the data request, such as the HTTP / 2 protocol.
[0068] In some embodiments, when a client makes multiple data requests concurrently, the back-end server corresponding to each of the multiple data requests receives the data request migrated by the front-end server through the corresponding second fast connection, creates a pseudo connection with the client, and sends the data packet corresponding to the data request to the client through the pseudo connection; the back-end server corresponding to each of the multiple data requests directly sends the corresponding data packet to the client, dispersing the downlink traffic to different paths, reducing the congestion of a single path, and improving transmission efficiency.
[0069] In some embodiments, the front-end server is configured with an edge data center (OC, Outer Center), and the back-end server is configured with an edge fog computing node (FOG). Compared with OC, FOG is closer to the client, so sending data packets directly to the client through the back-end server can reduce latency and improve transmission efficiency.
[0070] In the above embodiment, the front-end server receives the data request sent by the client through the first fast connection between the front-end server and the client, determines the back-end server to be scheduled according to the data request, and the front-end server migrates the data request to the back-end server through the second fast connection between the front-end server and the back-end server, so that the back-end server creates a pseudo connection between the client and the client, and the back-end server directly sends the data packet corresponding to the data request to the client based on the pseudo connection. The front-end server performs request-level scheduling and determines that the back-end server to be scheduled has the data to respond to the data request, so that the back-end server can directly respond to the data request without returning to the source to obtain the data to respond to the data request, thereby reducing latency and communication overhead between servers; the back-end server directly sends the data packet to the client through the pseudo connection, rather than the back-end server sending the data packet to the front-end server, and then the front-end server sending the data packet to the client, thereby reducing bandwidth consumption between the back-end server and the front-end server, reducing the pressure on the downstream traffic of the front-end server, and improving the upstream throughput of the front-end server, reducing latency, and improving transmission performance.
[0071] In some embodiments, the method for processing data requests also includes: when the data request migration is completed, receiving the migration completion instruction sent by the back-end server based on the first unidirectional flow of the second fast connection; the first unidirectional flow is initiated by the back-end server; and updating the migration status of the data request based on the migration completion instruction.
[0072] Among them, unidirectional flow refers to a data flow transmitted in one direction. In the embodiment of this application, unidirectional flow refers to the unidirectional flow in the standardized version specification RFC9000 of the QUIC protocol; the first unidirectional flow is the flow in which the back-end server sends data to the front-end server.
[0073] In some embodiments, when a data request is migrated to a back-end server, the back-end server creates a first unidirectional flow of a second quick connection, and sends a migration completion instruction to the front-end server based on the first unidirectional flow of the second quick connection. The migration completion instruction includes a flow identifier corresponding to the data request. The front-end server receives the migration completion instruction based on the first unidirectional flow, and updates the migration status of the corresponding data request to a migrated status according to the flow identifier included in the migration completion instruction.
[0074] In actual applications, the back-end server encapsulates the stream data corresponding to the migration completion instruction as an ordered byte stream into a stream frame of the first unidirectional stream, and sends the stream frame through the first unidirectional stream. The front-end server caches the stream data corresponding to the migration completion instruction in sequence through the stream frame to realize the reception of the migration completion instruction based on the first unidirectional stream.
[0075] In some embodiments, before the front-end server receives the migration completion instruction corresponding to the data request, the previous state of the data request is the un-migrated state; when the time from the back-end server sending the data request to the front-end server reaches a preset timeout period and no migration completion instruction is received, the front-end server may send the data request to the back-end server again, or the front-end server may provide a service to the client in response to the data request.
[0076] In the above embodiment, the front-end server receives the migration completion instruction sent by the back-end server based on the first unidirectional flow. The back-end server can actively transmit data to the front-end server without waiting for the front-end server to establish the flow, thereby improving the real-time performance of the migration status update. Compared with the bidirectional flow, the unidirectional flow requires fewer flow control resources, thereby reducing the resources consumed by data transmission.
[0077] In some embodiments, the data packet includes a first data packet and a second data packet; the method for processing the data request also includes: receiving a first confirmation frame sent by the client based on a first quick connection; the first confirmation frame is a confirmation frame sent by the client to confirm that it has received the first data packet, and the packet number of the first data packet belongs to the first packet number interval; sending the first confirmation frame and the second packet number interval to the back-end server based on the second quick connection to instruct the back-end server to send the second data packet to the client based on the pseudo connection when it is determined that there is no packet loss based on the first confirmation frame; the packet number of the second data packet belongs to the second packet number interval.
[0078] There may be multiple first data packets, each of which is obtained by encapsulating the first portion of the target data corresponding to the data request. There may also be multiple second data packets, each of which is obtained by encapsulating the second portion of the target data. The first packet number range includes the packet numbers used to encapsulate the first data packet, and the second packet number range includes the packet numbers used to encapsulate the second data packet. It should be noted that both the first and second packet number ranges are sent from the frontend to the backend server.
[0079] In some embodiments, when the first data packet is the first data packet sent by the back-end server to the client, the first packet number interval may be the packet number interval included in the initial signaling, that is, when the data request is migrated to the back-end server, the initial signaling including the first packet number interval will be sent to the back-end server at the same time, so that the back-end server can use the packet number in the first packet number interval to send packets.
[0080] It should be noted that the first packet number interval is associated with the flow identifier corresponding to the data request. In actual applications, each packet number interval allocated by the front-end server to the back-end server corresponding to the data request is associated with the flow identifier corresponding to the data request.
[0081] In some embodiments, the back-end server encapsulates the first part of the target data based on the packet number in the first packet number interval to obtain a first data packet, and sends the first data packet to the client through a pseudo connection. After the client receives the first data packet, it obtains a connection identifier based on the first data packet, and sends a first confirmation frame to the front-end server through the first quick connection corresponding to the connection identifier. The first confirmation frame includes the packet number of the first data packet received by the client; the client informs the front-end server through the first confirmation frame that it has received the first data packet.
[0082] The front-end server receives the first confirmation frame sent by the client through the first fast connection, determines the flow identifier based on the packet number included in the first confirmation frame, determines the corresponding second fast connection based on the flow identifier, and sends the first confirmation frame and the second packet number interval to the back-end server through the second fast connection. The back-end server receives the first confirmation frame and the second packet number interval sent by the front-end server through the second fast connection. The back-end server performs packet loss detection based on the first confirmation frame. When it is determined that there is no packet loss, the second part of the target data is encapsulated by the packet number in the second packet number interval to obtain a second data packet, and sends the second data packet to the client through the pseudo connection.
[0083] In some embodiments, the number of first data packets can be multiple. The back-end server performs packet loss detection based on the packet numbers of the multiple first data packets sent and the packet numbers of the multiple first data packets received by the client included in the first confirmation frame. When it is determined that the multiple first data packets sent are all received by the client, the back-end server sends the second data packet to the client through a pseudo connection.
[0084] In the above embodiment, the front-end server forwards the received first confirmation frame to the back-end server, so that the back-end server can determine whether packet loss occurs based on the first confirmation frame. If packet loss does not occur, it continues to send the second data packet to the client. While forwarding the first confirmation frame, the front-end server allocates a second packet number interval to the back-end server, so that the back-end server has sufficient packet numbers available, avoiding the exhaustion of packet numbers of the back-end server.
[0085] In some embodiments, the data packet also includes a third data packet, and after receiving the first confirmation frame sent by the client based on the first fast connection, it also includes: receiving the second confirmation frame sent by the client based on the first fast connection; the second confirmation frame is a confirmation frame sent by the client when confirming receipt of the third data packet; the packet number of the third data packet belongs to the first packet number interval, and the packet number of the third data packet is greater than the packet number of the first data packet; after sending the first confirmation frame and the second packet number interval to the back-end server based on the second fast connection, it also includes: receiving the third confirmation frame sent by the client based on the first fast connection; the third confirmation frame is a confirmation frame sent by the client when confirming receipt of the second data packet; the packet number of the second packet number interval is greater than the packet number of the first packet number interval; and feeding back a fourth confirmation frame to the client based on the first fast connection to indicate that the client determines that the first confirmation frame has been confirmed.
[0086] The number of data requests is multiple; the second confirmation frame includes the packet number of the third data packet received by the client; the third confirmation frame includes the packet number of each second data packet received by the client; the client sends the confirmation frame in the form of a data packet; and the fourth confirmation frame includes the packet number corresponding to the first confirmation frame.
[0087] In some embodiments, the client notifies the front-end server through a first confirmation frame that the first data packet has been received, notifies the front-end server through a second confirmation frame that the third data packet has been received, and notifies the front-end server through a third confirmation frame that the second data packet has been received.
[0088] When the front-end server determines based on the third confirmation frame that the back-end server has adopted the second packet number interval to send packets, it feeds back a fourth confirmation frame to the client based on the first quick connection. The fourth confirmation frame is used to feed back to the client that the first confirmation frame has been confirmed by the front-end server.
[0089] It should be noted that the front-end server does not immediately respond to the first confirmation frame sent by the client, but responds to the first confirmation frame after determining based on the third confirmation frame that the back-end server has used the second packet number interval to send packets. This process can be called delayed confirmation.
[0090] like Figure 3 As shown, the client sends a first confirmation frame to the front-end server ( Figure 3 1), the front-end server forwards the first confirmation frame to the back-end server and allocates the second packet number interval ( Figure 3 2), the backend server sends a second data packet to the client using a packet number in the second packet number interval ( Figure 3 3), the client obtains the second data packet and sends a third confirmation frame to the front-end server ( Figure 3 4), this process Figure 3 A loop is formed in the process, and the duration of the delayed confirmation is the loop duration between the client sending the first confirmation frame to the front-end server and the client sending the third confirmation frame to the front-end server.
[0091] In some embodiments, after the client receives the fourth confirmation frame sent by the front-end server through the first quick connection, the receiving record with a packet number less than or equal to the maximum packet number in the first received data packet is deleted. If a data packet with a packet number less than or equal to the maximum packet number is subsequently received, the data packet is discarded.
[0092] Exemplarily, when performing data request migration, the front-end server sends the data request and the first packet number interval (100, 120] to the back-end server through the second fast connection. The back-end server uses the packet number (100, 110] in the first packet number interval to encapsulate the first part of the target data to obtain a first data packet. The client obtains the first data packet and sends a first confirmation frame to the front-end server through the first fast connection. After the client receives the fourth confirmation frame fed back to the first confirmation frame, the client clears the record of the packet number less than or equal to the maximum packet number (110) of the first data packet, and if the client subsequently receives a data packet with a packet number less than or equal to 110, the data packet with the packet number less than or equal to 110 is discarded.
[0093] In some embodiments, there are multiple data requests, and the front-end server sends a first packet number interval to the back-end servers corresponding to each of the multiple data requests. Each back-end server uses the packet number of its corresponding first packet number interval to send a first data packet to the client. The client receives the first data packet sent by each back-end server and sends a first confirmation frame to the front-end server; each back-end server uses the packet number of its corresponding first packet number interval to send a third data packet to the client. The client receives the third data packet sent by each back-end server and sends a second confirmation frame to the front-end server; the front-end server forwards the first confirmation frame and its corresponding second packet number interval to each back-end server. The back-end server uses its corresponding second packet number interval to send a third data packet to the client. The client receives the third data packet sent by each back-end server and sends a third confirmation frame to the front-end server. Based on the third confirmation frame, the front-end server determines that the back-end server has used the second packet number interval to send the packet, and feeds back a fourth confirmation frame to the client.
[0094] like Figure 4 As shown, taking the client's two concurrent data requests as an example, data request 1 is responded to through the backend server BE1 (BackEnd 1), and data request 2 is responded to through the backend server BE2. The first packet number interval of the backend server BE1 is (100, 120], and the first packet number interval of the backend server BE2 is (120, 140];
[0095] At time t1, the backend server BE1 encapsulates the first data packet P1 using the packet number (100,110) in the first packet number interval (100,120], and sends the first data packet P1 with the packet number (100,110) to the client. At time t2, the backend server BE2 encapsulates the first data packet P2 using the packet number (120,130) in the first packet number interval (120,140], and sends the first data packet P2 with the packet number (120,130) to the client.
[0096] The client obtains P1 and P2. At time t3, the client sends a first confirmation frame to the front-end server FE (Front End). The first confirmation frame includes the packet number range: (100, 110] and (120, 130];
[0097] At time t4, the front-end server FE receives the first confirmation frame, sends the first confirmation frame to the back-end server BE1 and the back-end server BE2, and sends the second packet number interval (140,160] to the back-end server BE1, and sends the second packet number interval (160,180] to the back-end server BE2 (as shown in FIG. Figure 4 (indicated by the dashed line);
[0098] At time t5, the backend server BE1 encapsulates the third data packet with the packet number (110, 120) in the first packet number interval (100, 120) and sends the third data packet P3 with the packet number (110, 120) to the client.
[0099] At time t6, the client receives the third data packet P3 and sends a second confirmation frame to the front-end server FE; the back-end server BE1 receives the first confirmation frame and the second packet number interval (140, 160], and the back-end server BE2 receives the first confirmation frame and the second packet number interval (160, 180];
[0100] At time t7, the backend server BE1 encapsulates the second data packet P4 using the packet number (140, 150) in the second packet number interval (140, 160]. At time t8, the backend server BE2 encapsulates the second data packet P5 using the packet number (160, 170) in the second packet number interval (160, 180).
[0101] The client obtains P4 and P5. At time t9, the client sends a third confirmation frame to the front-end server FE. The packet number range included in the third confirmation frame is: the union of the packet numbers of P1, P2, P3, P4 and P5;
[0102] At time t10, the front-end server FE receives the third confirmation frame, determines based on the third confirmation frame that the back-end servers BE1 and BE2 have adopted the second packet number interval to send packets, and sends a fourth confirmation frame to the client;
[0103] At time t11, after receiving the fourth confirmation frame for the first confirmation frame, the client determines that the first confirmation frame has been confirmed by the front-end server FE, and deletes the reception record with a packet number less than or equal to the maximum packet number of the received first data packet (the maximum packet number in this example is 130). If a data packet with a packet number less than or equal to 130 is received subsequently, the data packet is discarded;
[0104] Before the back-end server receives the second packet number interval, the back-end server can also use the packet number of the first packet number interval to send packets. For example, at time t5, the packet numbers corresponding to P3 sent by the back-end server BE1 are all less than 130. When the client receives P3, the client has not received the fourth confirmation frame. Therefore, P3 will not be discarded by the client, which reduces the packet loss rate of the data transmission process, thereby reducing the bandwidth resources consumed by retransmitted data packets and improving transmission performance.
[0105] In the related art, after receiving the confirmation frame sent by the client, the front-end server immediately responds to the confirmation frame. For example, in the above example, the client sends a first confirmation frame to the front-end server at time t3, and the front-end server immediately responds to the confirmation frame. The client receives a confirmation frame fed back by the front-end server for the first confirmation frame at time t5. The maximum confirmed packet number corresponding to the first confirmation frame is 130. The client will subsequently discard data packets with packet numbers less than or equal to 130. For example, at time t6, the data packet P3 with a packet number of (110, 120] received by the client will be discarded.
[0106] In the above embodiment, when the front-end server receives the first confirmation frame sent by the client based on the received first data packet, it does not immediately respond to the first confirmation frame, and the packet sending action of the back-end server is continuous. Therefore, after each back-end server sends the first data packet, it will also use the first packet number interval to send the third data packet. When the front-end server determines based on the third confirmation frame that each back-end server has used the second packet number interval to send packets, the front-end server will send a fourth confirmation frame for the first confirmation frame to the client, so that the third data packet sent by the back-end server using the packet number in the first packet number interval will not be discarded by the client, thereby reducing the packet loss rate of the data transmission process, thereby reducing the bandwidth resources consumed by the retransmitted data packets, and improving the transmission performance.
[0107] In some embodiments, the method for processing data requests also includes: initiating a second unidirectional flow of a second quick connection; sending a first confirmation frame and a second packet number interval to the back-end server based on the second quick connection, including: when it is determined that the packet number allocation conditions are met based on the first confirmation frame and the first packet number interval, sending the first confirmation frame and the second packet number interval to the back-end server based on the second unidirectional flow.
[0108] The second unidirectional flow is a flow in which the front-end server sends data to the back-end server.
[0109] In some embodiments, the first confirmation frame includes the packet number of the first data packet, and the packet number allocation condition may be that the difference between the maximum packet number included in the first confirmation frame and the maximum packet number included in the first packet number interval is less than or equal to a preset difference.
[0110] The front-end server receives the first confirmation frame sent by the client based on the first quick connection, compares the packet number included in the first confirmation frame with the packet number included in the first packet number interval allocated to the back-end server, and when the difference between the maximum packet number included in the first confirmation frame and the maximum packet number included in the first packet number interval is less than or equal to the preset difference, the front-end server sends the first confirmation frame and the second packet number interval to the back-end server based on the second unidirectional flow.
[0111] It should be noted that the packet sending action of the back-end server is continuous. Between the time the back-end server sends the first data packet and the time the front-end server obtains the first confirmation frame, the back-end server uses the packet number in the first packet number interval to send the packet. Therefore, when the front-end server determines that the difference between the maximum packet number included in the first confirmation frame and the maximum packet number included in the first packet number interval is less than or equal to the preset difference, it means that there are not many available packet numbers in the first packet number interval, and the second packet number interval can be allocated to the back-end server.
[0112] In some embodiments, the packet number allocation condition may be that the packet number included in the first confirmation frame belongs to a first packet number interval. If the front-end server determines that the packet number included in the first confirmation frame belongs to the first packet number interval, it indicates that the back-end server has already sent packets using the first packet number interval. To ensure that the back-end server has sufficient packet numbers available, the front-end server may allocate a second packet number interval to the back-end server.
[0113] In some embodiments, when the client makes multiple concurrent data requests, the client receives each first data packet sent by each back-end server, and sends a first confirmation frame to the front-end server through a first quick connection. The first confirmation frame includes the packet number of each first data packet sent by each back-end server. When the front-end server determines that the first confirmation frame includes the packet number of the first packet number interval corresponding to each back-end server, that is, when the front-end server determines that each back-end server has adopted the first packet number interval to send packets, it sends the first confirmation frame and the corresponding second packet number interval to each back-end server.
[0114] It should be noted that the packet numbers allocated by the front-end server cannot be reused, and therefore the first packet number intervals corresponding to each back-end server are different; the second packet number intervals corresponding to each back-end server are different, and the packet numbers allocated by the front-end server are incremental, so the packet numbers in each second packet number interval are greater than the packet numbers in each first packet number interval.
[0115] In the above embodiment, when the front-end server receives the first confirmation frame and determines that the packet number allocation conditions are met based on the first confirmation frame and the first packet number interval, it actively allocates a new second packet number interval to the back-end server to ensure that the back-end server has sufficient available packet numbers.
[0116] In some embodiments, the data packet also includes a fourth data packet; the method for processing the data request also includes: receiving a packet number acquisition request sent by the back-end server based on the first unidirectional flow of the second fast connection; in response to the packet number acquisition request, sending a third packet number interval to the back-end server to instruct the back-end server to send a fourth data packet based on the third packet number interval; the packet number included in the third packet number interval is greater than the packet number included in the first packet number interval.
[0117] The packet number acquisition request includes a flow identifier corresponding to the data request, so as to instruct the front-end server to determine the packet number interval last allocated to the back-end server based on the flow identifier.
[0118] In some embodiments, the back-end server can actively obtain a new packet number range from the front-end server based on the consumption of packet number resources. For example, the back-end server obtains the packet number consumption rate and the number of available packet numbers. When it is determined that the available packet numbers are insufficient based on the packet number consumption rate and the number of available packet numbers, the back-end server sends a packet number acquisition request to the front-end server based on the first unidirectional flow of the second fast connection.
[0119] The front-end server receives a packet number acquisition request based on the first unidirectional flow, responds to the packet number acquisition request, and sends a third packet number interval to the back-end server based on the second unidirectional flow of the second fast connection. The back-end server receives the third packet number interval based on the second unidirectional flow, and uses the packet number included in the third packet number interval to encapsulate part of the target data to obtain a fourth data packet.
[0120] Since the packet numbers assigned by the front-end server increase monotonically, the first packet number interval is the packet number interval included in the initial signaling, so the packet numbers included in the packet number intervals subsequently assigned by the front-end server are all greater than the packet numbers included in the first packet number interval.
[0121] In some embodiments, the number of packet numbers included in the packet number interval sent by the front-end server to the back-end server can be a preset number of packet numbers. For example, the number of packet numbers included in the first packet number interval, the second packet number interval, and the third packet number interval can all be preset numbers of packet numbers. The preset number of packet numbers can be set according to actual needs, and the embodiments of the present application do not limit this.
[0122] In some embodiments, the number of packet numbers included in the packet number interval sent by the front-end server to the back-end server may also be determined based on the actual situation of packet number consumption by the back-end server.
[0123] After the front-end server sends the first packet number interval to the back-end server, the front-end server receives a packet number acquisition request, determines the number of packet numbers included in the third packet number interval based on the number of packet numbers included in the first packet number interval and the preset multiple, and sends the third packet number interval to the back-end server based on the number of packet numbers included in the third packet number interval. The preset multiple can be set based on actual needs and is not limited in this embodiment of the present application.
[0124] When the front-end server determines that the packet number allocation conditions are met based on the first confirmation frame and the first packet number interval, and after allocating the first packet number interval, receives a packet number acquisition request, it determines the number of packet numbers included in the second packet number interval based on the number of packet numbers included in the first packet number interval and the preset multiple, and sends the second packet number interval to the back-end server based on the number of packet numbers included in the second packet number interval.
[0125] That is to say, after the front-end server allocates the first packet number interval to the back-end server, the front-end server receives a packet number acquisition request, indicating that the number of packet numbers included in the first packet number interval allocated by the front-end server is small. Then, the front-end server allocates the second packet number interval or the third packet number interval according to the number of packet numbers included in the first packet number interval and a preset multiple. This can reduce the number of times the back-end server sends a packet number acquisition request and ensure that the back-end server has sufficient available packet numbers.
[0126] Exemplarily, the preset number of packet numbers is 50, and the preset packet number multiple is 2; at time t20, the front-end server allocates the first packet number interval to the back-end server according to the preset number of packet numbers, and the number of packet numbers included in the first packet number interval is 50; at time t21, the front-end server obtains the packet number acquisition request sent by the back-end server, and allocates the third packet number interval to the back-end server according to the preset number of packet numbers and the preset packet number multiple, and the number of packet numbers included in the third packet number interval is 100; at time t22, the front-end server obtains the first confirmation frame, and allocates the second packet number interval to the back-end server according to the preset number of packet numbers and the preset packet number multiple, and the number of packet numbers included in the second packet number interval is 100.
[0127] In the above embodiment, when the back-end server determines that the available packet numbers are insufficient, it can send a packet number acquisition request to the front-end server to actively obtain a new packet number from the front-end server, thereby avoiding passively waiting for the front-end server to allocate a packet number, resulting in no available packet number itself, which in turn affects packet sending.
[0128] In some embodiments, the data request carries initial signaling, which includes client information and flow control resources; the data request is migrated to the back-end server based on the second fast connection to instruct the back-end server to create a pseudo connection between the client and the client, and the data packet corresponding to the data request is sent to the client based on the pseudo connection, including: sending the data request to the back-end server based on the second fast connection to instruct the back-end server to create a pseudo connection between the client and the client based on the client information, and sending the data packet corresponding to the data request to the client through the pseudo connection under the limitation of flow control resources.
[0129] The client information includes the client's Internet Protocol address (IP address) and port (PORT), and the client information is used to establish a pseudo connection with the client; the flow control resources include flow-level flow control resources and connection-level flow control resources.
[0130] In some embodiments, during the process of establishing a first quick connection, the client sets the flow control resources at the stream level and the total flow control resources at the connection level through transmission parameters; the total flow control resources at the connection level can reflect the amount of data that can be sent by the first quick connection, and the total flow control resources at the connection level will limit the connection-level flow control resources available to a single stream, for example, the sum of the amount of data that can be sent by all streams is equal to the amount of data that can be sent by the first quick connection.
[0131] The front-end server allocates connection-level flow control resources to the back-end server based on the flow-level flow control resources and the total flow control resources at the connection level; the front-end server sends a data request carrying the initial signaling to the back-end server, and the back-end server creates a pseudo connection with the corresponding client based on the client information included in the initial signaling, and sends the data packet corresponding to the data request to the client through the pseudo connection under the restrictions of the flow-level flow control resources and the connection-level flow control resources included in the initial signaling.
[0132] In some embodiments, the total flow control resources at the connection level can reflect the capacity of the buffer corresponding to the first quick connection in the client. The back-end server sends the data packet corresponding to the data request under the restrictions of the connection-level flow control resources and the flow-level flow control resources to avoid the back-end server consuming the entire capacity of the buffer; the connection-level flow control resources and the flow-level flow control resources limit the amount of data sent by the back-end server. When the data packets that the back-end server needs to send exceed the connection-level flow control resources, it can apply to increase the connection-level flow control resource restrictions.
[0133] In some embodiments, the flow control resources include a flow window value and a connection window value. In actual applications, the connection window value corresponding to the initial signaling can be a first preset connection window value. The preset connection window value can be set according to actual needs. For example, the first preset connection window value can be 1MB.
[0134] In some embodiments, when the currently allocated stream window value is much smaller than the currently available connection window value (for example, the allocated stream window value is less than 1 / 10 of the currently available connection window value), the connection window value corresponding to the initial signaling can be set to 3 / 4 of the stream window value, so that the back-end server can update the stream window value when part of the stream window value is consumed; when the currently allocated stream window value is close to the currently available connection window value (for example, the currently allocated stream window value is greater than 9 / 10 of the currently available connection window value), the connection window value corresponding to the initial signaling can be set to the minimum value between the second preset connection window value and the currently available connection window value. The second preset connection window value can be set according to actual needs. For example, the second preset connection window value can be 256KB.
[0135] In some embodiments, when a client makes multiple concurrent data requests, the front-end server allocates connection-level flow control resources to the back-end servers corresponding to the multiple data requests, so that each back-end server can obtain the required connection-level flow control resources in a timely manner; the connection-level flow control resources allocated to each back-end server are smaller than the connection-level flow control resources of the front-end server, and the sum of the connection-level flow control resources of each back-end server is smaller than the sum of the connection-level flow control resources of the front-end server, so that when a new stream is created subsequently, connection-level flow control resources can be allocated to the newly created stream; after the back-end server finishes responding to the data request, if there are unused connection-level flow control resources, the unused connection-level flow control resources can be returned to the front-end server so that the front-end server can allocate them to other back-end servers.
[0136] In the above embodiment, the front-end server migrates the data request carrying the initial signaling to the back-end server, so that the back-end server creates a pseudo connection with the client based on the client information included in the initial signaling, and sends the data packet corresponding to the data request under the limitation of the flow control resources, thereby avoiding the back-end server continuing to send data packets when the buffer corresponding to the first quick connection in the client is full, resulting in data loss, reducing the data retransmission rate, and improving transmission performance.
[0137] In some embodiments, the flow control resources include a flow window value and a connection window value; the method for processing data requests also includes: receiving a target flow offset sent by the client based on a first quick connection; updating the flow window value based on the target flow offset to obtain an updated flow window value; sending the updated flow window value to the back-end server based on the second unidirectional flow of the second quick connection; under the limitation of the flow control resources, sending a data packet corresponding to the data request to the client through a pseudo connection, including: under the limitation of the updated flow window value and the connection window value, sending a data packet corresponding to the data request to the client through a pseudo connection.
[0138] The connection window value is used to indicate the number of bytes allowed to be transmitted corresponding to the first quick connection, and the stream window value and the connection window value are used to indicate the number of bytes allowed to be transmitted when the backend server responds to the data request.
[0139] In some embodiments, the client sends a maximum stream offset (MAX_STREAM_DATA) frame to the front-end server through a first fast connection. When the maximum sendable data offset in the MAX_STREAM_DATA frame is updated, the target stream offset is determined based on the MAX_STREAM_DATA frame, and the stream window value included in the flow control resource is updated by the target stream offset to obtain an updated stream window value. The updated stream window value is sent to the back-end server based on the second unidirectional stream of the second fast connection. The back-end server receives the updated stream window value based on the second unidirectional stream of the second fast connection, and sends a data packet corresponding to the data request to the client through a pseudo connection under the constraints of the updated stream window value and the connection window value.
[0140] In the above embodiment, the client can update the flow window value so that the back-end server sends packets under the constraints of the updated flow window value and the connection window value. When the updated flow window value is greater than the flow window value included in the flow control resources, it avoids the lack of available flow window value when sending data, reduces the delay caused by the back-end server waiting for the allocation of available flow window value, ensures the continuous transmission of target data corresponding to the data request, and improves the data transmission efficiency.
[0141] In some embodiments, the flow control resources include a flow window value and a connection window value; the method for processing data requests also includes: receiving a target connection offset sent by the client based on a first quick connection; updating the connection window value based on the target connection offset to obtain an updated connection window value; sending the updated connection window value to the back-end server based on the second unidirectional flow of the second quick connection; under the limitation of the flow control resources, sending a data packet corresponding to the data request to the client through a pseudo connection, including: under the limitation of the updated connection window value and the flow window value, sending a data packet corresponding to the data request to the client through a pseudo connection.
[0142] In some embodiments, the client sends a maximum connection offset (MAX_DATA) frame to the front-end server through a first fast connection. When the maximum sendable data offset in the MAX_DATA frame is updated, the target connection offset is determined based on the MAX_DATA frame, and the connection window value included in the flow control resource is updated using the target connection offset to obtain an updated connection window value. The updated connection window value and flow window value are sent to the back-end server based on the second unidirectional flow of the second fast connection, and the back-end server sends packets under the restrictions of the updated connection window value and flow window value.
[0143] In some embodiments, the front-end server updates the connection window value based on the target connection offset to obtain an updated connection window value. This may be by determining the updated total connection window value based on the target connection offset, determining a reference change in proportion based on the change between the updated total connection window value and the total connection window value before the update, and the consumption rate of the connection window value corresponding to the currently maintained stream, and updating the connection window value according to the reference change to obtain an updated connection window value.
[0144] In some embodiments, after the back-end server receives the updated flow control resources based on the second unidirectional flow of the second quick connection, it sends resource information to the front-end server based on the first unidirectional flow of the second quick connection. The resource information includes: the updated flow control resources and the consumption rate, so that the front-end server determines the consumption of the flow control resources of the back-end server based on the resource information. When the flow control resources of the front-end server are insufficient, the front-end can send a flow control resource return instruction to the back-end server through the second unidirectional flow of the second quick connection. If there are available flow control resources on the back-end server, the back-end server can return the available flow control resources based on the flow control resource return instruction.
[0145] In the above embodiment, the client can update the connection window value so that the back-end server sends packets under the constraints of the flow window value and the updated connection window value. When the updated connection window value is greater than the connection window value included in the flow control resources, the continuous transmission of the target data corresponding to the data request is guaranteed, thereby improving the data transmission efficiency.
[0146] In some embodiments, the initial signaling also includes an initial connection identifier; the data request processing method also includes: receiving an update connection identifier frame sent by the client based on the first fast connection; obtaining a target connection identifier based on the update connection identifier frame; sending the target connection identifier to the back-end server based on the second unidirectional flow of the second fast connection to instruct the back-end server to send a data packet carrying the target connection identifier to the client through a pseudo connection; sending a deactivation connection identifier frame to the client based on the first fast connection; the deactivation connection identifier frame is used to instruct the client to mark the initial connection identifier as deactivated, mark the target connection identifier as in use, and receive a data packet carrying the target connection identifier.
[0147] The connection identifier (CID) is the connection identifier of the first fast connection. In this embodiment, the connection identifier refers to the source connection identifier (SCID) generated by the client. The initial connection identifier is the connection identifier included in the initial signaling.
[0148] The short header of the data packet sent by the back-end server includes a connection identifier. The client obtains the connection identifier based on the short header of the received data packet. When the connection identifier is inconsistent with the connection identifier generated by the client, the client will discard the data packet. Therefore, when the client updates the connection identifier, the back-end server also needs to update the connection identifier in time to avoid packet loss.
[0149] In some embodiments, the client sends an update connection identifier (NEW_CONNECTION_ID) frame to the front-end server based on the first fast connection, the front-end server determines the target connection identifier based on the NEW_CONNECTION_ID frame, and sends the target connection identifier to the back-end server based on the second unidirectional flow of the second fast connection, and then sends a deactivation connection identifier (RETIRE_CONNECTION_ID) frame to the client based on the first fast connection. The client marks the initial connection identifier as deactivated and the target connection identifier as in use based on the RETIRE_CONNECTION_ID frame, and deactivates the initial connection identifier. If the client subsequently receives a data packet with a short header including the initial connection identifier, the data packet will be discarded.
[0150] In some embodiments, the front-end server sends a target connection identifier to the back-end server based on the second unidirectional flow of the second fast connection. After the back-end server sends a data packet carrying the target connection identifier to the client, the front-end server sends a deactivate connection identifier frame to the client based on the first fast connection; that is, the front-end server sends a deactivate connection identifier frame to the client after determining that the back-end server uses the target connection identifier to replace the initial connection identifier.
[0151] In the above embodiment, after the front-end server receives the updated connection identification frame, it first sends the target connection identification determined based on the updated connection identification frame to the back-end server, and then feeds back the deactivate connection identification frame to the client, thereby avoiding the situation where the deactivate connection identification frame is first fed back to the client while the back-end server has not yet received the target connection identification and still uses the initial connection identification to send packets, resulting in the data packet being discarded by the client, thereby reducing the packet loss rate and improving the data transmission efficiency.
[0152] In some embodiments, the method for processing data requests also includes: receiving an updated session key identifier sent by the client based on a first quick connection; determining a target session key based on the updated session key identifier; the target session key is obtained by updating the initial session key included in the initial signaling; sending an updated session key identifier to the back-end server based on a second unidirectional flow of a second quick connection to instruct the back-end server to determine the target session key based on the updated session key identifier, and encrypting the data packet corresponding to the data request based on the target session key.
[0153] The initial signaling includes an initial session key, which is a session key jointly determined by the client and the front-end server when the client establishes a first fast connection with the front-end server.
[0154] In some embodiments, the front-end server sends the initial signaling including the initial session key to the back-end server based on the second quick connection. The back-end server receives the initial signaling, encrypts the data packet corresponding to the data request using the session key in the initial signaling, and sends the encrypted data packet to the client through a pseudo connection. The client uses the initial session key to decrypt the encrypted data packet to obtain the data packet.
[0155] In order to ensure the security of data transmission, the client can update the initial session key; the client determines the target session key, sends the updated session key identifier (key_phase) to the front-end server based on the first fast connection, the front-end server obtains key_phase based on the first fast connection, determines the target session key based on key_phase and the initial session key, the front-end server replaces the initial session key with the target session key, sends key_phase to the back-end server based on the second unidirectional flow of the second fast connection, the back-end server receives key_phase based on the second unidirectional flow of the second fast connection, determines the target session key based on key_phase and the initial session key, and encrypts the data packet corresponding to the data request through the target session key, sends the encrypted data packet to the client through the pseudo connection, and the client decrypts the encrypted data packet using the target session key to obtain the data packet.
[0156] It should be noted that after the initial session key is updated to the target session key, if the key_phase is obtained subsequently, the updated session key is determined based on the obtained key_phase and the target session key. That is, each time the key_phase is obtained, the updated session key is determined by the obtained key_phase and the currently used session key.
[0157] It should be noted that the data corresponding to the data request includes multiple data packets. The back-end server can encrypt the first part of the multiple data packets based on the initial session key. After the initial session key is updated to the target session key, the back-end server can encrypt the second part of the multiple data packets based on the target session key.
[0158] In some embodiments, the front-end server receives the currently used session key and the encrypted quantity corresponding to the currently used session key based on the first unidirectional flow of the second fast connection; the currently used session key and the corresponding encrypted quantity are sent by the back-end server when the back-end server receives the packet number interval sent by the front-end server; when the front-end server determines that the encrypted quantity is greater than or equal to the encryption threshold, it generates a new session key, sends the new session key to the client through the first fast connection, and sends the new session key to the back-end server through the second unidirectional flow of the second fast connection, so that the client and the back-end server use the new session key to replace the currently used session key.
[0159] Among them, the currently used session key can be the initial session key, the target session key, or other session keys; the encryption quantity corresponding to the currently used session key is the number of data packets encrypted using the currently used session key; the packet number interval sent by the front-end server can be the second packet number interval, the third packet number interval, or other packet number intervals; the encryption threshold can be set according to actual needs, and the embodiments of the present application do not limit this.
[0160] This embodiment is a solution in which the front-end server initiates the update of the session key; in some embodiments, when the back-end server receives the packet number interval sent by the front-end server, the currently used session key and the encrypted number corresponding to the currently used session key are sent to the front-end server based on the second fast connection first unidirectional flow; when the encrypted number corresponding to the currently used session key reaches the encryption threshold, the front-end server actively updates the session key.
[0161] In the above embodiment, the client initiates an update of the session key identifier, and the front-end server synchronizes the updated session key identifier to the back-end server, so that the back-end server determines the target session key based on the updated session key identifier, uses the target session key to encrypt the data packet corresponding to the data request, updates the initial session key, and improves the security of data transmission.
[0162] In some embodiments, the method for processing data requests also includes: receiving a fifth confirmation frame sent by the client based on the first quick connection; the fifth confirmation frame is sent by the client when receiving a data packet encrypted based on the target session key; and feeding back a sixth confirmation frame to the client based on the first quick connection to indicate that the client has determined that the initial session key has been updated to the target session key.
[0163] The sixth confirmation frame is a confirmation frame for sending the updated session key identifier.
[0164] In some embodiments, after the client receives a data packet encrypted based on the target session key, it sends a fifth confirmation frame to the front-end server based on the first quick connection. When the front-end server determines based on the fifth confirmation frame that the back-end server has adopted the target session key to encrypt the data packet, it feeds back a sixth confirmation frame for the updated session key identifier to the client based on the first quick connection. The client determines based on the sixth confirmation frame that the initial session key has been updated to the target session key, thereby eliminating the initial session key.
[0165] In some embodiments, sending the target session key to the backend server based on the second unidirectional flow of the second fast connection further includes: sending an updated session key identifier and a fourth packet number interval to the backend server based on the second unidirectional flow of the second fast connection, instructing the backend server to encapsulate data corresponding to the data request using a packet number in the fourth packet number interval to obtain a data packet, determining the target session key based on the updated session key identifier, and encrypting the data packet using the target session key. The front-end server receives a fifth confirmation frame. When the fifth confirmation frame includes a packet number in the fourth packet number interval, the front-end server determines that the fifth confirmation frame was sent by the client upon receiving the data packet encrypted based on the target session key.
[0166] When the front-end server receives the updated session key identifier sent by the client, it re-allocates a new packet number interval (the fourth packet number interval) for the back-end server, so that the back-end server sends packets using the fourth packet number interval and the target session key. When the front-end server determines based on the fifth confirmation frame that the back-end server has adopted the fourth packet number interval to send packets, it feeds back the target session key for the updated session key identifier.
[0167] In the related technology, when the front-end server receives the updated session key identifier, it immediately feeds back a confirmation frame for the updated session key identifier. It is possible that the back-end server has not yet synchronously updated the initial session key to the target session key, and the client determines that the initial session key has been updated to the target session key, and then abolishes the initial session key, causing the data packet encrypted by the back-end server using the initial session key to be discarded by the client, affecting data transmission.
[0168] In the above embodiment, the front-end server determines based on the fifth confirmation frame that the back-end server has used the target session key to encrypt the data packet, and then feeds back the sixth confirmation frame for the updated session key identifier, thereby avoiding the situation where the client determines that the initial session key has been updated to the target session key when the back-end server has not yet synchronously updated the initial session key to the target session key, thereby causing the data packet encrypted by the back-end server using the initial session key to be discarded by the client, reducing the packet loss rate and improving the transmission efficiency.
[0169] In some embodiments, the initial signaling includes a four-tuple; the four-tuple includes: the IP address and port of the client, and the IP address and port of the back-end server; when the IP address and port of the client change, the front-end server sends the changed IP address and port of the client to the back-end server based on the second unidirectional flow of the second fast connection to instruct the back-end server to use the changed IP address and port to send the data packet corresponding to the data request.
[0170] In this embodiment, when the IP address and port of the client change, the client uses the changed IP address and port to send packets to the front-end server, and the front-end server subsequently also uses the changed IP address and port to send packets to the client; the front-end server sends the client's changed IP address and port to the back-end server based on the second unidirectional flow of the second fast connection, and the back-end server uses the changed IP address and port.
[0171] In some embodiments, the data request processing method can be applied to the scenario of obtaining playback data during live video broadcast, such as Figure 5 As shown, taking two concurrent data requests from the client as an example, a method for processing data requests is collaboratively executed by the client, front-end server FE, scheduling center, back-end server BE1 and back-end server BE2, wherein the front-end server FE is used to establish a fast connection with the client, scheduling center and back-end server, maintain the established fast connection, obtain the back-end server IP address corresponding to the data request from the scheduling center, migrate data requests, allocate packet numbers to the back-end server, and synchronize connection data, including synchronization confirmation frames, updated connection identifiers and updated session keys, etc.; the back-end server BE1 and the back-end server BE2 can independently perform packet loss detection and congestion detection, and are also used to encrypt sent data packets and synchronize connection data; the scheduling center is used to respond to the back-end server IP address corresponding to the data request.
[0172] When watching live video through a client, a first fast connection is established between the client and the front-end server FE. Based on the first fast connection, the client sends two data requests, namely data request 1 and data request 2, to the front-end server FE. The front-end server FE forwards each data request to the dispatch center through the fast connection with the dispatch center. The dispatch center determines the back-end server IP address corresponding to each data request, and the front-end server FE receives the back-end server dispatched by the dispatch center.
[0173] The front-end server FE creates a second fast connection Q21 with the back-end server BE1 according to the back-end server IP corresponding to data request 1, and creates a second fast connection Q22 with the back-end server BE2 according to the back-end server IP corresponding to data request 2;
[0174] The front-end server FE migrates data request 1 to the back-end server BE1 according to Q21. The back-end server BE1 creates a pseudo connection with the client. The front-end server FE migrates data request 1 to the back-end server BE2 according to Q22. The back-end server BE2 creates a pseudo connection with the client.
[0175] The back-end server BE1 obtains the target data corresponding to data request 1, and sends the data packet corresponding to data request 1 to the client through the pseudo connection between the client and the back-end server BE1 obtains the target data corresponding to data request 2, and sends the data packet corresponding to data request 2 to the client through the pseudo connection between the client and the client.
[0176] In some embodiments, as Figure 6 As shown, the data request processing method includes:
[0177] Step 601: The front-end server receives a data request sent by a client via a first fast connection;
[0178] Step 602: The front-end server determines the back-end server to be scheduled based on the data request and creates a second fast connection; the second fast connection is a fast connection between the front-end server and the back-end server;
[0179] Step 603: The front-end server sends a data request to the back-end server based on the second fast connection, instructing the back-end server to establish a pseudo connection with the client based on the client information, and to send a first data packet corresponding to the data request to the client through the pseudo connection, subject to flow control resource constraints.
[0180] Step 604: The front-end server receives a first confirmation frame sent by the client based on the first fast connection; the first confirmation frame is a confirmation frame sent by the client when confirming receipt of the first data packet, and the packet number of the first data packet belongs to the first packet number range;
[0181] Step 605: The front-end server receives a second confirmation frame sent by the client based on the first fast connection; the second confirmation frame is a confirmation frame sent by the client when confirming receipt of the third data packet; the packet number of the third data packet falls within the first packet number interval, and the packet number of the third data packet is greater than the packet number of the first data packet;
[0182] Step 606: The front-end server initiates a second unidirectional flow for the second fast connection. If the packet number allocation condition is determined to be met based on the first confirmation frame and the first packet number range, the front-end server sends the first confirmation frame and the second packet number range to the back-end server according to the second unidirectional flow, instructing the back-end server to send a second data packet to the client based on the pseudo connection if no packet loss is determined based on the first confirmation frame; the packet number of the second data packet falls within the second packet number range.
[0183] Step 607: The front-end server receives a third confirmation frame sent by the client based on the first fast connection; the third confirmation frame is a confirmation frame sent by the client when confirming receipt of the second data packet; the packet number in the second packet number interval is greater than the packet number in the first packet number interval;
[0184] In step 608 , the front-end server feeds back a fourth confirmation frame to the client based on the first fast connection to indicate that the first confirmation frame has been confirmed.
[0185] In some embodiments, as Figure 7 As shown, the method for processing data requests further includes:
[0186] Step 701: The front-end server receives a packet number acquisition request sent by the back-end server according to the first unidirectional flow of the second fast connection; in response to the packet number acquisition request, the front-end server sends a third packet number interval to the back-end server, instructing the back-end server to send a fourth data packet based on the third packet number interval; the packet numbers included in the third packet number interval are greater than the packet numbers included in the first packet number interval;
[0187] Step 702: When the data request migration is completed, the front-end server receives a migration completion instruction sent by the back-end server according to the first unidirectional flow of the second fast connection; and updates the migration status of the data request based on the migration completion instruction.
[0188] In step 703, the flow control resources include a flow window value and a connection window value; the front-end server receives the target flow offset sent by the client according to the first fast connection; updates the flow window value based on the target flow offset to obtain an updated flow window value; and sends the updated flow window value to the back-end server according to the second unidirectional flow of the second fast connection, instructing the back-end server to send a data packet corresponding to the data request to the client through the pseudo connection under the constraints of the updated flow window value and the connection window value.
[0189] In step 704, the front-end server receives the target connection offset sent by the client based on the first fast connection; updates the connection window value based on the target connection offset to obtain an updated connection window value; and sends the updated connection window value to the back-end server based on the second unidirectional flow of the second fast connection, instructing the back-end server to send a data packet corresponding to the data request to the client through the pseudo connection, subject to the constraints of the updated connection window value and the flow window value.
[0190] In step 705, the initial signaling also includes an initial connection identifier; the front-end server receives an update connection identifier frame sent by the client based on the first fast connection; obtains a target connection identifier based on the update connection identifier frame; sends the target connection identifier to the back-end server based on the second unidirectional flow of the second fast connection to instruct the back-end server to send a data packet carrying the target connection identifier to the client via a pseudo connection; and sends a deactivate connection identifier frame to the client based on the first fast connection; the deactivate connection identifier frame is used to instruct the client to mark the initial connection identifier as deactivated, mark the target connection identifier as enabled, and receive a data packet carrying the target connection identifier;
[0191] In step 706, the front-end server receives the updated session key identifier sent by the client based on the first fast connection; determines the target session key based on the updated session key identifier; the target session key is obtained by updating the initial session key included in the initial signaling; and sends the updated session key identifier to the back-end server based on the second unidirectional flow of the second fast connection, instructing the back-end server to determine the target session key based on the updated session key identifier and encrypt the data packet corresponding to the data request based on the target session key.
[0192] In step 707, the front-end server receives the fifth confirmation frame sent by the client based on the first fast connection; the fifth confirmation frame is sent by the client when receiving the data packet encrypted based on the target session key; and the front-end server feeds back the sixth confirmation frame to the client based on the first fast connection to indicate that the client has confirmed that the initial session key has been updated to the target session key.
[0193] In the above embodiment, the front-end server receives the data request sent by the client through the first fast connection between the front-end server and the client, determines the back-end server to be scheduled according to the data request, and the front-end server migrates the data request to the back-end server through the second fast connection between the front-end server and the back-end server, so that the back-end server creates a pseudo connection between the client and the client, and the back-end server directly sends the data packet corresponding to the data request to the client based on the pseudo connection. The front-end server performs request-level scheduling and determines that the back-end server to be scheduled has the data to respond to the data request, so that the back-end server can directly respond to the data request without returning to the source to obtain the data to respond to the data request, thereby reducing latency and communication overhead between servers; the back-end server directly sends the data packet to the client through the pseudo connection, rather than the back-end server sending the data packet to the front-end server, and then the front-end server sending the data packet to the client, thereby reducing bandwidth consumption between the back-end server and the front-end server, reducing the pressure on the downstream traffic of the front-end server, improving the upstream throughput of the front-end server, reducing latency, and improving transmission performance.
[0194] In some embodiments, as Figure 8As shown, a method for processing data request is provided, which is applied to Figure 1 The backend server in the example is used as an example to illustrate the following steps:
[0195] Step 802: receiving a data request for migration from a front-end server based on a second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection;
[0196] Step 804: In response to the data request, create a pseudo connection with the client and obtain target data corresponding to the data request;
[0197] Step 806: Send a data packet encapsulating the target data to the client through the pseudo connection.
[0198] The detailed process of step 802 to step 806 may refer to the embodiment of step 202 to step 206 above.
[0199] In the above embodiment, the front-end server receives the data request sent by the client through the first fast connection between the front-end server and the client, determines the back-end server to be scheduled according to the data request, and the front-end server migrates the data request to the back-end server through the second fast connection between the front-end server and the back-end server, so that the back-end server creates a pseudo connection between the client and the client, and the back-end server directly sends the data packet corresponding to the data request to the client based on the pseudo connection. The front-end server performs request-level scheduling and determines that the back-end server to be scheduled has the data to respond to the data request, so that the back-end server can directly respond to the data request without returning to the source to obtain the data to respond to the data request, thereby reducing latency and communication overhead between servers; the back-end server directly sends the data packet to the client through the pseudo connection, rather than the back-end server sending the data packet to the front-end server, and then the front-end server sending the data packet to the client, thereby reducing bandwidth consumption between the back-end server and the front-end server, reducing the pressure on the downstream traffic of the front-end server, improving the upstream throughput of the front-end server, reducing latency, and improving transmission performance.
[0200] In some embodiments, after receiving the data request for migration of the front-end server based on the second quick connection, it also includes: creating a first unidirectional flow of the second quick connection when the data request migration is completed; based on the first unidirectional flow, sending a migration completion instruction to the front-end server to instruct the front-end server to update the migration status of the data request.
[0201] In this embodiment, the back-end server creates a first unidirectional flow, sends a migration completion instruction to the front-end based on the first unidirectional flow, and the front-end server updates the migration status of the data request based on the migration completion instruction. For the detailed process, please refer to the above embodiment, where the front-end server receives the migration completion instruction sent by the back-end server based on the second quick connection to the first unidirectional flow, and updates the migration status of the data request based on the migration completion instruction.
[0202] In the above embodiment, the back-end server can actively initiate the first unidirectional flow and send a migration completion instruction to the front-end server based on the first unidirectional flow without waiting for the front-end server to establish the flow, thereby improving the real-time performance of the migration status update. In addition, compared with the bidirectional flow, the unidirectional flow requires fewer flow control resources, reducing the resources consumed by data transmission.
[0203] In some embodiments, the data packet includes a first data packet; sending a data packet encapsulating target data to a client via a pseudo connection, including: determining a first packet number interval based on a migration data request; encapsulating a first part of the target data according to the packet number in the first packet number interval to obtain a first data packet; and sending the first data packet to the client via a pseudo connection.
[0204] The migration data request carries initial signaling, which includes a first packet number interval; the first part of data is data encapsulated using a packet number in the first packet number interval.
[0205] In some embodiments, the back-end server obtains the first packet number interval carried by the migration data request, encapsulates the first part of the target data using the packet number in the first packet number interval to obtain a first data packet, and the back-end server sends the first data packet to the client through a pseudo connection.
[0206] It should be noted that the backend server does not necessarily need to use up all the packet numbers in the first packet number interval to encapsulate the first data packet. The backend server's packet sending process is continuous. The backend server can use some packet numbers in the first packet number interval to encapsulate the first part of the target data to obtain the first data packet. Thereafter, the backend server can use another part of the packet numbers in the first packet number interval to encapsulate another part of the target data to obtain another data packet. For example, if the first packet number interval is (100, 120], the first part of the data can be encapsulated using the packet numbers belonging to (100, 110) to obtain the first data packet.
[0207] In the above embodiment, the back-end server determines the first packet number interval through the migrated data request, so that the back-end server receives the first packet number interval at the same time as receiving the data request. When sending the data packet corresponding to the response data request, it can directly use the packet number included in the first packet number interval without having to obtain the available packet number again or wait for the front-end server to send the available packet number, thereby reducing the delay in data transmission and improving the data transmission efficiency.
[0208] In some embodiments, the data packet further includes a second data packet and a third data packet; Figure 9 As shown, after sending the first data packet to the client through the pseudo connection, the method further includes:
[0209] Step 901: Send a third data packet to the client through the pseudo connection, so that the client sends a second confirmation frame to the front-end server upon receiving the third data packet; the packet number of the third data packet falls within the first packet number interval, and the packet number of the third data packet is greater than the packet number of the first data packet;
[0210] Step 902: Receive a first confirmation frame and a second packet number interval sent by the front-end server according to the second unidirectional flow of the second fast connection; the first confirmation frame is a confirmation frame sent by the client to the front-end server when confirming receipt of the first data packet;
[0211] Step 903: Perform packet loss detection based on the first confirmation frame to obtain a detection result;
[0212] Step 904: When the detection result shows that there is no packet loss, the second portion of the target data is encapsulated according to the packet numbers in the second packet number interval to obtain a second data packet;
[0213] Step 905: Send a second data packet to the client through a pseudo connection, so that when the client confirms receipt of the second data packet, it sends a third confirmation frame to the front-end server to instruct the front-end server to feedback a fourth confirmation frame to the client, and the fourth confirmation frame is used to indicate that the first confirmation frame has been confirmed.
[0214] In this embodiment, the detailed description of the above-mentioned back-end server sending the third data packet, receiving the first confirmation frame and the second packet number interval, and sending the second data packet can refer to the relevant description of the above-mentioned embodiment, in which the front-end server receives the second confirmation frame sent by the client when receiving the third data packet, sends the first confirmation frame and the second packet number interval to the back-end server, receives the third confirmation frame sent by the client when receiving the second data packet, and feeds back the fourth confirmation frame to the client.
[0215] In some embodiments, when the detection result is no packet loss, the back-end server can filter the confirmation information belonging to the first packet number interval in the first confirmation frame, perform congestion detection based on the confirmation information, obtain the congestion window and packet sending rate, and send a second data packet to the client based on the congestion window and packet sending rate.
[0216] In the above embodiment, when the front-end server receives the first confirmation frame sent by the client based on the received first data packet, it does not immediately respond to the first confirmation frame, and the packet sending action of the back-end server is continuous. Therefore, after each back-end server sends the first data packet, it will also use the first packet number interval to send the third data packet. When the front-end server determines based on the third confirmation frame that each back-end server has used the second packet number interval to send packets, the front-end server will send a fourth confirmation frame for the first confirmation frame to the client, so that the third data packet sent by the back-end server using the packet number in the first packet number interval will not be discarded by the client, thereby reducing the packet loss rate of the data transmission process, thereby reducing the bandwidth resources consumed by the retransmitted data packets, and improving the transmission performance.
[0217] In some embodiments, packet loss detection is performed based on the first confirmation frame to obtain a detection result, including: filtering confirmation information belonging to the first packet number interval in the first confirmation frame; performing packet loss detection based on the confirmation information to obtain a detection result; the data packet also includes a retransmitted data packet; the data request processing method also includes: when the detection result is packet loss, performing congestion detection based on the confirmation information to obtain a congestion window and a packet sending rate; re-encapsulating the packet loss data based on the packet number in the second packet number interval to obtain a retransmitted data packet; and sending the retransmitted data packet to the client through a pseudo connection based on the congestion window and the packet sending rate.
[0218] Among them, the confirmation information is the information that the packet number in the first confirmation frame belongs to the first packet number interval, including the packet number belonging to the first packet number interval; the congestion window is used to limit the amount of data sent by the data packet, and the packet sending rate is the rate of sending data packets.
[0219] In some embodiments, the first confirmation frame may include the packet numbers of multiple first data packets sent by each back-end server. After receiving the first confirmation frame, the back-end server filters out the corresponding confirmation information based on the first packet number interval. The back-end server performs packet loss detection based on the packet number included in the confirmation information and the packet number of the first data packet sent. If the packet number included in the confirmation information is consistent with the packet number of the first data packet, the detection result is determined to be no packet loss. If the packet number included in the confirmation information is inconsistent with the packet number of the first data packet, the detection result is determined to be packet loss.
[0220] If the detection result indicates packet loss, congestion detection is performed based on the confirmation information to obtain the congestion window and packet sending rate. The lost packet data is determined based on the packet number included in the confirmation information and the packet number of the first data packet. The lost packet data is re-encapsulated using the packet number in the second packet number range to obtain a retransmitted data packet. The retransmitted data packet is sent to the client via a pseudo-connection based on the congestion window and packet sending rate. It should be noted that in related technologies, congestion detection is also referred to as congestion control.
[0221] In some embodiments, the number of retransmitted data packets is multiple, and the retransmitted data packets are sent to the client based on the congestion window and the packet sending rate, which means that the number of bytes of the multiple retransmitted data packets does not exceed the data volume corresponding to the congestion window, and the rate of sending the multiple retransmitted data packets does not exceed the packet sending rate.
[0222] In some embodiments, when the client makes multiple concurrent data requests, the client receives each first data packet sent by each back-end server using its corresponding first packet number interval, and sends a first confirmation frame to the front-end server. The first confirmation frame includes the packet number belonging to the first packet number interval corresponding to each back-end server. The front-end server sends the first confirmation frame to each back-end server, and each back-end server filters the confirmation information belonging to its first packet number interval based on the first confirmation frame.
[0223] For example, Figure 10 As shown, the back-end servers are back-end server BE1 and back-end server BE2 respectively, and the front-end server FE sends a first confirmation frame and a second packet number interval allocated to BE1 to BE1, and sends a first confirmation frame and a second packet number interval allocated to BE2 to BE2; taking BE1 as an example, BE1 filters the confirmation information of the first packet number interval belonging to BE1 in the first confirmation frame, performs packet loss detection based on the confirmation information, and when determining packet loss, performs congestion detection based on the confirmation information to obtain the congestion window and packet sending rate, and re-encapsulates the lost packet data through the packet number of the second packet number interval received by BE1 to obtain a retransmitted data packet, and sends the retransmitted data packet to the client according to the congestion window and packet sending rate.
[0224] In the above embodiment, the back-end server receives the first confirmation frame and performs packet loss detection based on the first confirmation frame. When it is determined that packet loss has occurred, a retransmitted data packet can be sent in a timely manner. The retransmitted data packet is sent to the client based on the congestion window and the packet sending rate. This can reduce the loss of retransmitted data packets due to congestion, thereby enabling the client to receive the retransmitted data packets in a timely manner. In actual applications, this can avoid the client from waiting for loading or page freezes due to packet loss, thereby improving data transmission efficiency.
[0225] In some embodiments, the maximum transmission unit detection of the back-end server is independent of the maximum transmission unit detection of the front-end server. The maximum transmission unit is the maximum transmission unit that does not require fragmentation when the back-end server (front-end server) sends data to the client. The maximum transmission unit detection can fragment the sent data according to the size of the maximum transmission unit and then send it, allowing the back-end server (front-end server) to send data packets with larger data volumes. The embodiments of the present application do not limit the specific process of the maximum transmission unit detection.
[0226] In some embodiments, when the client sends data to the front-end server, QPACK is used to compress the header field of the sent data. The front-end server can parse the header field of the data sent by the client according to QPACK, and the back-end server does not participate in this parsing process; QPACK represents the encoding of the HTTP / 3 header field; in the scenario where the client makes multiple concurrent data requests, the QPACK dynamic tables of multiple back-end servers are difficult to synchronize, so when the back-end server sends data to the client, the QPACK dynamic table is disabled, and only the static table is used to compress the header field of the sent data.
[0227] In some embodiments, QUIC is a low-latency Internet transport layer protocol based on UDP. It is necessary to complete the assembly of UDP data at the application layer and send the application layer data through the sendmsg interface. The sendmsg interface is an interface for sending application layer data; when the back-end server performs context recovery based on the data request and initial signaling, the back-end server obtains the virtual IP address from the initial signaling, sets the IP address of the back-end server to the virtual IP address, and sends a data packet. The socket created by the back-end server is used as the socket required by the sendmsg interface, thereby reusing the current packet sending interface of the back-end server; it should be noted that the sendmsg interface in this embodiment is only an example. In actual applications, it may also be other interfaces for sending application layer data.
[0228] In some embodiments, the data request processing method can be applied to a scenario of obtaining playback data when on-demand video is played. The on-demand video is not a real-time video, for example, a movie video is an on-demand video.
[0229] Taking the client's two concurrent data requests as an example, the client, the front-end server FE, the dispatch center, the back-end server BE1 and the back-end server BE2 collaborate to execute the data request processing method, as shown in FIG. Figure 11 As shown ( Figure 11 The interaction between the front-end server and the back-end server BE2 is not shown), and the method for processing data requests includes:
[0230] 1. Create the first fast connection between the front-end server FE and the client;
[0231] 2. The client sends data request 1 and data request 2 to the front-end server FE based on the first fast connection;
[0232] 3. The front-end server FE receives data request 1 and data request 2, and sends data request 1 and data request 2 to the dispatch center based on the fast connection between the front-end server FE and the dispatch center. The front-end server FE receives back the back-end server address IP1 corresponding to data request 1 and the back-end server address IP2 corresponding to data request 2.
[0233] 4. The front-end server FE establishes a second fast connection Q21 with the back-end server BE1 according to the back-end server address IP1, and establishes a second fast connection Q22 with the back-end server BE2 according to the back-end server address IP2;
[0234] 5. The front-end server FE migrates the data request 1 and the initial signaling x1 to the back-end server BE1 according to the second fast connection Q21; and migrates the data request 2 and the initial signaling x2 to the back-end server BE2 according to the second fast connection Q22;
[0235] 6. Backend server BE1 creates a pseudo connection W1 with the client based on data request 1 and initial signaling x1. Backend server BE2 creates a pseudo connection W2 with the client based on data request 2 and initial signaling x2.
[0236] 7. After completing the migration of data request 1, the backend server BE1 initiates the first unidirectional flow s11 of the second fast connection Q21 and sends a migration completion instruction to the front-end server FE through the first unidirectional flow s11. After completing the migration of data request 2, the backend server BE2 initiates the first unidirectional flow s12 of the second fast connection Q22 and sends a migration completion instruction to the front-end server FE through the first unidirectional flow s12.
[0237] 8. The front-end server FE updates the migration status of data request 1 based on the migration completion instruction sent by the back-end server BE1; and updates the migration status of data request 2 based on the migration completion instruction sent by the back-end server BE2.
[0238] 9. Backend server BE1 obtains target data d1 corresponding to data request 1. Based on target data d1, the first packet number interval r1, the initial connection identifier cid1, and the initial session key key1 included in the initial signaling x1, it determines the first data packet y1 corresponding to target data d1 and sends the first data packet y1 to the client via pseudo connection W1.
[0239] Backend server BE2 obtains target data d2 corresponding to data request 2. Based on target data d2, the first packet number interval r2, the initial connection identifier cid1, and the initial session key key1 included in the initial signaling x2, it determines the first data packet y2 corresponding to target data d2 and sends the first data packet y2 to the client via pseudo connection W2.
[0240] 10. After obtaining the first data packets y1 and y2, the client sends a first confirmation frame to the front-end server FE according to the first fast connection;
[0241] 11. The front-end server FE receives the first confirmation frame, initiates a second unidirectional flow s21 of the second fast connection Q21, initiates a second unidirectional flow s22 of the second fast connection Q21, sends the first confirmation frame and the second packet number interval r3 to the back-end server BE1 according to the second unidirectional flow s21, and sends the second confirmation frame and the second packet number interval r4 to the back-end server BE2 according to the second unidirectional flow s22; the back-end server BE1 sends the second data packet y3 to the client according to the second packet number interval r3, and the back-end server BE2 sends the second data packet y4 to the client according to the second packet number interval r4;
[0242] 12. When the front-end server FE receives the third confirmation frame sent by the client based on the second data packet, it sends a fourth confirmation frame in response to the first confirmation frame;
[0243] 13. The client sends an update connection identifier frame to the front-end server FE through the first fast connection, and the front-end server FE obtains the target connection identifier cid2;
[0244] 14. The front-end server FE sends the target connection identifier cid2 to the back-end server BE1 according to the second unidirectional flow s21, and sends the target connection identifier cid2 to the back-end server BE2 according to the second unidirectional flow s22. The back-end servers BE1 and BE2 update the initial connection identifier cid1 to the target connection identifier cid2.
[0245] 15. The client sends the updated flow control resources to the front-end server FE through the first fast connection. The front-end server FE determines the updated flow control resources corresponding to the back-end server BE1 and the back-end server BE2 according to the updated flow control resources.
[0246] 16. The front-end server FE sends the corresponding updated flow control resources to the back-end server BE1 according to the second unidirectional flow s21, and sends the corresponding updated flow control resources to the back-end server BE2 according to the second unidirectional flow s22;
[0247] 17. The client sends an updated session key identifier key_phase2 to the front-end server FE through the first fast connection;
[0248] 18. The front-end server determines the target session key key2 based on key_phase2, sends the updated session key identifier key_phase2 to the back-end server BE1 based on the second unidirectional flow s21, and sends the updated session key identifier key_phase2 to the back-end server BE2 based on the second unidirectional flow s22. The back-end server BE1 and the back-end server BE2 determine the target session key key2 based on key_phase2.
[0249] In some embodiments, as Figure 12 As shown, the data request processing method includes:
[0250] S1201: The backend server receives a data request for migration from the front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection;
[0251] S1202: When the data request migration is completed, the backend server initiates a first unidirectional flow of a second fast connection; based on the first unidirectional flow, the backend server sends a migration completion instruction to the frontend server to instruct the frontend server to update the migration status of the data request;
[0252] S1203: The backend server creates a pseudo connection with the client in response to the data request, and obtains target data corresponding to the data request;
[0253] S1204: The backend server determines a first packet number interval based on the data request for migration; encapsulates the first portion of the target data according to the packet numbers in the first packet number interval to obtain a first data packet; and sends the first data packet to the client via a pseudo connection.
[0254] S1205. The backend server sends a third data packet to the client through the pseudo connection, so that the client sends a second confirmation frame to the front-end server upon receiving the third data packet; the packet number of the third data packet falls within the first packet number interval, and the packet number of the third data packet is greater than the packet number of the first data packet;
[0255] S1206. The backend server receives the first confirmation frame and the second packet number interval sent by the front-end server according to the second unidirectional flow of the second fast connection; the first confirmation frame is a confirmation frame sent by the client to the front-end server when confirming receipt of the first data packet;
[0256] S1207. The backend server filters the confirmation information belonging to the first packet number interval in the first confirmation frame; performs packet loss detection based on the confirmation information to obtain a detection result;
[0257] S1208A: When the detection result shows that no packet is lost, the back-end server encapsulates the second portion of the target data according to the packet number in the second packet number interval to obtain a second data packet.
[0258] S1209A. The backend server sends a second data packet to the client through the pseudo connection, so that when the client confirms receipt of the second data packet, it sends a third confirmation frame to the front-end server to instruct the front-end server to feed back a fourth confirmation frame to the client. The fourth confirmation frame is used to indicate that the first confirmation frame has been confirmed.
[0259] S1208B. When the detection result is packet loss, the back-end server performs congestion detection based on the confirmation information to obtain the congestion window and packet sending rate; re-encapsulates the lost packet data based on the packet number in the second packet number interval to obtain a retransmitted data packet; and sends the retransmitted data packet to the client through a pseudo connection based on the congestion window and packet sending rate.
[0260] In the above embodiment, the front-end server receives the data request sent by the client through the first fast connection between the front-end server and the client, determines the back-end server to be scheduled according to the data request, and the front-end server migrates the data request to the back-end server through the second fast connection between the front-end server and the back-end server, so that the back-end server creates a pseudo connection between the client and the client, and the back-end server directly sends the data packet corresponding to the data request to the client based on the pseudo connection. The front-end server performs request-level scheduling and determines that the back-end server to be scheduled has the data to respond to the data request, so that the back-end server can directly respond to the data request without returning to the source to obtain the data to respond to the data request, thereby reducing latency and communication overhead between servers; the back-end server directly sends the data packet to the client through the pseudo connection, rather than the back-end server sending the data packet to the front-end server, and then the front-end server sending the data packet to the client, thereby reducing bandwidth consumption between the back-end server and the front-end server, reducing the pressure on the downstream traffic of the front-end server, improving the upstream throughput of the front-end server, reducing latency, and improving transmission performance.
[0261] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0262] Based on the same inventive concept, embodiments of the present application also provide a data request processing device for implementing the aforementioned data request processing method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of the one or more data request processing device embodiments provided below can be found in the above-mentioned limitations of the data request processing method and will not be repeated here.
[0263] In one embodiment, Figure 13 As shown, a data request processing device is provided, including: a data request receiving module 1301, a backend server scheduling module 1302 and a first data request migration module 1303, wherein:
[0264] The data request receiving module 1301 is configured to receive a data request sent by a client via a first fast connection;
[0265] The backend server scheduling module 1302 is used to determine the backend server to be scheduled based on the data request and create a second fast connection; the second fast connection is a fast connection between the backend server and the backend server;
[0266] The first data request migration module 1303 is configured to migrate the data request to the backend server based on the second fast connection, instruct the backend server to create a pseudo connection with the client, and send a data packet corresponding to the data request to the client based on the pseudo connection.
[0267] In some embodiments, the data request processing device also includes: a migration status update module, which is used to receive a migration completion instruction sent by the back-end server according to the first unidirectional flow of the second fast connection when the data request migration is completed; and update the migration status of the data request based on the migration completion instruction.
[0268] In some embodiments, the data packet includes a first data packet and a second data packet; the data request processing device also includes: a packet number interval sending module, used to receive a first confirmation frame sent by the client based on the first fast connection; the first confirmation frame is a confirmation frame sent by the client when confirming receipt of the first data packet, and the packet number of the first data packet belongs to the first packet number interval; the first confirmation frame and the second packet number interval are sent to the back-end server based on the second fast connection to instruct the back-end server to send a second data packet to the client based on the pseudo connection when it is determined that there is no packet loss based on the first confirmation frame; the packet number of the second data packet belongs to the second packet number interval.
[0269] In some embodiments, the data packet includes a first data packet and a second data packet; the data request processing device further includes: a delayed confirmation module; after receiving a first confirmation frame sent by the client according to the first fast connection, the module is configured to receive a second confirmation frame sent by the client according to the first fast connection; the second confirmation frame is a confirmation frame sent by the client when confirming receipt of a third data packet; the packet number of the third data packet falls within the first packet number interval, and the packet number of the third data packet is greater than the packet number of the first data packet;
[0270] After sending the first confirmation frame and the second packet number interval to the back-end server based on the second fast connection, it is also used to receive the third confirmation frame sent by the client based on the first fast connection; the third confirmation frame is the confirmation frame sent by the client when confirming receipt of the second data packet; the packet number of the second packet number interval is greater than the packet number of the first packet number interval; the fourth confirmation frame is fed back to the client based on the first fast connection to indicate that the client confirms that the first confirmation frame has been confirmed.
[0271] In some embodiments, the data request processing device is also used to create a second unidirectional flow for a second quick connection; the packet number interval sending module is specifically used to send the first confirmation frame and the second packet number interval to the back-end server according to the second unidirectional flow when it is determined that the packet number allocation conditions are met based on the first confirmation frame and the first packet number interval.
[0272] In some embodiments, the data packet further includes a fourth data packet;
[0273] A packet number acquisition request sent by a back-end server is received according to the first unidirectional flow of the second fast connection; in response to the packet number acquisition request, a third packet number interval is sent to the back-end server to instruct the back-end server to send a fourth data packet based on the third packet number interval; the packet number included in the third packet number interval is greater than the packet number included in the first packet number interval.
[0274] In some embodiments, the data request carries initial signaling, which includes client information and flow control resources; the first data request migration module 1303 is specifically used to send a data request to the back-end server based on the second fast connection to instruct the back-end server to create a pseudo connection between the client and the client based on the client information, and to send a data packet corresponding to the data request to the client through the pseudo connection under the limitation of flow control resources.
[0275] In some embodiments, the flow control resources include a flow window value and a connection window value; the data request processing device also includes: a flow control resource update module, which is used to receive the target flow offset sent by the client based on the first fast connection; update the flow window value based on the target flow offset to obtain an updated flow window value; send the updated flow window value to the back-end server based on the second unidirectional flow of the second fast connection; accordingly, under the limitation of the flow control resources, send the data packet corresponding to the data request to the client through the pseudo connection, including: under the limitation of the updated flow window value and the connection window value, send the data packet corresponding to the data request to the client through the pseudo connection.
[0276] In some embodiments, the flow control resource update module is further used to receive a target connection offset sent by the client based on the first quick connection; update the connection window value based on the target connection offset to obtain an updated connection window value; send the updated connection window value to the back-end server based on the second unidirectional flow of the second quick connection; and send a data packet corresponding to the data request to the client through a pseudo connection under the limitation of the flow control resources, including: sending a data packet corresponding to the data request to the client through a pseudo connection under the limitation of the updated connection window value and the flow window value.
[0277] In some embodiments, the initial signaling also includes an initial connection identifier, and the data request processing device also includes: a connection identifier update module, which is used to receive an updated connection identifier frame sent by the client based on the first fast connection; obtain the target connection identifier based on the updated connection identifier frame; send the target connection identifier to the back-end server based on the second unidirectional flow of the second fast connection to instruct the back-end server to send a data packet carrying the target connection identifier to the client through a pseudo connection; send a deactivation connection identifier frame to the client based on the first fast connection; the deactivation connection identifier frame is used to instruct the client to mark the initial connection identifier as deactivated, mark the target connection identifier as in use, and receive a data packet carrying the target connection identifier.
[0278] In some embodiments, the data request processing device also includes: a session key update module, which is used to receive an updated session key identifier sent by the client based on the first quick connection; determine the target session key based on the updated session key identifier; the target session key is obtained by updating the initial session key included in the initial signaling; based on the second unidirectional flow of the second quick connection, send the updated session key identifier to the back-end server to instruct the back-end server to determine the target session key based on the updated session key identifier, and encrypt the data packet corresponding to the data request based on the target session key.
[0279] In some embodiments, the session key update module is further used to receive a fifth confirmation frame sent by the client based on the first quick connection; the fifth confirmation frame is sent by the client when receiving a data packet encrypted based on the target session key; and to feed back a sixth confirmation frame to the client based on the first quick connection to indicate that the client has determined that the initial session key has been updated to the target session key.
[0280] In one embodiment, Figure 14 As shown, a data request processing device is provided, including: a second data request migration module 1401, a target data acquisition module 1402 and a data packet sending module 1403, wherein:
[0281] The second data request migration module 1401 is configured to receive a data request for migration from the front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection;
[0282] The target data acquisition module 1402 is used to create a pseudo connection with the client in response to a data request, and to acquire target data corresponding to the data request;
[0283] The data packet sending module 1403 is configured to send a data packet encapsulating target data to the client via a pseudo connection.
[0284] In some embodiments, the data request processing device further includes:
[0285] The migration completion instruction sending module is used to create a first unidirectional flow of the second fast connection when the data request migration is completed; based on the first unidirectional flow, send a migration completion instruction to the front-end server to instruct the front-end server to update the migration status of the data request.
[0286] In some embodiments, the data packet includes a first data packet, and the data packet sending module 1403 is specifically used to determine the first packet number interval based on the migration data request; encapsulate the first part of the target data according to the packet number of the first packet number interval to obtain a first data packet; and send the first data packet to the client through a pseudo connection.
[0287] In some embodiments, the data packet also includes a second data packet and a third data packet; the data packet sending module 1403 is also used to send the third data packet to the client through a pseudo connection, so that when the client receives the third data packet, it sends a second confirmation frame to the front-end server; the packet number of the third data packet belongs to the first packet number interval, and the packet number of the third data packet is greater than the packet number of the first data packet; according to the second unidirectional flow of the second fast connection, the first confirmation frame and the second packet number interval sent by the front-end server are received; the first confirmation frame is a confirmation frame sent to the front-end server when the client confirms receipt of the first data packet; packet loss detection is performed based on the first confirmation frame to obtain a detection result; when the detection result is that there is no packet loss, the second part of the target data is encapsulated according to the packet number of the second packet number interval to obtain a second data packet; the second data packet is sent to the client through the pseudo connection, so that when the client confirms receipt of the second data packet, it sends a third confirmation frame to the front-end server to instruct the front-end server to feedback a fourth confirmation frame to the client, and the fourth confirmation frame is used to indicate that the first confirmation frame has been confirmed.
[0288] In some embodiments, the data request processing device also includes: filtering confirmation information belonging to the first packet number interval in the first confirmation frame; performing packet loss detection based on the confirmation information to obtain a detection result; when the detection result is packet loss, performing congestion detection based on the confirmation information to obtain a congestion window and a packet sending rate; re-encapsulating the lost packet data based on the packet number in the second packet number interval to obtain a retransmitted data packet; and sending the retransmitted data packet to the client through a pseudo connection based on the congestion window and the packet sending rate.
[0289] Each module in the aforementioned data request processing device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0290] In one embodiment, a computer device is provided. The computer device may be a front-end server or a back-end server. The internal structure diagram thereof may be as follows: Figure 15As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data in response to data requests. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for processing data requests is implemented.
[0291] Those skilled in the art will understand that Figure 15 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0292] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0293] Receive a data request sent by a client through a first fast connection; determine a backend server to be scheduled based on the data request and create a second fast connection; the second fast connection is a fast connection between the backend server and the client; migrate the data request to the backend server based on the second fast connection to instruct the backend server to create a pseudo connection between the client and the client, and send a data packet corresponding to the data request to the client based on the pseudo connection; or
[0294] Receive a data request for migration from the front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection; in response to the data request, create a pseudo connection with the client, and obtain target data corresponding to the data request; send a data packet encapsulating the target data to the client through the pseudo connection.
[0295] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0296] Receive a data request sent by a client through a first fast connection; determine a backend server to be scheduled based on the data request and create a second fast connection; the second fast connection is a fast connection between the backend server and the client; migrate the data request to the backend server based on the second fast connection to instruct the backend server to create a pseudo connection between the client and the client, and send a data packet corresponding to the data request to the client based on the pseudo connection; or
[0297] Receive a data request for migration from the front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection; in response to the data request, create a pseudo connection with the client, and obtain target data corresponding to the data request; send a data packet encapsulating the target data to the client through the pseudo connection.
[0298] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0299] Receive a data request sent by a client through a first fast connection; determine a backend server to be scheduled based on the data request and create a second fast connection; the second fast connection is a fast connection between the backend server and the client; migrate the data request to the backend server based on the second fast connection to instruct the backend server to create a pseudo connection between the client and the client, and send a data packet corresponding to the data request to the client based on the pseudo connection; or
[0300] Receive a data request for migration from the front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection; in response to the data request, create a pseudo connection with the client, and obtain target data corresponding to the data request; send a data packet encapsulating the target data to the client through the pseudo connection.
[0301] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0302] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0303] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0304] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for processing a data request, characterized in that: The method comprises: receiving a data request sent by a client through a first fast connection; the data request carries initial signaling, the initial signaling includes client information and flow control resources; the flow control resources include a flow window value and a connection window value; Determine a backend server to be scheduled based on the data request, and create a second fast connection; the second fast connection is a fast connection between the backend server and the backend server; Receiving a target stream offset sent by the client according to the first fast connection; updating the stream window value based on the target stream offset to obtain an updated stream window value; and sending the updated stream window value to the backend server according to the second unidirectional stream of the second fast connection; The data request is sent to the back-end server according to the second quick connection to instruct the back-end server to create a pseudo connection with the client based on the client information, and to send the data packet corresponding to the data request to the client through the pseudo connection under the constraints of the updated flow window value and the connection window value.
2. The method according to claim 1, characterized in that The method further comprises: When the data request migration is completed, receiving a migration completion instruction sent by the backend server according to the first unidirectional flow of the second fast connection; The migration status of the data request is updated based on the migration completion instruction.
3. The method according to claim 1, characterized in that The data packet includes a first data packet and a second data packet; the method further includes: receiving a first confirmation frame sent by the client according to the first fast connection; the first confirmation frame is a confirmation frame sent by the client when confirming receipt of the first data packet, and the packet number of the first data packet belongs to a first packet number interval; The first confirmation frame and the second packet number interval are sent to the back-end server based on the second quick connection to instruct the back-end server to send the second data packet to the client based on the pseudo connection when it is determined that there is no packet loss based on the first confirmation frame; the packet number of the second data packet belongs to the second packet number interval.
4. The method according to claim 3, characterized in that The data packet further includes a third data packet; and after receiving the first confirmation frame sent by the client according to the first fast connection, the method further includes: receiving, based on the first fast connection, a second confirmation frame sent by the client; the second confirmation frame being a confirmation frame sent by the client when confirming receipt of the third data packet; the packet number of the third data packet being within the first packet number range, and the packet number of the third data packet being greater than the packet number of the first data packet; After sending the first confirmation frame and the second packet number interval to the backend server according to the second fast connection, the method further includes: receiving a third confirmation frame sent by the client according to the first fast connection; the third confirmation frame is a confirmation frame sent by the client when confirming receipt of the second data packet; the packet number in the second packet number interval is greater than the packet number in the first packet number interval; Feedback a fourth confirmation frame to the client according to the first fast connection to indicate to the client that the first confirmation frame has been confirmed.
5. The method according to claim 3, characterized in that The method further comprises: Initiating a second unidirectional flow of the second fast connection; The sending the first confirmation frame and the second packet number interval to the backend server according to the second fast connection includes: When it is determined based on the first confirmation frame and the first packet number interval that the packet number allocation condition is met, the first confirmation frame and the second packet number interval are sent to the backend server according to the second unidirectional flow.
6. The method according to claim 5, characterized in that The data packet further includes a fourth data packet; and the method further includes: receiving a packet number acquisition request sent by the backend server according to the first unidirectional flow of the second fast connection; In response to the packet number acquisition request, a third packet number interval is sent to the backend server to instruct the backend server to send the fourth data packet based on the third packet number interval; the packet number included in the third packet number interval is greater than the packet number included in the first packet number interval.
7. The method according to any one of claims 1 to 6, characterized in that The first quick connection is a quick connection based on the QUIC protocol, and the data request is a video data request.
8. The method according to claim 1, characterized in that Determining the backend server to be scheduled based on the data request and creating a second quick connection includes: The dispatch center determines the address of the back-end server that actually responds to the data request, and creates a second fast connection based on the address.
9. The method according to claim 1, characterized in that The flow control resources include a flow window value and a connection window value; the method further includes: receiving, according to the first quick connection, a target connection offset sent by the client; Updating the connection window value based on the target connection offset to obtain an updated connection window value; Sending the updated connection window value to the backend server according to the second unidirectional flow of the second fast connection; Under the constraints of the updated connection window value and the stream window value, a data packet corresponding to the data request is sent to the client through the pseudo connection.
10. The method according to claim 1, characterized in that The initial signaling further includes an initial connection identifier; and the method further includes: receiving, according to the first fast connection, an update connection identification frame sent by the client; Acquire a target connection identifier based on the update connection identifier frame; sending the target connection identifier to the backend server according to the second unidirectional flow of the second fast connection, so as to instruct the backend server to send a data packet carrying the target connection identifier to the client through the pseudo connection; A deactivate connection identification frame is sent to the client according to the first fast connection; the deactivate connection identification frame is used to instruct the client to mark the initial connection identification as deactivated, mark the target connection identification as used, and receive a data packet carrying the target connection identification.
11. The method according to claim 1, wherein The method further comprises: receiving, according to the first fast connection, an updated session key identifier sent by the client; Determining a target session key based on the updated session key identifier; the target session key is obtained by updating the initial session key included in the initial signaling; According to the second unidirectional flow of the second fast connection, the updated session key identifier is sent to the backend server to instruct the backend server to determine the target session key based on the updated session key identifier and encrypt the data packet corresponding to the data request based on the target session key.
12. The method according to claim 11, characterized in that The method further comprises: receiving a fifth confirmation frame sent by the client according to the first fast connection; the fifth confirmation frame is sent by the client when receiving a data packet encrypted based on the target session key; Feedback a sixth confirmation frame to the client according to the first quick connection to indicate that the client has determined that the initial session key has been updated to the target session key.
13. A method for processing a data request, characterized in that: The method comprises: receiving a data request for migration from a front-end server based on the second fast connection; the data request is a request sent by the client to the front-end server based on the first fast connection; the data request carries initial signaling, the initial signaling includes client information and flow control resources; the flow control resources include a flow window value and a connection window value; In response to the data request, establishing a pseudo connection with the client, and obtaining target data corresponding to the data request; Under the constraints of the updated flow window value and the connection window value, a data packet encapsulating the target data is sent to the client through the pseudo connection; wherein, the updated flow window value is sent by the front-end server based on the second unidirectional flow of the second fast connection, and is updated by the front-end server based on the target flow offset, and the target flow offset is received by the front-end server based on the first fast connection from the client.
14. The method according to claim 13, characterized in that After receiving the data request for migration of the front-end server based on the second fast connection, the method further includes: When the data request migration is completed, creating a first unidirectional flow of the second fast connection; According to the first unidirectional flow, a migration completion instruction is sent to the front-end server to instruct the front-end server to update the migration status of the data request.
15. The method according to claim 13, characterized in that The data packet includes a first data packet; and sending the data packet encapsulating the target data to the client through the pseudo connection includes: Determining a first packet number interval based on the migrated data request; Encapsulating a first portion of the target data according to the packet number in the first packet number interval to obtain a first data packet; The first data packet is sent to the client through the pseudo connection.
16. The method according to claim 15, characterized in that The data packet also includes a second data packet and a third data packet; After sending the first data packet to the client through the pseudo connection, the method further includes: sending the third data packet to the client through the pseudo connection, so that the client sends a second confirmation frame to the front-end server when receiving the third data packet; the packet number of the third data packet falls within the first packet number interval, and the packet number of the third data packet is greater than the packet number of the first data packet; receiving, according to a second unidirectional flow of the second fast connection, a first confirmation frame and a second packet number interval sent by the front-end server; the first confirmation frame is a confirmation frame sent by the client to the front-end server when confirming receipt of the first data packet; Performing packet loss detection based on the first confirmation frame to obtain a detection result; When the detection result is that there is no packet loss, encapsulating the second portion of the target data according to the packet number in the second packet number interval to obtain a second data packet; The second data packet is sent to the client through the pseudo connection, so that when the client confirms receipt of the second data packet, a third confirmation frame is sent to the front-end server to instruct the front-end server to feedback a fourth confirmation frame to the client, and the fourth confirmation frame is used to indicate that the first confirmation frame has been confirmed.
17. The method according to claim 16, characterized in that The performing packet loss detection based on the first confirmation frame to obtain a detection result includes: Filtering the first confirmation frame for confirmation information belonging to the first packet number interval; Perform packet loss detection based on the confirmation information to obtain a detection result; The data packet also includes a retransmission data packet; the method further includes: When the detection result is packet loss, performing congestion detection based on the confirmation information to obtain a congestion window and a packet sending rate; Re-encapsulating the lost packet data based on the packet numbers in the second packet number interval to obtain a retransmitted data packet; The retransmitted data packet is sent to the client through the pseudo connection according to the congestion window and the packet sending rate.
18. A data request processing device, characterized in that: Applied to a front-end server, the device includes: a data request receiving module, configured to receive a data request sent by a client through a first fast connection; the data request carries initial signaling, the initial signaling includes client information and flow control resources; the flow control resources include a flow window value and a connection window value; a backend server scheduling module, configured to determine a backend server to be scheduled based on the data request and to create a second fast connection; the second fast connection being a fast connection with the backend server; a flow control resource update module, configured to receive a target flow offset sent by the client according to the first fast connection; update the flow window value based on the target flow offset to obtain an updated flow window value; and send the updated flow window value to the backend server according to the second unidirectional flow of the second fast connection; A first data request migration module is used to send the data request to the back-end server based on the second quick connection to instruct the back-end server to create a pseudo connection between the client and the client based on the client information, and to send the data packet corresponding to the data request to the client through the pseudo connection under the constraints of the updated flow window value and the connection window value.
19. The device according to claim 18, characterized in that The device further comprises: A migration status update module is configured to receive a migration completion instruction sent by the backend server according to the first unidirectional flow of the second fast connection when the migration of the data request is completed; and update the migration status of the data request based on the migration completion instruction.
20. The device according to claim 18, characterized in that The data packet includes a first data packet and a second data packet; the apparatus further includes: A packet number interval sending module is used to receive a first confirmation frame sent by the client based on the first fast connection; the first confirmation frame is a confirmation frame sent by the client when confirming receipt of the first data packet, and the packet number of the first data packet belongs to the first packet number interval; the first confirmation frame and the second packet number interval are sent to the back-end server based on the second fast connection to instruct the back-end server to send the second data packet to the client based on the pseudo connection when it is determined that there is no packet loss based on the first confirmation frame; the packet number of the second data packet belongs to the second packet number interval.
21. The device according to claim 20, characterized in that The data packet further includes a third data packet; and the apparatus further includes: A delayed confirmation module is used to receive a second confirmation frame sent by the client based on the first fast connection; the second confirmation frame is a confirmation frame sent by the client when confirming receipt of the third data packet; the packet number of the third data packet belongs to the first packet number interval, and the packet number of the third data packet is greater than the packet number of the first data packet; receive a third confirmation frame sent by the client based on the first fast connection; the third confirmation frame is a confirmation frame sent by the client when confirming receipt of the second data packet; the packet number of the second packet number interval is greater than the packet number of the first packet number interval; and feed back a fourth confirmation frame to the client based on the first fast connection to indicate that the client has determined that the first confirmation frame has been confirmed.
22. The device according to claim 20, characterized in that The device further comprises: Initiating a second unidirectional flow of the second fast connection; The packet number interval sending module is specifically configured to send the first confirmation frame and the second packet number interval to the backend server according to the second unidirectional flow when it is determined that the packet number allocation condition is met based on the first confirmation frame and the first packet number interval.
23. The device according to claim 22, characterized in that The data packet further includes a fourth data packet; and the apparatus further includes: receiving a packet number acquisition request sent by the backend server according to the first unidirectional flow of the second fast connection; In response to the packet number acquisition request, a third packet number interval is sent to the backend server to instruct the backend server to send the fourth data packet based on the third packet number interval; the packet number included in the third packet number interval is greater than the packet number included in the first packet number interval.
24. The device according to any one of claims 18 to 23, characterized in that The first quick connection is a quick connection based on the QUIC protocol, and the data request is a video data request.
25. The device according to claim 18, wherein The back-end server scheduling module is further configured to determine, through a scheduling center, an address of a back-end server that actually responds to the data request, and create a second fast connection based on the address.
26. The device according to claim 18, characterized in that The flow control resources include a flow window value and a connection window value; the device further includes: a flow control resource update module, configured to receive a target connection offset sent by the client according to the first fast connection; update the connection window value based on the target connection offset to obtain an updated connection window value; and send the updated connection window value to the backend server according to the second unidirectional flow of the second fast connection; The first data request migration module is specifically configured to send a data packet corresponding to the data request to the client through the pseudo connection under the constraints of the updated connection window value and the flow window value.
27. The device according to claim 18, characterized in that The initial signaling further includes an initial connection identifier; and the device further includes: A connection identifier update module is used to receive an updated connection identifier frame sent by the client based on the first fast connection; obtain a target connection identifier based on the updated connection identifier frame; send the target connection identifier to the back-end server based on the second unidirectional flow of the second fast connection to instruct the back-end server to send a data packet carrying the target connection identifier to the client through the pseudo connection; send a deactivate connection identifier frame to the client based on the first fast connection; the deactivate connection identifier frame is used to instruct the client to mark the initial connection identifier as deactivated, mark the target connection identifier as in use, and receive a data packet carrying the target connection identifier.
28. The device according to claim 18, wherein The device further comprises: A session key update module is configured to receive an updated session key identifier sent by the client based on the first quick connection; determine a target session key based on the updated session key identifier; the target session key is obtained by updating the initial session key included in the initial signaling; and send the updated session key identifier to the back-end server based on the second unidirectional flow of the second quick connection to instruct the back-end server to determine the target session key based on the updated session key identifier and encrypt the data packet corresponding to the data request based on the target session key.
29. The device according to claim 28, characterized in that The device further comprises: The session key update module is further configured to receive a fifth confirmation frame sent by the client based on the first quick connection; the fifth confirmation frame is sent by the client when receiving a data packet encrypted based on the target session key; and to feed back a sixth confirmation frame to the client based on the first quick connection to indicate that the client has determined that the initial session key has been updated to the target session key.
30. A data request processing device, characterized in that: The device comprises: a second data request migration module configured to receive a data request for migration from a front-end server based on a second fast connection; the data request is a request sent by a client to the front-end server based on the first fast connection; the data request carries initial signaling, the initial signaling including client information and flow control resources; the flow control resources including a flow window value and a connection window value; a target data acquisition module, configured to create a pseudo connection with the client in response to the data request, and acquire target data corresponding to the data request; A data packet sending module is used to send a data packet encapsulating the target data to the client through the pseudo connection under the constraints of the updated flow window value and the connection window value; wherein, the updated flow window value is sent by the front-end server based on the second unidirectional flow of the second fast connection, and is updated by the front-end server based on the target flow offset, and the target flow offset is received by the front-end server based on the first fast connection from the client.
31. The device according to claim 30, characterized in that Also includes: a migration completion instruction sending module, configured to create a first unidirectional flow of the second fast connection when the data request migration is completed; According to the first unidirectional flow, a migration completion instruction is sent to the front-end server to instruct the front-end server to update the migration status of the data request.
32. The device according to claim 30, characterized in that The data packet sending module is specifically used to determine a first packet number interval based on the migrated data request; encapsulate the first part of the target data according to the packet number of the first packet number interval to obtain a first data packet; and send the first data packet to the client through the pseudo connection.
33. The device according to claim 32, characterized in that The data packet also includes a second data packet and a third data packet; The data packet sending module is further configured to send the third data packet to the client through the pseudo connection, so that the client sends a second confirmation frame to the front-end server upon receiving the third data packet; the packet number of the third data packet belongs to the first packet number interval, and the packet number of the third data packet is greater than the packet number of the first data packet; and receive the first confirmation frame and the second packet number interval sent by the front-end server according to the second unidirectional flow of the second fast connection; The first confirmation frame is a confirmation frame sent by the client to the front-end server when confirming receipt of the first data packet; Perform packet loss detection based on the first confirmation frame to obtain a detection result; when the detection result is that there is no packet loss, encapsulate the second part of the target data according to the packet number in the second packet number interval to obtain a second data packet; send the second data packet to the client through the pseudo connection, so that when the client confirms receipt of the second data packet, it sends a third confirmation frame to the front-end server to instruct the front-end server to feed back a fourth confirmation frame to the client, and the fourth confirmation frame is used to indicate that the first confirmation frame has been confirmed.
34. The device according to claim 33, characterized in that The data packet sending module is further configured to filter confirmation information belonging to the first packet number interval in the first confirmation frame; perform packet loss detection based on the confirmation information to obtain a detection result; When the detection result is packet loss, performing congestion detection based on the confirmation information to obtain a congestion window and a packet sending rate; Re-encapsulating the lost packet data based on the packet numbers in the second packet number interval to obtain a retransmitted data packet; The retransmitted data packet is sent to the client through the pseudo connection according to the congestion window and the packet sending rate.
35. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 17 are implemented.
36. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 17 are implemented.
37. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 17 are implemented.
Citation Information
Patent Citations
Transparent migration of endpoint
CN102238086A
Method and equipment for carrying out video transmission
CN104427353A
Data transmission method, system, and proxy server
CN109088892A
Streaming media communication method, system and device and storage medium
CN114615237A
Data processing method, device and equipment of wind power monitoring equipment and storage medium
CN115297194A