Request sending method, device and equipment, computer storage medium and computer program product
By selecting either the QUIC or HTTPS/HTTP/2 protocol interface between the client and server, and employing error correction, retransmission, and forward secrecy algorithms to process requests, the problem of low communication efficiency in existing technologies is solved, achieving efficient and secure data transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2026-03-03
AI Technical Summary
In existing technologies, data communication between clients and servers is inefficient, mainly because the Axios network request library can only call interfaces based on HTTPS and HTTP/2 protocols, resulting in low communication efficiency.
The target interface is determined by the target network request library based on the first type interface of the QUIC protocol and the second type interface of the HTTPS/HTTP/2 protocol. The target network request library is used to send the request to the server, and error correction algorithm, retransmission algorithm and forward secrecy algorithm are used to process the request to achieve data communication.
It significantly improves the data transmission efficiency between the client and the server, enhances the real-time performance and security of data transmission, and solves the problem of low communication efficiency.
Smart Images

Figure CN121603484A_ABST
Abstract
Description
Technical Field
[0001] This application relates to request processing technology in the field of network technology, and more particularly to a request sending method, apparatus, device, computer storage medium, and computer program product. Background Technology
[0002] Currently, clients typically retrieve necessary network information from servers by sending network requests. When sending these requests, clients usually use the Axios network request library, which is based on the Ajax-input / output system. Specifically, the Axios library first creates an instance of an extensible hypertext transfer request (HTTP) object, and then uses this instance to call the client's application programming interface (API) to send the network request to the server. However, because the current Axios library can only call interfaces based on Hypertext Transfer Protocol Secure (HTTPS) and Hypertext Transfer Protocol version 2 (HTTP version 2), there is a problem of poor communication efficiency between the client and server when using the Axios library for data communication. Summary of the Invention
[0003] To address the aforementioned technical problems, this application aims to provide a request sending method, apparatus, device, computer storage medium, and computer program product, thereby resolving the issue of poor communication efficiency between the client and server during data communication in related technologies.
[0004] The technical solution of this application is implemented as follows:
[0005] This application provides a request sending method, the method including:
[0006] Based on the target information in the target network request library, the target interface is determined from the first type of interface and the second type of interface; wherein, the target information is used to determine whether to call the first type of interface; the communication protocol corresponding to the first type of interface is the Fast User Datagram Protocol (FAP) network connection protocol.
[0007] Using the target network request library, a request to obtain network information is sent to the server through the target interface.
[0008] In the above scheme, determining the target interface from the first type of interface and the second type of interface based on the target information in the target network request library includes:
[0009] The target component is determined based on the target parameters in the target network request library; wherein, the target information includes the target parameters;
[0010] Based on the target component, the target interface is determined from the first type interface and the second type interface.
[0011] In the above scheme, determining the target component based on the target parameters in the target network request library includes:
[0012] If the value of the target parameter is a first value, the component corresponding to the first type of interface is determined to be the target component;
[0013] If the value of the target parameter is the second value or the target parameter is not assigned a value, the component corresponding to the second type of interface is determined to be the target component.
[0014] In the above scheme, determining the target interface from the first type of interface and the second type of interface based on the target component includes:
[0015] If the target component is a component corresponding to the first type of interface, then the first type of interface is determined to be the target interface;
[0016] If the target component is the component corresponding to the second type interface, then the second type interface is determined to be the target interface.
[0017] In the above scheme, the step of using the target network request library to send a request for obtaining network information to the server through the target interface includes:
[0018] If the target interface is the first type of interface, the request is processed to obtain the target request;
[0019] The target network request library is used to send the target request to the server by calling the first type of interface.
[0020] In the above scheme, processing the request to obtain the processed target request includes:
[0021] The request is processed using a target error correction algorithm and a target retransmission algorithm to obtain a processed request;
[0022] The processed request is encrypted using a target forward secrecy algorithm to obtain the target request.
[0023] The method in the above scheme further includes:
[0024] Send connection information for establishing a communication connection to the server;
[0025] The client receives the response information sent by the server to establish a communication connection between the client and the server.
[0026] This application embodiment also provides a request sending device, the device comprising:
[0027] The determining unit is configured to determine a target interface from a first type of interface and a second type of interface based on target information in the target network request library; wherein the target information is used to determine whether to call the first type of interface; the protocol corresponding to the first type of interface is the Fast User Datagram Protocol (FAP) network connection protocol.
[0028] The sending unit is used to send a request for obtaining network information to the server through the target interface using the target network request library.
[0029] This application embodiment also provides a client, the client including: a processor, a memory, and a communication bus;
[0030] The communication bus is used to realize the communication connection between the processor and the memory;
[0031] The processor is used to execute the request sending program in the memory to implement the steps of the request sending method described above.
[0032] This application also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the request sending method described above.
[0033] This application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described request sending method.
[0034] The request sending method, apparatus, device, computer storage medium, and computer program product provided in this application embodiment can determine the target interface from the first type interface and the second type interface based on the target information in the target network request library used to determine whether to call the first type interface. The protocol corresponding to the first type interface is the Quick User Datagram Protocol Internet Connection (QUIC). Then, using the target network request library, a request to obtain network information is sent to the server through the target interface. In this way, the target interface for sending client requests can be determined from the first type interface based on the Quick User Datagram Protocol Internet Connection (QUIC) protocol and the second type interface based on the HTTPS protocol or the HTTP / 2 protocol through the target information in the target network request library. That is, during data communication, the target network request library can call either the second type interface based on the HTTPS protocol or the HTTP / 2 protocol to send requests, or it can call the first type interface based on the QUIC protocol to send requests, instead of only being able to call the interface based on the HTTPS protocol or the HTTP / 2 protocol as in related technologies. This solves the problem of poor communication efficiency between the client and the server during data communication in related technologies. Attached Figure Description
[0035] Figure 1 A flowchart illustrating a request sending method provided in an embodiment of this application;
[0036] Figure 2 A flowchart illustrating another request sending method provided in an embodiment of this application;
[0037] Figure 3 This is a schematic diagram illustrating interface selection in a request sending method provided in an embodiment of this application;
[0038] Figure 4 This is a schematic diagram of data communication in a request sending method provided in an embodiment of this application;
[0039] Figure 5 This is a schematic diagram of the structure of a request sending device provided in an embodiment of this application;
[0040] Figure 6 This is a schematic diagram of the structure of a client provided in an embodiment of this application. Detailed Implementation
[0041] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0042] It should be understood that the phrases "embodiments of this application" or "foreign embodiments" throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "embodiments of this application" or "in the foreign embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0043] Unless otherwise specified, any step in the embodiments of this application performed by the electronic device may be executed by the processor of the electronic device. It is also worth noting that the embodiments of this application do not limit the order in which the electronic device performs the following steps. Furthermore, the methods used to process data in different embodiments may be the same or different methods. It should also be noted that any step in the embodiments of this application can be executed independently by the electronic device; that is, when the electronic device performs any step in the following embodiments, it may not depend on the execution of other steps.
[0044] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0045] This application provides a method that can be applied to a client, as shown in the following embodiments. Figure 1 As shown, the method may include the following steps:
[0046] Step 101: Based on the target information in the target network request library, determine the target interface from the first type interface and the second type interface.
[0047] The target information is used to determine whether to invoke the first type of interface; the protocol corresponding to the first type of interface is the Fast User Datagram Protocol (QUIC). It should be noted that the Fast User Datagram Protocol is the same as the QUIC protocol.
[0048] In this embodiment, the target network request library may refer to the Axios network request library (hereinafter referred to as the Axios library), and the protocol corresponding to the first type of interface may refer to the communication protocol used when communicating data through the first type of interface. In one possible implementation, the first type of interface may refer to a Webtransport API interface based on the QUIC protocol, the second type of interface may refer to an API interface based on the HTTPS protocol or the HTTP / 2 protocol, and the target interface may refer to the interface used by the client to send a request to obtain network information. The second type of interface may refer to the client's Representational State Transfer (REST) API interface.
[0049] It should be noted that the Axios library can run not only on the client but also on the server; HTTPS and HTTP / 2 are both protocols based on the Transmission Control Protocol (TCP).
[0050] In this embodiment, the target component corresponding to the request can be determined through target information in the target network library. Then, the target interface is determined from the first type interface and the second type interface based on the determined target component. In one possible implementation, the target information may refer to a piece of program code in the Axios library.
[0051] Step 102: Using the target network request library, send a request to the server to obtain target information through the target interface.
[0052] In this embodiment, the request may include different types of parameters. Specifically, the request may include a request path, a protocol version, request header parameters, and request body parameters. The protocol version may refer to the version of the transport protocol used by the target interface; the request header parameters may include data such as the type of the client initiating the request, the types of data the client can accept, and the address of the server; the request body parameters may include the data actually sent by the client to the server.
[0053] In this embodiment of the application, if the target interface is a first type interface, a request can be sent to the server by calling the first type interface through the target network request library; if the target interface is a second type interface, a request can be sent to the server by calling the second type interface through the target network request library.
[0054] The request sending method provided in the embodiments of this application can determine the target interface for sending client requests from a first type interface based on the QUIC protocol and a second type interface based on the HTTPS protocol or the HTTP / 2 protocol through target information in the target network request library. That is, during data communication, the target network request library can call the second type interface based on the HTTPS protocol or the HTTP / 2 protocol to send requests, or it can call the first type interface based on the QUIC protocol to send requests, instead of only being able to call the interface based on the HTTPS protocol or the HTTP / 2 protocol to send requests as in related technologies. This solves the problem of poor communication efficiency between the client and the server during data communication in related technologies.
[0055] Based on the foregoing embodiments, embodiments of this application provide a request sending method, referring to... Figure 2 As shown, the method may include the following steps:
[0056] Step 201: The client determines the target component based on the target parameters in the target network request library.
[0057] The target information includes target parameters.
[0058] In this embodiment, the target component corresponds to the interface type; that is, the target components corresponding to the first type of interface and the second type of interface are different. In one possible implementation, the target component can refer to an adapter in the Axios library. The Axios library can include different types of adapters; specifically, it can include a Webtransport adapter, an Extensible Hypertext Transfer Request (XHR) adapter, and a Hypertext Transfer Protocol (HTTP) adapter. It should be noted that the XHR and HTTP adapters are pre-existing adapters in the Axios library, while the Webtransport adapter is added to the Axios library by adding corresponding program code. It should also be noted that the Webtransport and XHR adapters are used on the client side, while the HTTP adapter is used on the server side. That is, when the client sends a request to the server through the Axios library, it uses either the Webtransport adapter or the XHR adapter; while when the server sends a request to the client through the Axios library, it uses the HTTP adapter.
[0059] In this embodiment of the application, the value of the target parameter can be detected first, and the adapter (i.e. the target component) corresponding to the request can be determined based on the value of the target parameter.
[0060] In the embodiments of this application, step 201 can be implemented by steps 201a to 201b.
[0061] Step 201a: If the value of the target parameter is the first value, the client determines the component corresponding to the first type of interface as the target component.
[0062] In this embodiment, the value of the target parameter can refer to a Boolean value, and the component corresponding to the first type of interface can refer to a Webtransport adapter. Specifically, as shown... Figure 3 As shown, the target parameter can refer to enableWebtransport. In this case, if the boolean value of the target parameter (i.e., the boolean value of enableWebtransport) is detected to be "1" or "True", the client will determine the Webtransport adapter (i.e. the component corresponding to the first type of interface) as the target component.
[0063] It should be noted that the values of the target parameters are set according to the actual application scenario and user needs.
[0064] Step 201b: If the value of the target parameter is the second value or the target parameter is not assigned a value, the client determines that the component corresponding to the second type of interface is the target component.
[0065] In this embodiment of the application, the component corresponding to the second type of interface may refer to an XHR adapter. Specifically, such as Figure 3 As shown, if the boolean value of the target parameter (i.e., the boolean value of enableWebtransport) is detected as "0" or "False", the client will identify the XHR adapter as the target component. Correspondingly, if the target parameter is not assigned a value, i.e., the target parameter is defined as "undefined", the client will also identify the XHR adapter corresponding to the second type interface as the target component.
[0066] In one feasible approach, the portion of the program code that determines the target component based on the target parameters can be shown below:
[0067]
[0068] Step 202: The client determines the target interface from the first type interface and the second type interface based on the target component.
[0069] The protocol corresponding to the first type of interface is the Fast User Datagram Protocol (FAP) network connection protocol.
[0070] In this embodiment of the application, after the target component is determined, the target interface called by the client in sending the request can be determined according to the type of the target component.
[0071] In the embodiments of this application, step 202 can be implemented by steps 202a to 202b.
[0072] Step 202a: If the target component is the component corresponding to the first type of interface, the client determines the first type of interface as the target interface.
[0073] In this embodiment of the application, if the target component is determined to be a Webtransport adapter, the client will determine the Webtransport API interface (i.e., the first type interface) based on the QUIC protocol as the target interface for sending requests.
[0074] Step 202b: If the target component is the component corresponding to the second type of interface, the client determines the second type of interface as the target interface.
[0075] In this embodiment of the application, if the target component is determined to be an XHR adapter, the client will determine the API interface (i.e., the second type interface) based on the HTTPS protocol or the HTTP / 2 protocol as the target interface for sending the request.
[0076] In the embodiments of this application, steps 203-204 or step 205 can be executed after step 202.
[0077] Step 203: If the target interface is a first-type interface, the client processes the request to obtain the target request.
[0078] In this embodiment of the application, if the target interface is a Webtransport API interface based on the QUIC protocol (i.e., the first type of interface), the client will perform verification and encryption on the data in the request in order to obtain the target request.
[0079] In this embodiment of the application, the "client processes the request to obtain the target request" in step 203 can be achieved through steps 203a to 203b.
[0080] Step 203a: The client processes the request using the target error correction algorithm and the target retransmission algorithm to obtain the processed request.
[0081] It should be noted that the target error correction algorithm can refer to the forward error correction (FEC) algorithm, and the target retransmission algorithm can refer to the retransmission mechanism.
[0082] In this embodiment, different types of parameters in the request can be validated first to determine whether the request is missing any necessary parameters (i.e., whether the request includes the request path, protocol version, request header parameters, and request body parameters). If the validation is successful, the client will check whether the data exchange format defined in the request body parameters is the same as the data exchange format of the protocol corresponding to the first type of interface. In one possible implementation, if the target interface is a Webtransport API interface based on the QUIC protocol, the corresponding data exchange format is application / json. In this case, it is possible to check whether the data exchange format defined in the request body parameters is application / json.
[0083] In this embodiment, if it is determined that the data exchange format defined in the request body parameters is the same as the data exchange format corresponding to the first type of interface, the request header parameters can be compressed using header compression technology. Then, the FEC algorithm is used to encode the data in the target request, i.e., adding redundant information to the request, resulting in a request containing redundant information. Subsequently, the data in the request can be divided into multiple data packets, and a unique identifier (ID) is assigned to each data packet through a retransmission mechanism, i.e., each data packet is numbered, thus obtaining the target request. In one possible implementation, the redundant information can refer to Hamming codes or convolutional codes; the retransmission mechanism can refer to the Acknowledgement Character (ACK) mechanism.
[0084] In this embodiment of the application, the request header parameters are compressed using header compression technology, which significantly reduces the size of the request header. This reduces communication overhead during data transmission and improves the communication efficiency between the client and the server.
[0085] In this embodiment, by employing a forward error correction algorithm to process the request, the server can correct the errors in the data by utilizing the redundant information carried in the request after receiving the request and detecting errors in the data in the request, thereby improving the reliability and integrity of the transmitted data. In addition, by employing a retransmission mechanism to assign a unique ID to each data packet of the request, feedback information indicating whether the data packet sent by the server has been successfully received can be obtained in a timely manner, and the corresponding data packet can be retransmitted in a timely manner when a data packet is not successfully received, thereby improving the efficiency of data transmission and ensuring the stability of data transmission.
[0086] Step 203b: The client uses the target forward secrecy algorithm to encrypt the processed request to obtain the target request.
[0087] In one feasible approach, the target forward secrecy algorithm can refer to either a forward-secure (FS) algorithm or a perfect forward-secure (PFS) algorithm. Specifically, the target forward secrecy algorithm can be used to encrypt the processed request to obtain the target request.
[0088] In this embodiment of the application, by encrypting the processed request, not only can the security of data transmission be improved, but also the privacy of users can be protected, thus solving the problem of low security in related technologies when using interfaces based on HTTPS or HTTP / 2 protocols for data transmission.
[0089] Step 204: The client sends a target request to the server by calling the first type of interface through the target network request library.
[0090] In this embodiment of the application, after receiving the target request, the client converts the target request into a data format that conforms to the QUIC protocol required by the first type of interface, and then, as follows: Figure 4 As shown, the target request can be converted into multiple data streams through serialization. Then, through the target network request library, the first type interface is called to send multiple data streams to the server in sequence. After receiving the data streams sent by the client, the server needs to deserialize the data streams to convert them into a compliant data format. After that, the server will return the data required by the client (i.e., the response data) to the client. After receiving the response data from the server, the client can serialize the response data. Then, the integrity of the response data can be checked by verifying the serialized data. Furthermore, the client will deserialize the processed response data. Finally, the data obtained after deserialization is encapsulated into an instance object and returned to the upper-layer business logic.
[0091] In one feasible approach, the client-side code for processing the response data sent by the server can be as follows:
[0092]
[0093] In this embodiment of the application, by converting the transmitted data into multiple data streams for sequential transmission, the server can receive and process the data streams in real time without waiting for the entire data to be fully received before processing. This can significantly improve the efficiency of data transmission, especially for the transmission of large files or video files, where the data transmission speed will be significantly improved.
[0094] In this embodiment of the application, by performing an integrity check on the response data sent by the server, not only can the accuracy of the response data be guaranteed, but also the consistency of the response data can be guaranteed, so as to ensure that the response data received by the client has not been damaged or tampered with.
[0095] Step 205: If the target interface is a second type interface, the client uses the target network request library to call the second type interface to send a request to the server.
[0096] In this embodiment, if the target interface is a second-type interface based on the HTTPS or HTTP / 2 protocol, it is necessary to first validate the different types of parameters in the request. After successful validation, it is checked whether the data exchange format defined in the request body parameters is the same as the data exchange format of the protocol corresponding to the second-type interface. Then, if it is determined that the data exchange format defined in the request body parameters is the same as the data exchange format corresponding to the second-type interface, the request can be sent to the server directly by calling the second-type interface through the target network request library. In one possible implementation, if the target interface is an HTTP / 2-based API interface, the corresponding data exchange format is application / json, and it is possible to check whether the data exchange format defined in the request body parameters is application / json; if the target interface is an HTTPS-based API interface, the corresponding data exchange format is form-data, and it is necessary to check whether the data exchange format defined in the request body parameters is form-data.
[0097] In other embodiments of this application, the method may further include the following steps:
[0098] Step 206: The client sends connection information to the server to establish a communication connection.
[0099] In this embodiment of the application, the connection information is the information required to establish a communication connection between the client and the server for transmitting target requests.
[0100] In this embodiment, the connection information may refer to an Inchoate ClientHello (CHLO) message. Specifically, if the target interface is a first-type interface, before sending the target request by calling the first-type interface, the client can first generate a public-private key pair according to the Diffie-Hellman Ephemeral (DHE) algorithm, and then carry the generated public-private key pair in the CHLO message and send it to the server through the first-type interface.
[0101] Step 207: The client receives the response information sent by the server to establish a communication connection between the client and the server.
[0102] In this embodiment, the response information carries another public-private key pair generated by the server after receiving the CHLO message. Specifically, after receiving the connection information (i.e., the CHLO message) sent by the client, the server obtains the public-private key pair carried in the connection information. Then, the server generates another public-private key pair based on the obtained public-private key pair and sends it to the client. After receiving the response information sent by the server carrying the other public-private key pair, the client determines that the communication connection between the client and the server has been successfully established. At this time, the client can send a request to obtain network information through this communication connection.
[0103] In one feasible approach, the code for establishing a communication connection can be shown as follows:
[0104] var req=io({url,option});
[0105] req.on("connect", () => {
[0106] req.emit("request", requestBody);
[0107] });
[0108] In this embodiment, since the QUIC protocol supports full-duplex communication, after a communication connection is established through the first type of interface, the client and the server can send and receive data simultaneously, which significantly improves the real-time performance and efficiency of data transmission.
[0109] In this embodiment, when the target interface is a first-type interface based on the QUIC protocol, i.e., when data transmission is performed using the QUIC protocol, the client and server can establish a communication connection through only one handshake, unlike the TCP protocol which requires a three-way handshake to successfully establish a communication connection between the client and server. Furthermore, when using the QUIC protocol, after receiving the response information sent by the server, the client will cache the server's configuration parameters. Thus, when communicating with the server subsequently, requests can be sent directly without another handshake, thereby achieving zero round-trip time (0-RTT) data communication and significantly improving the communication efficiency between the client and server.
[0110] The request sending method provided in the embodiments of this application can determine the target interface for sending client requests from a first type interface based on the QUIC protocol and a second type interface based on the HTTPS protocol or the HTTP / 2 protocol through target information in the target network request library. That is, during data communication, the target network request library can call the second type interface based on the HTTPS protocol or the HTTP / 2 protocol to send requests, or it can call the first type interface based on the QUIC protocol to send requests, instead of only being able to call the interface based on the HTTPS protocol or the HTTP / 2 protocol to send requests as in related technologies. This solves the problem of poor communication efficiency between the client and the server during data communication in related technologies.
[0111] Based on the foregoing embodiments, this application provides a request sending apparatus, which can be applied to... Figure 1 and 2 In the request sending method provided in the corresponding embodiment, refer to Figure 5 As shown, the request sending device 3 may include: a determining unit 31 and a sending unit 32, wherein:
[0112] The determining unit 31 is used to determine the target interface from the first type interface and the second type interface based on the target information in the target network request library; wherein, the target information is used to determine whether to call the first type interface; the protocol corresponding to the first type interface is the Fast User Datagram Protocol network connection protocol;
[0113] Sending unit 32 is used to send a request for obtaining network information to the server through the target interface using the target network request library.
[0114] In other embodiments of this application, the determining unit 31 is further configured to perform the following steps:
[0115] The target component is determined based on the target parameters in the target network request library; wherein, the target information includes the target parameters;
[0116] Based on the target component, the target interface is determined from the first type interface and the second type interface.
[0117] In other embodiments of this application, the determining unit 31 is further configured to perform the following steps:
[0118] If the value of the target parameter is the first value, then the component corresponding to the first type of interface is determined to be the target component;
[0119] If the value of the target parameter is the second value or the target parameter is not assigned a value, the component corresponding to the second type of interface is determined to be the target component.
[0120] In other embodiments of this application, the determining unit 31 is further configured to perform the following steps:
[0121] If the target component is the component corresponding to the first type of interface, then the first type of interface is determined to be the target interface.
[0122] If the target component is the component corresponding to the second type of interface, then the second type of interface is determined as the target interface.
[0123] In other embodiments of this application, the sending unit 32 is further configured to perform the following steps:
[0124] If the target interface is a first-type interface, process the request to obtain the target request;
[0125] Using the target network request library, the first type of interface is called to send the target request to the server.
[0126] In other embodiments of this application, the sending unit 32 is further configured to perform the following steps:
[0127] The request is processed using target error correction algorithm and target retransmission algorithm to obtain the processed request;
[0128] The target request is obtained by encrypting the processed request using the target forward secrecy algorithm.
[0129] In other embodiments of this application, the sending unit 32 is further configured to perform the following steps:
[0130] Send connection information used to establish a communication connection to the server;
[0131] Receive response information sent by the server to establish a communication connection between the client and the server.
[0132] It should be noted that a detailed explanation of the steps performed by each unit can be found in [reference needed]. Figure 1 and 2 The request sending method provided in the corresponding embodiment will not be described again here.
[0133] The request sending apparatus provided in the embodiments of this application can determine the target interface for sending client requests from a first type interface based on the QUIC protocol and a second type interface based on the HTTPS protocol or the HTTP / 2 protocol through target information in the target network request library. That is, during data communication, the target network request library can call the second type interface based on the HTTPS protocol or the HTTP / 2 protocol to send requests, or it can call the first type interface based on the QUIC protocol to send requests, instead of only being able to call the interface based on the HTTPS protocol or the HTTP / 2 protocol to send requests as in related technologies. This solves the problem of poor communication efficiency between the client and the server during data communication in related technologies.
[0134] Based on the foregoing embodiments, embodiments of this application provide a client that can be applied to... Figure 1 and 2 In the request sending method provided in the corresponding embodiment, refer to Figure 6 As shown, the client 4 may include: a processor 41, a memory 42, and a communication bus 43, wherein:
[0135] Communication bus 43 is used to realize the communication connection between processor 41 and memory 42;
[0136] Processor 41 is used to execute the request sending program in memory 42 to perform the following steps:
[0137] Based on the target information in the target network request library, the target interface is determined from the first type interface and the second type interface; wherein, the target information is used to determine whether to call the first type interface; the protocol corresponding to the first type interface is the Fast User Datagram Protocol (FAP) network connection protocol.
[0138] Use the target network request library to send a request to the server to obtain network information through the target interface.
[0139] In other embodiments of this application, the processor 41 is configured to execute the request sending program in the memory 42 to determine the target interface from the first type interface and the second type interface based on the target information in the target network request library, in order to implement the following steps:
[0140] The target component is determined based on the target parameters in the target network request library; wherein, the target information includes the target parameters;
[0141] Based on the target component, the target interface is determined from the first type interface and the second type interface.
[0142] In other embodiments of this application, processor 41 is configured to execute the target component determination based on target parameters in the target network request library of the request sending program in memory 42, to implement the following steps:
[0143] If the value of the target parameter is the first value, then the component corresponding to the first type of interface is determined to be the target component;
[0144] If the value of the target parameter is the second value or the target parameter is not assigned a value, the component corresponding to the second type of interface is determined to be the target component.
[0145] In other embodiments of this application, processor 41 is configured to execute a target-based component of a request sending program in memory 42, determining a target interface from a first type interface and a second type interface to perform the following steps:
[0146] If the target component is the component corresponding to the first type of interface, then the first type of interface is determined to be the target interface.
[0147] If the target component is the component corresponding to the second type of interface, then the second type of interface is determined as the target interface.
[0148] In other embodiments of this application, the processor 41 is used to execute the request sending program in the memory 42 to use the target network request library to send a request for obtaining network information to the server through the target interface, in order to implement the following steps:
[0149] If the target interface is a first-type interface, process the request to obtain the target request;
[0150] Using the target network request library, the first type of interface is called to send the target request to the server.
[0151] In other embodiments of this application, the processor 41 is further configured to process the request in the memory 42 to obtain the target request, in order to implement the following steps:
[0152] The request is processed using target error correction algorithm and target retransmission algorithm to obtain the processed request;
[0153] The target request is obtained by encrypting the processed request using the target forward secrecy algorithm.
[0154] In other embodiments of this application, the processor 41 is further configured to execute a request sending program in the memory 42 to perform the following steps:
[0155] Send connection information used to establish a communication connection to the server;
[0156] Receive response information sent by the server to establish a communication connection between the client and the server.
[0157] It should be noted that a detailed description of the steps performed by the processor can be found in [reference needed]. Figure 1 and 2 The request sending method provided in the corresponding embodiment will not be described again here.
[0158] The client provided in the embodiments of this application can determine the target interface for sending client requests from a first type interface based on the QUIC protocol and a second type interface based on the HTTPS protocol or the HTTP / 2 protocol through the target information in the target network request library. That is, during data communication, the target network request library can call the second type interface based on the HTTPS protocol or the HTTP / 2 protocol to send requests, or it can call the first type interface based on the QUIC protocol to send requests, instead of only being able to call the interface based on the HTTPS protocol or the HTTP / 2 protocol to send requests as in related technologies. This solves the problem of poor communication efficiency between the client and the server during data communication in related technologies.
[0159] Based on the foregoing embodiments, embodiments of this application provide a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to achieve... Figure 1 and 2 The steps of the request sending method provided in the corresponding embodiment.
[0160] Based on the foregoing embodiments, embodiments of this application provide a computer program product, which includes a computer program that, when executed by a processor, implements... Figure 1 and 2 The steps of the request sending method provided in the corresponding embodiment.
[0161] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0162] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0163] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0164] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0165] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A request sending method, characterized in that, The method includes: Based on the target information in the target network request library, the target interface is determined from the first type of interface and the second type of interface; wherein, the target information is used to determine whether to call the first type of interface; the protocol corresponding to the first type of interface is the Fast User Datagram Protocol (FAP) network connection protocol. Using the target network request library, a request to obtain network information is sent to the server through the target interface.
2. The method according to claim 1, characterized in that, The step of determining the target interface from the first type of interface and the second type of interface based on the target information in the target network request library includes: The target component is determined based on the target parameters in the target network request library; wherein, the target information includes the target parameters; Based on the target component, the target interface is determined from the first type interface and the second type interface.
3. The method according to claim 2, characterized in that, The step of determining the target component based on the target parameters in the target network request library includes: If the value of the target parameter is a first value, the component corresponding to the first type of interface is determined to be the target component; If the value of the target parameter is the second value or the target parameter is not assigned a value, the component corresponding to the second type of interface is determined to be the target component.
4. The method according to claim 3, characterized in that, Based on the target component, determining the target interface from the first type of interface and the second type of interface includes: If the target component is a component corresponding to the first type of interface, then the first type of interface is determined to be the target interface; If the target component is the component corresponding to the second type interface, then the second type interface is determined to be the target interface.
5. The method according to claim 1, characterized in that, The step of using the target network request library to send a request for obtaining network information to the server through the target interface includes: If the target interface is the first type of interface, the request is processed to obtain the target request; The target network request library is used to send the target request to the server by calling the first type of interface.
6. The method according to claim 5, characterized in that, Processing the request to obtain the target request includes: The request is processed using a target error correction algorithm and a target retransmission algorithm to obtain a processed request; The processed request is encrypted using a target forward secrecy algorithm to obtain the target request.
7. The method according to claim 6, characterized in that, The method further includes: Send connection information for establishing a communication connection to the server; The client receives the response information sent by the server to establish a communication connection between the client and the server.
8. A request sending device, characterized in that, The device includes: The determining unit is configured to determine a target interface from a first type of interface and a second type of interface based on target information in the target network request library; wherein the target information is used to determine whether to call the first type of interface; and the communication protocol corresponding to the first type of interface is the Fast User Datagram Protocol (FAP) network connection protocol. The sending unit is used to send a request for obtaining network information to the server through the target interface using the target network request library.
9. A client, characterized in that, The client includes: a processor, a memory, and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is configured to execute a request sending program in memory to implement the steps of the request sending method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that can be executed by one or more processors to implement the steps of the request sending method as described in any one of claims 1 to 7.
11. A computer program product, the computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the request sending method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Network request processing method and processing device
CN107438097A
Network communication method, system and device and computer readable storage medium
CN111756674A
Data transmission method, device and system
CN113382062A