Flow control methods, devices, servers, storage media, and software products

By updating traffic control configuration data in the database in real time and generating rules based on the number of request connections at multiple levels, the complexity and security risks of existing traffic control methods are resolved, achieving simple, easy-to-maintain, and efficient traffic control, and improving system performance and stability.

CN118827550BActive Publication Date: 2025-11-14CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410826303.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2025-11-14
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

Existing flow control methods are complex to configure, have high maintenance costs, require the use of open source software or third-party tools, pose security risks, and have coarse adjustment granularity, affecting system performance and response speed.

Method used

By updating traffic control configuration data in the database in real time, traffic control is performed based on the number of request connections at multiple levels, generating traffic control rules. No open-source software or third-party tools are required. The configuration method is simple, easy to maintain, and highly secure, thus refining the granularity of traffic control.

Benefits of technology

It achieves simple and easy-to-maintain flow control, improves system performance and stability, reduces resource consumption, prevents system crashes, and ensures high system availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118827550B_ABST
    Figure CN118827550B_ABST
Patent Text Reader

Abstract

This application provides a flow control method, apparatus, server, storage medium, and program product. It relates to the field of big data technology. The method is applied to a flow control server and includes: when a request is received from a requesting end, updating the request connection counts corresponding to multiple levels; the multiple levels include channel type, business, request type, and service type; performing flow control based on the request connection counts corresponding to each level and flow control rules; the flow control rules are generated based on flow control configuration data in a database; and when a response is returned to the requesting end, updating the request connection counts corresponding to each level. This application does not rely on open-source software or third-party tools, therefore the configuration is relatively simple, easy to maintain, highly secure, and consumes fewer resources. Furthermore, by referencing the request connection counts of multiple levels for flow control, it refines the granularity of flow control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data technology, and in particular to a flow control method, device, server, storage medium and program product. Background Technology

[0002] When the traffic (the number of connection requests per unit of time) exceeds the server's load or processing capacity limit, it can lead to network congestion and may even cause system crashes.

[0003] Related technologies use rate limiters or load balancers to regulate traffic, thereby avoiding network congestion and improving system stability. However, these traffic control methods are complex to configure, have high maintenance costs, require open-source software or third-party tools, and pose security risks. Summary of the Invention

[0004] This application provides a flow control method, device, server, storage medium, and program product that does not rely on open-source software or third-party tools. Therefore, the configuration method is relatively simple, easy to maintain, highly secure, and consumes fewer resources. Furthermore, by referencing the number of request connections at multiple levels for flow control, the granularity of flow control is refined.

[0005] In a first aspect, this application provides a traffic control method, which is applied to a traffic control server, and the method includes:

[0006] When a request is received from the requesting end, the number of request connections corresponding to multiple levels is updated; the multiple levels include channel type, service, request type and service type.

[0007] Traffic control is performed based on the number of request connections and traffic control rules corresponding to the multiple levels; the traffic control rules are generated based on traffic control configuration data in the database.

[0008] When a response is returned to the requesting end, the number of request connections corresponding to each of the aforementioned levels is updated.

[0009] In some embodiments, the flow control based on the number of request connections and flow control rules corresponding to the plurality of levels includes:

[0010] According to the flow control rules, perform the following operations:

[0011] When the switch corresponding to the overall traffic control is turned on, traffic control is performed based on the number of request connections and the switch status corresponding to the channel type, business, request type, and business type, respectively.

[0012] When the switch corresponding to the overall traffic control is turned off, the request is sent to the corresponding application server so that the application server processes the request through the server and returns a response to the requesting party; the response is the processing result response.

[0013] In some embodiments, the traffic control based on the number of request connections and on / off status corresponding to the channel type, service, request type, and service type respectively includes:

[0014] When both the switch corresponding to the channel type to which the request belongs and the switch corresponding to the service are turned on, traffic control is performed based on the number of request connections corresponding to the channel type to which the request belongs and the number of request connections corresponding to the service.

[0015] If the switch corresponding to the channel type to which the request belongs is not turned on but the switch corresponding to the service is turned on, traffic control is performed based on the number of request connections corresponding to the request type to which the request belongs, the switch status, and the number of request connections corresponding to the service.

[0016] When the switch corresponding to the channel type to which the request belongs is turned on and the switch corresponding to the service is turned off, traffic control is performed based on the number of request connections corresponding to the channel type to which the request belongs, the number of request connections corresponding to the service type to which the request belongs, and the switch status.

[0017] If neither the switch corresponding to the channel type to which the request belongs nor the switch corresponding to the service is turned on, traffic control is performed based on the number of request connections and switch status corresponding to the request type to which the request belongs, and the number of request connections and switch status corresponding to the service type to which the request belongs.

[0018] In some embodiments, the traffic control based on the number of request connections corresponding to the channel type to which the request belongs and the number of request connections corresponding to the service includes:

[0019] If the number of request connections corresponding to the channel type to which the request belongs reaches the corresponding threshold or the number of request connections corresponding to the service reaches the corresponding threshold, a response is returned to the requesting end; the response is a rejection response.

[0020] If the number of request connections corresponding to the channel type to which the request belongs does not reach the corresponding threshold and the number of request connections corresponding to the business does not reach the corresponding threshold, the request is sent to the corresponding application server so that the application server processes the request through the server and returns a response to the requesting party; the response is a processing result response.

[0021] In some embodiments, the flow control based on the number of request connections and on / off status corresponding to the request type to which the request belongs, and the number of request connections and on / off status corresponding to the service type to which the request belongs, includes:

[0022] When both the switch corresponding to the request type and the switch corresponding to the service type of the request are turned on, traffic control is performed based on the number of request connections corresponding to the request type and the number of request connections corresponding to the service type of the request.

[0023] If the switch corresponding to the request type to which the request belongs is not turned on and the switch corresponding to the service type to which the request belongs is turned on, traffic control is performed based on the number of request connections corresponding to the service type to which the request belongs.

[0024] If the switch corresponding to the request type to which the request belongs is turned on and the switch corresponding to the service type to which the request belongs is not turned on, traffic control is performed based on the number of request connections corresponding to the request type to which the request belongs.

[0025] If neither the switch corresponding to the request type nor the switch corresponding to the service type to which the request belongs is turned on, the request is sent to the corresponding application server so that the application server processes the request through the server and returns a response to the requesting party; the response is a processing result response.

[0026] In some embodiments, after updating the number of request connections corresponding to each of the levels when returning a response to the requesting client, the method further includes:

[0027] Record traffic-related information; the traffic-related information includes time information, processing information, request information, and the current number of request connections.

[0028] In some embodiments, the method further includes:

[0029] In response to the startup of the traffic control server, the system initializes and reads traffic control configuration data from the database, and generates traffic control rules based on the traffic control configuration data.

