Access request processing method, device and storage medium

By limiting and fuseing users' access requests on the front-end interface, the problem of service unavailability of the back-end gateway when facing large traffic is solved, the stability and reliability of the system are improved, and the user experience and service availability are ensured. .

CN118646800BActive Publication Date: 2024-11-01SHENZHEN SMARTCITY TECH DEV GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411096410.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-11-01
Estimated Expiration
2044-08-12

AI Technical Summary

Technical Problem

Back-end gateways may cause unavailability of services when facing bursts of large traffic, resulting in poor system stability.

Method used

By limiting the user's access requests on the front-end interface, randomly selecting the target access requests, and determining whether to perform the fuse action based on the response status code feedback from the back-end, reducing the data processing volume of the back-end gateway and improving system stability.

Benefits of technology

It effectively reduces the data processing volume of the backend gateway, improves the stability and reliability of the system, ensures the user's service experience, and promptly locates and solves problems in the service system through cache data and monitoring reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646800B_ABST
    Figure CN118646800B_ABST
Patent Text Reader

Abstract

The present application discloses an access request processing method, device and storage medium, belonging to the field of data processing technology. The method comprises: after receiving the current limiting start instruction sent by the server, obtaining the current limiting configuration file based on the content distribution network, and starting the current limiting function based on the current limiting configuration file; after receiving the service access request, selecting the target access request in the service access request according to the current limiting algorithm in the current limiting configuration file; according to the target access request, controlling the client interface to send a real access request to the server. The present application reduces the data processing amount of the gateway and improves the stability of the gateway by implementing the current limiting and fuse processing of the user's access request on the client, and realizing the monitoring and reporting of the current limiting and fuse, and the log reporting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an access request processing method, device and storage medium. Background Art

[0002] Web (World Wide Web) application system is a system based on Web technology that provides services to users. It consists of multiple Web resources, including static and dynamic resources. Web application system is a typical distributed application software, and each concurrent request and information exchange involves three levels: client, server, and network for transmitting interactive data. Among them, the client is mainly responsible for the display of Web information and interaction with users, while the server implements the function of Web dynamic request. The network for transmitting data is responsible for routing and switching functions.

[0003] When a large number of requests flow into a Web application system at the same time, system resources may be exhausted and the system may not respond normally. Or when the number of requests is too large, the response speed and performance of the service may be affected, thereby affecting the user experience. Current limiting can control the system load and ensure system stability.

[0004] In related technologies, the system's current limiting can only be handled by the backend gateway. However, due to the limited carrying capacity of the gateway, when encountering sudden large traffic, the backend gateway usually needs a certain amount of time to temporarily expand its capacity. In this case, due to insufficient processing capacity of the backend gateway or improper configuration, the service may be unavailable.

