A method, device and equipment for determining flow control data

Determining the concurrency number of the application system through configuration files and filter chains solves the problem of difficulty in determining the concurrency number quickly and accurately in the prior art, and achieves the effect of improving the system operation efficiency.

CN114661554BActive Publication Date: 2025-02-11CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210323798.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-02-11
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

In high concurrency, cluster deployment application systems, it is difficult for the prior art to quickly and accurately determine the concurrency number of the system, resulting in the possibility of missing the golden time to solve the problem and reducing the system operation efficiency.

Method used

Through the configuration file and filter chain, service requests are received and their flow control indicators are determined. The filter chain corresponding to the service request is determined based on the correspondence between the flow control indicators and counters, and whether to perform business processing is performed, and target flow control data is obtained.

Benefits of technology

It realizes the rapid and accurate determination of the system's flow control data, avoiding missing the golden time to solve problems, and improving the system operation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661554B_ABST
    Figure CN114661554B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a method, device and equipment for determining flow control data, which relates to the technical field of big data analysis. The method includes: receiving a business request and determining the flow control index of the business request; determining the filter chain corresponding to the business request based on the correspondence between the flow control index and the counter; determining whether to perform business processing based on the filter chain corresponding to the business request; in the case of determining to perform business processing, obtaining the target flow control data corresponding to the business request; the target flow control data includes the flow control data of each filter in the filter chain, and the flow control data includes the current data recorded by the counter corresponding to the filter. The embodiments of this specification can be used to quickly and accurately determine the flow control data of the system, thereby effectively avoiding missing the golden time to solve the problem and improving the system operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of big data analysis, and in particular to a method, device and equipment for determining flow control data. Background Art

[0002] In the operation of high-concurrency, cluster-deployed application systems, a large number of concurrent systems often makes it easy for small problems to have a big impact. For example, if an application system program has a problem, runs slowly, and causes blockage, this will not only lead to low efficiency of the entire system, but may even cause the system to crash. Therefore, how to determine the number of concurrent applications is becoming increasingly important.

[0003] In the prior art, the number of concurrent users of an application system is determined mainly by system operators checking each machine one by one. However, since large-scale application systems deployed in clusters often include dozens or even hundreds of machines, if system operators check each machine one by one, they will often miss the golden time for problem solving, thereby reducing system operation efficiency and affecting the business operation of the entire application system.

[0004] Therefore, the industry is in urgent need of a technical solution that can solve the above technical problems. Summary of the invention

[0005] The embodiments of this specification provide a method, apparatus, and device for determining flow control data, which can quickly and accurately determine the flow control data of the system.

[0006] The method, device and equipment for determining flow control data provided in this specification are implemented in the following manner.

[0007] A method for determining flow control data is applied to a target system, wherein the target system includes a configuration file and a filter chain, wherein the configuration file includes a correspondence between flow control indicators and counters, each counter corresponds to a filter, and the filter chain includes at least a global filter. The method includes: receiving a business request and determining the flow control indicator of the business request; determining the filter chain corresponding to the business request based on the correspondence between the flow control indicator and the counter; determining whether to perform business processing based on the filter chain corresponding to the business request; and obtaining target flow control data corresponding to the business request when it is determined that business processing is to be performed; the target flow control data includes the flow control data of each filter in the filter chain, and the flow control data includes the current data recorded by the counter corresponding to the filter.

[0008] A device for determining flow control data, comprising: a configuration file and a filter chain, wherein the configuration file includes a correspondence between flow control indicators and counters, each counter corresponds to a filter, and the filter chain includes at least a global filter. The device comprises: a receiving module, used to receive a business request and determine the flow control indicator of the business request; a first determining module, used to determine the filter chain corresponding to the business request according to the correspondence between the flow control indicator and the counter; a second determining module, used to determine whether to perform business processing based on the filter chain corresponding to the business request; an acquiring module, used to acquire target flow control data corresponding to the business request when determining to perform business processing; the target flow control data includes the flow control data of each filter in the filter chain, and the flow control data includes the current data recorded by the counter corresponding to the filter.

[0009] A device for determining flow control data includes at least one processor and a memory storing computer executable instructions, wherein when the processor executes the instructions, the steps of any method embodiment in the embodiments of this specification are implemented.

[0010] A computer-readable storage medium stores computer instructions, which, when executed, implement the steps of any method embodiment in the embodiments of this specification.

[0011] A computer program product includes a computer program, and when the computer program is executed by a processor, the steps of any method embodiment in the embodiments of this specification are implemented.

[0012] This specification provides a method, device and equipment for determining flow control data. In some embodiments, a business request can be received, and the flow control index of the business request can be determined. According to the correspondence between the flow control index and the counter, the filter chain corresponding to the business request can be determined; it can also be determined whether to perform business processing based on the filter chain corresponding to the business request. When it is determined to perform business processing, the target flow control data corresponding to the business request can be obtained, wherein the target flow control data includes the flow control data of each filter in the filter chain, and the flow control data includes the current data recorded by the counter corresponding to the filter. By using the embodiments of this specification, the flow control data of the system can be determined quickly and accurately, thereby effectively avoiding missing the golden time to solve the problem and improving the system operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The drawings described herein are used to provide a further understanding of this specification, constitute a part of this specification, and do not constitute a limitation of this specification. In the drawings:

[0014] Figure 1 is a flowchart of an embodiment of a method for determining flow control data provided in this specification;

[0015] Figure 2 is a flowchart of an embodiment of a method for determining flow control data provided in this specification;