[0030] During the operation of the traffic control server, traffic control configuration data is read from the database periodically, and the traffic control rules are updated according to the traffic control configuration data.

[0031] Secondly, this application provides a flow control device, which is integrated into a flow control server, and the device includes:

[0032] The update module is used to update the number of request connections corresponding to multiple levels when a request is received from the requesting end; the multiple levels include channel type, business, request type and business type;

[0033] The control module is used to perform traffic control based on the number of request connections and traffic control rules corresponding to the multiple levels respectively; the traffic control rules are generated based on traffic control configuration data in the database.

[0034] The update module is further configured to update the number of request connections corresponding to each of the levels when returning a response to the requesting end.

[0035] Thirdly, this application provides a server, including: a processor and a memory communicatively connected to the processor;

[0036] The memory stores computer-executed instructions;

[0037] The processor executes computer execution instructions stored in the memory to implement the flow control method as described in any of the first aspects.

[0038] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the flow control method described in any of the first aspects.

[0039] Fifthly, this application provides a computer program product, including computer execution instructions, which, when executed by a processor, implement the flow control method described in any of the first aspects.

[0040] The traffic control method, apparatus, server, storage medium, and program products provided in this application are applied to a business system that includes a requesting end, an application end, and a server end. The traffic control server is located between the requesting end and the application end. When a request is received from the requesting end, it first updates the number of request connections corresponding to multiple levels, such as channel master control, business master control, request type, and business type, to achieve traffic counting. Then, it performs traffic control based on the number of request connections corresponding to multiple levels and traffic control rules. The traffic control rules are generated based on the traffic control configuration data in the database, without the need for open source software or third-party tools. Therefore, the configuration method is relatively simple, easy to maintain, highly secure, and consumes fewer resources. Furthermore, by referring to the number of request connections at multiple levels, the granularity of traffic control is refined. Attached Figure Description

[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0042] Figure 1 This is a schematic diagram illustrating an application scenario applicable to related technologies;

[0043] Figure 2 This is a schematic diagram applicable to one application scenario of this application;

[0044] Figure 3 This is a schematic flowchart of a flow control method provided in an embodiment of this application;

[0045] Figure 4 This is a flowchart illustrating another flow control method provided in an embodiment of this application;

[0046] Figure 5 This is a schematic diagram of a flow control rule provided in an embodiment of this application;

[0047] Figure 6 This is a schematic diagram of the structure of a flow control device provided in an embodiment of this application;

[0048] Figure 7 This is a schematic diagram of the structure of a server provided in an embodiment of this application.

[0049] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0050] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0051] The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. In the following descriptions of embodiments, "a plurality of" means two or more, unless otherwise explicitly defined.

[0052] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals. It should be noted that certain software, components, models, and other existing solutions in the industry may be mentioned in the embodiments of this application. These should be considered as exemplary, and their purpose is only to illustrate the feasibility of implementing the technical solution of this application, but does not mean that the applicant has used or necessarily used such solutions.

[0053] Figure 1 This is a schematic diagram illustrating an application scenario applicable to related technologies. This scenario includes a requesting system, an application system, and a server system. A request originates from the requesting system, undergoes preliminary logical processing by the application system, and is then sent to the server system. The server system performs final processing on the request before returning the response to the requesting system.

[0054] The requesting system includes multiple terminals. Taking one terminal as an example, this terminal has a target application installed on it. The user performs an operation through the target application, which triggers the terminal to send a request to the application system. For example, the target application can be a client application (App), a mini-program, or a browser installed on the terminal. For example, the terminal can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these.

[0055] The application system is a server cluster or distributed system consisting of multiple servers. Each server has multiple business service programs. The server performs preliminary logical processing on the requests sent by the terminal through the business service program and calls the server-side system for final processing. Each business service program corresponds to a different business. Taking a financial scenario as an example, the business can be repayment, disbursement, settlement, etc.

[0056] The server-side system comprises multiple systems. Taking a financial scenario as an example, the server-side system includes a customer information system, a deposit system, a loan system, a housing provident fund system, and a credit card system. Each system within the server-side system is a server cluster or distributed system consisting of multiple servers. This server is used to process requests and obtain the processing result response, which is then returned to the requesting system through the application system.

[0057] In the aforementioned application scenarios, devices communicate via networks, such as wireless or wired networks. When the traffic (number of connection requests per unit time) exceeds the server system's load or processing capacity limit, network congestion can occur, potentially leading to system crashes. Related technologies use rate limiters or load balancers to regulate traffic, thereby preventing network congestion and improving system stability. However, these traffic control methods are complex to configure, have high maintenance costs, and require open-source software or third-party tools, posing security risks. Furthermore, these traffic control methods offer coarse-grained traffic adjustment, consuming significant system resources and potentially impacting system performance and response speed.

[0058] This application aims to dynamically adjust traffic by updating traffic control configuration data in the database in real time when the traffic exceeds the server system's load or processing capacity limit. This achieves the goals of rationally utilizing system resources, improving system performance, preventing system crashes, and ensuring high system availability. Specifically, this application is applied to a business system comprising a requester, an application, and a server. The traffic control server is positioned between the requester and the application. Upon receiving a request from the requester, it first updates the request connection counts corresponding to multiple levels—channel master control, business master control, request type, and business type—to achieve traffic counting. Traffic control is then performed based on the request connection counts and traffic control rules corresponding to these multiple levels. The traffic control rules are generated from the traffic control configuration data in the database, without relying on open-source software or third-party tools. Therefore, the configuration method is simple, easy to maintain, highly secure, and consumes fewer resources. Furthermore, by referencing the request connection counts at multiple levels, the granularity of traffic control is refined.

[0059] Figure 2 This is a schematic diagram illustrating an application scenario applicable to this application. For example... Figure 2 As shown, this application scenario includes a requesting system, an application system, and a server system. The scenario further includes a traffic control server positioned between the requesting system and the application system. This traffic control server performs traffic control on requests sent by the requesting system. Exemplarily, this traffic control server can be positioned not only between the requesting system and the application system but also within the application system itself. The scenario also includes a traffic control server positioned between the application system and the server system, which performs traffic control on responses sent by the server system. Exemplarily, this traffic control server can be positioned not only between the server system and the application system but also within the application system itself.

[0060] The composition and purpose of the requesting system, application system, and server system are described in the above-mentioned technical descriptions and will not be repeated here.

[0061] For example, the aforementioned flow control server can be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.

[0062] Those skilled in the art will understand that the number of traffic control servers described above can be more or less. For example, there may be only one traffic control server, or there may be dozens or hundreds, or more. This application does not limit the number of traffic control servers in its embodiments.