[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The main purpose of this application is to provide an access request processing method, which aims to solve the technical problem that the backend gateway may cause service unavailability when facing sudden large traffic.

[0007] To achieve the above object, the present application provides an access request processing method, the access request processing method comprising the following steps:

[0008] After receiving the flow limiting start instruction sent by the server, obtaining a flow limiting configuration file based on the content distribution network, and starting the flow limiting function based on the flow limiting configuration file;

[0009] After receiving the service access request, selecting a target access request from the service access request according to the current limiting algorithm in the current limiting configuration file;

[0010] According to the target access request, the client interface is controlled to send a real access request to the server.

[0011] Optionally, after receiving the service access request, the step of selecting a target access request from the service access request according to the current limiting algorithm in the current limiting configuration file includes:

[0012] After receiving the service access request, assigning a random number to the service access request based on the current limiting algorithm;

[0013] Comparing the random number with a preset random number threshold;

[0014] When the random number is less than the random number threshold, selecting the service access request as the target access request;

[0015] Alternatively, when the random number is greater than the random number threshold, the random number threshold is increased based on a threshold increase range preset in the current limiting configuration file.

[0016] Optionally, after the step of sending the real access request to the server according to the target access request, the method further includes:

[0017] After receiving the access response fed back by the server based on the real access request, extracting the status code in the access response;

[0018] When the status code matches a preset fuse status code, obtaining a fuse configuration file through the content distribution network;

[0019] Determine the client interface corresponding to the real access request, and send a fuse instruction to the client interface based on the fuse configuration file, wherein after receiving the fuse instruction, the client interface stops sending the real access request based on the fuse time preset in the fuse configuration file.

[0020] Optionally, after receiving the access response fed back by the server based on the real access request, after extracting the status code in the access response, the method further includes:

[0021] When the status code is a normal status code, determining a service code of the access response according to the access response;

[0022] When the service code is a cached service code, the cached data is updated based on the access response.

[0023] Optionally, after receiving the service access request, according to the current limiting algorithm in the current limiting configuration file, after the step of selecting the target access request in the service access request, the method further includes:

[0024] Determine, according to the target access request, a current-limited access request in the service access request, and match the current-limited access request with cached data;

[0025] When target cache data matching the current limiting access request exists in the cache data, generating a service access response based on the target cache data;

[0026] When the target cache data matching the current-limited access request does not exist in the cache data, prompt information indicating that the request failed is output.

[0027] Optionally, when the service code is a cache service code and the status code is a normal status code, after the step of updating the cache data based on the access response, the method further includes:

[0028] Determine monitoring data based on the current limiting action and / or the fuse action and / or the cache action of the client interface, and determine log data according to the monitoring data;

[0029] Uploading the monitoring data to the monitoring module, and uploading the log data to the log module;

[0030] When the monitoring data and / or the log data fails to be uploaded, the monitoring data and / or the log data are cached, and after the data reporting process is triggered, the cached monitoring data and / or the log data are uploaded.

[0031] Optionally, after receiving the access response fed back by the server based on the real access request, after extracting the status code in the access response, the method further includes:

[0032] When the status code is an abnormal status code, determining an interface physical address and a next-hop physical address of a standby service interface according to the content distribution network;

[0033] According to the routing table, the destination physical address sent by the client interface is replaced with the next hop physical address, and the source physical address is replaced with the interface physical address.

[0034] Optionally, after receiving the flow limiting start instruction sent by the server, before the step of obtaining a flow limiting configuration file based on the content distribution network and starting the flow limiting function based on the flow limiting configuration file, the step further includes:

[0035] Generate a current limiting configuration file according to the current limiting algorithm, and generate a fuse configuration file according to the fuse algorithm;

[0036] Saving the current limiting configuration file and the fuse configuration file to the content distribution network, and generating resource locators of the current limiting configuration file and the fuse configuration file;

[0037] The resource locator is associated with the current limiting profile or the fuse profile.

[0038] In addition, to achieve the above-mentioned purpose, the present application also provides a front-end-based access request processing device, which includes: a memory, a processor, and a front-end-based access request processing program stored on the memory and executable on the processor, wherein the front-end-based access request processing program is configured to implement the steps of the front-end-based access request processing method as described above.

[0039] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, on which a front-end-based access request processing program is stored. When the front-end-based access request processing program is executed by a processor, the steps of the front-end-based access request processing method as described above are implemented.

[0040] This application reduces the data processing volume of the backend gateway and improves the stability of the backend gateway by limiting the access request of the user at the front-end interface, randomly selecting the target access request from the service access request of the user, sending the real request to the backend based on the target access request, and judging whether to perform the fuse action according to the status code in the access response fed back by the backend, thereby reducing the data processing volume of the backend gateway and improving the stability of the backend gateway. At the same time, when the user's service access request is in the current limiting state, this application can output an access response that meets the user's needs based on the cached data. In addition, this application monitors and reports the data processing process of the interface and reports the log, timely locates and solves problems in the service system, and further improves the stability and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a flowchart of the first embodiment of the method for processing access requests of this application;

[0042] Figure 2 This is a schematic diagram of the access request processing flow involved in this application;

[0043] Figure 3 This is a flowchart of a second embodiment of the method for processing access requests for this application;

[0044] Figure 4 This is a flowchart of a third embodiment of the method for processing access requests for this application;

[0045] Figure 5 This is a flowchart of a fourth embodiment of the method for processing access requests of this application;

[0046] Figure 6 This is a flowchart of a fifth embodiment of the method for processing access requests of this application;

[0047] Figure 7 This is a flowchart of a sixth embodiment of the method for processing access requests of this application;

[0048] Figure 8 A schematic diagram of a multifunctional unified structure involved in the sixth embodiment of the access request processing method of the present application;

[0049] Fig. 9 This is a schematic diagram of the service system architecture involved in the sixth embodiment of the access request processing method of this application;

[0050] Fig.10 It is a structural diagram of an access request processing device in a hardware operating environment involved in an embodiment of the present application.

[0051] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] In this application, the client interface can implement operations such as current limiting, caching, and fuses for users' service access requests. At the same time, the client interface can monitor, report, and log the processing of service access requests, thereby achieving the effect of implementing gateway functions on the client, reducing the data processing volume of the server-side gateway, and improving the stability and reliability of the system.

[0054] In order to better understand the above technical solution, exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0055] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0056] Embodiment 1

[0057] When the backend gateway is limiting the flow, the service system may occasionally encounter sudden high traffic. Due to the limited carrying capacity of the gateway, it is usually necessary to temporarily expand the capacity of the gateway. In this case, the service system may be unavailable due to insufficient gateway processing capacity or improper configuration, and the stability is poor. In order to improve the stability of the service system, this embodiment of the application provides an access request processing method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the access request processing method of the present application.

[0058] In this embodiment, the access request processing method includes:

[0059] Step S10: after receiving the flow limiting start instruction sent by the server, obtaining a flow limiting configuration file based on the content distribution network, and starting the flow limiting function based on the flow limiting configuration file;