[0016] Figure 3 This is a schematic diagram of the Java virtual machine operating memory provided in this specification;

[0017] Figure 4 It is a flowchart provided in this specification for calling a filter to determine whether to perform business processing when receiving a business request;

[0018] Figure 5 It is a flow chart of the business request provided in this specification being submitted to the filter for processing;

[0019] Figure 6 It is a schematic diagram of the module structure of an embodiment of a device for determining flow control data provided in this specification;

[0020] Figure 7 This is a hardware structure block diagram of an embodiment of a server for determining flow control data provided in this specification. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments in this specification, not all of the embodiments. Based on one or more embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the embodiments of this specification.

[0022] An implementation scheme provided in this specification can be applied to a target system. The target system can be a cluster system, etc. The cluster system can be a group of independent computers interconnected by a high-speed network, which form a group and are managed in a single system mode. When a client interacts with the cluster system, the cluster system can be regarded as an independent server. Cluster configuration can improve availability and scalability.

[0023] In an embodiment of the present specification, the target system may include a configuration file and a filter chain. The configuration file may include a correspondence between flow control indicators and counters, each counter corresponds to a filter, and the filter chain may include at least a global filter. Among them, the counter corresponding to the global filter can be used to record the concurrency of the entire target system. The counters corresponding to other filters can be used to record the concurrency of the corresponding flow control indicator scenario.

[0024] In some implementation scenarios, the flow control indicator may include at least one of the following: transaction identification; front-end system identification; institution identification; a combination of transaction identification, front-end system identification and institution identification; back-end system identification; customer identification; a combination of customer identification and transaction identification; deployment unit identification; a combination of transaction identification and preset field content.

[0025] In some implementation scenarios, the correspondence between the flow control indicator and the counter may include many-to-one or one-to-one.

[0026] In some implementation scenarios, a configuration file may be created in advance in the target system, and then the corresponding relationship between the flow control indicator and the counter may be configured through the configuration file.

[0027] Specifically, for example, in some implementation scenarios, for business transactions, you can first configure a transaction group counter through a configuration file, and set the counting threshold (also called the maximum flow control number) of the transaction group counter to 100, and then configure the transaction identifier of a certain business transaction to point to the transaction group counter, thereby establishing a correspondence between the transaction identifier and the counter. Among them, the correspondence between the transaction identifier and the transaction group counter can be n:1, n≥1, that is, multiple transactions can point to the same transaction group counter. Business can also be called business transaction, which means a program to implement a specific business. Each business transaction corresponds to a transaction identifier. The transaction identifier can also be called a transaction code, which can be composed of one or more of numbers, letters, characters, etc.

[0028] For the front-end system (or back-end system), since each front-end system (or back-end system) has a corresponding front-end system identifier (or back-end system identifier), and the number of front-end systems (or back-end systems) is usually limited, the flow control number changes in the scenario is relatively small, so the correspondence between the front-end system identifier and the counter (or the correspondence between the back-end system identifier and the counter) and the maximum flow control number of the counter can be directly configured in the configuration file. Among them, the correspondence between the front-end system identifier and the counter (or the correspondence between the back-end system identifier and the counter) can be 1:1. The front-end system can be understood as a system that needs to access the target system. The front-end system can achieve system interaction by calling the business transaction of the target system. The back-end system can be understood as a third-party system that the target system needs to access. The target system can achieve system interaction by calling the business transaction of the back-end system. Setting flow control based on the front-end system dimension can limit the flow of the front-end system accessing the target system, thereby ensuring the stability of the target system resources and normal operation. Setting flow control based on the back-end system dimension can flexibly control the flow sent to the back-end system due to the different concurrent processing capabilities of the back-end system.

[0029] For an organization, you can first configure an organization group counter through the configuration file, and set the counting threshold of the organization group counter (also called the maximum flow control number) to 100. Then you can configure the organization ID of an organization to point to the organization group counter, thereby establishing a correspondence between the organization ID and the counter. Among them, the correspondence between the organization ID and the organization group counter can be n:1, n≥1, that is, multiple organizations can point to the same organization group counter. Among them, the target system can set up different organizations according to different regions or specific businesses. Setting flow control based on the organization dimension can provide greater resource support for organizations with relatively large business transaction volumes.

[0030] For business transactions + front-end systems + institutions, you can first configure a group counter through the configuration file, and set the counting threshold of the group counter (also known as the maximum flow control number) to 100, and then configure the combination of transaction identification, front-end system identification and institution identification (such as transaction identification | front-end system identification | institution identification) to point to the group counter, thereby establishing a correspondence between the combination of transaction identification, front-end system identification and institution identification and the counter. Among them, the correspondence between the combination of transaction identification, front-end system identification and institution identification and the group counter can be n:1, n≥1, that is, multiple combinations of transaction identification, front-end system identification and institution identification can point to the same group counter. Among them, setting flow control in the dimensions of business transactions + front-end systems + institutions can focus on increasing the flow control quota for key institutions when resources are limited, and achieve the optimal solution for resource utilization.