[0063] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0064] The following example illustrates how to set up a flow control server between the requesting system and the application system.

[0065] Figure 3 This is a flowchart illustrating a flow control method according to an embodiment of this application. The flow control method provided in this application is executed by a flow control device, which is integrated into a flow control server. Figure 3 As shown, the flow control method provided in this embodiment includes the following steps:

[0066] Step S101: When a request is received from the requesting end, update the number of request connections corresponding to multiple levels respectively; these multiple levels include channel type, business, request type and business type.

[0067] In this context, "requesting end" refers to any terminal in the requesting end system. A user performs an operation through the target application on the terminal, thereby triggering the terminal to send a request to the application system. In this application, the request first passes through a flow control server, which then executes the flow control method provided in this application.

[0068] In this embodiment, requests are divided into multiple levels: overall traffic control, channel type, service, request type, and service type. Among them, overall traffic control is the first level. Requests belonging to the overall traffic control level include pending requests from the requesting system. Therefore, the number of request connections corresponding to overall traffic control is the number of pending requests from the requesting system.

[0069] Channel type and business are at the second level. Requests can originate from various channels, such as client applications, mini-programs, or browsers. Correspondingly, the channel type is categorized as client application type, mini-program type, or browser type. For each channel type, the number of request connections corresponding to that channel type is the number of pending requests belonging to that channel type. For example, the number of request connections corresponding to the mini-program type is the number of pending requests from mini-programs.

[0070] Requests belonging to the business level include all pending requests that require initial processing by the application system. Since any request sent by any terminal in the requesting system requires initial processing by the application system, requests belonging to the business level are also requests belonging to the traffic control level. Accordingly, the number of request connections corresponding to the business is the number of pending requests from the requesting system.

[0071] Request type and business type are at the third level. There are multiple request types, distinguished by URL (Uniform Resource Locator). Different URLs represent different request types. Correspondingly, for each request type, the number of request connections is the number of pending requests belonging to that request type. There are also multiple business types that requests target, such as repayment, disbursement, and settlement. Correspondingly, for each business type, the number of request connections is the number of pending requests belonging to that business type.

[0072] For example, step S101 is specifically implemented as follows: for each received request, the request connection count corresponding to each level in the multiple levels is incremented by 1 to update the request connection count. Furthermore, after the update, the request connection count corresponding to each level is stored for use in subsequent operations.

[0073] Step S102: Perform traffic control based on the number of request connections and traffic control rules corresponding to multiple levels; the traffic control rules are generated based on the traffic control configuration data in the database.

[0074] In practical applications, technicians can modify the configuration data in the database according to actual needs without stopping the flow control server or performing other complex operations. By storing the flow control configuration data in a database, it can be easily managed and maintained. Technicians can modify, back up, and restore the configuration data using database management tools, thereby improving system maintainability.

[0075] The flow control server communicates with the database via the network to read flow control configuration data, generate flow control rules based on the flow control configuration data, and then store the flow control rules for use in subsequent operations.

[0076] In this embodiment, after updating the number of request connections corresponding to multiple levels, the latest stored traffic control rules are obtained, and traffic control is performed according to the number of request connections and traffic control rules corresponding to multiple levels.

[0077] Step S103: When a response is returned to the requesting end, update the number of request connections corresponding to each level.

[0078] Regarding the request received in step S101, it may be processed or rejected. If it is determined that no flow control is needed, the flow control server forwards the request to the corresponding server in the application system. This server performs preliminary processing on the request and sends it to the corresponding server in the server-side system. This server then performs final processing on the request, obtaining a processing result response, which is returned to the requesting end so that the requesting end can perform subsequent operations based on the processing result response. If it is determined that flow control is needed, the flow control server directly returns a rejection response to the requesting end so that the requesting end can perform subsequent operations based on the rejection response. Accordingly, the response in step S103 is either a processing result response or a rejection response.

[0079] In this embodiment, after returning a response to the requesting end, it indicates that the request will no longer be processed, and therefore the request is no longer considered a pending request. Accordingly, the request connection counts corresponding to each level are updated. For example, step S103 is specifically implemented as follows: for each response returned, the request connection counts corresponding to each level in the multiple levels are decremented by 1 to update the request connection counts. Furthermore, after the update, the request connection counts corresponding to each level are stored for use in subsequent operations.

[0080] This embodiment is applied to a business system that includes a requester, an application, and a server. The traffic control server is located between the requester and the application. When a request is received from the requester, it first updates the number of request connections corresponding to multiple levels, such as channel type, business, request type, and business type, to achieve traffic counting. Then, traffic control is performed based on the number of request connections corresponding to multiple levels and traffic control rules. The traffic control rules are generated based on the traffic control configuration data in the database, without the need for open source software or third-party tools. Therefore, the configuration method is relatively simple, easy to maintain, highly secure, and consumes fewer resources. Furthermore, by referring to the number of request connections at multiple levels, the granularity of traffic control is refined.

[0081] exist Figure 3 Based on the illustrated embodiments, in some embodiments, after step S103, the flow control method provided by this application further includes: recording flow-related information; the flow-related information includes time information, processing information, request information, and the current number of request connections. The time information includes the time when the flow control server receives the request, the time when the corresponding server in the application system receives the request, the time when the corresponding server in the server-side system receives the request, and the response time; the processing information includes the service type to which the request belongs and the server identifiers corresponding to the multiple servers processing the request; the request information includes the information carried by the request itself; the current number of request connections refers to the number of request connections corresponding to the multiple levels updated after the response is returned.

[0082] On the one hand, recording traffic-related information facilitates the monitoring and optimization of system performance: by analyzing processing and request information, bottlenecks and performance limitations can be identified, allowing for targeted optimization and improved system response speed and throughput. On the other hand, recording traffic-related information helps quickly locate and troubleshoot system faults and problems: by using time and request information, the processing of requests can be tracked, the causes of faults can be identified, and timely repairs can be made, improving system stability and reliability. Furthermore, recording the current number of request connections helps monitor system security: by monitoring changes in the number of request connections in real time, abnormal requests or malicious attacks can be detected promptly, allowing for appropriate security measures to protect the system. Finally, recording traffic-related information allows for better management of system resources: by analyzing request and processing information, system resources can be allocated rationally, avoiding excessive resource consumption and waste, and improving system resource utilization.

[0083] exist Figure 3 Based on the illustrated embodiments, in some embodiments, the process of generating and updating traffic control rules includes: in response to the startup of the traffic control server, initializing and reading traffic control configuration data from the database, and generating traffic control rules based on the traffic control configuration data; during the operation of the traffic control server, periodically reading traffic control configuration data from the database, and updating the traffic control rules based on the traffic control configuration data. The frequency of periodic reading can be set as needed, such as once per minute, once every 10 minutes, once per hour, etc., and this embodiment does not limit this.

