Multi-dimensional current limiting method, system and terminal applied to stadium management system
Through the multi-dimensional flow restriction method, combined with IP address, URL path and Token information, the flow restriction rules are dynamically adjusted, which solves the problems of insufficient flexibility of the flow restriction mechanism and high error interception rate in the existing sports venue management system, and improves the security and fairness of the system.
Patent Information
- Application Number
- CN202510548475.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-07-08
AI Technical Summary
The current limiting mechanism of the existing stadium management system is based on a single dimension, resulting in insufficient flexibility, high interception rate and insufficient fairness, which cannot effectively prevent malicious users from seizing resources.
The multi-dimensional flow restriction method is adopted to obtain the IP address, URL path and token information in the client request, match the corresponding flow restriction rules, record the number of concurrent requests, dynamically adjust the flow restriction threshold, and accurately control it in combination with the whitelist mechanism.
It realizes more flexible and accurate request traffic control, reduces the error interception rate, improves system security and fairness, and prevents malicious users from seizing resources.
Smart Images

Figure CN120281714A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer network technology, and in particular to a multi-dimensional current limiting method, system and terminal applied to a stadium management system. Background Art
[0002] Stadium management systems often need to handle high-concurrency requests, especially in scenarios such as hot event ticket sales and online venue reservations. Malicious users attack the system with a large number of requests, which may cause server resources to be exhausted, making it impossible for normal users to complete reservations or ticket purchases. Traditional throttling mechanisms usually limit throttling based on a single dimension (such as IP address), which has the following problems:
[0003] Lack of flexibility: Single-dimensional flow control cannot cope with complex business scenarios. For example, the same IP address may correspond to multiple users or multiple business requests.
[0004] High false interception rate: Traditional current limiting mechanisms can easily mistakenly intercept legitimate user requests, affecting user experience.
[0005] Lack of fairness: In scenarios such as ticket purchases, traditional flow control mechanisms cannot effectively prevent malicious users from seizing resources through technical means (such as ticket-swiping software).
[0006] Therefore, the prior art still has defects. Summary of the invention
[0007] The technical problem to be solved by the present invention is to provide a multi-dimensional current limiting method, system and terminal applied to a stadium management system in view of the above-mentioned defects of the prior art. The technical solution adopted by the present invention is as follows:
[0008] In a first aspect, the present invention provides a multi-dimensional current limiting method applied to a stadium management system, wherein the method comprises:
[0009] Obtaining a client request based on a request receiving module, and extracting information carried in the client request, wherein the carried information includes any one or more of an IP address, a URL path, and Token information, and the client request is used to request access to a gymnasium management system;
[0010] Based on the carried information, matching a current limiting rule corresponding to the carried information;
[0011] The client request is subjected to current limiting processing based on the current limiting rule.
[0012] In one implementation, after extracting the carried information in the client request, the method further includes:
[0013] Matching the carried information with a preset whitelist;
[0014] If the carried information fails to match the whitelist, then perform the step of matching the rate limiting rule corresponding to the carried information based on the carried information.
[0015] In one implementation manner, the matching of the rate limiting rule corresponding to the carried information based on the carried information includes:
[0016] If the carried information includes Token information, then obtain the first rate limiting rule corresponding to the Token information;
[0017] If the carried information does not include Token information, then obtain the second rate limiting rule corresponding to the IP address and / or URL path.
[0018] In one implementation manner, the rate limiting process for the client request based on the rate limiting rule includes:
[0019] Based on the shared dictionary module, record the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path;
[0020] Based on the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path, perform the rate limiting process for the client request by using the first rate limiting rule or the second rate limiting rule.
[0021] 5. The multi-dimensional rate limiting method applied to the stadium management system according to claim 4, wherein the performing the rate limiting process for the client request by using the first rate limiting rule or the second rate limiting rule based on the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path includes:
[0022] Based on the first rate limiting rule, compare the number of concurrent requests corresponding to each Token information with a preset first rate limiting threshold, wherein the first rate limiting threshold is the concurrent request quantity threshold for a single user;
[0023] If the number of concurrent requests corresponding to a certain Token information is greater than the first rate limiting threshold, then intercept and output an error message;
[0024] If the number of concurrent requests corresponding to a certain Token information is less than or equal to the first rate limiting threshold, then normally process the client request.
[0025] 6. The multi-dimensional flow-limiting method applied to the stadium management system according to claim 4, wherein, based on the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path, the first flow-limiting rule or the second flow-limiting rule is used to perform flow-limiting processing on the client request, including:
[0026] Based on the second flow-limiting rule, compare the number of concurrent requests corresponding to each IP address and / or URL path with a preset second flow-limiting threshold, wherein the second flow-limiting threshold is the concurrent request quantity threshold for a single IP address and / or URL path;
[0027] If the number of concurrent requests corresponding to a certain IP address and / or URL path is greater than the second flow-limiting threshold, intercept and output an error message;
[0028] If the number of concurrent requests corresponding to a certain IP address and / or URL path is less than or equal to the second flow-limiting threshold, process the client request normally.
[0029] In one implementation, the method further includes:
[0030] Record the flow-limiting process, generate log data, and sign the log data using the MD5 algorithm.
[0031] In a second aspect, an embodiment of the present invention further provides a multi-dimensional flow-limiting system applied to a stadium management system, wherein the system is used to implement the steps of the multi-dimensional flow-limiting method applied to the stadium management system described in the above solution, and the system includes:
[0032] A request receiving module, configured to receive and obtain a client request, and extract the carried information in the client request, wherein the carried information includes any one or more of an IP address, a URL path, and Token information, and the client request is used to request access to the stadium management system;
[0033] A flow-limiting rule module, configured to match a flow-limiting rule corresponding to the carried information based on the carried information;
[0034] A flow-limiting processing module, configured to perform flow-limiting processing on the client request based on the flow-limiting rule.
[0035] Third aspect, an embodiment of the present invention further provides a terminal. The terminal includes a memory, a processor, and a multi-dimensional current limiting program applied to a stadium management system stored in the memory and executable on the processor. When the processor executes the multi-dimensional current limiting program applied to the stadium management system, the steps of the multi-dimensional current limiting method applied to the stadium management system in any one of the above solutions are implemented.
[0036] Fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. A multi-dimensional current limiting program applied to a stadium management system is stored on the computer-readable storage medium. The multi-dimensional current limiting program applied to the stadium management system implements the steps of the multi-dimensional current limiting method applied to the stadium management system in any one of the above solutions on the computer-readable storage medium.
[0037] Beneficial effects: Compared with the prior art, the present invention provides a multi-dimensional current limiting method applied to a stadium management system. First, the present invention obtains a client request based on a request receiving module and extracts the carried information in the client request. The carried information includes any one or more of an IP address, a URL path, and Token information. The client request is used to request access to the stadium management system. Then, based on the carried information, a current limiting rule corresponding to the carried information is matched. Finally, the client request is subjected to current limiting processing based on the current limiting rule. It can be seen that the present invention specifically provides a multi-dimensional current limiting mechanism for high-concurrency scenarios in a stadium management system, and corresponding current limiting rules can be matched based on different dimensions, which can control the request traffic more flexibly and accurately, and improve the security and fairness of the system. Description of the Drawings
[0038] Figure 1 It is a flowchart of a preferred embodiment of the multi-dimensional current limiting method applied to a stadium management system provided by an embodiment of the present invention.
[0039] Figure 2 It is a flowchart of the multi-dimensional current limiting method applied to a stadium management system provided by an embodiment of the present invention in actual application.
[0040] Figure 3 It is a schematic architecture diagram of the multi-dimensional current limiting system applied to a stadium management system provided by an embodiment of the present invention.
[0041] Figure 4 It is a schematic block diagram of the principle of the terminal provided by an embodiment of the present invention. Detailed Embodiments
[0042] To make the objectives, technical solutions, and effects of the present invention clearer and more explicit, the following further elaborates on the present invention with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not intended to limit the present invention.
[0043] The flowcharts shown in the accompanying drawings are only illustrative examples and do not necessarily include all the content, operations, or steps, nor are they necessarily executed in the described order. For example, some operations or steps can be decomposed, combined, or partially merged, so the actual execution order may change according to the actual situation.
[0044] It should be understood that the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0045] It should be understood that, for the convenience of clearly describing the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. For example, the first control information and the second control information are only used to distinguish different control information and do not limit their sequence.
[0046] Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and "first", "second", etc. do not necessarily mean different.
[0047] It should also be understood that the term "and / or" used in the specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items and includes these combinations.
[0048] To solve the problems of the prior art, this embodiment provides a multi-dimensional flow-limiting method applied to a stadium management system. Specifically, in practical application, this embodiment can first obtain a client request based on a request receiving module and extract the carried information in the client request, where the carried information includes any one or more of an IP address, a URL path, and Token information, and the client request is used to request access to the stadium management system. Then, based on the carried information, match the flow-limiting rule corresponding to the carried information. Finally, perform flow-limiting processing on the client request based on the flow-limiting rule. It can be seen that this embodiment provides a multi-dimensional flow-limiting mechanism, which can match the corresponding flow-limiting rules based on different dimensions such as the IP address, URL path, or Token information in the carried information, and can control the request traffic more flexibly and accurately, improving the security and fairness of the system.
[0049] The multi-dimensional flow-limiting method applied to the stadium management system in this embodiment can be applied to terminals, and the terminals include intelligent product terminals such as mobile phones, smart TVs, and computers. For example, Figure 1 As shown in, the multi-dimensional flow-limiting method applied to the stadium management system in this embodiment includes the following steps:
[0050] Step S100: Obtain a client request based on the request receiving module, and extract the carried information in the client request. Among them, the carried information includes any one or more of an IP address, a URL path, and Token information. The client request is used to request access to the stadium management system.
[0051] In this embodiment, when a user wants to access and obtain a client request based on the request receiving module, and extract the carried information in the client request. Among them, the carried information includes any one or more of an IP address, a URL path, and Token information. The client request is used to request access to the stadium management system, an access request will be sent to the request receiving module based on the user's client to obtain the client request and extract the carried information in the client request. Among them, the carried information includes any one or more of an IP address, a URL path, and Token information. The client request is used to request access to the stadium management system. This access request is the client request. When the number of users is large, the corresponding client requests will also be relatively many, which may cause the stadium management system to crash. To avoid this situation, this embodiment can analyze the client requests and perform flow limiting according to specific situations, so as to ensure the security of the stadium management system. Specifically, this embodiment extracts the carried information in the client request. This carried information can be any one or more of an IP address, a URL path, and Token information. Different carried information can match different flow-limiting rules. Therefore, this embodiment can match different flow-limiting rules from different dimensions, so as to better control the client requests and ensure the security of the stadium management system.
[0052] Combined with Figure 2As shown, after receiving a client request, this embodiment extracts the carried information such as the IP address, URL path, or Token information in the client request. Then, this embodiment can use the whitelist mechanism to initially intercept the client request. The purpose of the interception is to directly release the clients belonging to the whitelist, so that the clients belonging to the whitelist can quickly access the stadium management system. For clients not belonging to the whitelist, this embodiment needs to further analyze whether rate limiting is required and in what way to perform rate limiting. To this end, this embodiment can match the IP address, URL path, or Token information in the carried information with the whitelist to determine whether the above IP address, URL path, or Token information exists in the whitelist. If the IP address, URL path, or Token information in the carried information matches the whitelist successfully, the client request can be directly released for processing, and the corresponding client can directly access the stadium management system. If the IP address, URL path, or Token information in the carried information fails to match the whitelist, the carried information is analyzed to determine the corresponding rate limiting rule.
[0053] Step S200: Based on the carried information, match the rate limiting rule corresponding to the carried information.
[0054] This embodiment provides a multi-dimensional rate limiting rule matching method. Since the carried information carries any one or more of the IP address, URL path, and Token information, and the carried information in different client requests may also be different. When facing scenarios such as hot event ticket purchases and online venue reservations, if there are too many client requests, it may cause the stadium management system to crash. Therefore, this embodiment can match the corresponding rate limiting rule based on the carried information of the client request, so as to perform rate limiting processing on the client requests on the stadium management system based on the matched rate limiting rule.
[0055] In one implementation, when this embodiment matches the rate limiting rule, it includes the following steps:
[0056] Step S201: If the carried information includes Token information, obtain the first rate limiting rule corresponding to the Token information;
[0057] Step S202: If the carried information does not include Token information, obtain the second rate limiting rule corresponding to the IP address and / or URL path.
[0058] Specifically, this embodiment classifies the IP address, URL path, or Token information in the carried information into two categories, combined with Figure 2As shown, it can be divided into two categories: the carried information includes Token information and the carried information does not include Token information. If the carried information of a certain client request includes Token information, that is, the client is a logged-in user at this time. For a successfully logged-in user, this embodiment can match the first traffic-limiting rule corresponding to the Token information. In practical applications, when there is Token information in the client request, there will also be an IP address and / or a URL path. This embodiment can be based on the existence of Token information. As long as there is Token information, the first traffic-limiting rule is matched. Therefore, when the carried information includes an IP address, a URL path, and Token information at the same time, the first traffic-limiting rule can also be matched. The first traffic-limiting rule analyzes the Token information in the client request to intercept or release the client request. If the carried information of a certain client request does not include Token information, at this time, the second traffic-limiting rule is matched based on the IP address and / or the URL path in the carried information. The second traffic-limiting rule analyzes the IP address and / or the URL path in the client request to intercept or release the client request. Thus, it can be seen that this embodiment combines three dimensions of IP address, URL path, and Token information to match the corresponding traffic-limiting rules, which can more accurately control the request traffic and effectively prevent malicious requests and system overload.
[0059] Step S300, perform traffic-limiting processing on the client request based on the traffic-limiting rule.
[0060] After determining the traffic-limiting rule, this embodiment can perform traffic-limiting processing on the client request based on the first traffic-limiting rule or the second traffic-limiting rule respectively. In practical applications, this embodiment can record the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path based on the shared dictionary module. According to the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path, the first traffic-limiting rule or the second traffic-limiting rule is used to perform traffic-limiting processing on the client request. The number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path can reflect the access congestion situation of the system at this time. In order to ensure the stability and smoothness of the stadium management system, therefore, this embodiment can use the first traffic-limiting rule or the second traffic-limiting rule matched above to perform traffic-limiting processing on the client request according to the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path.
[0061] In one implementation manner, when this embodiment performs traffic-limiting processing based on the first traffic-limiting rule, it includes the following steps:
[0062] Step S301: Compare the number of concurrent requests corresponding to each Token information with a preset first flow-limiting threshold based on the first flow-limiting rule, where the first flow-limiting threshold is the concurrent request quantity threshold for a single user.
[0063] Step S302: If the number of concurrent requests corresponding to a certain Token information is greater than the first flow-limiting threshold, intercept and output an error message.
[0064] Step S303: If the number of concurrent requests corresponding to a certain Token information is less than or equal to the first flow-limiting threshold, process the client request normally.
[0065] In this embodiment, when obtaining the number of concurrent requests corresponding to each Token information, the access congestion situation of the stadium management system can be determined, and then the flow-limiting mechanism can be triggered based on this access congestion situation. In practical applications, when the access congestion situation of the stadium management system has reached the trigger threshold, the flow-limiting mechanism is started to process the client requests. As Figure 2 shown, then compare the number of concurrent requests corresponding to each Token information with the first flow-limiting threshold, and based on the comparison result, perform steps of reporting an error or processing the request normally for the client request.
[0066] Specifically, for the client requests with Token information, since the existence of Token information indicates that the client requests are access requests sent by successfully logged-in users, this embodiment can determine the number of concurrent requests corresponding to these Token information. Then, compare the number of concurrent requests corresponding to each Token information with the preset first flow-limiting threshold, where the first flow-limiting threshold is the concurrent request quantity threshold for a single user; if the number of concurrent requests corresponding to a certain Token information is greater than the first flow-limiting threshold, intercept and output an error message; if the number of concurrent requests corresponding to a certain Token information is less than or equal to the first flow-limiting threshold, process the client request normally.
[0067] In other implementation manners, in combination with Figure 2 and Figure 3As shown, when there is Token information in this embodiment, the Token information, IP address, and URL path can also be combined to obtain a key, and then the dictionary module records the concurrent request count corresponding to the combined key, which represents the concurrent request count of a logged-in user for an IP address or a URL path. Then, rate limiting is performed based on the determined concurrent request count at this time. Similarly, the concurrent request count can also be compared with a preset rate limiting threshold at this time. If the concurrent request count at this time is greater than the rate limiting threshold, an error message is intercepted and output. This embodiment determines the concurrent request count and performs rate limiting control through the combination of Token information + IP address + URL path, which can effectively solve the problem of false interception caused by too coarse granularity of the interception rules for a single IP address or a URL path.
[0068] In another implementation, when performing rate limiting processing based on the second rate limiting rule in this embodiment, the following steps are included:
[0069] Step S31: Based on the second rate limiting rule, compare the concurrent request count corresponding to each IP address and / or URL path with a preset second rate limiting threshold, where the second rate limiting threshold is the concurrent request quantity threshold for a single IP address and / or URL path;
[0070] Step S32: If the concurrent request count corresponding to a certain IP address and / or URL path is greater than the second rate limiting threshold, intercept and output an error message;
[0071] Step S33: If the concurrent request count corresponding to a certain IP address and / or URL path is less than or equal to the second rate limiting threshold, process the client request normally.
[0072] Specifically, for client requests without Token information in this embodiment, this embodiment can determine the key corresponding to each IP address and / or URL path, and determine the corresponding concurrent request count. At this time, the concurrent request count corresponding to each IP address and / or URL path can also reflect the access congestion situation of the stadium management system. Similarly, this embodiment can compare the concurrent request count corresponding to each IP address and / or URL path with a preset second flow limit threshold, where the second flow limit threshold is the concurrent request quantity threshold for a single IP address and / or URL path. The specific values of the second flow limit threshold and the first flow limit threshold in this embodiment can be the same or different. When they are different, the flow limit thresholds set by the first flow limit rule and the second flow limit rule in this embodiment are different, which can facilitate the implementation of flow limit processing in different dimensions and more refined flow limit processing. Similarly, if the concurrent request count corresponding to a certain IP address and / or URL path is greater than the second flow limit threshold, an error message is output. If the concurrent request count corresponding to a certain IP address and / or URL path is less than or equal to the second flow limit threshold, the client request is processed normally.
[0073] In addition, in other implementation manners, when performing flow limit processing in this embodiment, the delay time of the client request can also be dynamically adjusted according to the concurrent situation of the request and the processing time for the client request to alleviate the access congestion situation. In this way, in scenarios such as ticket grabbing, it is ensured that each request can be fairly processed.
[0074] Furthermore, this embodiment can also record the entire flow limit process, generate log data, and sign the log data using the MD5 algorithm to ensure data security. In actual application, the log recording module of this embodiment can record the entire flow limit status and process, and send the generated log data to the log analysis system for storing the log data and facilitating the analysis of abnormal situations.
[0075] This embodiment also provides code examples (based on OpenResty and Lua) for each part of the multi-dimensional flow limit method applied to the stadium management system, as follows:
[0076]
[0077]
[0078] In addition, this embodiment also provides specific lua code examples of the present invention, as follows: -- IP white list, configured according to the actual situation
[0079]
[0080]
[0081]
[0082]
[0083]
[0084] Compared with the prior art, the technical effects of the present invention include at least the following:
[0085] 1. Refined current limiting control: By combining the three dimensions of IP address, URL path and Token information to match the corresponding current limiting rules, the request flow can be controlled more accurately, effectively preventing malicious requests and system overload.
[0086] 2. High flexibility: Supports dynamic adjustment of flow control rules to adapt to different business scenarios and needs.
[0087] 3. Low false interception rate: Through the whitelist mechanism and multi-dimensional current limiting rules, the false interception rate is effectively reduced and the user experience is improved.
[0088] 4. High fairness: In scenarios such as ticket purchases, it can effectively prevent malicious users from seizing resources through technical means and protect the rights and interests of legitimate users.
[0089] Based on the above embodiments, the present invention further provides a multi-dimensional current limiting system applied to a stadium management system, which can be used to implement the steps of the multi-dimensional current limiting method applied to a stadium management system in the above method embodiments. Figure 3As shown in the figure, the multi-dimensional flow-limiting system applied to the stadium management system in this embodiment includes: a request receiving module, a flow-limiting rule module, a flow-limiting processing module, a shared dictionary module, and a log recording module. Specifically, the request receiving module 10 is configured to receive a client request and extract the carried information in the client request, where the carried information includes any one or more of an IP address, a URL path, and Token information, and the client request is used to request access to the stadium management system. The flow-limiting rule module 20 is configured to match a flow-limiting rule corresponding to the carried information based on the carried information. The flow-limiting processing module 30 is configured to perform flow-limiting processing on the client request based on the flow-limiting rule. For example, when the carried information of the client request includes Token information and both an IP address and a URL path exist at the same time, flow-limiting can be performed based on the IP address, the URL path, and the Token information. When the carried information of the client request does not include Token information, flow-limiting can be performed based on the IP address and the URL path. The shared dictionary module is configured to obtain the flow-limiting status and update the number of concurrent requests received by the stadium management system and the number of client requests waiting in real time based on the flow-limiting status. The log recording module is configured to record the entire flow-limiting status and the flow-limiting process and send the generated log data to the log analysis system.
[0090] The working principles of the modules in the multi-dimensional flow-limiting system applied to the stadium management system in this embodiment are the same as those of the steps in the above method embodiment, and will not be elaborated here.
[0091] Each of the above modules in the multi-dimensional flow-limiting system applied to the stadium management system can be implemented in whole or in part by software, hardware, and their combinations. Each of the above modules can be embedded in the processor in the terminal in hardware form or independent of the processor, or stored in the memory in the terminal in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0092] Based on the above embodiment, the present invention also provides a terminal, and the principle block diagram of the terminal can be as Figure 4 shown. The terminal may include one or more processors 100 ( Figure 4 only one is shown in the figure), a memory 101, and a computer program 102 stored in the memory 101 and executable on one or more processors 100. For example, a multi-dimensional flow-limiting program applied to the stadium management system. When one or more processors 100 execute the computer program 102, each step in the method embodiment of the multi-dimensional flow-limiting method applied to the stadium management system can be implemented. Or, when one or more processors 100 execute the computer program 102, the functions of the modules / units in the embodiment of the multi-dimensional flow-limiting system applied to the stadium management system can be implemented, which is not limited here.
[0093] In one embodiment, the so-called processor 100 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0094] In one embodiment, the memory 101 may be an internal storage unit of the electronic device, such as the hard disk or memory of the electronic device. The memory 101 may also be an external storage device of the electronic device, such as a plug-in hard disk equipped on the electronic device, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 101 may also include both the internal storage unit and the external storage device of the electronic device. The memory 101 is used to store computer programs and other programs and data required by the terminal. The memory 101 may also be used to temporarily store data that has been output or is to be output.
[0095] Those skilled in the art can understand that Figure 4 the principle block diagram shown in does not constitute a limitation on the terminal to which the solution of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0096] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, operational database, or other medium used in the various embodiments provided by the present invention can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or equivalently replace some of the technical features. However, such modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A multi-dimensional flow-limiting method applied to a stadium management system, characterized in that The method includes: Based on a request receiving module, obtain a client request and extract the carried information in the client request. Among them, the carried information includes any one or more of an IP address, a URL path, and Token information. The client request is used to request access to the stadium management system; Based on the carried information, match a traffic limiting rule corresponding to the carried information; Based on the traffic limiting rule, perform traffic limiting processing on the client request.
2. The multi-dimensional flow limiting method applied to the stadium management system according to claim 1, wherein After extracting the carried information in the client request, it further includes: Match the carried information with a preset whitelist; If the carried information fails to match the whitelist, then execute the step of matching a traffic limiting rule corresponding to the carried information based on the carried information.
3. The multi-dimensional flow limiting method applied to the stadium management system according to claim 2, characterized in that, The matching of a traffic limiting rule corresponding to the carried information based on the carried information includes: If the carried information includes Token information, obtain a first traffic limiting rule corresponding to the Token information; If the carried information does not include Token information, obtain a second traffic limiting rule corresponding to the IP address and / or the URL path.
4. The multi-dimensional flow-limiting method applied to the stadium management system according to claim 3, wherein, The performing traffic limiting processing on the client request based on the traffic limiting rule includes: Based on a shared dictionary module, record the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path; Based on the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path, use the first traffic limiting rule or the second traffic limiting rule to perform traffic limiting processing on the client request.
5. The multi-dimensional flow-limiting method applied to the stadium management system according to claim 4, characterized in that, The performing traffic limiting processing on the client request based on the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path, using the first traffic limiting rule or the second traffic limiting rule, includes: Based on the first traffic limiting rule, compare the number of concurrent requests corresponding to each Token information with a preset first traffic limiting threshold, where the first traffic limiting threshold is the concurrent request quantity threshold for a single user; If the number of concurrent requests corresponding to a certain Token information is greater than the first traffic limiting threshold, then intercept and output an error message; If the number of concurrent requests corresponding to a certain Token information is less than or equal to the first traffic limiting threshold, then normally process the client request.
6. The multi-dimensional flow limiting method applied to the stadium management system according to claim 4, characterized in that, The performing traffic limiting processing on the client request based on the number of concurrent requests corresponding to each Token information and the number of concurrent requests corresponding to each IP address and / or URL path, using the first traffic limiting rule or the second traffic limiting rule, includes: Based on the second traffic limiting rule, compare the number of concurrent requests corresponding to each IP address and / or URL path with a preset second traffic limiting threshold, where the second traffic limiting threshold is the three-dimensional concurrent request quantity threshold for a single IP address and / or URL path; If the number of concurrent requests corresponding to a certain IP address and / or URL path is greater than the second traffic limiting threshold, then intercept and output an error message; If the number of concurrent requests corresponding to a certain IP address and / or URL path is less than or equal to the second traffic limiting threshold, the client request is processed normally.
7. The multi-dimensional flow limiting method applied to the stadium management system according to claim 1, characterized in that, The method further includes: Recording the traffic limiting process, generating log data, and signing the log data using the MD5 algorithm.
8. A multi-dimensional flow limiting system applied to a stadium management system, characterized in that, The system is used to implement the steps of the multi-dimensional traffic limiting method applied to the stadium management system according to any one of claims 1-7. The system includes: A request receiving module, configured to receive and obtain a client request, and extract the carried information in the client request, where the carried information includes any one or more of an IP address, a URL path, and Token information, and the client request is used to request access to the stadium management system; A traffic limiting rule module, configured to match a traffic limiting rule corresponding to the carried information based on the carried information; A traffic limiting processing module, configured to perform traffic limiting processing on the client request based on the traffic limiting rule.
9. A terminal, characterized in that, The terminal includes a memory, a processor, and a multi-dimensional traffic limiting program applied to the stadium management system stored in the memory and executable on the processor. When the processor executes the multi-dimensional traffic limiting program applied to the stadium management system, the steps of the multi-dimensional traffic limiting method applied to the stadium management system according to any one of claims 1-7 are implemented.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a multi-dimensional traffic limiting program applied to the stadium management system. The multi-dimensional traffic limiting program applied to the stadium management system implements the steps of the multi-dimensional traffic limiting method applied to the stadium management system according to any one of claims 1-7 on the computer-readable storage medium.
Citation Information
Cited By
Multi-dimensional current limiting method, system and terminal applied to stadium management system
CN121000666A
Multi-dimensional flow limiting method, system and terminal applied to stadium management system
CN121000666B