[0031] In addition, for customers, customers + business transactions, deployment units, business transactions + preset field content, the process of establishing corresponding relationships with counters is similar to the establishment process of the above-mentioned business transactions, business transactions + front-end systems + institutions, and can be referenced to each other, so no further description is given. Among them, customers represent users who use the target system, each customer has a unique customer identifier, and each customer has two associated attributes: a front-end system identifier belonging to different front-end systems, and an institution identifier belonging to different institutions. Deployment units represent clusters that handle a certain type of business, and deployment units may include multiple machines. A deployment unit corresponds to a deployment unit identifier. The preset field content may represent a field in a transaction request message, transmitting specific business information. In some implementation scenarios, transaction requests transmit business data in the form of XML messages. The preset field content may be set according to the actual scenario, and this specification does not limit this. Setting flow control in the customer dimension can achieve the tilt of system resources for specific important customers. Setting flow control in the customer + business transaction dimension can achieve the tilt of system resources for specific important customers for some important transaction resources or transactions with fierce competition. By setting flow control based on the deployment unit dimension, you can set a lower flow control value for deployment units with fewer resources when the system resources of different business deployment units are inconsistent. By setting flow control based on the business transaction + preset field content dimension, you can flexibly implement flow control quota control.

[0032] It should be noted that in the filter chain, the filter corresponding to the counter corresponding to the combined flow control indicator can be prioritized. In some implementation scenarios, when the combined flow control indicator is identified in the business request, the filter corresponding to the counter corresponding to the combined flow control indicator can be directly used for judgment without subsequent filter judgment.

[0033] Of course, the above is only an exemplary explanation. The flow control indicators and the way of configuring the relationship between the flow control indicators and the counters are not limited to the above examples. Technical personnel in the relevant field may make other changes inspired by the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they should be covered within the scope of protection of this application.

[0034] The following is an example of a specific application scenario to illustrate the implementation plan of this specification. Specifically, Figure 1 It is a flowchart of an embodiment of a method for determining flow control data provided in this specification. Although this specification provides method operation steps or device structures as shown in the following embodiments or drawings, the method or device may include more or fewer operation steps or module units after partial combination based on routine or no creative labor.

[0035] It should be noted that the following embodiment description does not limit the technical solutions in other application scenarios that can be extended based on this specification. Figure 1 As shown, in an embodiment of a method for determining flow control data provided by this specification, the method may include the following steps.

[0036] S10: receiving a service request and determining a flow control indicator of the service request.

[0037] The business request may be a request for accessing a resource file of a target system, etc. The business request may also be referred to as a business transaction request or a transaction request.

[0038] In some embodiments, the service request may be sent by a client, a third-party organization or system, etc. that interacts with the target system.

[0039] In some embodiments, after receiving a business request, the target system can identify the flow control indicator corresponding to the business request. Specifically, for example, in some implementation scenarios, after receiving a business request, the target system can determine the flow control indicator corresponding to the business request according to the information carried in the business request. In other implementation scenarios, after receiving a business request, the target system can obtain the corresponding business information from the local storage or remote storage according to the business request, and then determine the flow control indicator corresponding to the business request according to the business information. Among them, the local storage can be the memory of the target system, etc. The remote storage can be a third-party system that communicates with the target system, etc. The business information corresponding to each business can be pre-stored locally or remotely, such as the business operation process, the information used in the business operation process, etc. Of course, the above is only an exemplary description, and the method of determining the flow control indicator corresponding to the business request is not limited to the above example. The technical personnel in the relevant field may make other changes under the inspiration of the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they should be covered within the scope of protection of this application.

[0040] In some implementation scenarios, the flow control indicator may include at least one of the following: transaction identification; front-end system identification; institution identification; a combination of transaction identification, front-end system identification and institution identification; back-end system identification; customer identification; a combination of customer identification and transaction identification; deployment unit identification; a combination of transaction identification and preset field content.

[0041] S12: Determine a filter chain corresponding to the service request according to the corresponding relationship between the flow control indicator and the counter.

[0042] In an embodiment of the present specification, after determining the flow control index corresponding to the business request, the filter chain corresponding to the business request can be determined according to the correspondence between the flow control index and the counter in the configuration file. Among them, the filter chain corresponding to the business request includes at least a global filter. In the configuration file, the correspondence between the flow control index and the counter can include many-to-one or one-to-one. Each filter (Filter) corresponds to a filtering rule. According to the filtering rule, it can be determined whether the business request can pass the filter. The filtering rules of each filter can be the same or different.

[0043] In some embodiments, after determining the flow control indicator corresponding to the service request, the flow control indicator corresponding to the service request can be used to match in the configuration file, thereby determining the counter corresponding to the flow control indicator. Further, since each counter corresponds to a filter, the filter included in the filter chain corresponding to the service request can be determined according to the counter corresponding to the flow control indicator.

[0044] In some implementation scenarios, when matching the flow control indicators corresponding to the business request in the configuration file, one or more flow control indicators may not have corresponding counters. In this case, you can only obtain the matched counters, and then determine the filter chain corresponding to the business request based on the filters corresponding to the matched counters.

[0045] Of course, in some implementation scenarios, the correspondence between the flow control indicators and the counters in the configuration file can also be updated. For example, the flow control indicators that do not appear in the configuration file can be added to the configuration file in real time or periodically, and the counters can be configured accordingly. For another example, the correspondence between the flow control indicators and the counters in the configuration file can be changed according to the actual scenario requirements.

[0046] S14: Determine whether to perform business processing based on the filter chain corresponding to the business request.

[0047] In the embodiment of the present specification, after determining the filter chain corresponding to the service request, it can be determined whether to perform service processing based on the filter chain. The filter chain is used to determine whether to perform service processing and then access resource files.