[0084] By periodically reading traffic control configuration data from the database and updating traffic control rules, the traffic control server can respond to configuration changes in a timely manner. This ensures the real-time nature of the traffic control rules and allows the system to respond more flexibly to different traffic conditions.

[0085] Based on the above embodiments, exemplarily, Figure 4 This is a flowchart illustrating another flow control method provided in an embodiment of this application. A flow control program is deployed in the flow control server; see [link to relevant documentation]. Figure 4 The traffic control program comprises multiple modules, including a traffic control rules module, a traffic counter, and a traffic controller. These modules collaborate to complete traffic control. The basic principle of their collaboration is as follows: technical personnel maintain and update the traffic control configuration data through the dependency configuration maintenance page; after the traffic control server starts, the traffic control rules module initializes by reading the traffic control configuration data, generates traffic control rules, and periodically reads the traffic control configuration data to update the traffic control rules during operation; upon receiving a request during operation, the traffic counter increments by 1 to update the number of request connections corresponding to multiple levels; the traffic controller combines the traffic control rules to perform traffic control, and upon returning a response, the traffic counter decrements by 1 to update the number of request connections corresponding to multiple levels; and traffic-related information is recorded.

[0086] In some embodiments, traffic control configuration data exists in the form of database tables. Accordingly, for each level, a separate configuration data table is maintained. Technical personnel can configure the configuration data upon which traffic control rules depend in the database tables according to actual needs, thereby updating the traffic control configuration data. Each configuration data table includes multiple fields. Each field includes multiple configuration data such as field name, field name, data type, whether it is nullable, and description. The field name is the English definition of the field, the field name is the Chinese definition of the field, and the description is a textual description to facilitate technical personnel's understanding and configuration of the field.

[0087] The following provides an example illustration of the configuration data tables corresponding to each level. As not shown in the following configuration data tables, each configuration data table also includes values ​​for each field, which technical personnel can configure according to actual needs.

[0088] Table 1 shows a configuration data table corresponding to a flow control, specifically a flow control switch table.

[0089] Table 1 Flow Control Switch Table

[0090] Field Name Data types Is it empty? illustrate main switch Type A(1) no 1 on 0 off Operation time Type A (20) no YYYYMMDD hh:mm:ss

[0091] The "Master Switch" field represents the switch for master flow control. Its value can be 1 or 0, where 1 indicates "on" (flow control is applied to received requests) and 0 indicates "off" (flow control is disabled). The "Operation Time" field refers to the last update time of this configuration data table, i.e., the time when the technical staff modified the table. Its value is in the format "YYYYMMDD hh:mm:ss", where "YYYY" represents the year, "MM" represents the month, "DD" represents the day, and "hh:mm:ss" represents the hour, minute, and second. For example, "20240201 10:20:30" represents February 1, 2024, at 10:20:30 AM. The "Data Type A(M)" field can be set according to actual needs, where M represents the maximum length of the string that this data type can store. For example, type A can be varchar2.

[0092] Table 2 shows a configuration data table corresponding to one channel type, specifically a channel type traffic control table. In practical applications, a corresponding data configuration table can be set for each channel type, and this application does not limit this.

[0093] Table 2 Flow Control Table by Channel Type

[0094] Field Name Data types Is it empty? illustrate Channel type name Type A (8) no For example, mini-programs Channel type flow control switch Type A(1) no 1 on 0 off threshold Type A (8) no Required value when flow control switch is set to 1 Operation time Type A (20) no YYYYMMDD hh:mm:ss

[0095] The "Channel Type Name" field indicates the channel type. Technical personnel can configure the value of this field according to actual needs, such as "Client Application," "Mini Program," or "Browser." The "Channel Type Flow Control Switch" field indicates the flow control switch for this channel type. The value of this field can be 1 or 0, where 1 indicates "On," meaning flow control is applied to requests belonging to this channel type, and 0 indicates "Off," meaning flow control is not applied to requests belonging to this channel type. The "Threshold" field represents the threshold for the number of request connections corresponding to this channel type, used to determine whether the number of request connections for this channel type exceeds the threshold during flow control. The meaning of "Operation Time" is shown in Table 1.

[0096] Table 3 shows a configuration data table corresponding to one request type, specifically a request type traffic control table. In practical applications, a corresponding data configuration table can be set for each request type; this application does not impose any limitations on this.

[0097] Table 3 Request Type Traffic Control Table

[0098] Field Name Data types Is it empty? illustrate Request type name Type A (45) no For example, URL Request type flow control switch Type A(1) no 1 on 0 off threshold Type A (8) no Required value when flow control switch is set to 1 Operation time Type A (20) no YYYYMMDD hh:mm:ss

[0099] The request type name indicates the request type and can be configured according to actual needs, such as a specific URL. The request type flow control switch has a value of 1 or 0, where 1 indicates on (flow control is applied to requests of that type) and 0 indicates off (flow control is not applied to requests of that type). The threshold is used to determine whether the number of request connections for that request type exceeds the threshold during flow control. See Table 1 for the meaning of the operation time.

[0100] Table 4 shows the configuration data table corresponding to the business, specifically the business module traffic control table.

[0101] Table 4 Flow Control Table for Business Modules

[0102] Field Name Data types Is it empty? illustrate Business module flow control switch Type A(1) no 1 on 0 off threshold Type A (8) no Required value when flow control switch is set to 1 Operation time Type A (20) no YYYYMMDD hh:mm:ss

[0103] Among them, the business module flow control switch represents the flow control switch corresponding to the business, with a value of 1 or 0. 1 indicates on, meaning that flow control is performed on requests that require initial processing by the application system, and 0 indicates off, meaning that flow control is not performed on requests that require initial processing by the application system. The threshold represents the threshold number of request connections corresponding to the business, used to determine whether the number of request connections exceeds the threshold during flow control. The meaning of operation time is shown in Table 1.

[0104] Table 5 shows the configuration data tables corresponding to the service types, specifically the service type traffic control table.

[0105] Table 5 Flow Control Table for Business Types

[0106] Field Name Data types Is it empty? illustrate Business type name Type A (45) no For example, business types such as repayment, disbursement, and settlement. Business type flow control switch Type A(1) no 1 on 0 off threshold Type A (8) no Required value when flow control switch is set to 1 Operation time Type A (20) no YYYYMMDD hh:mm:ss