[0060] In this embodiment, when the user interacts with the service system through the client, the client interface sends the service access request input by the user to the server according to the routing table. After receiving the service access request from the user, the server will perform the corresponding action according to the service access request and feedback the service access response to the client. Further, the server will monitor the service call data of the client interface, and when the data volume of the service call data of the client interface is greater than the preset data volume threshold, the server will send the flow limiting instruction and / or flow limiting configuration file to the corresponding client interface through the content distribution network (CDN, Content Delivery Network) to control the client interface to start the flow limiting state. After the client interface starts the flow limiting state, it can limit the user's service access request based on the flow limiting algorithm preset in the flow limiting configuration file, thereby reducing the data processing pressure on the server. Among them, the service system is a complete Web (World Wide Web, World Wide Web) application system, which includes a client, a server, and a content distribution network for data transmission and interaction, and can provide corresponding system services for users.

[0061] In specific implementation, the server side can monitor the service call data of the client interface from dimensions such as page views (PV) and unique user visits (UV). Based on the page views and unique user visits, the server side can calculate the service call data of the client to determine whether to send a flow limit start instruction to the client. Through flow limiting, the front-end gateway can limit the traffic to control the rate of data transmission and protect the network from overload and failure, playing a role in network traffic management, load balancing and security protection. Among them, page views refer to the number of times a web page is visited in a specific time period, and unique user visits refer to the number of independent users who visit the website and application in a specific time period. If a user visits the website or application system multiple times in a specific time period, the independent user visit is only counted as 1.

[0062] It should be noted that the content distribution network is a layer of intelligent virtual network on the existing Internet, which is formed by placing node servers in various places on the network. The content distribution network can redirect user requests to the service node closest to the user in real time based on comprehensive information such as network traffic and the connection and load status of each node, as well as the distance to the user and response time. Its purpose is to enable users to obtain the required content nearby, solve the problem of network congestion, and improve the response speed of users visiting websites.

[0063] Step S20: after receiving the service access request, selecting a target access request from the service access request according to the current limiting algorithm in the current limiting configuration file;

[0064] In this embodiment, after the client turns on the current limiting function and receives the user's service access request, it will select a target access request from the service access request according to the current limiting algorithm in the current limiting configuration file. The target access request is the service access request for which the client will send a real access request to the server.

[0065] As an optional implementation method of limiting the flow of service access requests, after the client turns on the flow limiting state and receives the user's service access request, a random number can be assigned to the service access request based on a preset random number value range. By comparing the random number with the preset random number threshold, and when the random number is less than the random number threshold, the service access request is selected as the target access request, and a certain number of target access requests can be selected based on the ratio of the random number threshold to the random number value range. Among them, the target access request is a service access request that is not subject to flow limiting, and the service access request with a random number greater than the random number threshold is a service access request that is subject to flow limiting.

[0066] It is understandable that the target access request may also be a service access request that is less than the random number threshold. In this case, the client may also select a certain proportion of target access requests based on the difference between the random number value range and the random number threshold and the ratio of the random number value range, which does not have a substantial impact on this solution.

[0067] Furthermore, after the service access request is limited, the client will increase the random number threshold based on the threshold increase range preset in the current limiting configuration file. In this way, it is possible to avoid frequent current limiting of service access requests during user access to the service system, thereby improving the user's interactive experience with the service system.

[0068] Exemplarily, when the random number value range is between 0 and 1 and the random number threshold is 0.5, the client will screen the service access request based on the random number value range and the random number threshold. After receiving the service access request, the client will assign a random number between 0 and 1 to the service access request and determine whether the service access request is a target access request. For example, when the random number assigned to the service access request is 0.4, the client will select the service access request as a target access request after determining that the random number is less than the random number threshold.

[0069] When the random number assigned to the service access request is 0.7, the client will increase the random number threshold to 0.6 based on the preset threshold increase after determining that the random number is greater than the random number threshold. When the user re-initiates a service access request, the client will re-assign a random number to the service access request, and when the random number is less than 0.6, the service access request will be selected as the target access request.

[0070] As another optional implementation method of limiting the flow of service access requests, the client can also select the target access request in the service access request based on the preset probability parameters in the flow limiting configuration file. Among them, the probability parameters include the initial pass probability and the probability increase amplitude. When the service access request is not selected as the target access request and the client does not send a real access request, the client will increase the pass probability of the service access request based on the probability increase amplitude until the service access request is sent, and then reset the pass probability of the service access request to the initial pass probability.

[0071] Exemplarily, the client interface can determine two parameters, namely the initial pass probability of the current limiting and the probability increase range, based on the current limiting configuration file. For example, the initial pass probability parameter of the current limiting is 50, and the user indicates that when the client interface first turns on the current limiting, the probability that the service access request can issue a real access request is 50%, and the current limiting probability increase range parameter is 10, which is used to indicate that when the service access request received last time did not issue a real request, the probability of the client interface issuing a real access request the next time it receives a service access request will increase by 10%. After the real access request is issued, the client interface will reset the probability of sending the real access request to the initial pass probability. In this way, good user availability and experience can be guaranteed under the pressure of service access.

[0072] Step S30: According to the target access request, the client interface is controlled to send a real access request to the server.