[0048] In some embodiments, determining whether to perform business processing based on the filter chain corresponding to the business request may include: submitting the business request to a global filter; determining whether the business request satisfies the filtering rule corresponding to the global filter; if it is determined to be satisfied, determining whether the filter chain includes a first filter; if it is determined not to include, determining to perform business processing. The first filter may be any filter except the global filter.

[0049] Since the filter chain includes at least a global filter, when determining whether to perform business processing based on the filter chain, the business request will inevitably be submitted to the global filter to determine whether the business request meets the filtering rules of the global filter.

[0050] In some implementation scenarios, determining whether the business request satisfies the filtering rules corresponding to the global filter may include: obtaining the current data recorded by the counter corresponding to the global filter; adding 1 to the current data to obtain first data; determining whether the first data is greater than a first threshold; the first threshold is the counting threshold of the counter corresponding to the global filter; when the first data is not greater than the first threshold, determining that the business request satisfies the filtering rules corresponding to the global filter.

[0051] In some implementation scenarios, when the first data is greater than the first threshold, it can be determined that the service request does not meet the filtering rule corresponding to the global filter. At this time, the first data can be reduced by 1 and the information that the flow control is exceeded can be returned. Each counter has a corresponding counting threshold, that is, the maximum flow control number, which can be set according to the actual scenario, and this specification does not limit this.

[0052] In some implementation scenarios, since the filter chain may include other filters in addition to the global filter, when it is determined that the business request satisfies the filtering rule corresponding to the global filter, it can be determined whether the filter chain includes the first filter.

[0053] In some implementation scenarios, when it is determined that the first filter is not included, it can be indicated that the business request has passed the filter chain, and business processing can be performed and resource files can be accessed.

[0054] In some implementation scenarios, when it is determined that the first filter is included, the business request can be submitted to the first filter; it is determined whether the business request satisfies the filtering rule corresponding to the first filter; when it is determined that it satisfies, it is determined whether the filter chain includes a second filter; when it is determined that it does not include, it is determined to perform business processing. The second filter can be any filter except the global filter and the first filter.

[0055] In some implementation scenarios, determining whether the business request satisfies the filtering rules corresponding to the first filter may include: obtaining the current data recorded by the counter corresponding to the first filter; adding 1 to the current data to obtain second data; determining whether the second data is greater than a second threshold; the second threshold is the counting threshold of the counter corresponding to the first filter; when the second data is not greater than the second threshold, determining that the business request satisfies the filtering rules corresponding to the first filter.

[0056] In some implementation scenarios, when the second data is greater than a second threshold, it can be determined that the business request does not satisfy the filtering rule corresponding to the first filter. At this time, the second data can be subtracted by 1 and information that exceeds flow control can be returned.

[0057] It should be noted that if there are multiple filters in the filter chain, the business request can be submitted to the next filter for filtering in sequence if it meets the filtering rules of the previous filter. When the filtering conditions of all filters are met, it can be said that the business request has passed the filter chain, and business processing can be performed and resource files can be accessed. If the filtering conditions of a certain filter are not met in the middle, the business request will be processed by the filter and cannot enter the subsequent filters, which means that the business request has not passed the filter chain and business processing cannot be performed. Among them, the arrangement order of filters in the filter chain can be pre-configured in a preset file (such as a web.xml file), and the specific arrangement order can be set according to the actual scenario, and this manual does not limit this.

[0058] S16: When it is determined to perform business processing, the target flow control data corresponding to the business request is obtained; the target flow control data includes the flow control data of each filter in the filter chain, and the flow control data includes the current data recorded by the counter corresponding to the filter.

[0059] In the embodiment of the present specification, when it is determined to perform business processing, the target flow control data corresponding to the business request can be obtained. Among them, the target flow control data includes the flow control data of each filter in the filter chain. The flow control data of each filter may include the current data recorded by the counter corresponding to the filter. The counter corresponding to the global filter can be used to record the concurrency of the entire target system. The counters corresponding to other filters can be used to record the concurrency of the corresponding flow control indicator scenario.

[0060] In some embodiments, when it is determined to perform business processing, after obtaining the target flow control data corresponding to the business request, the business program can be entered to perform business processing. When the business processing is completed, the target flow control data can be subtracted by 1.

[0061] In some embodiments, when the service processing is completed, the service processing result can also be obtained and returned to the client, where the client can be a terminal that sends a service request.

[0062] In some embodiments, the target system may also receive a flow control query request, obtain current data recorded by a counter corresponding to each filter in the target system, and then display the current data on a monitoring page.

[0063] Specifically, for example, in some implementation scenarios, the target system can receive the flow control query request sent by the monitoring system, obtain the current data recorded by each counter, and then display the obtained current data on the flow control monitoring page provided by the monitoring system, so that the staff can intuitively see the current concurrency and flow control in the system memory. Among them, the current data may include the system concurrency (also called the system flow control number) and the personalized scene concurrency (also called the personalized scene flow control number). The system concurrency is the data recorded by the counter corresponding to the global filter, and the personalized scene concurrency is the data recorded by the counter corresponding to other filters except the global filter.

[0064] In some embodiments, it may also include: determining whether the current data recorded by the counter corresponding to each filter is greater than a preset threshold; when it is determined that it is greater than the preset threshold, issuing a prompt message. The preset threshold can be set according to the actual scenario, for example, it can be 60% of the counting threshold of each counter, 80% of the counting threshold of each counter, etc. The prompt message can be issued in the form of text, audio, etc., which is not limited in this specification.