[0107] The configuration table is structured as follows: **Business Type Name:** This field represents the business type. Technical personnel can configure the value of this field according to actual needs, such as "Repayment," "Disbursement," or "Settlement." **Business Type Flow Control Switch:** This field represents the flow control switch corresponding to this business type. The value can be 1 or 0, where 1 indicates "On," meaning flow control is applied to requests belonging to this business type, and 0 indicates "Off," meaning flow control is not applied to requests belonging to this business type. **Threshold:** This represents the threshold for the number of request connections corresponding to this business type, used to determine whether the number of request connections for this business type exceeds the threshold during flow control. **Operation Time:** This refers to the time of the most recent update of this configuration data table. In practical applications, a corresponding data configuration table can be set up for each business type.

[0108] In some embodiments, step S102 is specifically implemented by performing the operation in case (1) or the operation in case (2) below according to the flow control rules.

[0109] Case (1): When the switch corresponding to the overall traffic control is turned on, traffic control is performed based on the number of request connections and the switch status corresponding to the channel type, service, request type, and service type, respectively. Among them, the channel type is the channel type to which the received request belongs, the request type is the request type to which the received request belongs, and the service type is the service type to which the received request belongs.

[0110] Case (2): When the switch corresponding to the total flow control is closed, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a response to the requesting end; the response is the processing result response.

[0111] When the switch corresponding to the overall traffic control is turned on, it means that traffic control is required for the received requests. In this case, traffic control can be performed based on the number of request connections and the switch status corresponding to the channel type, business, request type, and business type, respectively. When the switch corresponding to the overall traffic control is turned off, it means that traffic control is not required for the received requests. In this case, the requests are directly passed to the backend for processing.

[0112] By selecting an appropriate strategy based on the switch status of the main flow controller, the system's flow control requirements can be better met.

[0113] In some embodiments, the flow control in case (1) based on the number of request connections and the switch status corresponding to the channel type, service, request type and service type respectively is specifically implemented as case (1-1), case (1-2), case (1-3) or case (1-4) below.

[0114] Case (1-1): When both the switch corresponding to the channel type of the request and the switch corresponding to the business are enabled, traffic control is performed based on the number of request connections corresponding to the channel type of the request and the number of request connections corresponding to the business.

[0115] If the switch corresponding to the channel type of the request is on, it means that traffic control is required for requests belonging to that channel type. If the switch corresponding to the channel type is off, it means that traffic control is not required for requests belonging to that channel type. If the switch corresponding to the business is on, it means that traffic control is required for requests that need to be initially processed by the application system. If the switch corresponding to the channel type is off, it means that traffic control is not required for requests that need to be initially processed by the application system.

[0116] With both the switch for the channel type of the request and the switch for the business enabled, traffic control can be further performed based on the number of request connections for the channel type of the request and the number of request connections for the business, thus enabling more precise traffic control.

[0117] In some embodiments, traffic control based on the number of request connections corresponding to the channel type to which the request belongs and the number of request connections corresponding to the service in case (1-1) is specifically implemented as case (1-1-1) or case (1-1-2) below.

[0118] Case (1-1-1): If the number of request connections corresponding to the channel type to which the request belongs reaches the corresponding threshold or the number of request connections corresponding to the business reaches the corresponding threshold, a response is returned to the requesting party; this response is a rejection response.

[0119] If the number of connection requests corresponding to the channel type of the request reaches the corresponding threshold, it indicates that there are a large number of pending requests belonging to that channel type, which is very likely exceeding the server's load or processing capacity limit. Similarly, if the number of connection requests corresponding to the business function reaches the corresponding threshold, it indicates that there are a large number of pending requests, which is very likely exceeding the server's load or processing capacity limit. Therefore, the request can be left unprocessed, and a rejection response can be directly returned to the requesting party.

[0120] Case (1-1-2): If the number of request connections corresponding to the channel type to which the request belongs has not reached the corresponding threshold and the number of request connections corresponding to the business has not reached the corresponding threshold, a request is sent to the corresponding application server so that the application server can process the request through the server and return a response to the requesting party; this response is the processing result response.

[0121] If the number of request connections corresponding to the channel type to which the request belongs has not reached the corresponding threshold and the number of request connections corresponding to the business has not reached the corresponding threshold, it means that the number of pending requests belonging to that channel type is small and the number of pending requests is small. Accordingly, the server has the ability to continue processing requests. Therefore, in this case, the request can be directly passed to the backend for processing.

[0122] On the one hand, by returning a rejection response to the requesting end when the number of request connections corresponding to the channel type or the business reaches a certain threshold, overload or overload situations can be avoided. This helps protect the system from excessive requests and ensures system stability and reliability. On the other hand, when neither the number of request connections corresponding to the channel type nor the business reaches the corresponding threshold, the request is passed on to the backend for processing. This approach helps to effectively utilize system resources, avoid resource waste, and ensure that requests are processed and responded to in a timely manner. In summary, this request connection management and processing strategy helps optimize system performance, improve system throughput and response speed, while effectively preventing the risk of system overload and crashes.

[0123] Case (1-2): When the switch corresponding to the channel type to which the request belongs is not turned on but the switch corresponding to the business is turned on, traffic control is performed based on the number of request connections corresponding to the request type to which the request belongs, the switch status, and the number of request connections corresponding to the business.

[0124] In some embodiments, the flow control in case (1-2) based on the number of request connections corresponding to the request type to which the request belongs, the switch status, and the number of request connections corresponding to the service is specifically implemented as case (1-2-1) or case (1-2-2) below.

[0125] Case (1-2-1): When the switch corresponding to the request type to which the request belongs is turned on, traffic control is performed based on the number of request connections corresponding to the request type to which the request belongs and the number of request connections corresponding to the business.

[0126] If the switch corresponding to the request type is enabled, it indicates that traffic control is required for requests belonging to that type. In this case, further traffic control can be implemented based on the number of request connections corresponding to that request type and the number of request connections corresponding to the business logic. This strategy allows for targeted traffic management based on the characteristics and needs of different request types, ensuring the rational allocation and utilization of system resources.

[0127] For example, traffic control based on the number of request connections corresponding to the request type and the number of request connections corresponding to the business is specifically implemented as follows: if the number of request connections corresponding to the request type reaches the corresponding threshold or the number of request connections corresponding to the business reaches the corresponding threshold, a rejection response is returned to the requesting end; if the number of request connections corresponding to the request type does not reach the corresponding threshold and the number of request connections corresponding to the business does not reach the corresponding threshold, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a processing result response to the requesting end.

[0128] If the number of connection requests corresponding to a request type reaches the corresponding threshold, it indicates that there are a large number of pending requests of that type, which is very likely exceeding the server's load or processing capacity limit. Therefore, if the number of connection requests for that request type or the business logic reaches the corresponding threshold, the request can be ignored, and a rejection response can be returned directly to the requesting server. Conversely, if the number of connection requests for both the request type and the business logic does not reach the corresponding threshold, it indicates that there are relatively few pending requests of that type, and the server has the capacity to continue processing requests. In this case, the request can be directly passed on to the next server for processing.