[0073] In this embodiment, the real access request is a service request sent by the client to the server based on the user service demand in the target access request. Through the real access request, the server can be instructed to perform corresponding service actions to meet the user demand.

[0074] For example, refer to Figure 2 , Figure 2 This is a schematic diagram of the access request processing flow involved in this application. After the client determines that the service access request is a target access request, it will send a sending instruction of the real access request to the client interface according to the target access request. After receiving the sending instruction, the client generates a real access request based on the target access request, and sends the real access request to the server through the network transmission protocol. After receiving the real access request, the server can perform the corresponding service action according to the real access request, and generate an access response according to the result of the action execution, and feedback the access response to the client.

[0075] In the embodiment of the present application, when the access traffic of the service system is large, the data processing pressure on the server side is reduced by limiting the flow of the user's service access request on the client side, thereby increasing the stability and reliability of the system.

[0076] Embodiment 2

[0077] Based on the same inventive concept, the present application also provides a second embodiment, referring to Figure 3 , Figure 3 This is a flowchart of the second embodiment of the access request processing method of the present application.

[0078] In this embodiment, the access request processing method includes:

[0079] Step S40: after receiving the access response fed back by the server based on the real access request, extracting the status code in the access response;

[0080] Step S50: when the status code matches a preset fuse status code, obtaining a fuse configuration file through the content distribution network;

[0081] Step S60: Determine the client interface corresponding to the real access request, and send a fuse instruction to the client interface based on the fuse configuration file, wherein after receiving the fuse instruction, the client interface stops sending the real access request based on the fuse time preset in the fuse configuration file.

[0082] In this embodiment, the client gateway can protect the service system from further damage by fusing when the service system fails or is overloaded. When the service system is overloaded, the client gateway can temporarily stop receiving new requests according to the fusing mechanism in the fusing configuration file until the load returns to normal levels. In order to protect the service system from excessive pressure and the risk of collapse, access to the service system is restricted to prevent the service system from being overloaded.

[0083] Furthermore, when a component of a service system fails or fails to work properly, the fuse mechanism can also isolate the component from the system to prevent the failure from spreading to other parts. This helps maintain the stability and availability of the entire system.

[0084] In the specific implementation process, refer to Figure 2 After the server executes the corresponding service action based on the real access request, it can generate a status code according to the execution process and results of the service action, and feed back the access response containing the status code to the client. According to the execution result of the service action, the status code can be a normal status code or an abnormal status code. The client can extract the status code in the access response and identify the status code. When the status code is a fuse status code in the abnormal status code, according to the fuse configuration file sent by the content distribution network, a fuse instruction is sent to the client interface corresponding to the access response to control the client interface to perform the fuse action. After receiving the fuse instruction, the client interface will stop sending real access requests to the server within the fuse time preset in the fuse configuration file.

[0085] Optionally, the client can also implement a fuse effect for a single user based on the access request. Based on the access response sent by the server and / or the status code in the access response, the client can mark the target user. When the client interface receives a service access request sent by a user with a fuse mark within the fuse time, it will no longer initiate a real access request.

[0086] Exemplarily, the status code fed back by the server can be configured based on the fuse configuration file. For example, the configuration status code is 200 for normal, 400-600 for abnormal situations, wherein the status code 503 is set as the fuse status code, and the fuse cooling time is 100 seconds. When the status code fed back by the server is 503, the client interface determines that the fuse status code is hit, and no real access request is issued within 100 seconds, which ensures that the client interface will not continue to accept requests when it cannot provide services, preventing avalanches.

[0087] In an embodiment of the present application, the client can turn on the circuit breaker state based on the status code in the access response fed back by the server and the circuit breaker configuration file of the content distribution network to prevent the service system from crashing due to excessive data processing pressure.

[0088] Since the system introduced in the second embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of this application.

[0089] Embodiment 3

[0090] Based on the same inventive concept, the present application also provides a third embodiment, referring to Figure 4 , Figure 4 This is a flowchart of the third embodiment of the access request processing method of the present application.

[0091] In this embodiment, as described in step S40, after receiving the access response fed back by the server based on the real access request, after extracting the status code in the access response, the method further includes:

[0092] Step S41: when the status code is a normal status code, determining the service code of the access response according to the access response;

[0093] Step S42: When the service code is a cached service code, the cached data is updated based on the access response.

[0094] In this embodiment, when the status code in the access response is a normal status code, that is, when the execution process and execution result of the server based on the real access request are normal, the client will determine whether to cache the access response based on the business code in the access response. When the business code is a cache business code, the client will update the cache data based on the access response.

[0095] Specifically, the client caches data based on the cache configuration file of the content distribution network. There are two key parameters. One is the cache business code, that is, the cache key. The client caches based on the key, so the key is unique. The second is the cache time of the data, which is set according to the business characteristics and can be in seconds. For example, when the status code in the access response is 200 indicating normal, and the business code is 0 indicating cache, the client will cache the access response and cache the service execution result in the access response into the data cache area. At the same time, the client will time the data cache based on the cache time. According to the cache time, the client can calculate the cache expiration time of the cached data, and remove the cached data when the system time reaches the cache expiration time.