[0065] Specifically, for example, in some implementation scenarios, after obtaining the current data recorded by the counter corresponding to each filter in the target system, it can be compared with the preset threshold (e.g., 60% of the counting threshold). If it exceeds the preset threshold, an alarm tone is issued and a text message is sent to the operation and maintenance personnel to remind them whether the current concurrency is normal and whether the flow control needs to be adjusted.

[0066] The embodiments of this specification can quickly and accurately determine the flow control data of the system, thereby effectively avoiding missing the golden time for solving the problem and improving the operating efficiency of the system.

[0067] In order to further verify the practicality and feasibility of this method, this specification also provides an embodiment of applying the above solution. Figure 2 The figure is a flow chart of an embodiment of a method for determining flow control data provided in this specification.

[0068] Specifically, in this embodiment, a configuration file can be designed in the application system in advance, and a system default flow control counter default_counter is defined in the configuration file, the maximum flow control number of default_counter is set to n, and a flow control counter txn_counter_1 of a specific dimension is defined, and the maximum flow control number of txn_counter_1 is set to m.

[0069] Furthermore, you can use the Java language to design a class Class that is loaded when the application system starts. In the class, use static to declare a ConcurrentHashMap member variable as flowctlMap, read the name of the flow control counter configured in the configuration file as the Key, and store the count of the corresponding flow control counter as the Value in flowctlMap. At the same time, you can create a static variable remoteFlowMap for the current number of concurrencies used. It should be noted that Java's static member variables are static member variables, which can also be called class variables. The life cycle of a class variable is the same as that of a class and is valid throughout the execution of the application. Static variables are shared by all objects and there is only one copy in memory. For example Figure 3 As shown, it is a schematic diagram of the Java virtual machine running memory provided in this specification, wherein the Java virtual machine running memory includes multiple threads and shared memory, each thread (thread 1, thread 2, thread 3) corresponds to a PC register, a stack, and a local method stack, the shared memory includes a method area and a heap, and the method includes a runtime constant pool. Static variables are stored in the method area of ​​the shared memory during the JVM operation process, so the flowctlMap generated above always exists during the system operation process and is shared by threads.

[0070] Next, you can add multiple business transactions pointing to the counter txn_counter_1 in the configuration file, such as configuring business transaction txn1 to point to the counter txn_counter_1, and business transaction txn2 to point to the counter txn_counter_1, so that different flow controls can be implemented for specific business transaction requests. Here, business transaction txn1 can be understood as the aforementioned flow control indicator.

[0071] Finally, when a service request is received, the filter in Java can be called to implement flow control. Figure 4As shown, it is a flowchart provided by this specification for calling a filter to determine whether to perform business processing when receiving a business request. Among them, the filter chain includes at least one filter, such as Filter1, Filter2, ..., Filtern in the figure. n represents the number of filters, which can be set according to the actual scenario. The order of each filter in the filter chain is related to the order in which it is configured in web.xml, and the one configured in front is located at the front end of the filter chain. In specific implementation, the received business request can be submitted to the first filter (Filter1) in the filter chain for filtering. If the filtering rule of Filter1 is met, it is released and submitted to the next filter (Filter2) in the filter chain for filtering. Further, Filter2 can determine whether the business request meets the filtering rule of Filter2. If it is met, it is released and submitted to the next filter in the filter chain for filtering, and so on, until the filtering rule of each filter in the filter chain is met, it is determined to perform business processing. Among them, when the business request meets the filtering rules of all filters in the filter chain, the business request can access the resource file. If the business request does not meet the filtering rule of a certain filter, it cannot pass the filter, so that the business processing cannot be performed. It should be noted that if a service request cannot pass a filter, the service request will be processed in the filter. After the service request is processed by the filter, the filter chain can feedback to the client that sent the service request that the filtering rules are not met.

[0072] like Figure 5 As shown, it is a flowchart of the business request provided by this specification submitted to the filter for processing. Among them, in the configuration file, flowctlMap is used to store the maximum flow control number n of the system default flow control counter default_counter and the maximum flow control number m of the flow control counter txn_counter_1 in the business transaction dimension, and remoteFlowMap is used to store the current used concurrency number of default_counter and the current used concurrency number of txn_counter_1. Specifically including the following steps: the transaction identifier points to the counter txn_counter_1.

[0073] Specifically, after the business request enters the Filter processing, the flow control indicator corresponding to the business request can be determined as the transaction identifier based on the information carried in the business request. Then, the target system can obtain the count value corresponding to the default_counter in the remoteFlowMap from the memory, and perform an addition operation, and compare the result after the addition operation with the maximum flow control number n of the default_counter in the flowctlMap.

[0074] If it exceeds n, the result after the addition operation can be subtracted by 1, and the excess flow control information is returned. If it does not exceed, check whether the counter corresponding to the transaction identifier is configured in the configuration file according to the flow control indicator corresponding to the business request (the counter corresponding to the flow control indicator can also be called a personalized flow control counter). In this embodiment, the configuration file is configured with a counter txn_counter_1 corresponding to the transaction identifier, then the count value corresponding to txn_counter_1 in remoteFlowMap can be obtained from the memory, and an addition operation can be performed to compare the result after the addition operation with the maximum flow control number m of txn_counter_1 in flowctlMap. Among them, if the configuration file is not configured with a counter corresponding to the transaction identifier, the business processing can be entered.

[0075] Furthermore, if it exceeds m, the result after the addition operation can be subtracted by 1, and the excess flow control information is returned. Since the flow control indicator corresponding to the business request determined according to the information carried in the business request only includes the transaction identifier, if it does not exceed m, the business process can be entered. Among them, when it is determined to enter the business process, the current count values ​​of txn_counter_1 and default_counter can be obtained as the target flow control data corresponding to the business request.