[0129] Case (1-2-2): If the switch corresponding to the request type to which the request belongs is not turned on, traffic control is performed based on the number of request connections corresponding to the business.

[0130] If the switch corresponding to the request type is off, it means that there is no need to perform traffic control on requests of that type at present. In this case, traffic control can be performed directly based on the number of request connections corresponding to the business logic. This approach simplifies the traffic control logic while still effectively managing traffic and ensuring system stability and performance.

[0131] For example, traffic control based on the number of request connections corresponding to a business is specifically implemented as follows: when the number of request connections corresponding to a business reaches a corresponding threshold, a rejection response is returned to the requesting end; when the number of request connections corresponding to a business does not reach the corresponding threshold, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a processing result response to the requesting end.

[0132] Cases (1-3): When the switch corresponding to the channel type to which the request belongs is turned on and the switch corresponding to the business is not turned on, traffic control is performed based on the number of request connections corresponding to the channel type to which the request belongs, the number of request connections corresponding to the business type to which the request belongs, and the switch status.

[0133] In some embodiments, traffic control based on the number of request connections corresponding to the channel type to which the request belongs, the number of request connections corresponding to the service type to which the request belongs, and the switch status is specifically implemented as follows (1-3-1) or (1-3-2).

[0134] Case (1-3-1): When the switch corresponding to the business type to which the request belongs is turned on, traffic control is performed based on the number of request connections corresponding to the business type to which the request belongs and the number of request connections corresponding to the channel type to which the request belongs.

[0135] If the switch corresponding to the business type of the request is enabled, it means that traffic control is required for requests belonging to that business type. In this case, further traffic control can be implemented based on the number of request connections corresponding to that business type and the number of request connections corresponding to the channel type to which the request belongs. This strategy allows for targeted traffic management based on the characteristics and needs of different request types, ensuring the rational allocation and utilization of system resources.

[0136] For example, traffic control based on the number of request connections corresponding to the business type and the number of request connections corresponding to the channel type to which the request belongs is specifically implemented as follows: if the number of request connections corresponding to the business type reaches the corresponding threshold or the number of request connections corresponding to the channel type to which the request belongs reaches the corresponding threshold, a rejection response is returned to the requesting end; if the number of request connections corresponding to the business type does not reach the corresponding threshold and the number of request connections corresponding to the channel type to which the request belongs does not reach the corresponding threshold, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a processing result response to the requesting end.

[0137] If the number of connection requests corresponding to the business type of a request reaches the corresponding threshold, it indicates that there are a large number of pending requests for that business type, which is very likely exceeding the server's load or processing capacity limit. Therefore, if the number of connection requests for that business type or the channel type reaches the corresponding threshold, the request can be ignored, and a rejection response can be returned directly to the requesting party. Conversely, if the number of connection requests for both the business type and the channel type does not reach the corresponding threshold, it indicates that there are a small number of pending requests for that business type and the channel type. Consequently, the server has the capacity to continue processing requests, and in this case, the request can be directly passed on for processing.

[0138] Case (1-3-2): If the switch corresponding to the business type to which the request belongs is not turned on, traffic control is performed based on the number of request connections corresponding to the channel type to which the request belongs.

[0139] If the switch corresponding to the business type of the request is off, it means that there is no need to perform traffic control on requests belonging to that business type. In this case, traffic control can be performed directly based on the number of request connections corresponding to the channel type to which the request belongs. This approach simplifies the traffic control logic while still effectively managing traffic and ensuring system stability and performance.

[0140] For example, traffic control based on the number of request connections corresponding to the channel type to which the request belongs is specifically implemented as follows: if the number of request connections corresponding to the channel type to which the request belongs reaches the corresponding threshold, a rejection response is returned to the requesting end; if the number of request connections corresponding to the channel type to which the request belongs does not reach the corresponding threshold, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a processing result response to the requesting end.

[0141] Cases (1-4): When neither the switch corresponding to the channel type nor the switch corresponding to the business is turned on, traffic control is performed based on the number of request connections and switch status corresponding to the request type and the number of request connections and switch status corresponding to the business type.

[0142] Traffic control is implemented based on the number of request connections and on / off status corresponding to channel type, business, request type, and business type, respectively. Appropriate strategies are selected from multiple levels to conduct targeted traffic management, ensuring the rational allocation and utilization of system resources.

[0143] In some embodiments, the flow control in case (1-4) based on the number of request connections and switch status corresponding to the request type to which the request belongs, and the number of request connections and switch status corresponding to the service type to which the request belongs, is specifically implemented as case (1-4-1), case (1-4-2), case (1-4-3), or case (1-4-4).

[0144] Case (1-4-1): When both the switch corresponding to the request type and the switch corresponding to the service type are enabled, traffic control is performed based on the number of request connections corresponding to the request type and the number of request connections corresponding to the service type.

[0145] For example, traffic control based on the number of request connections corresponding to the request type and the number of request connections corresponding to the business type is specifically implemented as follows: if the number of request connections corresponding to the request type reaches a corresponding threshold or the number of request connections corresponding to the business type reaches a corresponding threshold, a rejection response is returned to the requesting end; if the number of request connections corresponding to the request type does not reach the corresponding threshold and the number of request connections corresponding to the business type does not reach the corresponding threshold, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a processing result response to the requesting end.

[0146] Case (1-4-2): When the switch corresponding to the request type is not turned on but the switch corresponding to the service type is turned on, traffic control is performed based on the number of request connections corresponding to the service type.

[0147] For example, traffic control based on the number of request connections corresponding to the business type of the request is specifically implemented as follows: if the number of request connections corresponding to the business type of the request reaches the corresponding threshold, a rejection response is returned to the requesting end; if the number of request connections corresponding to the business type of the request does not reach the corresponding threshold, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a processing result response to the requesting end.

[0148] Case (1-4-3): When the switch corresponding to the request type is turned on and the switch corresponding to the service type is turned off, traffic control is performed based on the number of request connections corresponding to the request type.

[0149] For example, traffic control based on the number of request connections corresponding to the request type is specifically implemented as follows: if the number of request connections corresponding to the request type reaches the corresponding threshold, a rejection response is returned to the requesting end; if the number of request connections corresponding to the request type does not reach the corresponding threshold, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a processing result response to the requesting end.

[0150] Case (1-4-4): When neither the switch corresponding to the request type nor the switch corresponding to the business type of the request is turned on, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a response to the requesting party; this response is the processing result response.

[0151] By selecting appropriate strategies based on the number of request connections and on / off status corresponding to the request type and the request business type, the system's traffic control needs can be better met.