[0096] Optionally, during the process of data caching, the client may associate the corresponding service access request, user information, and service access time with the cached data, and save them together in the data cache area.

[0097] Further, as described in step S20, after receiving the service access request, according to the current limiting algorithm in the current limiting configuration file, after selecting the target access request in the service access request, it also includes:

[0098] Step S21: determining a current-limited access request in the service access request according to the target access request, and matching the current-limited access request with cache data;

[0099] Step S22: when there is target cache data matching the current-limited access request in the cache data, generating a service access response based on the target cache data;

[0100] Step S23: When the target cache data matching the current-limited access request does not exist in the cache data, a prompt message indicating that the request has failed is output.

[0101] In this embodiment, after the user's service access request is limited, that is, when the client interface does not send a real access request for the service access request, the client will use the service access request as a limited access request and match the limited access request with the cache data in the cache area. Based on the matching result, the client can determine whether there is target cache data matching the limited access request in the cache area, and if there is target cache data, generate a service access response based on the target cache data. Alternatively, when there is no target cache data, the client will output prompt information such as "Please try again later" or "Request failed" to prompt the user.

[0102] Optionally, the client may match the current limiting access request with the service access request based on the service access request in the associated information of the cached data to determine the cached data that complies with the current limiting access request.

[0103] For example, refer to Figure 2 After receiving the access response, the client first determines whether the status code in the access response is a normal status code. If the status code is a normal status code, the client will return the data to the user and check the business code and cache configuration to determine whether caching is required. If necessary, the data will be cached locally based on the cache rules in the cache configuration file.

[0104] Furthermore, when the access response is abnormal or the status code is an abnormal status code, the client can also determine whether there is cache data corresponding to the service access request through cache data. If it exists, the cache data is returned to the user. If not, a prompt message to try again later is output, and monitoring and log reporting are done well.

[0105] The embodiment of the present application can cache data according to the access response, and after the service access response is limited, check whether the cached data already exists in the cache area. If it exists, the client can directly obtain the data from the cache area without having to access the server again. Speed ​​up data access and reduce the pressure on the server side from subsequent requests.

[0106] Since the system introduced in the third embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of the present application.

[0107] Embodiment 4

[0108] Based on the same inventive concept, the present application also provides a fourth embodiment, referring to Figure 5 , Figure 5 This is a flowchart of the fourth embodiment of the access request processing method of the present application.

[0109] In this embodiment, as described in step S42, when the service code is a cache service code and the status code is a normal status code, after updating the cache data based on the access response, the method further includes:

[0110] Step S70: determining monitoring data based on the current limiting action and / or the fuse action and / or the cache action of the client interface, and determining log data according to the monitoring data;

[0111] Step S80: uploading the monitoring data to the monitoring module, and uploading the log data to the log module;

[0112] Step S90: When the monitoring data and / or the log data fails to be uploaded, the monitoring data and / or the log data are cached, and after the data reporting process is triggered, the cached monitoring data and / or the log data are uploaded.

[0113] In this embodiment, the monitoring module collects monitoring data such as page visits, independent user visits, page access speed, interface response speed, abnormal information, cache write times, cache hit times, current limiting times, fuse times, etc. of the client interface, and reports all of them in real time. The log collects abnormal situations of service requests in real time and records them as logs, such as situations where the http status code is not 200, abnormal client errors, etc. By monitoring the client interface data and logging the abnormal data, the causes of the abnormal situation can be accurately analyzed.

[0114] Furthermore, when the reporting of monitoring data and / or log data fails, the monitoring data and / or log data will be cached locally, and after the data reporting process is triggered next time, the cached monitoring data and / or log data will be reported simultaneously with the reporting data corresponding to the reporting process, and the monitoring data and / or log data that have been successfully reported will be deleted from the cached data.

[0115] Exemplarily, the monitoring module can monitor and report each access request processing process of the client interface, while the log module only records and reports abnormal conditions of the client. For example, when the business code in the access response with a normal status code hits the cached business code, the number of cache hits of the front-end interface is increased by 1. When the fuse status code hits, the number of fuse hits will be increased by 1 in both the log module and the monitoring module, or when the client turns on the current limit, the log module and the monitoring module will increase the number of current limit hits by 1. In addition, the log module will also record the abnormal status code in the access response.

[0116] The embodiment of the present application monitors the client's access request processing process and records abnormal conditions through a monitoring module and a log module, which helps to monitor and analyze system abnormalities, provide real-time error information and a basis for troubleshooting, and determine the health status and performance of the system.

[0117] Since the system introduced in the fourth embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of this application.

[0118] Embodiment 5

[0119] Based on the same inventive concept, the present application also provides a fifth embodiment, referring to Figure 6 , Figure 6 This is a flowchart of the fifth embodiment of the access request processing method of the present application.

[0120] In this embodiment, as described in step S40, after receiving the access response fed back by the server based on the real access request, after extracting the status code in the access response, the method further includes:

[0121] Step S43: when the status code is an abnormal status code, determining the interface physical address and the next hop physical address of the backup service interface according to the content distribution network;

[0122] Step S44: According to the routing table, the destination physical address sent by the client interface is replaced with the next hop physical address, and the source physical address is replaced with the interface physical address.

[0123] In this embodiment, when the status code is an abnormal status code, or the execution result of the server is abnormal, the server can also implement routing forwarding based on the routing table and the client interface.

[0124] In specific implementation, when the received status code is abnormal, the client can search for a target client interface with a smaller amount of service call data, or a backup service interface preset in a configuration file. According to the physical address of the backup service interface or the target client interface, the next hop physical address and the source physical address in the routing table are changed, and the client can forward the service access request received by the client interface to the backup service interface or the target client interface to achieve routing forwarding.

[0125] Optionally, in addition to determining whether to perform routing forwarding based on the status code, the client can also actively perform routing forwarding when the amount of data called by the client interface service is large or the client interface is blown, so as to improve the acceptance speed of the user's service access request.

[0126] The embodiment of the present application uses routing forwarding to transfer an unavailable client interface to a spare interface, thereby further improving the availability of the service system.

[0127] Since the system introduced in the fifth embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of the present application.

[0128] Embodiment 6

[0129] Based on the same inventive concept, the present application also provides a sixth embodiment, referring to Figure 7 , Figure 7 This is a flowchart of the sixth embodiment of the access request processing method of the present application.

[0130] In this embodiment, after receiving the flow limiting start instruction sent by the server as described in step S10, a flow limiting configuration file is obtained based on the content distribution network, and before the flow limiting function is turned on based on the flow limiting configuration file, the following is also included:

[0131] Step S11: generating a current limiting configuration file according to the current limiting algorithm, and generating a fuse configuration file according to the fuse algorithm;

[0132] Step S12: saving the current limiting configuration file and the fuse configuration file to the content distribution network, and generating resource locators of the current limiting configuration file and the fuse configuration file;

[0133] Step S13: Associating the resource locator with the current limiting configuration file or the fuse configuration file.

[0134] In this embodiment, the service system can use the content distribution network to perform cloud operation and maintenance management. Based on the content distribution advantage of the content distribution network, the service system can publish various configuration files to the content distribution network. When facing some emergencies, such as when the client suddenly encounters a large number of visits, causing the server to be overloaded, the configuration management and control capabilities of the client and the content distribution network can be brought into play. The administrator can enable current limiting, fuse and other measures through the configuration on the server side, and quickly send the corresponding configuration file to the client through the content distribution network to reduce service pressure and improve user experience. Among them, the client does not need to perform operations such as turning on current limiting and fuse, and the current limiting configuration file and fuse configuration file sent by the content distribution network are used for current limiting and fuse, while caching, application monitoring and abnormal log reporting can cover the client's operating cycle.

[0135] In specific implementation, after generating a current limiting configuration file and a fuse configuration file based on the current limiting algorithm and the fuse algorithm, the current limiting configuration file and the fuse configuration file can be saved to the content distribution network. At the same time, based on the location where the configuration file is saved, the resource locator (URL, Uniform ResourceLocator) of the current limiting configuration file and the fuse configuration file is generated, and the resource locator is associated with the current limiting configuration file or the fuse configuration file. When the client turns on the current limiting function or the fuse function, it can accept the current limiting configuration file and the fuse configuration file sent by the content distribution network, or obtain the corresponding current limiting configuration file and the fuse configuration file from the content distribution network according to the resource locator.

[0136] Exemplarily, the configuration files uploaded by the service system to the content distribution network include but are not limited to plug-in configuration files and interface configuration files. Among them, the plug-in mode of the plug-in configuration file supports customized capability access, and log reporting and monitoring reporting are accessed in the form of plug-ins. The interface list configuration has built-in current limiting configuration files, fuse configuration files, and cache configuration files.

[0137] Further, see Figure 8 , Figure 8 This is a schematic diagram of the multifunctional unified structure involved in the embodiment of the present application. In this embodiment, a global request function is customized in the service system, defined as Request. All user access requests received by the client interface pass through Request. This function will perform pre- and post-processing on all requests, where the pre-processing includes: determining whether to limit the flow, whether to read the cache, whether to report the log, and whether to report the monitoring. Post-processing includes: whether to blow the fuse, whether to cache data, whether to read the cache, whether to report monitoring data, whether to report log data, prompt the user to try again later, etc. By performing pre- and post-processing through a unified request function, the intrusiveness of the access request processing operation on the business logic can be reduced.

[0138] For example, refer to Fig. 9 , Fig. 9This is a schematic diagram of the service system architecture involved in the embodiment of the present application. The architecture of the service system can be composed of four parts: application, client interface, client business part, and server-side service and management. Among them, the application of the service system can be selected to include but not limited to Web application, applet application and H5 (HTML5, Hyper TextMarkup Language 5) application. The client interface can implement actions such as current limiting, fuse, monitoring, logging, caching and routing forwarding. The client business part is responsible for processing business requests and Hypertext Transfer Protocol (HTTPS, Hyper TextTransfer Protocol Secure) requests, and performing status management. The service and management part of the server side can provide business services to users, and perform data logging services and monitoring services. At the same time, the service and management part of the server side can also implement cloud configuration management to improve the business management and forwarding capabilities of the service system.