[0076] Finally, after the service processing is completed, the service processing result can be returned to the client that sent the service request. Furthermore, the current count values ​​of txn_counter_1 and default_counter can be reduced by 1 to release the flow control data so that other service requests can enter.

[0077] Of course, in this embodiment, real-time monitoring of pages, real-time modification of flow control data in memory, and provision of a red and yellow line mechanism to trigger different alarms can also be provided.

[0078] The embodiments of this specification can quickly view the system flow control data in many machines deployed in a cluster, so that the operation problems of specific machines can be located in time, and the concurrency number of specific machines can be quickly adjusted according to the system concurrency situation.

[0079] It should be noted that the above only uses the flow control indicator corresponding to the business request as the transaction identifier for exemplary explanation, and the embodiments of this specification are not limited to the above examples. Technical personnel in the relevant field may make other changes under the inspiration of the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they should be included in the protection scope of this application. In addition, the "first" and "second" mentioned above are only for distinguishing different indicators and have no actual meaning. The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0080] In this specification, each embodiment of the above method is described in a progressive manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments. For relevant parts, refer to the partial description of the method embodiment.

[0081] From the above description, it can be seen that the embodiment of the present application can receive a business request and determine the flow control index of the business request, and determine the filter chain corresponding to the business request based on the correspondence between the flow control index and the counter; it can also determine whether to perform business processing based on the filter chain corresponding to the business request, and when it is determined to perform business processing, it can obtain the target flow control data corresponding to the business request, wherein the target flow control data includes the flow control data of each filter in the filter chain, and the flow control data includes the current data recorded by the counter corresponding to the filter. It can be seen that by adopting the embodiment of this specification, the flow control data of the system can be determined quickly and accurately, thereby effectively avoiding missing the golden time to solve the problem and improving the system operation efficiency.

[0082] Based on the above-mentioned method for determining flow control data, one or more embodiments of this specification also provide a device for determining flow control data. The device may include a system (including a distributed system), software (application), module, component, server, client, etc. that uses the method described in the embodiment of this specification and is combined with the necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiment of this specification is as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiment of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0083] Specifically, Figure 6 is a schematic diagram of a module structure of an embodiment of a device for determining flow control data provided in this specification, such as Figure 6 As shown, a device for determining flow control data provided in this specification may include: a receiving module 120 , a first determining module 122 , a second determining module 124 , and an acquiring module 126 .

[0084] The receiving module 120 may be used to receive a service request and determine a flow control indicator of the service request;

[0085] A first determination module 122, which may be used to determine a filter chain corresponding to the service request according to a correspondence between a flow control indicator and a counter;

[0086] A second determination module 124 may be used to determine whether to perform business processing based on a filter chain corresponding to the business request;

[0087] The acquisition module 126 can be used to obtain the target flow control data corresponding to the business request when determining business processing; the target flow control data includes the flow control data of each filter in the filter chain, and the flow control data includes the current data recorded by the counter corresponding to the filter.

[0088] In some embodiments, each filter corresponds to a filtering rule; the second determination module 124 may include:

[0089] A first submitting unit, which may be used to submit the service request to a global filter;

[0090] A first judgment unit may be used to judge whether the service request satisfies the filtering rule corresponding to the global filter;

[0091] A second judgment unit may be configured to judge whether the filter chain includes the first filter when the condition is satisfied;

[0092] The first determining unit may be configured to determine to perform business processing when it is determined that the service is not included.

[0093] In some embodiments, the first determining unit may include:

[0094] A first acquisition unit may be used to acquire current data recorded by a counter corresponding to a global filter;

[0095] A first operation unit may be used to perform an addition operation on the current data to obtain first data;

[0096] A third judgment unit may be used to judge whether the first data is greater than a first threshold; the first threshold is a counting threshold of a counter corresponding to a global filter;

[0097] The second determining unit may be configured to determine, when the first data is not greater than a first threshold, that the service request satisfies a filtering rule corresponding to a global filter.

[0098] In some embodiments, it may also include:

[0099] A third determining unit may be configured to determine that the service request does not satisfy a filtering rule corresponding to a global filter when the first data is greater than a first threshold;

[0100] The second operation unit can be used to perform a subtraction operation on the first data and return information that exceeds flow control.

[0101] In some embodiments, it may also include:

[0102] A second submitting unit may be configured to submit the service request to the first filter when determining that the first filter is included;

[0103] A fourth judgment unit may be used to judge whether the service request satisfies a filtering rule corresponding to the first filter;

[0104] A fifth judgment unit may be configured to judge whether the filter chain includes a second filter when the condition is satisfied;

[0105] The fourth determining unit may be configured to determine to perform business processing when it is determined that the service is not included.

[0106] In some embodiments, it may also include:

[0107] Processing unit, which can be used to enter the business program for business processing;

[0108] The third operation unit can be used to perform a subtraction operation on the target flow control data when the business processing is completed.

[0109] In some embodiments, it may also include:

[0110] The second acquisition unit can be used to obtain the business processing result;

[0111] The returning unit may be used to return the business processing result to the client.

[0112] In some embodiments, it may also include:

[0113] A receiving unit, which can be used to receive a flow control query request;

[0114] A third acquisition unit may be used to acquire current data recorded by a counter corresponding to each filter in the target system;

[0115] The display unit can be used to display the current data on the monitoring page.

