Method of processing user access request, electronic device, electronic apparatus, and medium
By detecting the load status of edge servers and redirecting user access requests to other edge servers, the problem of excessive load caused by the QUIC protocol is solved, achieving load balancing and efficient business processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2026-03-27
AI Technical Summary
The QUIC protocol incurs excessive load when handling user access requests on edge servers, leading to a decrease in business processing efficiency, especially during peak hours.
The edge server detects its own load status. If it exceeds a preset threshold, it generates a response message containing the address information of the second edge server, instructing the client to redirect the user's access request using the HTTP or HTTPS protocol, thus avoiding direct parsing of the QUIC request.
It reduces the load pressure on edge servers, achieves load balancing, avoids excessive consumption of computing resources during QUIC protocol processing, and improves business processing efficiency.
Smart Images

Figure CN116506441B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to data processing technology, and in particular to a method for processing user access requests, an electronic device, an electronic equipment and a medium. BACKGROUND
[0002] QUIC is a low-latency Internet transport protocol based on UDP protocol, which provides reliable, ordered, secure and faster transmission services on the basis of UDP. These advantages are particularly important for CDN networks facing a large number of users, so business platforms increasingly use the QUIC protocol for business processing.
[0003] However, since the UDP protocol is relatively simple, in order to achieve the same security transmission as the TCP protocol, the QUIC protocol will complete a large number of processing functions such as congestion control, data encryption and decryption, flow control, and data retransmission in the server, which will also cause the processing load of the server to be too high, especially during the peak period of user access requests, which will affect the efficiency of business processing. SUMMARY
[0004] The embodiments of the present application provide a method for processing user access requests, an electronic device, an electronic equipment and a medium. The technical solution of the present application can avoid the problem that the edge server is too high in its own load when processing user access requests based on the QUIC protocol, thereby affecting the efficiency of business processing.
[0005] According to an aspect of the embodiments of the present application, a method for processing user access requests is provided, applied to a first edge server, comprising:
[0006] receiving a user access request sent by a client based on a QUIC protocol;
[0007] detecting whether the self-load exceeds a preset load, if so, generating a first response message containing address information of a second edge server, the first response message further comprising identification information, the identification information being used to instruct the client to send the user access request to the second edge server based on a HTTP or HTTPS protocol;
[0008] sending the first response message to the client.
[0009] Optionally, in another embodiment based on the above-mentioned method of the present application, the identification information is located in the response header or response body of the first response message.
[0010] Optionally, in another embodiment based on the above-mentioned method of the present application, the detection of whether the self-load exceeds the preset load comprises:
[0011] determining whether the current service processing amount of the first edge server exceeds a first preset threshold, and if the first preset threshold is exceeded, the preset load is exceeded.
[0012] Optionally, in another embodiment based on the above method of the present application, before the first response message containing the address information of the second edge server is generated, the method further comprises:
[0013] determining a server cluster associated with itself;
[0014] selecting the second edge server from the server cluster based on a preset rule.
[0015] Optionally, in another embodiment based on the above method of the present application, the selecting the second edge server from the server cluster based on a preset rule comprises:
[0016] randomly selecting an edge server from the server cluster as the second edge server; or,
[0017] selecting an edge server from the server cluster whose current service processing amount is lower than a second preset threshold as the second edge server, the second preset threshold being lower than the first preset threshold; or,
[0018] selecting an edge server from the server cluster whose deployment location matches the area where the client is located as the second edge server.
[0019] Optionally, in another embodiment based on the above method of the present application, after the selecting the second edge server from the server cluster based on a preset rule, the method further comprises:
[0020] obtaining the domain name or IP address corresponding to the second edge server, and taking the domain name or IP address as the address information of the second edge server.
[0021] Optionally, in another embodiment based on the above method of the present application, the generating the first response message containing the address information of the second edge server comprises:
[0022] generating the first response message for instructing the client to send the user access request to the second edge server only next time; or,
[0023] generating the first response message for instructing the client to send the user access request to the second edge server permanently.
[0024] Optionally, in another embodiment based on the above method of the application, the generating the first response message for instructing the client to send the user access request to the second edge server only next time comprises:
[0025] detecting the number of times of sending the first response message to at least one client in a historical time period; if the number of times does not exceed a preset value, generating the first response message for instructing the client to perform data access to the second edge server only next time; or,
[0026] detecting the current service processing amount; if the service processing amount exceeds the first preset threshold and does not exceed a third preset threshold, generating the first response message for instructing the client to perform data access to the second edge server only next time, wherein the third preset threshold is greater than the first preset threshold.
[0027] Optionally, in another embodiment based on the above method of the application, the generating the first response message for instructing the client to send the user access request to the second edge server only next time comprises:
[0028] detecting the number of times of sending the first response message to at least one client in a historical time period; if the number of times does not exceed a preset value, generating the first response message for instructing the client to perform data access to the second edge server only next time; or,
[0029] detecting the current service processing amount; if the service processing amount exceeds the first preset threshold and does not exceed a third preset threshold, generating the first response message for instructing the client to perform data access to the second edge server only next time, wherein the third preset threshold is greater than the first preset threshold.
[0030] According to an aspect of an embodiment of the application, a method for processing a user access request is provided, which is applied to a second edge server and comprises:
[0031] receiving a user access request sent by a client based on an HTTP or HTTPS protocol, wherein the user access request is a user access request sent by the client to a first edge server based on a QUIC protocol in a historical time period;
[0032] sending a second response message to the client based on the HTTP or HTTPS protocol, wherein the second response message comprises resource data requested by the client.
[0033] According to another aspect of an embodiment of the application, an electronic device for processing a user access request is provided, which is applied to an edge server and comprises:
[0034] which is applied to a first edge server and comprises:
[0035] The first receiving module is configured to receive a user access request sent by a client based on a QUIC protocol;
[0036] The detecting module is configured to detect whether a self load exceeds a preset load, and if so, generate a first response message containing second edge server address information, the first response message being used to instruct the client to send the user access request to the second edge server based on an HTTP or HTTPS protocol;
[0037] The first sending module is configured to send the first response message to the client.
[0038] According to yet another aspect of embodiments of the present application, an electronic device for processing a user access request is provided, and is applied to a second edge server, and includes:
[0039] The second receiving module is configured to receive a user access request sent by a client based on an HTTP or HTTPS protocol, the user access request being a user access request sent by the client to a first edge server based on a QUIC protocol within a historical time period;
[0040] The second sending module is configured to send a second response message to the client based on an HTTP or HTTPS protocol, the second response message including resource data requested by the client.
[0041] According to yet another aspect of embodiments of the present application, an electronic device is provided, and includes:
[0042] a memory configured to store executable instructions; and
[0043] a display configured to display with the memory to execute the executable instructions to complete operations of any of the above-mentioned methods for processing a user access request.
[0044] According to yet another aspect of embodiments of the present application, a computer readable storage medium is provided, and is configured to store computer readable instructions, the instructions being executed to perform operations of any of the above-mentioned methods for processing a user access request.
[0045] In the present application, the user access request sent by the client based on the QUIC protocol can be received by the first edge server; it is detected whether the load of itself exceeds the preset load, if yes, the first response message containing the address information of the second edge server is generated, the first response message further includes identification information, the identification information is used to instruct the client to send the user access request to the second edge server based on the HTTP or HTTPS protocol; the first response message is sent to the client. Through the application of the technical solution of the present application, in the process of receiving the user access request sent by the client based on the QUIC protocol by the edge server, the user access request is not directly parsed, but the load state of itself is detected first, and when it is determined that the load of itself exceeds the preset load, a response message for instructing the client to redirect the service request based on the HTTP or HTTPS protocol to other edge server is sent to the client, so that other edge server continues to process the access request of the client based on the HTTP or HTTPS protocol with less calculation resource consumption. Not only can the problem that the self load (for example, at least one of the business load and the machine running load) of the edge server is too high during the use of the QUIC protocol for business processing and thus affects the business processing efficiency be avoided, but also the problem that the redirected edge server also faces the problem of too heavy self load in a short time when continuing to transmit data with the client based on the QUIC protocol can be avoided.
[0046] The technical solution of the present application will be described in further detail below by means of the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0047] The accompanying drawings, which form a part of the specification, illustrate embodiments of the present application and, together with the description, serve to explain the principles of the present application.
[0048] With reference to the drawings, the present application can be more clearly understood in light of the following detailed description, in which:
[0049] Figure 1 A method for processing user access request is proposed in the present application;
[0050] Figure 2 Another method for processing user access request is proposed in the present application;
[0051] Figures 3-4 An electronic device for processing user access request is proposed in the present application;
[0052] Figure 5 An electronic device for processing user access request is proposed in the present application. DETAILED DESCRIPTION
[0053] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of the components and steps illustrated in these embodiments, the numerical expressions, and numerical values set forth in the examples, are not limiting of the scope of the present application, unless otherwise specifically indicated.
[0054] It should be understood, however, that the sizes of the regions illustrated in the figures are chosen for convenience only and therefore are not necessarily drawn to scale.
[0055] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the scope of the application or its application or uses.
[0056] Techniques, methods, and apparatus known to those of ordinary skill in the relevant art can not be discussed in detail herein, but should be considered as part of the specification, where appropriate.
[0057] It should be noted that like reference numerals and letters refer to like items in the following figures, and as a result, further discussion of such items is unnecessary in the subsequent figures.
[0058] In addition, the technical solutions among various embodiments of the present application can be combined with each other, but it must be based on the fact that a person of ordinary skill in the art can realize the combination, and when the combination of technical solutions contradicts each other or cannot be realized, it should be considered that the combination of technical solutions does not exist, and is not within the protection scope of the present application.
[0059] It should be noted that other embodiments of the present application will readily occur to those skilled in the art having the benefit of the present description. The application is intended to include all such variations that fall within the scope of the application. The specification and examples given should be considered exemplary only, with the true scope and spirit of the application indicated by the following claims.
[0060] It should be understood that the present application is not limited to the precise construction and compositions described herein and as illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the present application. The scope of the present application is limited only by the appended claims.
[0061] The method for processing a user access request according to the exemplary embodiments of the present application will now be described with reference to the accompanying drawings. Figures 1-2 It should be noted that the following application scenarios are merely shown for the purpose of facilitating the understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. On the contrary, the embodiments of the present application can be applied to any applicable scenario.
[0062] In an implementation, the application further provides a method for processing a user access request. Figure 1 A flowchart of a method for processing a user access request according to an implementation of the application is schematically shown. As shown in the figure, the method is applied to a first edge server and comprises: Figure 1
[0063] S101, receiving a user access request sent by a client based on a QUIC protocol.
[0064] The QUIC is a low-latency Internet transmission protocol based on the UDP protocol, which mainly aims to solve some problems existing in the current TCP network transmission protocol, including TCP head blocking, handshake delay, and TCP protocol rigidity, etc. The QUIC provides reliable, ordered, secure, and faster transmission services on the basis of the UDP, which is particularly important for CDNs facing a large number of users. Therefore, some individual CDN manufacturers have begun to provide processing capabilities for QUIC protocol requests.
[0065] The QUIC protocol can be widely used, one of the reasons is that it can achieve higher business processing efficiency compared with HTTPS or HTTP transmission protocols. However, since the UDP protocol is relatively simple, in order to achieve the same security transmission as the TCP protocol, the QUIC protocol will complete a large number of functions such as congestion control, data encryption and decryption, flow control, data retransmission, etc. in the server, which will consume more application layer resources of the server, and then cause the problem of too high business processing load of the server, especially during the peak period of user access requests, which will greatly affect the efficiency of business processing.
[0066] S102, detecting whether the load of the first edge server exceeds a preset load, if yes, generating a first response message containing address information of a second edge server, the first response message further comprising identification information, the identification information being used to instruct the client to send a user access request to the second edge server based on a HTTP or HTTPS protocol.
[0067] To solve the above problems, the application can not directly parse the user access request when the first edge server receives the user access request sent by the client based on the QUIC protocol, but first detect the load state of the first edge server, and then process the user request differently according to the load state of the first edge server.
[0068] In one way, the first edge server detecting the load state of the first edge server can include detecting the business load state of the first edge server (for example, by determining the amount of business being processed), and can also include detecting the machine running load state of the first edge server (for example, by determining the CPU running index, continuous working time, etc.). The application does not limit this.
[0069] In one embodiment, when the first edge server detects that its load exceeds the preset load, it is determined that the first edge server currently has a large amount of business to process. In order to avoid further adding new user access requests to the edge server and affecting the efficiency of the first edge server in processing business, the first edge server generates an identification information for instructing the client to send a user access request to the second edge server based on the HTTP or HTTPS protocol, carries the identification information in the first response message, and sends the first response message to the client. The user access request is redirected to other edge servers (second edge servers), thereby reducing the business processing pressure of the first edge server and achieving the purpose of load balancing.
[0070] It can be understood that if the first edge server does not detect that its load exceeds the preset load, the user access request can be directly processed.
[0071] In one embodiment, the identification information is not specifically limited, for example, it can be a 301 response code, a 302 response code, etc.
[0072] In another embodiment, the identification information can also be an arbitrary number or letter field or any data generated based on the QUIC protocol. It can be understood that as long as the number or letter field is agreed in advance on the first edge server side and the client side to have the meaning of instructing the client to send a user access request to the second edge server based on the HTTP or HTTPS protocol.
[0073] It can be understood that since the HTTP or HTTPS protocol is transmitted based on the TCP protocol, and the TCP protocol implements protocol processing at the transport layer, most of the calculations have been fixed to hardware, so using the HTTP or HTTPS protocol to process user business can achieve the purpose of consuming less computing resources at the application layer of the edge server. Not only can it avoid the problem of excessive load (at least one of business load and machine running load) of the edge server when using the QUIC protocol to process business, which affects the efficiency of business processing, but also can avoid the problem of excessive load of the redirected edge server when continuing to transmit data with the client based on the QUIC protocol in a short time.
[0074] S103, send the first response message to the client.
[0075] Further, when the first edge server generates the identification information for instructing the client to send the user access request to the second edge server based on the HTTP or HTTPS protocol, and carries the identification information in the first response message, the first edge server sends the first response message to the client, so that the client receives the first response message and sends the user access request to the second edge server in a protocol downgrade manner (i.e., converting from the QUIC protocol to the HTTP or HTTPS protocol).
[0076] In the present application, the first edge server can receive the user access request sent by the client based on the QUIC protocol, detect whether the load of the first edge server exceeds a preset load, generate a first response message containing address information of a second edge server if the load of the first edge server exceeds the preset load, the first response message further including identification information for instructing the client to send the user access request to the second edge server based on the HTTP or HTTPS protocol, and send the first response message to the client. By applying the technical solution of the present application, when the edge server receives the user access request sent by the client based on the QUIC protocol, the edge server does not directly parse the user access request, but first detects the load state of the edge server, and when it is determined that the load of the edge server exceeds the preset load, the edge server sends a response message to the client for instructing the client to redirect the service request based on the HTTP or HTTPS protocol to another edge server, so that the other edge server continues to process the access request of the client based on the HTTP or HTTPS protocol with less consumption of computing resources. Not only can the problem of high load of the edge server when the edge server uses the QUIC protocol to process services and affects the efficiency of service processing be avoided, but also the problem of high load of the redirected edge server when the redirected edge server continues to transmit data with the client based on the QUIC protocol in a short time can be avoided.
[0077] Optionally, in another embodiment based on the above method of the present application, the identification information is located in the response header information or the response body information of the first response message.
[0078] In one way, the first edge server in the embodiment of the present application can carry the identification information in the response header or the response body of the first response message, so that after the client receives the first response message, the client can conveniently extract and parse the response header or the response body of the first response message, thereby achieving the purpose of quickly sending the user access request to the second edge server.
[0079] Optionally, in another embodiment based on the above method of the present application, in S102 (detecting whether the load of the first edge server exceeds a preset load), the following steps can be implemented:
[0080] detecting whether the current service processing amount of the first edge server exceeds a first preset threshold, if the first preset threshold is exceeded, the preset load is exceeded.
[0081] It can be understood that the process of detecting the load of the first edge server can be performed in various ways, for example, the current or recent service processing amount of the first edge server, the current CPU running parameter, the current memory consumption parameter, etc. can be detected.
[0082] For example, the current service processing amount of the first edge server is detected to determine whether the current service processing amount exceeds the first preset threshold, if the first preset threshold is exceeded, it is determined that the load of the first edge server exceeds the preset load, and if the first preset threshold is not exceeded, it is determined that the load of the first edge server does not exceed the preset load. The first preset threshold is not limited in the present application.
[0083] It can be understood that when the first edge server detects that the load exceeds the preset load, it is determined that the current load of the first edge server (e.g. at least one of the service load and the machine running load) is large. In order to avoid the problem of further increasing the user processing service to the edge server and affecting the progress of the first edge server processing service, the embodiment of the present application generates an identification information for indicating that the client sends a user access request to the second edge server based on the HTTP or HTTPS protocol, and carries the identification information in the first response message, and then sends the first response message to the client. The user access request is redirected to other edge servers (second edge servers), thereby reducing the service processing pressure of the first edge server and achieving the purpose of load balancing.
[0084] Optionally, in another embodiment based on the above method of the present application, before S102 (generating a first response message containing second edge server address information), the following steps can be implemented:
[0085] determining a server cluster associated with itself;
[0086] selecting a second edge server from the server cluster based on a preset rule.
[0087] Further, in order to ensure that the second edge server can process the user access request of the client, the first edge server needs to determine a server cluster associated with itself in the process of selecting the second edge server, so as to subsequently select the second edge server from the server cluster. It can be understood that, since the first edge server and the second edge server belong to the same server cluster, it can be ensured that the second edge server selected by the first edge server can process the user access request of the client, thereby avoiding the problem of affecting the user browsing experience caused by the second edge server being unable to process the access request of the client.
[0088] In the present application, the server cluster associated with the first edge server is not specifically limited, for example, the server cluster can be a server cluster deployed in the same business area as the first edge server, or a server cluster processing the same type of business as the first edge server.
[0089] Alternatively, in another embodiment based on the above-mentioned method of the present application, the second edge server is selected from the server cluster based on a preset rule, and the following steps can be implemented:
[0090] The edge server randomly selected from the server cluster is taken as the second edge server; or,
[0091] The edge server with a current business processing amount lower than a second preset threshold value in the server cluster is taken as the second edge server, and the second preset threshold value is smaller than the first preset threshold value; or,
[0092] The edge server with a deployment position matching the area where the client is located in the server cluster is taken as the second edge server.
[0093] In one way, the first edge server can determine the second edge server in multiple ways, for example, the second edge server can be randomly selected, or the second edge server can be selected from the server cluster associated with itself according to a preset rule, wherein the preset rule can be to select a server with a lower current load value (i.e., a current business processing amount lower than a second preset threshold value) from the server cluster as the second edge server, wherein the present application does not specifically limit the second preset threshold value, as long as it is a threshold value with a value smaller than the first preset threshold value.
[0094] In another way, the preset rule can also be to select a server with a deployment position matching (e.g., closest or distance lower than a preset distance) the distance of the client from the server cluster as the second edge server, wherein the present application does not specifically limit the preset distance.
[0095] It can be understood that, since the first edge server and the second edge server belong to the same server cluster, the edge servers in the same server cluster are highly associated with each other in terms of the type or deployment location of the access service processed, and such selection can increase the probability that the second edge server processes the user access request of the client. In addition, the edge servers in the same server cluster can know the current load status of other edge servers, so as to select an edge server with a better current load status as the second edge server. Thus, the problem that the user browsing experience is affected due to the second edge server being unable to process the request when the client sends a user access request to the second edge server based on the HTTP or HTTPS protocol subsequently can be avoided.
[0096] Optionally, in another embodiment based on the above method of the present application, after selecting the second edge server from the server cluster based on the preset rule, the following steps can be implemented:
[0097] The domain name or IP address corresponding to the second edge server is obtained, and the domain name or IP address is taken as the address information of the second edge server.
[0098] Further, after the first edge server selects the second edge server, in order to ensure that the client can accurately send a user access request to the second edge server, the first edge server can send the domain name or IP address corresponding to the second edge server as the address information of the second edge server to the client, so that the client can quickly obtain the address of the second edge server, and then can directly send a user access request to the second edge server, thereby achieving the purpose of accelerating the service processing efficiency.
[0099] Optionally, in another embodiment based on the above method of the present application, in S102 (generating a first response message containing the address information of the second edge server), the following steps can be implemented:
[0100] The first response message for instructing the client to send a user access request to the second edge server only once is generated; or,
[0101] The first response message for instructing the client to send a user access request to the second edge server permanently is generated.
[0102] In one way, the present application can generate a 301 response code (identification information) to realize the generation of the first response message for instructing the client to send a user access request to the second edge server permanently. The present application can also generate a 302 response code (identification information) to realize the generation of the first response message for instructing the client to send a user access request to the second edge server only once.
[0103] It can be understood that the above-mentioned method of the present application can be used by the first edge server to send a temporary redirection or permanent redirection response message to the client according to the current or recent service processing amount, current CPU running parameters, current memory consumption parameters and other load conditions of the first edge server, so as to achieve the purpose of the first edge server being able to flexibly instruct the client whether to continue to send access requests to it in the future.
[0104] Optionally, in another embodiment based on the above-mentioned method of the present application, when the first response message for instructing the client to send a user access request to the second edge server only once is generated, the following steps can be implemented:
[0105] detecting the number of times of sending the first response message to at least one client in a historical time period; if the number of times does not exceed a preset value, generating the first response message for instructing the client to perform data access on the second edge server only once; or,
[0106] detecting the current service processing amount; if the service processing amount exceeds a first preset threshold value and does not exceed a third preset threshold value, generating the first response message for instructing the client to perform data access on the second edge server only once, wherein the third preset threshold value is greater than the first preset threshold value.
[0107] In the process of generating the first response message for instructing the client to send a user access request to the second edge server only once (i.e. temporary redirection) by the first edge server, the number of times of sending the first response message to the client or other clients in a historical time period can be detected by the first edge server to determine.
[0108] For example, when the first edge server detects that it has received a user access request sent by a client based on the QUIC protocol, and the first edge server has also sent a first response message to the client for instructing the client to send a user access request to other edge servers based on the HTTP or HTTPS protocol, and the number of times of sending the first response message to the client in a historical time period does not exceed a preset value, it indicates that the first edge server is not in a high-load state for a long time (e.g. exceeding a preset time length, in one way, the preset time length can be at least one hour or at least one day, etc.).
[0109] In this case, the present application can be used by the first edge server to send a first response message to the client for instructing the client to send an access request to the second edge server only once when receiving a user access request sent by the client based on the QUIC protocol, so as to achieve the purpose of reducing the processing pressure of the first edge server by temporarily transferring the user access request when the first edge server is in a state of excessive load, while also improving the resource utilization rate of other edge servers.
[0110] In another mode, in the process of generating the first response message for instructing the client to send the user access request to the second edge server only once (i.e. temporary redirection) by the first edge server, the current service processing amount of the first edge server can also be detected, and when it is determined that the service processing amount is between the first preset threshold and the third preset threshold, the first response message for instructing the client to send the user access request to the second edge server only once is sent to the client, so that in the case that the first edge server is overloaded, the processing pressure of the first edge server can be reduced by temporarily transferring the user access request, and the resource utilization of other edge servers is also improved.
[0111] Optionally, in another embodiment based on the above method of the present application, the first response message for instructing the client to send the user access request to the second edge server permanently can be generated by implementing the following steps:
[0112] detecting the number of times of sending the first response message to at least one client in a historical time period; if the number of times exceeds a preset value, generating the first response message for instructing the client to send the user access request to the second edge server permanently; or
[0113] detecting the current service processing amount; if the service processing amount exceeds a third preset threshold, generating the first response message for instructing the client to send the user access request to the second edge server permanently, wherein the third preset threshold is greater than the first preset threshold.
[0114] In the process of generating the first response message for instructing the client to send the user access request to the second edge server permanently by the first edge server, the number of times of sending the first response message to the client or other clients in a historical time period can be detected by the first edge server to determine.
[0115] For example, when the first edge server detects that it has received a user access request sent by a client based on the QUIC protocol, and the first edge server has also sent the first response message to the client for instructing the client to send the user access request to other edge servers based on the HTTP or HTTPS protocol, and the number of times of sending the first response message to the client in a historical time period exceeds a preset value, it indicates that the first edge server is always in a high load state for a long time.
[0116] Therefore, in order to avoid the problem that the first edge server further consumes the transceiving resources of the edge server in the state of long-term high load caused by repeatedly sending the first response message to the client, the application can send the first response message for indicating the client to permanently access the second edge server for data by the first edge server when receiving the user access request sent by the client based on the QUIC protocol, so as to reduce the load of the first edge server by permanently transferring the user access request in the case of heavy load of the first edge server.
[0117] In another way, in the process of generating the first response message for indicating the client to permanently send the user access request to the second edge server (i.e. permanent redirection) by the first edge server, the application can also detect the current business processing amount of the first edge server, and send the first response message for indicating the client to permanently access the second edge server for data when determining that the business processing amount exceeds the third preset threshold, so as to reduce the load of the first edge server by permanently transferring the user access request in the case of heavy load of the first edge server.
[0118] In another embodiment, the application further provides a method for processing a user access request. Figure 2 The flowchart of the method for processing a user access request according to the embodiment of the application is schematically shown. As shown in the figure, Figure 2 The method is applied to the second edge server, and includes:
[0119] S201, receiving the user access request sent by the client based on the HTTP or HTTPS protocol, the user access request being the user access request sent by the client to the first edge server based on the QUIC protocol in a historical time period.
[0120] The QUIC is a low-latency Internet transmission protocol based on the UDP protocol, which mainly appears to solve some problems existing in the existing TCP network transmission protocol, including TCP head blocking, handshake delay and TCP protocol rigidity. The QUIC provides reliable, ordered, secure and faster transmission services on the basis of the UDP, which is particularly important for the CDN network facing a large number of users, so some CDN manufacturers begin to provide the processing capacity of the QUIC protocol request.
[0121] Among them, one of the reasons why the QUIC protocol can be widely used is that it can achieve the purpose of higher business processing efficiency compared with the HTTPS / HTTP transmission protocol. However, since the UDP protocol is relatively simple, in order to make it achieve the same security transmission as the TCP protocol, the QUIC protocol will complete a large number of functions such as congestion control, data encryption and decryption, flow control, data retransmission and the like in the server, which will also consume more application layer resources of the server, and then cause the problem of too high processing load of the server, especially during the peak period of user access request, which will greatly affect the efficiency of business processing.
[0122] In view of the above problems, the application proposes a process in which the edge server receives the user access request sent by the client based on the QUIC protocol. Instead of directly parsing the user access request, the load state of the edge server is detected, and when it is determined that the load exceeds the preset load, a response message is sent to the client to indicate that the client redirects the business request based on the HTTP or HTTPS protocol to other edge servers, so that other edge servers continue to process the access request of the client based on the HTTP or HTTPS protocol with less consumption of computing resources.
[0123] Further, when the second edge server receives the user access request sent based on the HTTP or HTTPS protocol, the subsequent resource data transmission between the second edge server and the client is carried out based on the HTTP or HTTPS protocol.
[0124] In an optional manner, when the second edge server can support both the HTTP or HTTPS protocol and the QUIC protocol, after receiving the user access request sent by the client based on the HTTP or HTTPS protocol, the second edge server can select whether to preferentially carry out subsequent resource data transmission based on the HTTP or HTTPS protocol according to the load state of the second edge server and the like.
[0125] It can be understood that since the HTTP or HTTPS protocol is transmitted based on the TCP protocol, and the TCP protocol implements protocol processing at the transport layer, most of the calculations have been fixed to hardware, so that the second edge server adopts the HTTP or HTTPS protocol to process user business can achieve the purpose of consuming less computing resources of the application layer of the second edge server, thereby avoiding the situation that the second edge server will also face the same situation of too heavy load as the first edge server if it continues to transmit data with the client based on the QUIC protocol.
[0126] S202, sending a second response message to the client based on the HTTP or HTTPS protocol, the second response message including resource data requested by the client.
[0127] In one way, after the second edge server receives the user access request sent by the client based on the HTTP or HTTPS protocol, it can be detected whether the resource data corresponding to the user access request is stored in the storage area of the second edge server. It can be understood that if yes, the resource data can be directly read, and the resource data is sent to the client based on the HTTP or HTTPS protocol in the subsequent.
[0128] If not, the resource data can be called from the server where the resource data is stored, such as the source station server or other edge servers, parent servers, and central servers, and then sent to the client based on the HTTP or HTTPS protocol.
[0129] In this application, the second edge server can receive the user access request sent by the client based on the HTTP or HTTPS protocol, and the user access request is the user access request sent by the client to the first edge server based on the QUIC protocol in the historical time period. The second response message includes the resource data requested by the client. By applying the technical solution of the application, the first edge server can receive the user access request sent by the client based on the QUIC protocol, and the user access request is not directly parsed, but the load state of the first edge server is detected first. When it is determined that the load exceeds the preset load, a response message is sent to the client to indicate that the client redirects the service request based on the HTTP or HTTPS protocol to the second edge server, so that the second edge server continues to process the access request of the client based on the HTTP or HTTPS protocol with less calculation resource consumption, thereby helping the first edge server with high load to reduce the pressure.
[0130] In another embodiment of the application, as shown in Figure 3 The application further provides an electronic device for processing user access requests. Wherein, applied to the first edge server, comprising,
[0131] The first receiving module 301 is configured to receive the user access request sent by the client based on the QUIC protocol;
[0132] The detection module 302 is configured to detect whether the load of the first edge server exceeds the preset load. If yes, a first response message containing the address information of the second edge server is generated, and the first response message is used to instruct the client to send the user access request to the second edge server based on the HTTP or HTTPS protocol.
[0133] The first sending module 303 is configured to send the first response message to the client.
[0134] In the present application, the user access request sent by the client based on the QUIC protocol can be received by the first edge server; it is detected whether the self-load exceeds the preset load, if yes, the first response message containing the second edge server address information is generated, the first response message further includes identification information, the identification information is used to instruct the client to send the user access request to the second edge server based on the HTTP or HTTPS protocol; the first response message is sent to the client. Through the application of the technical solution of the present application, in the process of receiving the user access request sent by the client based on the QUIC protocol by the edge server, the user access request is not directly parsed, but the load state of the self is detected first, and when it is determined that the self-load exceeds the preset load, a response message for instructing the client to redirect the service request based on the HTTP or HTTPS protocol to other edge servers is sent to the client, so that other edge servers continue to process the access request of the client based on the HTTP or HTTPS protocol with less calculation resource consumption. Not only can the problem that the self-load is too high due to the use of the QUIC protocol by the edge server in the process of business processing and thus affects the business processing efficiency be avoided, but also the problem that the redirected edge server also faces the problem of too heavy self-load in a short time when continuing to perform data transmission with the client based on the QUIC protocol can be avoided, wherein the too heavy self-load includes but is not limited to too high edge server business load or too high machine running load and the like.
[0135] In another embodiment of the present application, the detection module 302 is configured to:
[0136] The identification information is located in the response header or response body of the first response message.
[0137] In another embodiment of the present application, the detection module 302 is configured to:
[0138] It is detected whether the current service processing amount of the first edge server exceeds the first preset threshold, if yes, the preset load is exceeded.
[0139] In another embodiment of the present application, the detection module 302 is configured to:
[0140] The server cluster associated with the self is determined;
[0141] Based on the preset rule, the second edge server is selected from the server cluster.
[0142] In another embodiment of the present application, the detection module 302 is configured to:
[0143] The edge server randomly selected from the server cluster is taken as the second edge server; or,
[0144] The edge server with a current service processing amount lower than a second preset threshold in the server cluster is taken as the second edge server, and the second preset threshold is smaller than the first preset threshold; or
[0145] The edge server with a deployment position matching the area where the client is located in the server cluster is taken as the second edge server.
[0146] In another embodiment of the present application, the detection module 302 is configured to:
[0147] The domain name or IP address corresponding to the second edge server is acquired, and the domain name or IP address is taken as the address information of the second edge server.
[0148] In another embodiment of the present application, the detection module 302 is configured to:
[0149] A first response message for instructing the client to send the user access request to the second edge server only next time is generated; or,
[0150] A first response message for instructing the client to send the user access request to the second edge server permanently is generated.
[0151] In another embodiment of the present application, the detection module 302 is configured to:
[0152] The number of times of sending the first response message to at least one client in a historical time period is detected; if the number of times does not exceed a preset value, a first response message for instructing the client to perform data access to the second edge server only next time is generated; or,
[0153] The current service processing amount is detected; if the service processing amount exceeds the first preset threshold and does not exceed a third preset threshold, a first response message for instructing the client to perform data access to the second edge server only next time is generated, wherein the third preset threshold is greater than the first preset threshold.
[0154] In another embodiment of the present application, the detection module 302 is configured to:
[0155] The number of times of sending the first response message to at least one client in a historical time period is detected; if the number of times exceeds a preset value, a first response message for instructing the client to perform data access to the second edge server permanently is generated; or,
[0156] detect a current service processing amount; and if the service processing amount exceeds a third preset threshold, generate a first response message for instructing the client to permanently access data from the second edge server, wherein the third preset threshold is greater than the first preset threshold.
[0157] In another embodiment of the present application, as shown in Figure 4 The present application also provides an electronic device for processing user access requests. Wherein, applied to a second edge server, comprising,
[0158] The second receiving module 304 is configured to receive a user access request sent by a client based on HTTP or HTTPS protocol, wherein the user access request is a user access request sent by the client to a first edge server based on a QUIC protocol within a historical time period;
[0159] The second sending module 305 is configured to send a second response message to the client based on HTTP or HTTPS protocol, wherein the second response message includes resource data requested by the client.
[0160] Figure 5 is a logical structure block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 400 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0161] Referring to Figure 5 , the electronic device 400 can include one or more of the following components: a processor 401 and a memory 402.
[0162] The processor 401 can include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 401 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 401 can also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit), and the coprocessor being a low-power processor for processing data in a standby state. In some embodiments, the processor 401 can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing of content to be displayed by the display screen. In some embodiments, the processor 401 can further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
[0163] The memory 402 can include one or more computer-readable storage media that can be non-transitory. The memory 402 can also include a high-speed random access memory, and a nonvolatile memory such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 402 is used to store at least one instruction for being executed by the processor 401 to implement the interactive special effect calibration method provided by the method embodiments in the present application.
[0164] In some embodiments, the electronic device 400 can also optionally include a peripheral device interface 403 and at least one peripheral device. The processor 401, the memory 402, and the peripheral device interface 403 can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 403 through a bus, a signal line, or a circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 404, a touch display screen 405, a camera 406, an audio circuit 407, a positioning component 408, and a power supply 409.
[0165] The peripheral interface 403 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 401 and the memory 402. In some embodiments, the processor 401, the memory 402 and the peripheral interface 403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 401, the memory 402 and the peripheral interface 403 can be implemented on a separate chip or circuit board, and the present embodiments are not limited in this regard.
[0166] The radio frequency circuit 404 is configured to receive and send RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 404 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 404 converts electrical signals into electromagnetic signals for transmission, or converts electromagnetic signals received into electrical signals. Optionally, the radio frequency circuit 404 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 404 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 404 can also include NFC (Near Field Communication) related circuitry, and the present application is not limited in this regard.
[0167] The display 405 is configured to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display 405 is a touch display, the display 405 is further capable of acquiring a touch signal on or above the surface of the display 405. The touch signal can be input to the processor 401 as a control signal for processing. At this time, the display 405 can also be configured to provide a virtual button and / or a virtual keyboard, also known as a soft button and / or a soft keyboard. In some embodiments, the display 405 can be one, arranged on the front panel of the electronic device 400; in other embodiments, the display 405 can be at least two, arranged on different surfaces of the electronic device 400 or in a folding design; in still other embodiments, the display 405 can be a flexible display, arranged on a curved surface or a folding surface of the electronic device 400. Even, the display 405 can also be arranged in an irregular shape other than a rectangle, i.e., a notched screen. The display 405 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.
[0168] The power supply 409 is configured to supply power to various components in the electronic device 400. The power supply 409 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 409 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be configured to support fast charging technology.
[0169] Those skilled in the art can understand that the structure shown in the above description is not a limitation on the electronic device 400, and the electronic device 400 can include more or fewer components than those shown in the figure, or combine certain components, or use a different arrangement of components. Figure 5 The structure shown in the above description does not constitute a limitation on the electronic device 400, and the electronic device 400 can include more or fewer components than those shown in the figure, or combine certain components, or use a different arrangement of components.
[0170] In an example embodiment, a non-transitory computer-readable storage medium, for example, the memory 402 including instructions, is also provided. The instructions can be executed by the processor 401 of the electronic device 400 to perform the above-mentioned method for pushing audio and video streams, which comprises: receiving a user access request sent by a client based on a QUIC protocol; detecting whether a load of the electronic device 400 exceeds a preset load, and if so, generating a first response message including second edge server address information, the first response message further including identification information, the identification information being used to instruct the client to send the user access request to the second edge server based on an HTTP or HTTPS protocol; and sending the first response message to the client. Optionally, the instructions can also be executed by the processor 401 of the electronic device 400 to perform other steps involved in the above-mentioned example embodiments. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.
[0171] In an example embodiment, an application program / computer program product is also provided, which includes one or more instructions that can be executed by the processor 401 of the electronic device 400 to perform the above-mentioned method for pushing audio and video streams, which comprises: receiving a user access request sent by a client based on a QUIC protocol; detecting whether a load of the electronic device 400 exceeds a preset load, and if so, generating a first response message including second edge server address information, the first response message further including identification information, the identification information being used to instruct the client to send the user access request to the second edge server based on an HTTP or HTTPS protocol; and sending the first response message to the client. Optionally, the instructions can also be executed by the processor 401 of the electronic device 400 to perform other steps involved in the above-mentioned example embodiments.
[0172] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims.
[0173] It should be understood that the application is not limited to the precise construction that has been described above and shown in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application is limited only by the appended claims.
Claims
1. A method of processing a user access request, characterized by, Applied to a first edge server, comprising: receiving a user access request sent by a client based on a QUIC protocol; detecting whether a self-load exceeds a preset load, if yes, generating a first response message containing second edge server address information, the first response message further comprising identification information, the identification information being used to instruct the client to send the user access request to the second edge server based on a HTTP or HTTPS protocol; the QUIC protocol consumes more application layer resources, and the HTTP or HTTPS protocol consumes less application layer resources; sending the first response message to the client; wherein, in the case that the second edge server can support the HTTP or HTTPS protocol and the QUIC protocol, the second edge server is used to select whether to preferentially perform resource data transmission based on the HTTP or HTTPS protocol according to a self-load state after receiving a user access request sent by the client based on the HTTP or HTTPS protocol.
2. The method of claim 1, wherein, The identification information is located in a response header or a response body of the first response message.
3. The method of claim 1, wherein, The detection of whether the self-load exceeds the preset load comprises: detecting whether a current service processing amount of the first edge server exceeds a first preset threshold, if yes, exceeding the preset load.
4. The method of claim 1, wherein, Before the generation of the first response message containing the second edge server address information, further comprising: determining a server cluster associated with itself; selecting the second edge server from the server cluster based on a preset rule.
5. The method of claim 4, wherein, The selection of the second edge server from the server cluster based on the preset rule comprises: randomly selecting an edge server from the server cluster as the second edge server; or, selecting an edge server with a current service processing amount lower than a second preset threshold from the server cluster as the second edge server, the second preset threshold being less than the first preset threshold; or, selecting an edge server with a deployment position matching a region where the client is located from the server cluster as the second edge server.
6. The method of claim 4, wherein, After the selection of the second edge server from the server cluster based on the preset rule, further comprising: obtaining a domain name or an IP address corresponding to the second edge server, and taking the domain name or the IP address as address information of the second edge server.
7. The method of claim 1, wherein, The generation of the first response message containing the second edge server address information comprises: generating the first response message used to instruct the client to send the user access request to the second edge server only next time; or, generating the first response message used to instruct the client to send the user access request to the second edge server permanently.
8. The method of claim 7, wherein, The generation of the first response message used to instruct the client to send the user access request to the second edge server only next time comprises: detecting a number of times of sending the first response message to at least one client in a historical time period; if the number of times does not exceed a preset value, generating the first response message for indicating that the client only accesses data to the second edge server next time; or detecting a current service processing amount; if the service processing amount exceeds a first preset threshold and does not exceed a third preset threshold, generating the first response message for indicating that the client only accesses data to the second edge server next time, wherein the third preset threshold is greater than the first preset threshold.
9. The method of claim 7, wherein, The generating of the first response message for indicating that the client permanently sends the user access request to the second edge server comprises: detecting a number of times of sending the first response message to at least one client in a historical time period; if the number of times exceeds a preset value, generating the first response message for indicating that the client permanently accesses data to the second edge server; or detecting a current service processing amount; if the service processing amount exceeds a third preset threshold, generating the first response message for indicating that the client permanently accesses data to the second edge server, wherein the third preset threshold is greater than the first preset threshold.
10. A method of processing a user access request, characterized by, The application is applied to a second edge server, comprising: receiving a user access request sent by a client based on an HTTP or HTTPS protocol, wherein the user access request is a user access request sent by the client to a first edge server based on a QUIC protocol in a historical time period; the QUIC protocol consumes more application layer resources, and the HTTP or HTTPS protocol consumes less application layer resources; sending a second response message based on the HTTP or HTTPS protocol to the client, wherein the second response message comprises resource data requested by the client; wherein, in the case that the second edge server can support the HTTP or HTTPS protocol and the QUIC protocol, after receiving the user access request sent by the client based on the HTTP or HTTPS protocol, whether to preferentially perform resource data transmission based on the HTTP or HTTPS protocol is selected according to a load state of the second edge server. 11.An electronic device that processes a user access request, the electronic device comprising: The application is applied to a first edge server, comprising: a first receiving module configured to receive a user access request sent by a client based on a QUIC protocol; a detecting module configured to detect whether a load of the first edge server exceeds a preset load, and if yes, generate a first response message comprising address information of a second edge server, wherein the first response message is used to indicate that the client sends the user access request to the second edge server based on an HTTP or HTTPS protocol; the QUIC protocol consumes more application layer resources, and the HTTP or HTTPS protocol consumes less application layer resources; a first sending module configured to send the first response message to the client; The device is further configured to, in the case that the second edge server is capable of supporting the HTTP or HTTPS protocol and the QUIC protocol, the second edge server being configured to, after receiving the user access request sent by the client based on the HTTP or HTTPS protocol, select whether to preferentially perform resource data transmission based on the HTTP or HTTPS protocol according to its own load state.
12. An electronic device for processing a user access request, the electronic device comprising: Applied to a second edge server, comprising: A second receiving module configured to receive a user access request sent by a client based on an HTTP or HTTPS protocol, the user access request being a user access request sent by the client to a first edge server based on a QUIC protocol within a historical time period; the QUIC protocol consuming more application layer resources, and the HTTP or HTTPS protocol consuming less application layer resources; A second sending module configured to send a second response message to the client based on an HTTP or HTTPS protocol, the second response message including resource data requested by the client; The device is further configured to, in the case that the second edge server is capable of supporting the HTTP or HTTPS protocol and the QUIC protocol, after receiving the user access request sent by the client based on the HTTP or HTTPS protocol, select whether to preferentially perform resource data transmission based on the HTTP or HTTPS protocol according to its own load state.
13. An electronic device, comprising: Comprising: A memory for storing executable instructions; And, A processor for displaying with the memory to execute the executable instructions to complete the operations of the method for processing a user access request in any one of claims 1-9 or 10.
14. A computer readable storage medium storing computer readable instructions, wherein, The instructions are executed to perform the operations of the method for processing a user access request in any one of claims 1-9 or 10.
15. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the operations of the method for processing a user access request as claimed in any one of claims 1-9 or 10.
Citation Information
Patent Citations
Service request processing method and device
CN111371866A
Load Balancing Method of P2P Networks by Load Threshold Adjustment and Device Implementing the Same
KR101595948B1