[0152] Based on the above embodiments, see, for example, the following: Figure 5 It illustrates a flow control rule, which is shown below.

[0153] 1) When the main switch is in the 0 (off state), the flow control function is turned off.

[0154] 2) When the main switch is in position 1 (on), the flow control function is enabled, and it is further determined whether the channel type flow control switch is in position 1 (on) and whether the business module flow control switch is in position 1 (on).

[0155] 3) If the channel type flow control switch is in 1 (on state), then determine whether the number of request connections corresponding to the channel type to which the request belongs exceeds the threshold. If it exceeds the threshold, then return a connection rejection message. The connection rejection message is returned in the form of a rejection response.

[0156] 4) If the channel type flow control switch is 0 (off state), then further determine whether the request type flow control switch to which the request belongs is 1 (on state).

[0157] 5) If the flow control switch for the request type is in 1 (on state), then determine whether the number of connection requests corresponding to that request type exceeds the threshold. If it exceeds the threshold, then return a connection rejection message.

[0158] 6) If the flow control switch for the request type is in the 0 (off state), no flow control will be performed.

[0159] 7) If the flow control switch of the business module is in 1 (on state), then determine whether the number of request connections corresponding to the business exceeds the threshold. If it exceeds the threshold, then return a connection rejection message.

[0160] 8) If the flow control switch of the business module is in the 0 (off state), then further determine whether the flow control switch of the business type to which the request belongs is in the 1 (on state).

[0161] 9) If the flow control switch for this service type is in 1 (on state), then determine whether the number of request connections corresponding to this service type exceeds the threshold. If it exceeds the threshold, then return a connection rejection message.

[0162] 10) If the flow control switch for this service type is in the 0 (off state), no flow control will be performed.

[0163] The above embodiment is illustrated by setting up a flow control server between the requesting system and the application system. In other embodiments, a flow control server can also be set up between the application system and the server system. In this case, the server system can be regarded as the requesting system, and the response sent by any server in the server system can be regarded as a request to the flow control server. Thus, the flow control server performs flow control on the request. The implementation principle is the same as setting up a flow control server between the requesting system and the application system, and will not be described again here.

[0164] Figure 6 This is a schematic diagram of the structure of a flow control device provided in an embodiment of this application, as shown below. Figure 6 As shown, in this embodiment, the flow control device 200 can be integrated into the flow control server. The flow control device 200 includes:

[0165] The update module 201 is used to update the number of request connections corresponding to multiple levels when a request is received from the requesting end; the multiple levels include channel type, business, request type and business type;

[0166] Control module 202 is used to perform flow control based on the number of request connections and flow control rules corresponding to multiple levels; the flow control rules are generated based on flow control configuration data in the database.

[0167] The update module 201 is also used to update the number of request connections corresponding to each level when returning a response to the requesting end.

[0168] In some embodiments, the control module 202 includes:

[0169] The first control unit is used to perform traffic control based on the number of request connections and the switch status corresponding to the channel type, service, request type and service type, respectively, when the switch corresponding to the total traffic control is turned on.

[0170] The second control unit is used to send a request to the corresponding application server when the switch corresponding to the overall flow control is closed, so that the application server processes the request through the server and returns a response to the requesting end; the response is the processing result response.

[0171] In some embodiments, the first control unit is configured to:

[0172] When both the switch corresponding to the channel type of the request and the switch corresponding to the business are turned on, traffic control is performed based on the number of request connections corresponding to the channel type of the request and the number of request connections corresponding to the business.

[0173] If the switch corresponding to the channel type to which the request belongs is not turned on but the switch corresponding to the business is turned on, traffic control is performed based on the number of request connections corresponding to the request type to which the request belongs, the switch status, and the number of request connections corresponding to the business.

[0174] If the switch corresponding to the channel type of the request is turned on but the switch corresponding to the business is turned off, traffic control is performed based on the number of request connections corresponding to the channel type of the request, the number of request connections corresponding to the business type of the request, and the switch status.

[0175] If neither the switch corresponding to the channel type of the request nor the switch corresponding to the business is turned on, traffic control is performed based on the number of request connections and switch status corresponding to the request type and the number of request connections and switch status corresponding to the business type of the request.

[0176] In some embodiments, the first control unit is configured to:

[0177] If the number of request connections corresponding to the channel type to which the request belongs reaches the corresponding threshold or the number of request connections corresponding to the business reaches the corresponding threshold, a response is returned to the requesting party; the response is a rejection response.

[0178] If the number of request connections corresponding to the channel type to which the request belongs does not reach the corresponding threshold and the number of request connections corresponding to the business does not reach the corresponding threshold, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a response to the requesting party; the response is the processing result response.

[0179] In some embodiments, the first control unit is configured to:

[0180] When both the switch corresponding to the request type and the switch corresponding to the business type of the request are enabled, traffic control is performed based on the number of request connections corresponding to the request type and the number of request connections corresponding to the business type of the request.

[0181] If the switch corresponding to the request type is not turned on but the switch corresponding to the business type is turned on, traffic control is performed based on the number of request connections corresponding to the business type.

[0182] If the switch corresponding to the request type is turned on but the switch corresponding to the business type is turned off, traffic control is performed based on the number of request connections corresponding to the request type.

[0183] If neither the switch corresponding to the request type nor the switch corresponding to the business type of the request is turned on, a request is sent to the corresponding application server so that the application server processes the request through the server and returns a response to the requesting party; the response is the processing result response.

[0184] In some embodiments, it also includes:

[0185] The recording module is used to record traffic-related information, including time information, processing information, request information, and the current number of request connections.

[0186] In some embodiments, it also includes:

[0187] The read module is used to initialize and read traffic control configuration data from the database in response to the startup of the traffic control server, and generate traffic control rules based on the traffic control configuration data;

[0188] This reading module is also used to periodically read traffic control configuration data from the database during the operation of the traffic control server, and update the traffic control rules based on the traffic control configuration data.

[0189] The flow control device provided in this embodiment can execute the technical solution of the corresponding method embodiment. Its implementation principle and technical effect are similar to those of the corresponding method embodiment, and will not be described again here.

[0190] This application also provides a server. Figure 7 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Figure 7 As shown, server 300 includes: processor 301 and memory 302 communicatively connected to processor 301.

[0191] The memory 302 stores computer-executable instructions; the processor 301 executes the computer-executable instructions stored in the memory 302 to implement the flow control method provided in this application.

[0192] In this embodiment, the memory 302 and the processor 301 are connected via a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be categorized as an address bus, a data bus, a control bus, etc.

[0193] The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein. The various components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required.

[0194] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores computer-executable instructions that, when executed by a processor, are used to implement the flow control method provided in this application.