[0116] In some embodiments, it may also include:

[0117] The sixth judgment unit may be used to judge whether the current data recorded by the counter corresponding to each filter is greater than a preset threshold;

[0118] The issuing unit can be used to issue a prompt message when it is determined that the value is greater than a preset threshold.

[0119] In some embodiments, the flow control indicator includes at least one of the following: transaction identification; front-end system identification; institution identification; a combination of transaction identification, front-end system identification and institution identification; back-end system identification; customer identification; a combination of customer identification and transaction identification; deployment unit identification; a combination of transaction identification and preset field content.

[0120] In some embodiments, the correspondence between the flow control indicator and the counter may include many-to-one or one-to-one.

[0121] It should be noted that the above-mentioned device may also include other implementation modes according to the description of the method embodiment. The specific implementation mode may refer to the description of the relevant method embodiment, which will not be described one by one here.

[0122] The present specification also provides an embodiment of a device for determining flow control data, including a processor and a memory for storing processor executable instructions, wherein the instructions, when executed by the processor, implement the following steps: receiving a business request and determining a flow control indicator of the business request; determining a filter chain corresponding to the business request based on the correspondence between the flow control indicator and the counter; determining whether to perform business processing based on the filter chain corresponding to the business request; if it is determined that business processing is to be performed, obtaining target flow control data corresponding to the business request; the target flow control data includes the flow control data of each filter in the filter chain, and the flow control data includes the current data recorded by the counter corresponding to the filter.

[0123] An embodiment of the present specification also provides a computer program product, comprising a computer program, which implements the following steps when executed by a processor: receiving a business request and determining a flow control indicator of the business request; determining a filter chain corresponding to the business request based on the correspondence between the flow control indicator and the counter; determining whether to perform business processing based on the filter chain corresponding to the business request; if it is determined that business processing is to be performed, obtaining target flow control data corresponding to the business request; the target flow control data includes the flow control data of each filter in the filter chain, and the flow control data includes the current data recorded by the counter corresponding to the filter.

[0124] It should be noted that the above-mentioned device, computer program product may also include other implementation modes according to the description of the method or apparatus embodiment. The specific implementation modes may refer to the description of the relevant method embodiment, which will not be described one by one here.

[0125] The method embodiments provided in this specification can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Figure 71 is a hardware structure block diagram of an embodiment of a server for determining flow control data provided in this specification. The server may be the device for determining flow control data or the equipment for determining flow control data in the above-mentioned embodiment. Figure 7 As shown, the server 10 may include one or more (only one is shown in the figure) processors 100 (the processor 100 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 200 for storing data, and a transmission module 300 for communication functions. A person skilled in the art can understand that Figure 7 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 7 More or fewer components shown in the figure may also include other processing hardware, such as a database or multi-level cache, GPU, or other hardware with Figure 7 Different configurations are shown.

[0126] The memory 200 can be used to store software programs and modules of application software, such as program instructions / modules corresponding to the method for determining flow control data in the embodiment of this specification. The processor 100 executes various functional applications and data processing by running the software programs and modules stored in the memory 200. The memory 200 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 200 may further include a memory remotely arranged relative to the processor 100, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0127] The transmission module 300 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission module 300 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 300 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0128] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0129] The methods or devices described in the above embodiments provided in this specification can implement business logic through computer programs and record them on storage media, and the storage media can be read and executed by computers to achieve the effects of the solutions described in the embodiments of this specification. The storage medium may include a physical device for storing information, which is usually to digitize the information and then store it in a medium using electrical, magnetic or optical methods. The storage medium may include: devices that use electrical energy to store information, such as various types of memories, such as RAM, ROM, etc.; devices that use magnetic energy to store information, such as hard disks, floppy disks, magnetic tapes, magnetic core memories, bubble memories, and U disks; devices that use optical methods to store information, such as CDs or DVDs. Of course, there are other types of readable storage media, such as quantum memories, graphene memories, and so on.

[0130] The above-mentioned method or device embodiment for determining flow control data provided in this specification can be implemented by a processor in a computer executing corresponding program instructions, such as using the C++ language of the Windows operating system to implement it on a PC, on a Linux system, or other methods such as using Android or iOS system programming languages ​​to implement it on a smart terminal, as well as based on the processing logic of a quantum computer.

[0131] It should be noted that the devices, equipment, and systems described in the specification may also include other implementation methods according to the description of the relevant method embodiments. The specific implementation methods can refer to the description of the corresponding method embodiments, which will not be described one by one here.

[0132] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the hardware + program embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0133] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of some modules can be implemented in the same or more software and / or hardware, and the modules that implement the same function can also be implemented by a combination of multiple sub-modules or sub-units.

[0134] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and systems according to the embodiments of the present invention. It should be understood that it can be implemented by computer program instructions, and these computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the specified function. These computer program instructions can also be stored in a computer-readable memory that can guide the computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, and the instruction device is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0135] Those skilled in the art will appreciate that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may be provided in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware.

[0136] The above is only an example of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application should be included in the scope of the claims.

Claims