[0139] The embodiment of the present application improves the management and control capabilities of the service system, simplifies deployment and management, and improves operation and maintenance efficiency through a content distribution network configured in the cloud. At the same time, the present application uniformly performs pre- and post-processing on the request proxy function, so that functions such as current limiting, fuse, cache, monitoring reporting, and log reporting will not be intrusive to the business logic of the application.

[0140] Since the system introduced in the sixth embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of the present application.

[0141] Embodiment 7

[0142] Reference Fig.10 , Fig.10 This is a schematic diagram of the structure of an access request processing device in the hardware operating environment involved in the embodiment of the present application.

[0143] like Fig.10As shown, the access request processing device may include: a processor 1001, such as a core processor (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0144] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the access request processing device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0145] like Fig.10 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module, and an access request processing program.

[0146] exist Fig.10 In the access request processing device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the access request processing device of the present application can be set in the access request processing device, and the access request processing device calls the access request processing program stored in the memory 1005 through the processor 1001, and executes the following method:

[0147] After receiving the flow limiting start instruction sent by the server, obtaining a flow limiting configuration file based on the content distribution network, and starting the flow limiting function based on the flow limiting configuration file;

[0148] After receiving the service access request, selecting a target access request from the service access request according to the current limiting algorithm in the current limiting configuration file;

[0149] According to the target access request, the client interface is controlled to send a real access request to the server.

[0150] Furthermore, the access request processing device calls the access request processing program stored in the memory 1005 through the processor 1001, and also executes the following method:

[0151] After receiving the service access request, assigning a random number to the service access request based on the current limiting algorithm;

[0152] Comparing the random number with a preset random number threshold;

[0153] When the random number is less than the random number threshold, selecting the service access request as the target access request;

[0154] Alternatively, when the random number is greater than the random number threshold, the random number threshold is increased based on a threshold increase range preset in the current limiting configuration file.

[0155] Furthermore, the access request processing device calls the access request processing program stored in the memory 1005 through the processor 1001, and also executes the following method:

[0156] After receiving the access response fed back by the server based on the real access request, extracting the status code in the access response;

[0157] When the status code matches a preset fuse status code, obtaining a fuse configuration file through the content distribution network;

[0158] Determine the client interface corresponding to the real access request, and send a fuse instruction to the client interface based on the fuse configuration file, wherein after receiving the fuse instruction, the client interface stops sending the real access request based on the fuse time preset in the fuse configuration file.

[0159] Furthermore, the access request processing device calls the access request processing program stored in the memory 1005 through the processor 1001, and also executes the following method:

[0160] When the status code is a normal status code, determining a service code of the access response according to the access response;

[0161] When the service code is a cached service code, the cached data is updated based on the access response.

[0162] Furthermore, the access request processing device calls the access request processing program stored in the memory 1005 through the processor 1001, and also executes the following method:

[0163] Determine, according to the target access request, a current-limited access request in the service access request, and match the current-limited access request with cached data;

[0164] When target cache data matching the current limiting access request exists in the cache data, generating a service access response based on the target cache data;

[0165] When the target cache data matching the current-limited access request does not exist in the cache data, prompt information indicating that the request failed is output.

[0166] Furthermore, the access request processing device calls the access request processing program stored in the memory 1005 through the processor 1001, and also executes the following method:

[0167] Determine monitoring data based on the current limiting action and / or the fuse action and / or the cache action of the client interface, and determine log data according to the monitoring data;

[0168] Uploading the monitoring data to the monitoring module, and uploading the log data to the log module;

[0169] When the monitoring data and / or the log data fails to be uploaded, the monitoring data and / or the log data are cached, and after the data reporting process is triggered, the cached monitoring data and / or the log data are uploaded.

[0170] Furthermore, the access request processing device calls the access request processing program stored in the memory 1005 through the processor 1001, and also executes the following method:

[0171] When the status code is an abnormal status code, determining an interface physical address and a next-hop physical address of a standby service interface according to the content distribution network;

[0172] According to the routing table, the destination physical address sent by the client interface is replaced with the next hop physical address, and the source physical address is replaced with the interface physical address.

[0173] Furthermore, the access request processing device calls the access request processing program stored in the memory 1005 through the processor 1001, and also executes the following method:

[0174] Generate a current limiting configuration file according to the current limiting algorithm, and generate a fuse configuration file according to the fuse algorithm;

[0175] Saving the current limiting configuration file and the fuse configuration file to the content distribution network, and generating resource locators of the current limiting configuration file and the fuse configuration file;

[0176] The resource locator is associated with the current limiting profile or the fuse profile.

