A processing method, apparatus, device, medium, product
Patent Information
- Application Number
- CN202510376479.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2026-09-29
AI Technical Summary
[0023]本申请提供的技术方案中,客户端的工作原理包括:响应于携带有目标域名的第一请求被触发,按照第一模式,如“同时使用第一协议(如QUIC协议)和第二协议(如TCP协议)发送同一请求”这一竞速模式,将该第一请求向该目标域名指示的服务端进行发送,以通过该第一模式实现从该第一协议和该第二协议中选择该第一请求对应的目标协议,以使该目标协议能够表示出在当前情况下该目标域名最适用的协议,如此能够实现通过该第一模式快速地确定出该目标域名最适用的协议,以便在确定该目标协议为该第一协议时,能够确定出在当前情况下该目标域名最适用的协议为该第一协议,故直接从该第一模式的使用阶段直接切换为“先使用第一协议发送以及在发送失败后再使用第二协议发送”这一第二模式的使用阶段,以便将后续触发的携带有该目标域名的第二请求按照该第二模式向该服务端发送,以通过该第二模式实现优先使用第一协议发送第二请求以及在确定使用第一协议发送第二请求失败时再使用第二协议发送第二请求进行兜底,如此能够通过该第二模式有效地提升请求成功率,以避免后续因该第一协议发生故障而导致请求发送失败的缺陷,从而有利于更好地提高请求效果。
Smart Images