1. A method for determining flow control data, characterized in that: Applied to a target system, the target system includes a configuration file and a filter chain, the configuration file includes a correspondence between flow control indicators and counters, each counter corresponds to a filter, the filter chain includes at least a global filter, and the method includes: Receive a service request and determine a flow control indicator of the service request; Determine the filter chain corresponding to the service request according to the corresponding relationship between the flow control indicator and the counter; Determining whether to perform business processing based on the filter chain corresponding to the business request; When it is determined to perform business processing, target flow control data corresponding to the business request is obtained; the target flow control data includes flow control data of each filter in the filter chain, and the flow control data includes current data recorded by a counter corresponding to the filter; Each filter has a corresponding filtering rule; determining whether to perform business processing based on the filter chain corresponding to the business request includes: submitting the business request to a global filter; determining whether the business request satisfies the filtering rule corresponding to the global filter; if it is determined that the filtering rule is satisfied, determining whether the filter chain includes the first filter; if it is determined that the filter chain does not include the first filter, determining to perform business processing; And, it also includes: when it is determined that the first filter is included, submitting the business request to the first filter; judging whether the business request satisfies the filtering rules corresponding to the first filter; when it is determined that it is satisfied, judging whether the filter chain includes the second filter; when it is determined that it is not included, determining to perform business processing.

2. The method according to claim 1, characterized in that: Determining whether the service request satisfies the filtering rule corresponding to the global filter includes: Get the current data recorded by the counter corresponding to the global filter; Performing an addition operation on the current data to obtain first data; Determine whether the first data is greater than a first threshold; the first threshold is a counting threshold of a counter corresponding to a global filter; When the first data is not greater than a first threshold, it is determined that the service request satisfies a filtering rule corresponding to a global filter.

3. The method according to claim 2, characterized in that Also includes: When the first data is greater than a first threshold, determining that the service request does not satisfy a filtering rule corresponding to a global filter; A subtraction operation is performed on the first data, and information indicating that the flow control is exceeded is returned.

4. The method according to claim 1, characterized in that Also includes: Enter the business procedure to process the business; When the business processing is completed, the target flow control data is subtracted by 1.

5. The method according to claim 4, characterized in that Also includes: Obtain business processing results; The business processing result is returned to the client.

6. The method according to claim 1, characterized in that Also includes: Receive flow control query requests; Get the current data recorded by the counter corresponding to each filter in the target system; The current data is displayed on the monitoring page.

7. The method according to claim 6, characterized in that Also includes: Determine whether the current data recorded by the counter corresponding to each filter is greater than a preset threshold; When it is determined that the value is greater than the preset threshold, a prompt message is issued.

8. The method according to claim 1, characterized in that The flow control indicator includes at least one of the following: transaction identification; front-end system identification; institution identification; a combination of transaction identification, front-end system identification and institution identification; back-end system identification; customer identification; a combination of customer identification and transaction identification; deployment unit identification; a combination of transaction identification and preset field content.

9. The method according to claim 8, characterized in that The corresponding relationship between the flow control indicator and the counter includes many-to-one or one-to-one.

10. A device for determining flow control data, characterized in that: The device comprises a configuration file and a filter chain, wherein the configuration file comprises a correspondence between a flow control indicator and a counter, each counter corresponds to a filter, the filter chain comprises at least a global filter, and the device comprises: A receiving module, used to receive a service request and determine a flow control indicator of the service request; A first determination module, used to determine a filter chain corresponding to the service request according to a correspondence between a flow control indicator and a counter; A second determination module, used to determine whether to perform business processing based on a filter chain corresponding to the business request; An acquisition module, used to acquire target flow control data corresponding to the business request when determining to perform business processing; the target flow control data includes flow control data of each filter in the filter chain, and the flow control data includes current data recorded by a counter corresponding to the filter; Each filter corresponds to a filtering rule; the second determination module includes: a first submission unit, used to submit the business request to the global filter; a first judgment unit, used to judge whether the business request satisfies the filtering rule corresponding to the global filter; the second judgment unit, used to judge whether the filter chain includes the first filter when it is determined that the filter chain does not include the first filter; the first determination unit, used to determine to perform business processing when it is determined that the filter chain does not include the first filter; And, it also includes: a second submission unit, which is used to submit the business request to the first filter when it is determined that the first filter is included; a fourth judgment unit, which is used to judge whether the business request satisfies the filtering rules corresponding to the first filter; a fifth judgment unit, which is used to judge whether the filter chain includes the second filter when it is determined that the filter is satisfied; and a fourth determination unit, which is used to determine to perform business processing when it is determined that the filter is not included.

11. The device according to claim 10, characterized in that The first judging unit comprises: A first acquisition unit, used to acquire current data recorded by a counter corresponding to a global filter; A first operation unit, configured to perform an addition operation on the current data to obtain first data; A third judgment unit is used to judge whether the first data is greater than a first threshold; the first threshold is a counting threshold of a counter corresponding to a global filter; The second determining unit is configured to determine, when the first data is not greater than a first threshold, whether the service request satisfies a filtering rule corresponding to a global filter.

12. The device according to claim 10, characterized in that Also includes: A processing unit is used to enter a business program for business processing; The third operation unit is used to perform a subtraction operation on the target flow control data when the business processing is completed.

13. The device according to claim 10, characterized in that Also includes: A receiving unit, used for receiving a flow control query request; A third acquisition unit is used to acquire current data recorded by a counter corresponding to each filter in the target system; The display unit is used to display the current data on the monitoring page.

14. A device for determining flow control data, characterized in that: The method comprises at least one processor and a memory storing computer executable instructions, wherein the processor implements the steps of the method according to any one of claims 1 to 9 when executing the instructions.

15. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

16. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 9 when being executed by a processor.

Citation Information

Patent Citations

  • Business approval processing method, device and system

    CN108346028A

  • Global flow control method and device in cluster environment

    CN110048907A