[0177] In addition, the present application also provides a computer-readable storage medium, which stores the access request processing program. The access request processing program can also be executed by a processor to implement the steps of each embodiment of the above-mentioned access request processing method.

[0178] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0179] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0180] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0181] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0182] It should be noted that in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The present application may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.

[0183] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0184] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for processing an access request, characterized in that: Applied to a Web client, the access request processing method comprises the following steps: After receiving the flow limiting start instruction sent by the server, obtaining a flow limiting configuration file based on the content distribution network, and starting the flow limiting function based on the flow limiting configuration file; After receiving the service access request, selecting a target access request from the service access request according to the current limiting algorithm in the current limiting configuration file; According to the target access request, controlling the client interface to send a real access request to the server; Wherein, after the step of sending the real access request to the server according to the target access request, the method further includes: After receiving the access response fed back by the server based on the real access request, extract the status code in the access response, wherein, after the server executes the corresponding service action based on the real access request, it generates a status code according to the execution process and execution result of the service action, and feeds back the access response containing the status code to the client, wherein, according to the execution result of the service action, the status code includes a normal status code and an abnormal status code; when the status code matches the preset fuse status code, obtain the fuse configuration file through the content distribution network; determine the client interface corresponding to the real access request, and send the fuse instruction to the client interface based on the fuse configuration file, wherein, after receiving the fuse instruction, the client interface stops sending the real access request based on the fuse time preset in the fuse configuration file; Wherein, data caching is performed based on a cache profile of a content distribution network, wherein there are two key parameters, one of which is a cached business code, i.e., a cached key, and the other is a data cache time, which is set according to business characteristics. After receiving an access response fed back by the server based on the real access request, after extracting a status code from the access response, the step further includes: when the status code is a normal status code, determining a business code of the access response according to the access response; when the business code is a cached business code, updating cached data based on the access response; Wherein, when the service code is a cache service code, the step of updating the cache data based on the access response includes: when the status code in the access response is a normal status code 200 and the service code is a cache service code 0 indicating a cache, caching the access response, and caching the service execution result in the access response into the data cache area; at the same time, timing the cache of the data based on the cache time, calculating the cache expiration time of the cache data according to the cache time, and removing the cache data when the system time is the cache expiration time; Wherein, when the service code is a cache service code, after the step of updating the cache data based on the access response, the method further includes: Determine monitoring data based on the current limiting action and / or the fuse action and / or the cache action of the client interface, and determine log data according to the monitoring data; Uploading the monitoring data to the monitoring module, and uploading the log data to the log module; When the monitoring data and / or the log data fails to be uploaded, the monitoring data and / or the log data are cached, and after the data reporting process is triggered, the cached monitoring data and / or the log data are uploaded.

2. The access request processing method according to claim 1, characterized in that: After receiving the service access request, the step of selecting a target access request from the service access request according to the current limiting algorithm in the current limiting configuration file includes: After receiving the service access request, assigning a random number to the service access request based on the current limiting algorithm; Comparing the random number with a preset random number threshold; When the random number is less than the random number threshold, selecting the service access request as the target access request; Alternatively, when the random number is greater than the random number threshold, the random number threshold is increased based on a threshold increase range preset in the current limiting configuration file.

3. The access request processing method according to claim 1, characterized in that: After receiving the service access request, according to the current limiting algorithm in the current limiting configuration file, after the step of selecting the target access request in the service access request, the method further includes: Determine, according to the target access request, a current-limited access request in the service access request, and match the current-limited access request with cached data; When target cache data matching the current limiting access request exists in the cache data, generating a service access response based on the target cache data; When the target cache data matching the current-limited access request does not exist in the cache data, prompt information indicating that the request failed is output.

4. The access request processing method according to claim 1, characterized in that: After receiving the access response fed back by the server based on the real access request, extracting the status code in the access response, the step further includes: When the status code is an abnormal status code, determining an interface physical address and a next-hop physical address of a standby service interface according to the content distribution network; According to the routing table, the destination physical address sent by the client interface is replaced with the next hop physical address, and the source physical address is replaced with the interface physical address.

5. The access request processing method according to claim 1, characterized in that: After receiving the flow limiting start instruction sent by the server, before the step of obtaining a flow limiting configuration file based on the content distribution network and starting the flow limiting function based on the flow limiting configuration file, the method further includes: Generate a current limiting configuration file according to the current limiting algorithm, and generate a fuse configuration file according to the fuse algorithm; Saving the current limiting configuration file and the fuse configuration file to the content distribution network, and generating resource locators of the current limiting configuration file and the fuse configuration file; The resource locator is associated with the current limiting profile or the fuse profile.

6. An access request processing device, characterized in that: The access request processing device comprises: a memory, a processor, and an access request processing program stored in the memory and executable on the processor, wherein the access request processing program is configured to implement the steps of the access request processing method according to any one of claims 1 to 5.

7. A storage medium, characterized in that: The storage medium stores an access request processing program, and when the access request processing program is executed by the processor, the steps of the access request processing method according to any one of claims 1 to 5 are implemented.