[0195] In an exemplary embodiment, a computer program product is also provided, including computer execution instructions, which, when executed by a processor, are used to implement the flow control method provided in this application.

[0196] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0197] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0198] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.

[0199] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.

[0200] When an integrated unit / module is implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic component. Unless otherwise specified, memory can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as USB flash drives, random-access memory (RAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), enhanced dynamic random-access memory (EDRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), high-bandwidth memory (HBM), or hybrid memory cube (HMC) and other media capable of storing program code.

[0201] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a server to execute all or part of the steps of the methods of the various embodiments of this application.

[0202] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0203] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.

[0204] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A flow control method, characterized in that, The method is applied to a traffic control server, and the method includes: When a request is received from the requesting end, the number of request connections corresponding to multiple levels is updated; the multiple levels include channel type, service, request type and service type. Traffic control is performed based on the number of request connections and traffic control rules corresponding to the multiple levels; the traffic control rules are generated based on traffic control configuration data in the database. When a response is returned to the requesting end, the number of request connections corresponding to each of the levels is updated. The flow control based on the number of request connections and flow control rules corresponding to the multiple levels includes: According to the flow control rules, perform the following operations: When the switch corresponding to the overall traffic control is turned on, traffic control is performed based on the number of request connections and the switch status corresponding to the channel type, business, request type, and business type, respectively. When the switch corresponding to the overall traffic control is turned off, the request is sent to the corresponding application server, so that the application server processes the request through the server and returns a response to the requesting party; the response is a processing result response. The traffic control based on the number of request connections and on / off status corresponding to the channel type, service, request type, and service type respectively includes: When both the switch corresponding to the channel type to which the request belongs and the switch corresponding to the service are turned on, traffic control is performed based on the number of request connections corresponding to the channel type to which the request belongs and the number of request connections corresponding to the service. If the switch corresponding to the channel type to which the request belongs is not turned on but the switch corresponding to the service is turned on, traffic control is performed based on the number of request connections corresponding to the request type to which the request belongs, the switch status, and the number of request connections corresponding to the service. When the switch corresponding to the channel type to which the request belongs is turned on and the switch corresponding to the service is turned off, traffic control is performed based on the number of request connections corresponding to the channel type to which the request belongs, the number of request connections corresponding to the service type to which the request belongs, and the switch status. If neither the switch corresponding to the channel type to which the request belongs nor the switch corresponding to the service is turned on, traffic control is performed based on the number of request connections and switch status corresponding to the request type to which the request belongs, and the number of request connections and switch status corresponding to the service type to which the request belongs.

2. The method according to claim 1, characterized in that, The traffic control based on the number of request connections corresponding to the channel type to which the request belongs and the number of request connections corresponding to the service includes: If the number of request connections corresponding to the channel type to which the request belongs reaches the corresponding threshold or the number of request connections corresponding to the service reaches the corresponding threshold, a response is returned to the requesting end; the response is a rejection response. If the number of request connections corresponding to the channel type to which the request belongs does not reach the corresponding threshold and the number of request connections corresponding to the business does not reach the corresponding threshold, the request is sent to the corresponding application server so that the application server processes the request through the server and returns a response to the requesting party; the response is a processing result response.

3. The method according to claim 1, characterized in that, The flow control based on the number of request connections and on / off status corresponding to the request type and the service type to which the request belongs includes: When both the switch corresponding to the request type and the switch corresponding to the service type of the request are turned on, traffic control is performed based on the number of request connections corresponding to the request type and the number of request connections corresponding to the service type of the request. If the switch corresponding to the request type to which the request belongs is not turned on and the switch corresponding to the service type to which the request belongs is turned on, traffic control is performed based on the number of request connections corresponding to the service type to which the request belongs. If the switch corresponding to the request type to which the request belongs is turned on and the switch corresponding to the service type to which the request belongs is not turned on, traffic control is performed based on the number of request connections corresponding to the request type to which the request belongs. If neither the switch corresponding to the request type nor the switch corresponding to the service type to which the request belongs is turned on, the request is sent to the corresponding application server so that the application server processes the request through the server and returns a response to the requesting party; the response is a processing result response.

4. The method according to any one of claims 1-3, characterized in that, When returning a response to the requesting client, after updating the number of request connections corresponding to each of the aforementioned levels, the method further includes: Record traffic-related information; the traffic-related information includes time information, processing information, request information, and the current number of request connections.

5. The method according to any one of claims 1-3, characterized in that, The method further includes: In response to the startup of the traffic control server, the system initializes and reads traffic control configuration data from the database, and generates traffic control rules based on the traffic control configuration data. During the operation of the traffic control server, traffic control configuration data is read from the database periodically, and the traffic control rules are updated according to the traffic control configuration data.

6. A flow control device, characterized in that, The device is integrated into a flow control server, and the device includes: The update module is used to update the number of request connections corresponding to multiple levels when a request is received from the requesting end; the multiple levels include channel type, business, request type and business type; The control module is used to perform traffic control based on the number of request connections and traffic control rules corresponding to the multiple levels respectively; the traffic control rules are generated based on traffic control configuration data in the database. The update module is also used to update the number of request connections corresponding to each level when returning a response to the requesting end; The control module includes: The first control unit is used to perform traffic control based on the number of request connections and the switch status corresponding to the channel type, service, request type and service type, respectively, when the switch corresponding to the total traffic control is turned on. The second control unit is configured to send the request to the corresponding application server when the switch corresponding to the overall flow control is closed, so that the application server processes the request through the server and returns a response to the requesting end; the response is a processing result response. The first control unit is used for: When both the switch corresponding to the channel type to which the request belongs and the switch corresponding to the service are turned on, traffic control is performed based on the number of request connections corresponding to the channel type to which the request belongs and the number of request connections corresponding to the service. If the switch corresponding to the channel type to which the request belongs is not turned on but the switch corresponding to the service is turned on, traffic control is performed based on the number of request connections corresponding to the request type to which the request belongs, the switch status, and the number of request connections corresponding to the service. When the switch corresponding to the channel type to which the request belongs is turned on and the switch corresponding to the service is turned off, traffic control is performed based on the number of request connections corresponding to the channel type to which the request belongs, the number of request connections corresponding to the service type to which the request belongs, and the switch status. If neither the switch corresponding to the channel type to which the request belongs nor the switch corresponding to the service is turned on, traffic control is performed based on the number of request connections and switch status corresponding to the request type to which the request belongs, and the number of request connections and switch status corresponding to the service type to which the request belongs.

7. A server, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the flow control method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the flow control method as described in any one of claims 1-5.

9. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the flow control method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Service access control method and device, control equipment and storage medium

    CN114157482A

  • Flow control method and device of distributed system, equipment, medium and product

    CN116319810A