Figure CN122845676A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a processing method, apparatus, device, medium, or product. Background Technology
[0002] The process of a client accessing a server over a network includes: first, the client generates a network request (such as a content sequence retrieval request); then, the client performs Domain Name System (DNS) resolution on the domain name carried in the network request to obtain the server's Internet Protocol Address (IP address); next, a data transmission connection is established between the client and the server indicated by the IP address, such as a data transmission connection under a protocol like Transmission Control Protocol (TCP) or Quick UDP Internet Connections (QUIC), so that after the connection is successfully established, the client can transmit the network request to the server through this connection, and the server can transmit the feedback data provided by the network request to the client through this connection for use.
[0003] As can be seen, network access is achieved through domain names and connection protocols. However, when multiple protocols (such as TCP and QUIC) can be used to access a particular domain name, the performance (such as success rate and / or latency) of the same domain name varies under different protocols, making the selection of the appropriate protocol for a given domain name a pressing technical problem that needs to be solved. Summary of the Invention
[0004] This application provides a processing method, apparatus, device, medium, and product that can better enable protocol selection for any domain name, thereby improving request performance.
[0005] To achieve the above objectives, the technical solution provided in this application is as follows:
[0006] This application provides a processing method applied to a client. The method includes: in response to a first request carrying a target domain name being triggered, sending the first request to a server indicated by the target domain name according to a first mode, wherein the first mode indicates that the first request is sent using a first protocol at a first time and the first request is sent using a second protocol at a second time, and taking the protocol that is successfully sent first between the first protocol and the second protocol as the target protocol corresponding to the first request, wherein the difference between the first time and the second time does not exceed a preset time threshold; in response to the target protocol being the first protocol, sending a second request carrying the target domain name to the server according to a second mode, wherein the trigger time of the second request is later than the determination time of the target protocol, and the second mode indicates that the second request is first sent using the first protocol and then sent using the second protocol if it is determined that sending the second request using the first protocol fails.
[0007] In one possible implementation, the first request is the first request carrying the target domain name triggered after the client has been cold-started.
[0008] In one possible implementation, the method further includes: in response to a third request carrying the target domain name being triggered, sending the third request to the server according to the first mode, wherein the triggering time of the third request is later than the triggering time of the first request, and the triggering time of the third request is not later than the determination time of the target protocol.
[0009] In one possible implementation, the method further includes: in response to each request in the request sequence being sent to the server using the second protocol, sending a fourth request carrying the target domain name to the server according to a third mode, wherein the trigger time of the fourth request is later than the trigger time of the latest request in the request sequence, the third mode indicates that the fourth request is sent using the second protocol, the request sequence includes a preset number of requests triggered sequentially, the trigger time of the earliest request in the request sequence is not earlier than the trigger time of the first request, and for any request in the request sequence, the request is sent to the server according to either the first mode or the second mode.
[0010] In one possible implementation, the method further includes: in response to each request in the request sequence being sent to the server using the second protocol, initializing the usage duration of the third mode, the usage duration of the third mode varying with the client's time; in response to the usage duration of the third mode reaching a duration threshold, sending a probe request carrying the target domain name to the server using the first protocol; in response to the successful sending of the probe request using the first protocol, sending a fifth request carrying the target domain name to the server according to the first mode, the triggering time of the fifth request being later than the determination time of the successful sending of the probe request using the first protocol.
[0011] In one possible implementation, the method further includes: in response to the failure to send the probe request using the first protocol, continuing to perform the step of initializing the usage duration of the third mode.
[0012] In one possible implementation, the method further includes: in response to failure to send the probe request using the first protocol, updating the duration threshold, wherein the updated duration threshold is greater than the original duration threshold, the difference between the updated duration threshold and the original duration threshold is positively correlated with the number of times the duration threshold is updated, and continuing to perform the step of initializing the usage duration of the third mode.
[0013] In one possible implementation, the first mode includes multiple candidate modes, including a first candidate mode and a second candidate mode; in response to the first request being sent according to the first candidate mode, the first time is the same as the second time; in response to the first request being sent according to the second candidate mode, the first time is earlier than the second time.
[0014] In one possible implementation, the step of sending the first request to the server indicated by the target domain name in accordance with a first mode in response to the first request being triggered includes: selecting a mode that matches the configuration information of the client from the plurality of candidate modes in response to the first request being triggered, and sending the first request to the server in accordance with the matched mode.
[0015] In one possible implementation, the step of sending the first request to the server indicated by the target domain name in accordance with a first mode in response to the first request being triggered includes: selecting a mode from the plurality of candidate modes that matches the remaining resource amount of the client at the triggering time of the first request, and sending the first request to the server in accordance with the matched mode in response to the first request being triggered.
[0016] In one possible implementation, the step of sending the first request to the server indicated by the target domain name in accordance with a first mode in response to the first request being triggered includes: in response to the first request being triggered, selecting a mode from the plurality of candidate modes according to a target probability to send the first request to the server, wherein the target probability is used to indicate the probability of selecting the first candidate mode and the probability of selecting the second candidate mode, and the target probability is obtained by statistical analysis of multiple sample data, wherein different sample data are used to indicate the mode selected by different clients from the plurality of candidate modes when sending network requests.
[0017] In one possible implementation, the first protocol is obtained by making at least one improvement to the second protocol; and / or, the version number of the first protocol is greater than the version number of the second protocol.
[0018] This application provides a processing apparatus, comprising: a first sending unit, configured to, in response to a first request carrying a target domain name being triggered, send the first request to a server indicated by the target domain name according to a first mode, wherein the first mode indicates that the first request is sent using a first protocol at a first time and the first request is sent using a second protocol at a second time, and the protocol that is successfully sent first between the first protocol and the second protocol is taken as the target protocol corresponding to the first request, wherein the difference between the first time and the second time does not exceed a preset time threshold; and a second sending unit, configured to, in response to the target protocol being the first protocol, send a second request carrying the target domain name to the server according to a second mode, wherein the trigger time of the second request is later than the determination time of the target protocol, and the second mode indicates that the second request is first sent using the first protocol and then sent using the second protocol if it is determined that sending the second request using the first protocol fails.
[0019] This application provides an electronic device, the device comprising: a processor and a memory; the memory for storing instructions or computer programs; the processor for executing the instructions or computer programs in the memory, so that the electronic device performs the processing method provided in this application.
[0020] This application provides a computer-readable medium storing instructions or computer programs that, when executed on a device, cause the device to perform the processing method provided in this application.
[0021] This application provides a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the processing method provided in this application.
[0022] Compared with related technologies, this application has at least the following advantages:
[0023] In the technical solution provided in this application, the working principle of the client includes: in response to a first request carrying a target domain name being triggered, according to a first mode, such as a race mode of "simultaneously sending the same request using a first protocol (such as the QUIC protocol) and a second protocol (such as the TCP protocol)," the first request is sent to the server indicated by the target domain name. This first mode allows for the selection of the target protocol corresponding to the first request from the first protocol and the second protocol, so that the target protocol can represent the most suitable protocol for the target domain name in the current situation. This enables the rapid determination of the most suitable protocol for the target domain name through the first mode, so that when the target protocol is determined to be the first protocol, the most suitable protocol for the current situation can be determined. In this case, the most suitable protocol for the target domain name is the first protocol. Therefore, we can directly switch from the first mode to the second mode, which is "send using the first protocol first and then use the second protocol if the first protocol fails." This way, subsequent second requests carrying the target domain name can be sent to the server according to the second mode. The second mode prioritizes sending the second request using the first protocol and then uses the second protocol as a fallback if the first protocol fails. This effectively improves the request success rate and avoids the defect of subsequent request failures due to the failure of the first protocol, thus improving the request effect.
[0024] As can be seen, the client provided in this application selects different modes to send requests at different times, so that requests for the same domain name sent at different times can flexibly select protocols based on the actual situation of the server (such as a sudden failure of a certain protocol). This can improve the request success rate while quickly determining the applicable protocol for the target domain name, and effectively overcome the defects caused by using only a single mode. In this way, better protocol selection can be performed for any domain name to improve the request effect (such as improving the request sending success rate and reducing the request sending time). Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 A flowchart illustrating a processing method provided in an embodiment of this application;
[0027] Figure 2 A schematic diagram illustrating a switching process between different modes provided in an embodiment of this application;
[0028] Figure 3 A schematic diagram of a first candidate mode provided in an embodiment of this application;
[0029] Figure 4 A schematic diagram of a second mode provided for an embodiment of this application;
[0030] Figure 5 This application provides a schematic diagram illustrating the process of switching from the usage phase of racing mode to the usage phase of fixed mode 1 in an embodiment of the present application.
[0031] Figure 6 A schematic diagram illustrating the process of switching from the usage phase of rollback mode 1 to the usage phase of fixed mode 1, provided in an embodiment of this application;
[0032] Figure 7 A schematic diagram illustrating a scenario where the cumulative count is reset to zero, as provided in an embodiment of this application;
[0033] Figure 8 A schematic diagram illustrating another scenario of resetting the cumulative count to zero, provided as an embodiment of this application;
[0034] Figure 9 A schematic diagram illustrating periodic detection based on a fixed duration threshold, provided as an embodiment of this application;
[0035] Figure 10 A schematic diagram illustrating periodic detection based on a dynamically changing duration threshold, provided as an embodiment of this application;
[0036] Figure 11 A schematic diagram illustrating a second candidate mode provided in an embodiment of this application;
[0037] Figure 12 This is a schematic diagram of the structure of a processing device provided in an embodiment of this application;
[0038] Figure 13This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0039] Research has revealed that for a URL carried in a network request, such as https: / / www.exsample.com, the "https: / / " part indicates that the URL uses the Hypertext Transfer Protocol (HTTP), thus constraining the protocol used when sending the network request. The "www.exsample.com" part represents the domain name of the server that processes the network request, thus constraining the recipient of the network request, so that the network request can be sent from the client to the server for processing based on this protocol and domain name.
[0040] The study also found that the above-mentioned URL uses multiple versions of the protocol, such as HTTP 1.1 based on TCP, HTTP 2.0 based on TCP, and HTTP 3.0 based on QUIC. Therefore, when sending a network request carrying the URL, it is necessary to select one of these versions. In order to meet the needs of different scenarios, this application provides the following five protocol selection methods.
[0041] Method 1, in some scenarios, can select the protocol through a pre-defined fixed mode 1. Specifically, this fixed mode 1 means that for any network request carrying a domain name, the TCP protocol (such as HTTP 1.1 or HTTP 2.0) is always used. It's clear that the process based on this fixed mode 1 has the advantage of simplicity, but it also has the following drawbacks: when a domain name is not well-compatible with the TCP protocol, network requests carrying that domain name will have poor performance, such as low success rate and / or long processing time.
[0042] Method 2, in some scenarios, can select the protocol through a pre-defined fixed mode 2. Specifically, this fixed mode 2 uses the QUIC protocol (such as HTTP / 3.0) for every domain name carried in a network request. While this fixed mode 2 offers the advantage of simplicity, it also has the following drawbacks: when a domain name is poorly compatible with the QUIC protocol, network requests carrying that domain name may experience poor performance, such as low success rate and / or long processing time.
[0043] Method 3, in some scenarios, can use a pre-defined race mode to select the protocol. This race mode (also known as fair race mode) works as follows: for any network request carrying a domain name, both TCP (e.g., HTTP / 2.0) and QUIC (e.g., HTTP / 3.0) are used to initiate connection establishment tasks simultaneously. Whichever protocol successfully establishes a connection first is used for subsequent data transmission. For example, if a QUIC connection is established first, QUIC is used for subsequent data transmission; if a TCP connection is established first, TCP is used. It's clear that this race mode has the advantage of selecting the most suitable protocol (e.g., the fastest connection establishment protocol) for sending requests. However, this process has the following drawbacks: the resources required to initiate two connection establishment tasks simultaneously for the same network request increase significantly, impacting client and server performance.
[0044] Method 4: In some scenarios, protocol selection can be achieved through a pre-defined fallback mode 1. Specifically, fallback mode 1 prioritizes the use of the QUIC protocol (e.g., HTTP / 3.0) for any network request carrying a domain name, and uses the TCP protocol (e.g., HTTP / 2.0) as a fallback only if that fails. It's clear that fallback mode 1 improves the success rate by attempting multiple protocols sequentially. However, this process has the following drawbacks: when using the TCP protocol for fallback, it's equivalent to triggering the same network request twice, drastically increasing processing time and impacting request performance. Furthermore, for any given domain name, since it's unclear which protocol is more suitable, a large number of requests carrying that domain name may need to fall back to the TCP protocol to succeed, resulting in a high fallback rate and further affecting request performance.
[0045] Method 5: In some scenarios, protocol selection can be achieved through a pre-defined fallback mode 2. Specifically, fallback mode 2 prioritizes TCP (e.g., HTTP / 2) for any network request carrying a domain name, and uses QUIC (e.g., HTTP / 3) as a fallback only if that fails. This fallback mode 2 improves the success rate by attempting multiple protocols sequentially. However, it has several drawbacks: using QUIC for fallback is equivalent to triggering the same network request twice, drastically increasing processing time and impacting request performance. Furthermore, for any given domain name, the optimal protocol is unclear, potentially leading to a high fallback rate for many requests carrying that domain, further hindering request performance.
[0046] The study also found that all five methods mentioned above send client requests to the server using only a single mode. However, each mode has certain defects, so the solutions based on a single mode still have the inherent defects of that single mode, thus affecting the request performance.
[0047] Based on the above research, in order to improve request performance, this application provides a processing method applied to a client. The method includes: in response to a first request carrying a target domain name being triggered, sending the first request to the server indicated by the target domain name according to a first mode, such as a race mode of "simultaneously sending the same request using a first protocol (e.g., QUIC protocol) and a second protocol (e.g., TCP protocol)". This first mode allows for the selection of a target protocol corresponding to the first request from the first and second protocols, so that the target protocol can represent the most suitable protocol for the target domain name in the current situation. This enables the rapid determination of the most suitable protocol for the target domain name through the first mode, so that the target protocol can be identified as the first protocol. During the discussion, it was determined that the most suitable protocol for the target domain name under the current circumstances was the first protocol. Therefore, the usage phase of the first mode was directly switched to the usage phase of the second mode, which is "send using the first protocol first and then send using the second protocol if the sending fails". This allows subsequent triggering of second requests carrying the target domain name to be sent to the server according to the second mode. The second mode enables the priority use of the first protocol to send the second request and the use of the second protocol as a fallback if it is determined that sending the second request using the first protocol fails. This can effectively improve the request success rate and avoid the defect of subsequent request failure due to failure of the first protocol, thereby improving the request effect.
[0048] As can be seen, the client provided in this application selects different modes to send requests at different times, so that requests for the same domain name sent at different times can flexibly select protocols based on the actual situation of the server (such as a sudden failure of a certain protocol). This can improve the request success rate while quickly determining the applicable protocol for the target domain name, and effectively overcome the defects caused by using only a single mode. In this way, better protocol selection can be performed for any domain name to improve the request effect (such as improving the request sending success rate and reducing the request sending time).
[0049] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0050] To better understand the technical solution provided in this application, the processing method provided in this application will be explained below with reference to some accompanying drawings. For example... Figure 1 As shown, the processing method provided in the embodiments of this application includes S1-S2 below.
[0051] S1: In response to the first request carrying the target domain name being triggered, the client sends the first request to the server indicated by the target domain name according to the first mode. The first mode indicates that the first request is sent using the first protocol at the first time and the first request is sent using the second protocol at the second time. The protocol that is sent first successfully between the first protocol and the second protocol is taken as the target protocol corresponding to the first request. The difference between the first time and the second time does not exceed a preset time threshold.
[0052] The target domain name refers to the domain name that needs to undergo protocol selection processing, such as the domain name "www.exsample.com" mentioned above. Figure 2 The domain name of the server shown Figure 3 The domain name shown is 1, or Figure 4 The domain name shown is 1.
[0053] The first request refers to a network request triggered on the client, carrying the target domain name, triggered relatively early, and sent using the race mode, such as the first triggered request or... Figure 2Request 1 is shown. It should be noted that this application does not limit the implementation method of this first request. For example, it can be implemented using any type of network request, such as a short video sequence acquisition request or a pre-request for acquiring certain data in advance. Furthermore, this application does not limit the triggering method of this first request. For example, it can be implemented using any type of network request triggering method, such as a method triggered by the client in response to a user operation or a method triggered actively by the client under certain conditions.
[0054] For the first mode in S1 (such as the racing mode mentioned above), Figure 2 The racing mode shown Figure 3 The first candidate pattern shown or Figures 5-10 In the racing mode shown, the first mode indicates that: at a first moment, a first request is sent using a first protocol (such as the QUIC protocol); at a second moment, the first request is sent using a second protocol (such as the TCP protocol); and the protocol that is successfully sent first among the first and second protocols is taken as the target protocol corresponding to the first request, so that the target protocol can represent the most suitable protocol for the target domain name carried by the first request under the current circumstances. This allows for the rapid determination of the most suitable protocol for the target domain name through the first mode. The difference between the first moment and the second moment does not exceed a preset time threshold (e.g., ...). Figure 11 (As shown in 300 milliseconds). It can be seen that this application can quickly determine which protocol can present a better request effect when the target domain name carried by the first request is used through this first mode, so as to a certain extent, the availability of the first protocol (or the second protocol) under the target domain name can be determined through this first mode.
[0055] It should be noted that this application does not limit the implementation methods of the first and second protocols described above. For example, the first protocol refers to a protocol that is pre-defined and preferentially selected based on the application scenario (such as the QUIC protocol), and the second protocol refers to a protocol that is pre-defined and used as an alternative based on the application scenario (such as the TCP protocol). Therefore, in one possible implementation, the first protocol can be implemented using the QUIC protocol, and the second protocol can be implemented using the TCP protocol.
[0056] It should also be noted that this application does not limit the number of the first protocol and the number of the second protocol. For example, in some scenarios (such as when there is only one alternative protocol), the number of the first protocol is 1, and the number of the second protocol is 1. In other scenarios (such as when there are many alternative protocols), the number of the first protocol is 1, and the number of the second protocol is ≥2. Therefore, in one possible implementation, the number of the second protocol can be at least one.
[0057] Furthermore, this application does not limit the implementation of the first mode in S1. For example, in some scenarios (such as scenarios with sufficient resources), the first mode may adopt the first candidate mode (such as...). Figure 3 The first candidate mode shown is implemented so that the first mode can indicate that: at the same time (such as the first time and the second time mentioned above), a first request is sent using a first protocol and a second protocol respectively, and the protocol that is successfully sent first among the first protocol and the second protocol is taken as the target protocol corresponding to the first request. In this way, by sending the same request using different protocols at the same time, it is possible to determine which protocol is more suitable for the target domain name carried by the first request as quickly as possible, thereby improving efficiency.
[0058] It should be noted that the first candidate mode mentioned above specifically refers to: for any network request carrying a domain name (such as...) Figure 3 For the domain name 1 shown, connection establishment tasks under various protocols (such as QUIC, TCP, etc.) are initiated simultaneously. The protocol whose connection establishment task succeeds first is used for subsequent data transmission. Specifically, for any of these protocols, the connection establishment task under that protocol is used to establish a data transmission connection between the client and the server indicated by the domain name, so that subsequent data transmission between the client and the server can be based on the established connection.
[0059] Furthermore, this application does not limit the implementation of the above-mentioned S1. For example, when S1 is implemented using the first candidate mode, S1 can specifically be as follows: when the client detects that a first request carrying a target domain name has been triggered, the client first resolves the target domain name carried by the first request to obtain the IP address; then the client simultaneously initiates a connection establishment task under the first protocol (such as the QUIC protocol) and a connection establishment task under the second protocol (such as the TCP protocol) to the server indicated by the IP address, so that the client can subsequently provide the first request to the server based on the feedback results of the two connection establishment tasks.
[0060] It should be noted that this application does not limit the implementation of the step described above, which involves the client providing the first request to the server based on the feedback results of these two connection establishment tasks. For example, it could specifically be: if these feedback results indicate that the first protocol has successfully established a connection first (e.g., ... Figure 3In scenario 2), it can be determined that the applicability of the first request under the first protocol is higher than its applicability under the second protocol. Therefore, it can be determined that the target domain name carried in the first request is more suitable for the first protocol. Thus, the client can transmit data with the server indicated by the target domain name through the connection already established under the first protocol (e.g., the client transmits the first request to the server through the connection, and the server transmits the feedback data provided for the first request to the client through the connection). However, if these feedback results indicate that the second protocol successfully established the connection first (e.g., ...), Figure 3 If the first request is applicable under the second protocol (as shown in case 1 or case 3), it can be determined that the first request is more applicable under the second protocol than under the first protocol. Therefore, it can be determined that the target domain name carried by the first request is more suitable for the second protocol. Thus, the client can transmit data with the server through the connection already established under the second protocol.
[0061] Based on the above content related to S1, it is known that for a client, such as any application (App), when the client detects that a first request carrying the target domain name has been triggered (e.g., Figure 2 Following request 1), the client uses the first mode (e.g., Figure 3 The first candidate mode shown sends the first request to the server indicated by the target domain name, so as to accurately determine which protocol is more suitable for the target domain name carried in the first request, so that subsequent requests carrying the target domain name can be preferentially selected using the protocol most suitable for the target domain name (e.g., ...). Figure 2 Request 3 is shown.
[0062] S2: In response to the first request, the target protocol is the first protocol. The client sends a second request carrying the target domain name to the server according to the second mode. The triggering time of the second request is later than the determination time of the target protocol. The second mode indicates that the second request is sent using the first protocol first and the second request is sent using the second protocol only if it is determined that sending the second request using the first protocol fails.
[0063] The second request refers to a network request triggered on the client, carrying the target domain name, triggered later than the time when the client obtains the target protocol corresponding to the first request, and sent using the second mode. It should be noted that this application does not limit the implementation method of the second request.
[0064] For the second mode in S2 (such as the aforementioned rollback mode 1), Figure 2 The rollback mode 1 shown Figure 4 The second mode shown or Figures 6-10As shown in the fallback mode 1), the second mode can indicate that: first use the first protocol (such as the QUIC protocol) to send the second request, and then use the second protocol (such as the TCP protocol) to send the second request if it is determined that using the first protocol to send the second request fails. This allows the second mode to achieve the premise of prioritizing the use of the first protocol to send the request carrying the target domain name (such as the second request) and using other protocols as a fallback. This can effectively avoid the adverse effects caused by the failure of the first protocol to send the request (such as a significant drop in the request success rate), thereby improving the request success rate and thus improving the request effect.
[0065] It should be noted that this application does not limit the implementation of the second mode in S2. For example, it can specifically be: for any network request carrying a domain name (such as...) Figure 4 For the domain name 1 shown, first initiate a connection establishment task under the first protocol (such as the QUIC protocol). If the connection establishment task under the first protocol is successfully completed (such as...), Figure 4 If scenario 2) is shown, it can be determined that the data transmission connection under the first protocol has been successfully established, and therefore the connection can be directly used for data transmission between the client and the server; however, if the establishment task under the first protocol fails (e.g., Figure 4 In case 1), it can be determined that a data transmission connection under the first protocol cannot be established. Therefore, a connection establishment task under the second protocol (such as TCP) can be initiated. Once the connection establishment task under the second protocol is successfully completed, the connection can be used for data transmission between the client and the server.
[0066] Based on the above content in S1 to S2, it can be seen that for any domain name (such as the target domain name), this application first uses the first mode (such as...). Figure 3 The first candidate mode shown determines which protocol will produce better request performance for the domain. After determining the protocol that is more suitable for the domain, the system switches to the corresponding second mode. In the second mode, the protocol that is more suitable for the domain is used first, and other protocols are used as a fallback if the protocol that is more suitable for the domain fails. This can quickly determine which protocol is more suitable for the domain and improve the request success rate through the second mode, thereby improving the request performance.
[0067] Research has revealed that for a client (such as any app), there are two launch methods: warm start and cold start. A warm start refers to the launch (opening) operation triggered when the client is exited to the background, ensuring that the client's state remains consistent with its state when it was last exited. This allows the client to retain some information generated during its previous use, such as which protocol applies to a particular domain name. A cold start, on the other hand, refers to the launch (opening) operation triggered when the client is completely closed (e.g., directly closing the client in the background after exiting it to ensure it is no longer running in the background). This causes the system to create a new process to launch the client, thus preventing the client from retaining any information generated during its previous use.
[0068] Based on the above research, in order to determine the protocol applicable to the target domain name as early as possible, the aforementioned first request can be the first request carrying the target domain name triggered after the client's cold start (e.g., ...). Figure 2 The first request (as shown in Request 1) is intended to enable subsequent use of the selection results among different protocols presented in the first mode (e.g., ...). Figure 2 The result shown, "QUIC protocol successfully raced under request 1", indicates that knowing which protocol the target domain is more suitable for as early as possible can help improve the performance of requests under that target domain, such as request success rate and request time.
[0069] It is evident that for clients (such as...) Figure 2 For the client shown, after the client's cold start, the first request carrying the target domain name triggered on the client is sent according to the first mode (e.g., ...). Figure 2 Request 1 shown is used to determine, through a first mode, which protocol best performs for the target domain, so that the client can obtain the feedback result of the request in the first mode (e.g., Figure 2 After the result "QUIC protocol successfully raced under request 1" is shown, the client determines from the feedback result which protocol is more suitable for the target domain name. This helps to determine which protocol is more suitable for the target domain name as quickly as possible, thereby improving the request effect.
[0070] Research has found that some network requests (such as...) Figure 2The triggering time of request 2) shown is later than the triggering time of the first request, but the triggering time of these network requests is earlier than the time when the client obtains the feedback result of the first request in the first mode. Therefore, in order to ensure the real-time nature of these network requests, they need to be sent immediately after they are triggered, so that the feedback result cannot be referenced when selecting a protocol for these network requests.
[0071] Based on the above research, in order to solve the problem shown in the previous paragraph, this application also provides a possible implementation of the above processing method. In this method, when the first request is the first request carrying the target domain name triggered after the client's cold start (e.g., Figure 2 When responding to request 1), the processing method may further include the following steps: in response to a third request carrying the target domain name (such as... Figure 2 When request 2) is triggered, the client sends the third request to the server indicated by the target domain name according to the first mode. The triggering time of the third request is later than the triggering time of the first request, and the triggering time of the third request is not later than (e.g., earlier than or equal to) the determination time of the target protocol corresponding to the first request. This ensures that all network requests carrying the target domain name triggered within the time period described by the open interval (the triggering time of the first request and the time when the client obtains the feedback result of the first request in the first mode) are sent according to the first mode. This ensures that network requests carrying the target domain name are sent according to the first mode until the feedback result of the first request in the first mode is returned. This not only improves the success rate of these requests, but also allows for further verification of the accuracy of the feedback result of the first request in the first mode by using the feedback result of these requests in the first mode, thereby helping to improve the request effect.
[0072] Research has found that when selecting a protocol for a domain name, among the various protocols to be considered (such as TCP and QUIC), some protocols (such as QUIC) were proposed to overcome certain shortcomings of other protocols (such as TCP), making them superior in certain aspects (such as request processing speed). Therefore, when selecting a protocol, these protocols can be given priority, and the availability of these protocols under the target domain name can be confirmed through the first mode.
[0073] Based on the above research, in one possible implementation, the first protocol and the second protocol satisfy at least the following constraints: the first protocol (e.g., HTTP 3.0) is obtained by improving the second protocol (e.g., HTTP 2.0) at least once; and / or, the version number of the first protocol is greater than the version number of the second protocol, so that the first protocol can represent a new protocol proposed to overcome certain defects of the second protocol, thereby making the performance of the first protocol better than that of the second protocol in some aspects, and thus enabling the availability of the first protocol under the target domain name to be confirmed first in a certain way (e.g., the first mode), and once it is confirmed to be available, the first protocol is used first to send network requests carrying the target domain name.
[0074] Research has revealed that the state of a protocol (such as the QUIC protocol) under a particular domain is not static but can change. For example, when the protocol experiences a failure, it may become unavailable under that domain because it cannot send requests carrying that domain name.
[0075] Research has also revealed that when a request fails to be sent via a certain protocol, it may be because the protocol is unavailable (e.g., in a faulty state) or due to other reasons (e.g., problems with the data carried in the request). It should be noted that this application does not limit the type of failure; for example, it may include at least the following: failure to successfully establish a connection under the protocol within a pre-set timeout threshold.
[0076] Based on the above research, in order to better detect whether a protocol (such as the QUIC protocol) is unavailable, this application also provides a possible implementation of the above processing method. In this implementation, the processing method may further include the following steps: in response to each request in the request sequence being sent to the server indicated by the target domain name using a second protocol (such as the TCP protocol), the client sends a fourth request carrying the target domain name according to a third mode (such as the fixed mode 1 mentioned above). Figure 2 Fixed pattern 1 shown Figures 5-6 Fixed pattern 1 shown Figures 9-10The fourth request is sent to the server in the fixed mode 1 shown (or the fixed TCP protocol mode). The trigger time of the fourth request is later than the trigger time of the latest request in the request sequence. The third mode is used to indicate that the fourth request is sent using the second protocol. The request sequence includes a preset number of requests (e.g., 5) that are triggered sequentially. The trigger time of the earliest request in the request sequence is not earlier than the trigger time of the first request mentioned above (e.g., the first network request carrying the target domain name triggered after a cold start). For any request in the request sequence, the request is sent to the server in the first mode or the second mode.
[0077] As can be seen, in this application, upon detecting a certain request (such as...) Figure 2 When request 3) is not sent using the first protocol (such as QUIC), it is not directly determined that the first protocol is unavailable under the domain name carried in the request. Instead, it continues to detect subsequent requests carrying the domain name that are triggered in sequence (such as...). Figure 2 The system checks whether requests 4 through 7 can be sent using the first protocol. This is to determine if the first protocol is unavailable (e.g., in a faulty state) under this domain name if subsequent requests are not sent using the first protocol. Therefore, to avoid this unavailability affecting subsequent requests, subsequent requests carrying this domain name (such as the fourth request mentioned above) can be sent according to the third mode of "fixed use of the second protocol". Figure 2 As shown in Request 8), this effectively overcomes the adverse effects caused by the unavailability of the first protocol, thereby improving the request performance. Based on this, it can be seen that this application comprehensively judges the availability of a protocol (such as the QUIC protocol) by combining the protocol selection results of multiple consecutive requests, rather than judging availability solely based on the protocol selection result of a single request. This effectively overcomes interference from other factors that could lead to transmission failure, thus ensuring the accuracy of availability judgment and further improving the request performance.
[0078] It should be noted that, for the aforementioned fourth request, this fourth request refers to a network request triggered on the client, carrying the target domain name, whose trigger time is later than the latest request in the above request sequence (e.g., the trigger time is within the period when the target domain name + the first protocol is blocked), and sent using the third mode. Figure 2 Request 8 shown Figure 5 Request 6 is shown. Furthermore, this application does not limit the implementation of this fourth request.
[0079] It should also be noted that, for the aforementioned request sequence, this request sequence is used to record a preset number of network requests carrying the same domain name, triggered in a consecutive order, sent without using the first protocol (such as the QUIC protocol), so that the first protocol can be characterized as unavailable later using this request sequence. It can be seen that for any request in this request sequence, if the request is sent to the server according to the first mode, the target protocol corresponding to the request determined by the first mode is not the first protocol, but the second protocol (such as the TCP protocol); if the request is sent to the server according to the second mode, the request failed to be sent using the first protocol in the second mode and needs to fall back to the second protocol for transmission. Furthermore, this application does not limit the implementation of the request sequence; for example, the request sequence may include... Figure 2 The five requests shown are 3 through 7. Alternatively, this request sequence could include... Figure 5 The five requests shown are Request 1 through Request 5.
[0080] Research has found that in some scenarios, such as when the usage phases of different modes do not interfere with each other, in order to better meet the needs of these scenarios, the above request sequence can be used to record multiple requests that carry the same domain name, are triggered consecutively, and are sent according to the same mode (such as the first mode or the second mode), so that the availability of a certain protocol (such as the QUIC protocol) during the usage phase of that mode can be characterized by the request sequence later.
[0081] Based on the above research, in order to better meet the aforementioned requirements, when all requests in the request sequence are sent to the server indicated by the target domain name according to the same pattern (such as the first pattern or the second pattern), the request sequence can at least satisfy the following constraint: if the request sequence (such as including...) Figure 5 In the request sequence (represented as requests 1 to 5), each request is sent to the server according to the first mode. Therefore, the target protocol for each request in this request sequence is determined by the first mode. If the target protocol for each request in this request sequence is not the first protocol (e.g., QUIC), but a second protocol (e.g., TCP), then this request sequence can be used to accurately determine whether the first protocol is unavailable under the target domain name during the usage phase of the first mode. Alternatively, if the request sequence (e.g., including...) Figure 2In the request sequence (represented by requests 3 to 7), each request is sent to the server according to the second mode. Therefore, each request in this sequence fails to send using the first protocol in the second mode and needs to fall back to the second protocol for retransmission. This request sequence allows for accurate determination of whether the first protocol is unavailable under the target domain name during the usage phase of the second mode. It is evident that this application determines the availability of the first protocol during the usage phase of a certain mode (such as the first or second mode) by detecting whether a predetermined number of consecutive requests use the second protocol. This allows for flexible switching from any phase (such as the first or second mode usage phase) to the third mode ("fixed use of the second protocol") without interfering with the usage phases of different modes, thus improving request performance. For clarity, two examples are provided below.
[0082] Example 1, for the usage phase of the first mode, if the above first request (such as...) Figure 5 The request shown 1) selects the second protocol (such as TCP) as the protocol to be used in the first mode, and triggers multiple requests sequentially after the first request (such as...). Figure 5 If requests 2 to 5 are shown, and the protocol selected for use in the first mode is the second protocol, then the above request sequence may include the first request and the "multiple requests triggered sequentially after the first request is triggered". Furthermore, the difference between the number of requests in the request sequence (as preset above) and the number of the "multiple requests triggered sequentially after the first request is triggered" is 1, so that it can be determined through the request sequence that the first protocol is unavailable during the usage phase of the first mode. Therefore, it is possible to directly switch from the usage phase of the first mode to the usage phase of the third mode, "the mode that always uses the second protocol", to ensure that the subsequently triggered requests (such as...) Figure 5 The request shown in 6) no longer uses the first protocol, but uses another protocol (such as TCP), which is beneficial to improving the request efficiency.
[0083] Example 2, for the usage phase of the second mode, if the above second request (such as...) Figure 2 Request 3) shown fails to be sent using the first protocol (such as QUIC) in the second mode, and multiple requests (such as...) are triggered sequentially after the second request is triggered. Figure 2If requests 4 through 7 shown fail to be sent using the first protocol in the second mode, then the request sequence may include the second request and "multiple requests triggered sequentially after the second request is triggered". Furthermore, the difference between the number of requests in the request sequence (as preset above) and the number of "multiple requests triggered sequentially after the second request is triggered" is 1, so that the request sequence can be used to determine that the first protocol is unavailable during the second mode's usage phase. Therefore, the usage phase of the second mode can be directly switched to the third mode's usage phase of "fixed use of the second protocol" to ensure that subsequent triggered requests (such as...) are sent using the first protocol. Figure 2 The request shown in 8) no longer uses the first protocol, but uses another protocol (such as TCP), which is beneficial to improving the request efficiency.
[0084] Based on the two examples above, it can be seen that when the first protocol is not selected multiple times consecutively in the first mode (e.g. Figure 5 (e.g., 5 consecutive failed races) or in the third mode, multiple consecutive rollbacks from the first protocol to the second protocol (e.g.) Figure 2 When the system rolls back to the TCP protocol five times consecutively (as shown), it can be accurately determined that the first protocol is unavailable under the target domain name. Therefore, the first protocol can be disabled under the target domain name by switching from the current mode (such as the first mode or the second mode) to the third mode of "fixed use of the second protocol". This can effectively avoid the impact caused by the unavailability of the first protocol, thereby improving the request effect.
[0085] It should be noted that this application does not limit the implementation method of "disabling the first protocol under the target domain". For example, it can be implemented using a blacklist strategy. Therefore, when the first protocol is detected to be unavailable under the target domain, the combination of the target domain and the first protocol (such as key-value pairs or tuples) can be blacklisted to ensure that requests carrying the target domain will no longer use the first protocol within a certain period (e.g., 300 seconds). This effectively disables the first protocol under the target domain.
[0086] Research has revealed that when switching from the first mode of usage to the second mode, some already triggered requests may occur (such as...). Figure 6 The selection results shown in request 2) in the first mode have not yet been fed back, and these selection results can also indicate to some extent whether a certain protocol (such as the QUIC protocol) is available.
[0087] Based on the above research, in order to detect the unavailability of a protocol (such as the QUIC protocol) as early as possible, the above request sequence can at least satisfy the following constraint: the request sequence includes at least one request sent in a first mode (such as...) triggered sequentially. Figure 6 Request 2) shown and at least one request sent in accordance with the second mode (such as...) triggered sequentially Figure 6 (As shown in requests 3 to 6), the trigger time of the latest triggered request among the at least one requests sent according to the first mode (e.g., Figure 6 The trigger time of request 2 shown is earlier than the trigger time of the earliest triggered request among the at least one requests sent according to the second mode (e.g., Figure 6 (The trigger time of request 3 shown) indicates that the target protocols corresponding to the at least one request sent according to the first mode are not the first protocol (such as the QUIC protocol), the target protocols corresponding to each request in the at least one request sent according to the first mode are all determined by the first mode, and each request in the at least one request sent according to the second mode fails to be sent using the first protocol in the second mode. It can be seen that after switching from the first mode to the second mode, feedback results of some requests carrying target domain names sent according to the first mode may be obtained successively. These feedback results can, to a certain extent, indicate whether the first protocol is available. Therefore, after entering the second mode usage phase, the availability of the first protocol can be comprehensively judged by combining these feedback results with the feedback results of requests sent according to the second mode. This is beneficial for discovering the unavailability of the first protocol as early as possible, thereby helping to avoid the impact caused by the unavailability of the first protocol (such as affecting...). Figure 6 (As shown in Request 7, request time, etc.), which helps to improve the request effect.
[0088] It should be noted that, for a request sequence used to characterize the unavailability of the first protocol on the target domain, in order to better detect the request sequence, the detection process can be implemented by recording the number of consecutive requests sent using the second protocol carrying the target domain. Specifically, this implementation can be: upon first detecting a request sent using the second protocol carrying the target domain (e.g., ... Figure 2 Request 3 as shown Figure 5 Request 1 shown Figure 6 Request 2 shown Figure 7 Request 1 shown or Figure 8 When request 3) is shown, the cumulative count is initialized to 1, and it is determined whether the next triggered request carrying the target domain name is also sent using the second protocol. If not, the cumulative count is cleared to zero (e.g., ...). Figure 8 The current record will end if the count is reset to zero (as shown); otherwise, the cumulative count will be updated to 2 (e.g., ...). Figure 7 The cumulative number shown is 2), and it determines whether the next triggered request carrying the target domain name is also sent using the second protocol; ... (and so on). It is evident that this application can more accurately detect whether the request sequence occurs through the "cumulative number" parameter, thus improving request performance.
[0089] Research has revealed that because the first protocol (such as the QUIC protocol) is not always unavailable under the target domain, it needs to be unblocked after disabling the target domain and the first protocol for a period of time (e.g., 300 seconds). However, if it is unblocked directly after the disabling period (e.g., 300 seconds), it is easy for the protocol to remain unavailable under the target domain after unblocking. Therefore, to overcome this problem, it is advisable to first detect whether the first protocol has been restored to an available state under the target domain before unblocking, so that the target domain and the first protocol can be unblocked only after confirming that it has been restored to an available state.
[0090] Based on this, this application provides a possible implementation of the above processing method. In this implementation, the processing method may further include the following steps: In response to each request in the request sequence being sent to the server indicated by the target domain name using a second protocol (such as TCP), the client initializes the usage duration of the third mode (e.g., sets the usage duration of the third mode to zero), so that the usage duration of the third mode can change with the client's time, thereby enabling the usage duration of the third mode to represent the duration for which the target domain name + the first protocol (such as QUIC protocol) has been disabled; In response to the usage duration of the third mode reaching a duration threshold (e.g., ... Figure 2 (As shown in the 300 seconds), the client uses the first protocol to send a probe request (such as a network request without any actual function) carrying the target domain name to the server; in response to the successful sending of the probe request using the first protocol, it can be determined that the first protocol has been restored to an available state under the target domain name, so the client will send a fifth request (such as a network request with the target domain name) carrying the target domain name. Figure 2 The request 9 shown is sent to the server according to the first mode. The triggering time of the fifth request is later than the determination time of the probe result "successfully sent probe request using the first protocol".
[0091] As can be seen, when a client detects that all requests in a certain request sequence are sent to the server indicated by the target domain using the second protocol (such as TCP), it can be determined that the first protocol (such as QUIC) is unavailable under that target domain. Therefore, to avoid the impact of this unavailability, it can directly switch from the current mode (such as the first or second mode) to the third mode, which is "fixed to use the second protocol". This not only ensures that all requests carrying the target domain triggered during the third mode (such as the fourth request mentioned above) are sent according to the third mode to disable the first protocol under the target domain, but also ensures that all requests carrying the target domain triggered during the third mode are sent according to the third mode to disable the first protocol under the target domain. By processing the parameter "duration of third mode usage" (such as initialization and updating as the client's time changes), the duration for which the target domain name and the first protocol are disabled is recorded. This allows the client to detect whether the first protocol has been restored to an available state under the target domain name by sending a network request carrying the target domain name (such as the aforementioned probe request) when the parameter reaches a pre-set threshold (e.g., 300 seconds). If the network request detects that the first protocol has been restored, the client can switch from the third mode usage phase to the first mode usage phase. This ensures that subsequent requests carrying the target domain name (such as the fifth request mentioned above) will be able to be used in conjunction with this request. Figure 2 The request 9) shown is sent to the server according to the first mode. This enables the target domain name + the first protocol to be unblocked by detecting the availability of the first protocol in advance, thereby effectively overcoming the defects caused by blind unblocking and thus improving the request effect.
[0092] It should be noted that, for the aforementioned fifth request, this fifth request refers to a network request triggered on the client, carrying the target domain name, whose triggering time is later than the time when the client obtains the probe result of "successfully sent probe request using the first protocol" (e.g., the triggering time is within the time period after the target domain name + the first protocol is released from the blacklist), and sent using the first mode. Figure 2 Request 9 shown Figure 9 Request 11 shown or Figure 10 Request 11 is shown. Furthermore, this application does not limit the implementation of this fifth request.
[0093] It should also be noted that the aforementioned duration threshold may refer to a duration set in advance based on the application scenario, so that the duration threshold can be used to indicate how long after disabling can an attempt be made to probe the availability of a certain protocol (such as the QUIC protocol).
[0094] It should also be noted that the above statement that "the usage duration of the third mode can change with the client's time" means that after the usage duration of the third mode is initialized, the usage duration of the third mode will increase as the client's time increases. For example, when the client's time increases by 10 seconds, the usage duration of the third mode will also increase by 10 seconds accordingly.
[0095] Research has shown that the state changes of a certain protocol (such as the QUIC protocol) under a target domain name are difficult to predict. Therefore, in order to detect such state changes in a timely manner, it is possible to detect whether the state of the protocol under the target domain name has been restored to a usable state in a certain periodic manner.
[0096] Based on this, this application provides a possible implementation of the above-mentioned processing method. In this implementation, the processing method may include at least the following steps: In response to each request in the request sequence being sent to the server indicated by the target domain name using a second protocol (such as TCP), the client initializes the usage duration of the third mode so that the usage duration of the third mode can change with the client's time, thereby enabling the usage duration of the third mode to represent the duration during which the target domain name + the first protocol (such as QUIC protocol) has been disabled in the current round of probing; In response to the usage duration of the third mode reaching a duration threshold, the client sends a probe request carrying the target domain name to the server using the first protocol; In response to the failure to send the probe request using the first protocol, the client continues to execute the aforementioned "initializing the usage duration of the third mode" step and its subsequent steps, repeating this process multiple times (e.g., ...). Figure 9 The multi-round probing (as shown) continues until a successful probing request using the first protocol is confirmed, at which point this periodic probing process ends and the target domain name + the first protocol is unblocked, allowing subsequent requests carrying the target domain name (such as the fifth request mentioned above) to be allowed. Figure 9 The request 13) shown can be sent in the first mode, which is beneficial to discover as early as possible that the first protocol has been restored to an available state under the target domain name, thereby improving the request effect.
[0097] As can be seen, the client can periodically probe the server at fixed time intervals (e.g., 300 seconds) to confirm whether the first protocol has returned to an available state under the target domain. Once it is detected that the first protocol has returned to an available state under the target domain, the target domain and the first protocol are unblocked. This helps to detect the first protocol's return to an available state under the target domain earlier, thereby improving request efficiency. It should be noted that since the processing time for the probe request is relatively short, the waiting time for the probe request's feedback can be ignored. Additionally, requests carrying the target domain (e.g., during periodic probing) are also considered. Figure 9 Both Request 11 and Request 12 shown need to be sent in the third mode, which is "fixed to use the second protocol".
[0098] Research has shown that frequent probes can lead to resource waste. Therefore, in order to minimize the resource overhead of periodic probes, the probe frequency can be reduced as the number of probes increases.
[0099] Based on this, this application provides a possible implementation of the above-mentioned processing method. In this implementation, the processing method may include at least the following steps: In response to each request in the request sequence being sent to the server indicated by the target domain name using a second protocol (such as TCP), the client initializes the usage duration of the third mode so that the usage duration of the third mode can change with the client's time, thereby enabling the usage duration of the third mode to represent the duration during which the target domain name + the first protocol (such as QUIC protocol) has been disabled in the current round of probing; In response to the usage duration of the third mode reaching a duration threshold, the client sends a probe request carrying the target domain name to the server using the first protocol; In response to the failure to send a probe request using the first protocol, the client updates the duration threshold so that the updated duration threshold is greater than the previous duration threshold, and the difference between the updated duration threshold and the previous duration threshold is positively correlated with the number of times the duration threshold is updated (such as the number of times probe requests are sent), and continues to execute the aforementioned "initializing the usage duration of the third mode" step and its subsequent steps, thus repeating this process multiple times (such as...). Figure 10 The multi-round probing (as shown) continues until a successful probing request using the first protocol is confirmed, at which point this periodic probing process ends and the target domain name + the first protocol is unblocked, allowing subsequent requests carrying the target domain name (such as the fifth request mentioned above) to be allowed. Figure 10 The request 13) shown can be sent in the first mode, which can realize the first protocol being restored to an available state under the target domain as early as possible while minimizing resource waste, thereby improving the request effect.
[0100] As can be seen, the client can confirm with the server whether the first protocol under the target domain name has recovered to an available state by periodically probing at gradually increasing time intervals. This ensures that the duration threshold used in the later round of probing in any two adjacent rounds is greater than the duration threshold used in the earlier round. This allows for a gradual reduction in the probing frequency as the number of probing attempts increases, thus better reducing resource waste. Furthermore, since the difference between the duration threshold used in the later round and the duration threshold used in the earlier round is positively correlated with the number of probing attempts (such as the number of times the duration threshold is updated or the number of probing requests sent), increasing the number of probing attempts significantly extends the duration of the target domain name + first protocol being in a disabled state, thereby significantly reducing the probing frequency and further reducing resource waste. It should be noted that requests carrying the target domain name (such as...) triggered during periodic probing... Figure 10 Both requests 11 and 12 shown need to be sent according to the third mode of "fixed use of the second protocol". Furthermore, this application does not limit the implementation to positive correlation.
[0101] Research has found that, although the aforementioned first candidate modes (such as...) Figure 3 The first candidate mode shown can quickly discover the most suitable protocol for a domain name. However, because the first candidate mode requires two connection establishment tasks to be initiated simultaneously for the same network request, the requests sent based on the first candidate mode consume a lot of resources, thus limiting the application scope of the first candidate mode.
[0102] The study also found that, for any given domain name, it is more likely to be compatible with the latest version of the protocol (such as the QUIC protocol).
[0103] Based on the research in the above two paragraphs, and in order to better conserve resources, this application also provides a second candidate mode (such as...). Figure 11 The second candidate mode shown is a non-fair race mode, specifically: for any network request carrying a domain name, a connection establishment task is initiated using the first protocol (such as the QUIC protocol). If the connection is successfully established using the first protocol before a preset time (such as 300 milliseconds) is reached... Figure 11 In case 3), data transmission can be directly performed using the connection under the first protocol; however, if the connection establishment fails before the preset time limit is reached (e.g., ...), the connection establishment fails under the first protocol. Figure 11In scenario 2), the second protocol (such as TCP) is used to initiate the connection establishment task directly, so that data transmission can be performed using the connection under the second protocol when the connection is successfully established. However, if no connection establishment feedback for the first protocol is obtained after a preset time period (such as...), Figure 11 In scenario 1), the second protocol is used directly to initiate the connection establishment task, so that the protocol that successfully establishes the connection first will be used for subsequent data transmission. It is evident that this second candidate mode can determine which protocol is more suitable for a domain name with minimal resource overhead. This facilitates faster determination of the appropriate protocol for a domain name while minimizing resource consumption, thus improving request performance.
[0104] Based on the above, for any network request carrying a target domain name sent according to the first mode (such as the first request mentioned above), the network request can be sent according to the first candidate mode (such as...). Figure 3 The first candidate pattern shown) or the second candidate pattern (such as Figure 11 The second candidate pattern shown is sent to the server indicated by the target domain name. For ease of understanding, the following explanation uses the first request as an example.
[0105] As an example, for a first request carrying a target domain name, the first request can at least satisfy the following constraints: the first request is sent to the server indicated by the target domain name according to a first candidate mode or a second candidate mode; in the first candidate mode, the time for initiating the establishment of a data transmission connection under the first protocol for the first request is the same as the time for initiating the establishment of a data transmission connection under the second protocol for the first request; in the second candidate mode, the time for initiating the establishment of a data transmission connection under the first protocol for the first request is earlier than the time for initiating the establishment of a data transmission connection under the second protocol for the first request. This is beneficial to enriching the sending methods of the first request, thereby better overcoming the problem caused by the large resource overhead of the first candidate mode, and thus helping to expand the application scope of the processing method provided in this application.
[0106] Based on the above two paragraphs, it can be seen that in one possible implementation, the first mode may include multiple candidate modes, including a first candidate mode (such as the first candidate mode) and a second candidate mode (such as the second candidate mode); in response to the first request being sent according to the first candidate mode, the first moment is the same as the second moment; in response to the first request being sent according to the second candidate mode, the first moment is earlier than the second moment. This is beneficial to enriching the sending method of the first request, thereby better overcoming the problem caused by the large resource overhead of the first candidate mode, and thus helping to expand the application scope of the processing method provided in this application.
[0107] Research has shown that some types of clients (such as clients of device type A) are suitable for using the first candidate mode, while other types of clients (such as clients of device type B) are suitable for using the second candidate mode. Therefore, the appropriate racing mode for sending requests can be selected based on the type of client.
[0108] Based on this, in one possible implementation, S1 may specifically include: in response to the first request being triggered, selecting a mode from the multiple candidate modes that matches the client's configuration information, and sending the first request to the server according to the matched mode. Here, since the configuration information describes the characteristics of the client, such as the type of device it belongs to, the racing mode selected based on the configuration information is more suitable for implementing the racing process on the client. This allows the client to better understand which protocol is more suitable for the target domain name carried in the first request, thereby improving request performance.
[0109] It should be noted that this application is not limited to the selection process shown in the above paragraph. For example, it can be implemented using a pre-built mapping relationship. This mapping relationship is used to record the racing modes corresponding to different configuration information, so that the racing mode corresponding to any configuration information (such as the first candidate mode or the second candidate mode) can be queried from this mapping relationship as the racing mode to be matched with that configuration information. Alternatively, it can also be implemented using other methods, such as a pre-built machine learning model with this selection function.
[0110] Based on the above two paragraphs, it can be seen that for any network request (such as the first request, the third request, or the fifth request mentioned above) triggered on the client and requiring to be sent in a race mode, if the triggering of the network request is detected, the client's configuration information is first obtained so that the configuration information can represent the characteristics of the client, such as what type of machine the client belongs to; then, a race mode (such as the first candidate mode or the second candidate mode) that matches the configuration information is selected from a number of pre-set candidate modes so that the network request can be sent to the server indicated by the target domain name in accordance with the selected race mode. In this way, the appropriate race mode can be selected based on the characteristics of the client itself, thereby effectively avoiding the defects caused by the mismatch between the race mode and the client's configuration information, and thus helping to improve the request effect.
[0111] In addition, since the client's configuration information hardly changes during the client's operation, in order to improve efficiency, the racing mode can be selected only for the first request carrying the target domain name after the cold start, so that subsequent requests carrying the target domain name can directly follow the racing mode selected for the "first request carrying the target domain name".
[0112] Based on the above, for any network request (such as the first request, the third request, or the fifth request mentioned above) triggered on the client and requiring to be sent in a race mode, if the triggering of the network request is detected, it is first determined whether the client has already stored the race mode corresponding to the target domain. If the race mode corresponding to the target domain is stored, the network request can be directly sent to the server indicated by the target domain using the race mode corresponding to the target domain, without needing to redetermine the race mode adapted to the client. However, if the race mode corresponding to the target domain is not stored, the client's configuration information and the race mode that matches the configuration information are obtained from a variety of pre-set candidate modes. This allows the network request to be sent to the server indicated by the target domain not only according to the selected race mode, but also to be stored as the race mode corresponding to the target domain for later use. In this way, the request effect can be better improved by reusing the race mode selection result of the first triggered request.
[0113] Research has found that although the resource overhead of the second candidate mode is less than that of the first candidate mode, in some cases (such as...) Figure 11 In cases 1 and 2 shown, the time cost of the second candidate mode may be greater than that of the first candidate mode. Therefore, in order to improve the request performance, the first candidate mode is selected to reduce the time consumption when resources are plentiful, while the second candidate mode is selected to reduce the resource cost when resources are scarce.
[0114] The study also found that the amount of remaining resources of the client changes constantly during the client's operation, so that the racing mode applicable to the client also changes at different times.
[0115] Based on the above two studies, in one possible implementation, S1 may specifically include: in response to the first request being triggered, selecting from the multiple candidate modes a mode that matches the remaining resource amount of the client at the trigger time of the first request, and sending the first request to the server according to the matched mode. Since the remaining resource amount indicates whether the client has sufficient resources at the trigger time of the first request, the racing mode selected based on the remaining resource amount is more suitable for the client's current resource situation. This facilitates dynamically adjusting the racing mode applicable to network requests based on the client's resource situation, thereby improving request performance.
[0116] It should be noted that this application is not limited to the selection process shown in the above paragraph. For example, it can be implemented using a pre-built mapping relationship. This mapping relationship is used to record the racing modes corresponding to different amounts of remaining resources, so that a racing mode (such as the first candidate mode or the second candidate mode) corresponding to any amount of remaining resources can be queried from this mapping relationship as the racing mode to be matched for that amount of remaining resources. Alternatively, it can also be implemented using other methods, such as a pre-built machine learning model with this selection function.
[0117] It should also be noted that for the same client, the race mode required for requests triggered at different times may be the same or different, depending on the remaining resources available to the client at the time each request is triggered.
[0118] Based on the above three paragraphs, it can be seen that for any network request (such as the first request, the third request, or the fifth request mentioned above) triggered on the client and requiring to be sent in a race mode, if the triggering of the network request is detected, the remaining resource amount of the client at the current time (such as the triggering time of the network request) is first obtained; then, a race mode (such as the first candidate mode or the second candidate mode) matching the remaining resource amount is selected from a pre-set multiple candidate modes, so that the network request can be sent to the server indicated by the target domain name in accordance with the selected race mode. In this way, the race mode required for requests triggered at different times can be dynamically adjusted based on the real-time changes in the client's resource usage, thereby reducing time overhead while adapting to the current resource status as much as possible, which is conducive to improving the request effect.
[0119] Research has revealed the following pattern in certain scenarios, based on data analysis from a large number of clients: 80% of clients will choose the second candidate mode, but 20% of clients will choose the first candidate mode.
[0120] Based on the patterns shown in the above research, in one possible implementation, S1 may specifically include: in response to the triggering of the first request, selecting a mode from the multiple candidate modes according to a target probability to send the first request to the server. The target probability indicates the probability of selecting the first candidate mode (e.g., 20%) and the probability of selecting the second candidate mode (e.g., 80%). This target probability is obtained in advance through statistical analysis of multiple sample data, with different sample data used to indicate the mode selected by different clients when sending network requests from the multiple candidate modes. Since the target probability refers to a distribution pattern obtained through extensive data analysis, describing the distribution pattern presented during the selection of the racing mode, the racing mode selection process based on this target probability should conform to this distribution pattern as much as possible. This facilitates request sending under the constraint of this distribution pattern, ensuring that multiple requests sent by the client through the racing mode satisfy this distribution pattern as much as possible, thereby improving request performance.
[0121] As can be seen, for any network request (such as the first request, the third request, or the fifth request mentioned above) that is triggered on the client and needs to be sent in a race mode and carries a target domain name, if the triggering of the network request is detected, a race mode (such as the first candidate mode or the second candidate mode) is selected from multiple candidate modes according to the target probability, so that the network request can be sent to the server indicated by the target domain name in accordance with the selected race mode. This ensures that the selection distribution of multiple requests that the client needs to send in the race mode in the multiple candidate modes reaches the target probability, thereby helping to improve the request effect.
[0122] Based on the above processing methods, the technical solution provided in this application can be as follows: The first request carrying the target domain name triggered after a client cold start uses a race mode (such as the first candidate mode or the second candidate mode) by default, aiming to confirm the availability of the QUIC protocol under the target domain name through this race mode. All requests carrying the target domain name triggered before the client obtains the race result of the first request carrying the target domain name in this race mode use the race mode. Furthermore, after the client obtains the race result of the first request carrying the target domain name in this race mode, if the race result indicates that the QUIC protocol race is successful, it can be confirmed that the QUIC protocol is available under the target domain name. Therefore, the application directly switches from the race mode usage phase to the second mode usage phase, which prioritizes the use of the QUIC protocol and falls back to the TCP protocol after failure. This ensures that all requests carrying the target domain name triggered during the second mode usage phase are sent according to the second mode, thereby improving the request success rate. However, if the race result indicates that the QUIC protocol race is successful... If a race fails, the system remains in race mode to ensure subsequent requests continue to use race mode. This continues until five consecutive race failures are detected. This confirms that the QUIC protocol is unavailable on the target domain. The system then switches to a third mode, "Constantly Using TCP Protocol," to ensure that all requests carrying the target domain in this third mode consistently use TCP. This effectively disables (or blacklists) the target domain and QUIC protocol, allowing for periodic checks to verify its availability. Once QUIC is confirmed to be available, the system switches back to race mode to unblock (or release) the target domain and QUIC protocol, enabling subsequent requests to use race mode.
[0123] Furthermore, after switching to the second mode ("prioritize QUIC protocol and fall back to TCP protocol after failure"), if five consecutive requests are detected that require TCP protocol (e.g., five consecutive requests that require TCP protocol fallback), it can be confirmed that the QUIC protocol is unavailable under the target domain. Therefore, the system directly switches from the second mode to the third mode ("fixed TCP protocol usage mode"), ensuring that all requests carrying the target domain in the third mode consistently use TCP protocol. This disables the target domain + QUIC protocol, allowing for periodic probing to check if the QUIC protocol is back to usable under the target domain. Once the QUIC protocol is confirmed to be back to usable under the target domain, the system switches back to the race mode to unblock the target domain + QUIC protocol, enabling subsequent requests to use race mode.
[0124] Based on the above two paragraphs, it can be seen that in this application, after the client cold start, the racing mode is first used to explore which protocol is more suitable for the target domain name, so as to quickly determine the protocol applicable to the target domain name; then the second mode is used to improve the request success rate. In this way, different modes can be adaptively selected at different times, thereby effectively overcoming the defects caused by using only a single mode, and thus helping to improve the request effect.
[0125] Based on the processing method provided in the embodiments of this application, the embodiments of this application also provide a processing device, which is described below in conjunction with... Figure 12 Explanation and clarification will be provided. Among them, Figure 12 This is a schematic diagram of a processing device provided in an embodiment of this application. It should be noted that for technical details of the processing device provided in this embodiment, please refer to the relevant content of the processing method described above.
[0126] like Figure 12 As shown, the processing apparatus 1200 provided in this application embodiment includes:
[0127] The first sending unit 1201 is configured to, in response to the triggering of a first request carrying a target domain name, send the first request to the server indicated by the target domain name according to a first mode, wherein the first mode indicates that the first request is sent using a first protocol at a first time and the first request is sent using a second protocol at a second time, and the protocol that is successfully sent first between the first protocol and the second protocol is taken as the target protocol corresponding to the first request, wherein the difference between the first time and the second time does not exceed a preset time threshold.
[0128] The second sending unit 1202 is configured to, in response to the target protocol being the first protocol, send a second request carrying the target domain name to the server in a second mode, wherein the triggering time of the second request is later than the determination time of the target protocol, and the second mode indicates that the second request is sent using the first protocol first and the second request is sent using the second protocol only if it is determined that sending the second request using the first protocol fails.
[0129] In one possible implementation, the first request is the first request carrying the target domain name triggered after the cold start of the processing device 1200.
[0130] In one possible implementation, the processing apparatus 1200 further includes: a third sending unit, configured to send the third request to the server in accordance with the first mode in response to the triggering of a third request carrying the target domain name, wherein the triggering time of the third request is later than the triggering time of the first request and the triggering time of the third request is not later than the determination time of the target protocol.
[0131] In one possible implementation, the processing apparatus 1200 further includes: a fourth sending unit, configured to, in response to each request in the request sequence being sent to the server using the second protocol, send a fourth request carrying the target domain name to the server according to a third mode, wherein the triggering time of the fourth request is later than the triggering time of the latest request in the request sequence, the third mode indicates that the fourth request is sent using the second protocol, the request sequence includes a preset number of requests triggered sequentially, the triggering time of the earliest request in the request sequence is not earlier than the triggering time of the first request, and for any request in the request sequence, the request is sent to the server according to either the first mode or the second mode.
[0132] In one possible implementation, the processing apparatus 1200 further includes: a processing unit, configured to, in response to each request in the request sequence being sent to the server using the second protocol, initialize the usage duration of the third mode, the usage duration of the third mode varying with the time of the processing apparatus 1200; in response to the usage duration of the third mode reaching a duration threshold, send a probe request carrying the target domain name to the server using the first protocol; and in response to the successful sending of the probe request using the first protocol, send a fifth request carrying the target domain name to the server according to the first mode, the triggering time of the fifth request being later than the determination time of the successful sending of the probe request using the first protocol.
[0133] In one possible implementation, the processing unit is further configured to: in response to the failure to send the probe request using the first protocol, continue to execute the step of initializing the usage duration of the third mode.
[0134] In one possible implementation, the processing unit is further configured to: in response to the failure to send the probe request using the first protocol, update the duration threshold, wherein the updated duration threshold is greater than the original duration threshold, the difference between the updated duration threshold and the original duration threshold is positively correlated with the number of times the duration threshold is updated, and continue to perform the step of initializing the usage duration of the third mode.
[0135] In one possible implementation, the first mode includes multiple candidate modes, including a first candidate mode and a second candidate mode; in response to the first request being sent according to the first candidate mode, the first time is the same as the second time; in response to the first request being sent according to the second candidate mode, the first time is earlier than the second time.
[0136] In one possible implementation, the first sending unit 1201 is specifically configured to: in response to the first request being triggered, select a mode from the plurality of candidate modes that matches the configuration information of the processing device 1200, and send the first request to the server according to the matched mode.
[0137] In one possible implementation, the first sending unit 1201 is specifically configured to: in response to the first request being triggered, select from the plurality of candidate modes a mode that matches the remaining resource amount of the processing device 1200 at the triggering time of the first request, and send the first request to the server according to the matched mode.
[0138] In one possible implementation, the first sending unit 1201 is specifically configured to: in response to the first request being triggered, select a mode from the plurality of candidate modes according to a target probability to send the first request to the server, wherein the target probability is used to indicate the probability of selecting the first candidate mode and the probability of selecting the second candidate mode, wherein the target probability is obtained by statistical analysis of a plurality of sample data, and different sample data are used to indicate the mode selected by different processing devices 1200 from the plurality of candidate modes when sending network requests.
[0139] In one possible implementation, the first protocol is obtained by making at least one improvement to the second protocol; and / or, the version number of the first protocol is greater than the version number of the second protocol.
[0140] Based on the aforementioned processing device 1200, its working principle includes: for any domain name (such as a target domain name), a first mode is first used to determine which protocol would produce a better request effect for that domain name. After determining that the protocol is more suitable for that domain name, the device switches to the corresponding second mode. In this second mode, the "protocol more suitable for that domain name" is used first, and other protocols are used as a fallback if the determination of the "protocol more suitable for that domain name" fails. This allows for the rapid determination of which protocol is more suitable for that domain name and also improves the request success rate through the second mode, thereby improving the request effect.
[0141] In addition, this application also provides an electronic device, the device including a processor and a memory: the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs in the memory, so that the electronic device performs any implementation of the processing method provided in this application.
[0142] See Figure 13 The diagram illustrates a structural schematic of an electronic device 1300 suitable for implementing embodiments of the present disclosure. Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 13 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0143] like Figure 13 As shown, electronic device 1300 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 1301, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1302 or a program loaded from storage device 1308 into random access memory (RAM) 1303. RAM 1303 also stores various programs and data required for the operation of electronic device 1300. Processing device 1301, ROM 1302, and RAM 1303 are interconnected via bus 1304. Input / output (I / O) interface 1305 is also connected to bus 1304.
[0144] Typically, the following devices can be connected to I / O interface 1305: input devices 1306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1309. Communication device 1309 allows electronic device 1300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 13 An electronic device 1300 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0145] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1309, or installed from storage device 1308, or installed from ROM 1302. When the computer program is executed by processing device 1301, it performs the functions defined in the methods of embodiments of this disclosure.
[0146] The electronic device provided in this embodiment belongs to the same inventive concept as the method provided in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0147] This application also provides a computer-readable medium storing instructions or a computer program that, when executed on a device, causes the device to perform any implementation of the processing method provided in this application.
[0148] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0149] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0150] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0151] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, enable the electronic device to perform the aforementioned methods.
[0152] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0153] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0154] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units / modules do not necessarily limit the specific unit itself.
[0155] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0156] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0157] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.
[0158] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0159] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0160] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0161] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A processing method, characterized in that, The method is applied to a client, and the method includes: In response to the first request carrying the target domain name being triggered, the first request is sent to the server indicated by the target domain name according to the first mode. The first mode indicates that the first request is sent using the first protocol at the first time and the first request is sent using the second protocol at the second time. The protocol that is successfully sent first between the first protocol and the second protocol is taken as the target protocol corresponding to the first request. The difference between the first time and the second time does not exceed a preset time threshold. In response to the target protocol being the first protocol, a second request carrying the target domain name is sent to the server according to a second mode. The trigger time of the second request is later than the determination time of the target protocol. The second mode indicates that the second request is sent using the first protocol first and the second request is sent using the second protocol only if it is determined that sending the second request using the first protocol fails.
2. The method according to claim 1, characterized in that, The first request is the first request carrying the target domain name triggered after the client has been cold-started.
3. The method according to claim 2, characterized in that, The method further includes: In response to the triggering of a third request carrying the target domain name, the third request is sent to the server according to the first mode, wherein the triggering time of the third request is later than the triggering time of the first request and the triggering time of the third request is not later than the determination time of the target protocol.
4. The method according to claim 1, characterized in that, The method further includes: In response to each request in the request sequence being sent to the server using the second protocol, a fourth request carrying the target domain name is sent to the server according to the third mode. The trigger time of the fourth request is later than the trigger time of the latest request in the request sequence. The third mode indicates that the fourth request is sent using the second protocol. The request sequence includes a preset number of requests that are triggered sequentially. The trigger time of the earliest request in the request sequence is no earlier than the trigger time of the first request. For any request in the request sequence, the request is sent to the server according to either the first mode or the second mode.
5. The method according to claim 4, characterized in that, The method further includes: In response to each request in the request sequence being sent to the server using the second protocol, the usage duration of the third mode is initialized, and the usage duration of the third mode changes with the client's time. In response to the third mode's usage time reaching a duration threshold, a probe request carrying the target domain name is sent to the server using the first protocol; In response to the successful transmission of the probe request using the first protocol, a fifth request carrying the target domain name is sent to the server according to the first mode, wherein the triggering time of the fifth request is later than the determination time of the successful transmission of the probe request using the first protocol.
6. The method according to claim 5, characterized in that, The method further includes: In response to the failure to send the probe request using the first protocol, the step of initializing the usage duration of the third mode continues.
7. The method according to claim 5, characterized in that, The method further includes: In response to the failure to send the probe request using the first protocol, the duration threshold is updated. The updated duration threshold is greater than the original duration threshold. The difference between the updated duration threshold and the original duration threshold is positively correlated with the number of times the duration threshold is updated. The step of initializing the usage duration of the third mode is then performed.
8. The method according to claim 1, characterized in that, The first mode includes multiple candidate modes, and the multiple candidate modes include a first candidate mode and a second candidate mode; In response to the first request being sent according to the first candidate pattern, the first moment is the same as the second moment; In response to the first request being sent according to the second candidate mode, the first moment is earlier than the second moment.
9. The method according to claim 8, characterized in that, The response to the first request carrying the target domain name being triggered, sending the first request to the server indicated by the target domain name according to the first mode, includes: In response to the first request being triggered, a mode matching the client's configuration information is selected from the multiple candidate modes, and the first request is sent to the server according to the matched mode.
10. The method according to claim 8, characterized in that, The response to the first request carrying the target domain name being triggered, sending the first request to the server indicated by the target domain name according to the first mode, includes: In response to the first request being triggered, a mode matching the remaining resource amount of the client at the trigger time of the first request is selected from the multiple candidate modes, and the first request is sent to the server according to the matched mode.
11. The method according to claim 8, characterized in that, The response to the first request carrying the target domain name being triggered, sending the first request to the server indicated by the target domain name according to the first mode, includes: In response to the first request being triggered, a mode is selected from the multiple candidate modes according to a target probability to send the first request to the server. The target probability is used to indicate the probability of selecting the first candidate mode and the probability of selecting the second candidate mode. The target probability is obtained by statistical analysis of multiple sample data. Different sample data are used to indicate the mode selected by different clients from the multiple candidate modes when sending network requests.
12. The method according to any one of claims 1-11, characterized in that, The first protocol is obtained by making at least one improvement to the second protocol; And / or, The version number of the first protocol is greater than the version number of the second protocol.
13. A processing apparatus, characterized in that, include: The first sending unit is configured to, in response to the triggering of a first request carrying a target domain name, send the first request to the server indicated by the target domain name according to a first mode, wherein the first mode indicates that the first request is sent using a first protocol at a first time and the first request is sent using a second protocol at a second time, and the protocol that is successfully sent first between the first protocol and the second protocol is taken as the target protocol corresponding to the first request, wherein the difference between the first time and the second time does not exceed a preset time threshold. The second sending unit is configured to, in response to the target protocol being the first protocol, send a second request carrying the target domain name to the server according to a second mode, wherein the triggering time of the second request is later than the determination time of the target protocol, and the second mode indicates that the second request is sent using the first protocol first and the second request is sent using the second protocol only if it is determined that sending the second request using the first protocol fails.
14. An electronic device, characterized in that, The device includes: a processor and a memory; The memory is used to store instructions or computer programs; The processor is configured to execute the instructions or computer program in the memory to cause the electronic device to perform the method according to any one of claims 1-12.
15. A computer-readable medium, characterized in that, The computer-readable medium stores instructions or computer programs that, when executed on the device, cause the device to perform the method according to any one of claims 1-12.
16. A computer program product, characterized in that, It includes a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the method of any one of claims 1-12.