Current limiting method, device, equipment and storage medium based on distributed service architecture

By obtaining metric data in the distributed service architecture to generate flow limit rules and distributing them to service providers, the problem that the existing technology cannot quickly deal with flow limits in different business scenarios is solved, and unified management and precise flow limits of distributed service architecture interfaces are realized.

CN119766730APending Publication Date: 2025-04-04GUANGDONG ESHORE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411890150.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing distributed service architecture flow restriction method cannot quickly deal with the current limit control in different business scenarios, and cannot implement a personalized business flow restriction strategy.

Method used

A distributed service architecture is provided to generate flow restriction rules by obtaining relevant metric data, and distributing these rules to the distributed service architecture service provider, so that it can perform flow restriction processing on the interface according to the flow restriction rules.

Benefits of technology

It realizes unified management and control of distributed service architecture interfaces, ensures consistency and real-timeness of current limiting strategies, and can define finer-grained current limiting rules based on business scenarios to meet the needs of different business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766730A_ABST
    Figure CN119766730A_ABST
Patent Text Reader

Abstract

The present application relates to a current limiting method, device, equipment and storage medium based on a distributed service architecture. The method includes: in response to receiving a current limiting request, obtaining relevant indicator data according to the request, and generating a current limiting rule that matches the relevant indicator data; according to the relevant indicator data, distributing the current limiting rule to at least one target distributed service architecture service provider, so that at least one target distributed service architecture service provider performs current limiting processing on the distributed service architecture interface according to the current limiting rule. The solution provided by the present application enables the distributed service architecture service provider to perform current limiting processing on the distributed service architecture interface according to the current limiting rule, thereby facilitating the unified management and control of the distributed service architecture interface and ensuring the consistency and real-time performance of the current limiting strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of distributed service technology, and in particular to a current limiting method, device, equipment and storage medium based on a distributed service architecture. Background Art

[0002] In the related art, the current limiting method of the distributed service architecture can be implemented by static methods such as setting a thread pool.

[0003] With the diversification of business scenarios, static current limiting solutions such as setting thread pools cannot meet the needs of quickly responding to current limiting control in different business scenarios. Therefore, there is an urgent need to implement business-customized current limiting strategies for distributed service architecture interfaces based on business scenarios. Summary of the invention

[0004] In order to solve or partially solve the problems existing in the related technology, the present application provides a current limiting method, device, equipment and storage medium based on a distributed service architecture, which enables the distributed service architecture service provider to perform current limiting processing on the distributed service architecture interface according to the current limiting rules, thereby facilitating the unified management and control of the distributed service architecture interface and ensuring the consistency and real-time performance of the current limiting strategy.

[0005] The first aspect of the present application provides a current limiting method based on a distributed service architecture, including: in response to receiving a current limiting request, obtaining relevant indicator data according to the request, and generating current limiting rules that match the relevant indicator data; based on the relevant indicator data, distributing the current limiting rules to at least one target distributed service architecture service provider, so that at least one target distributed service architecture service provider performs current limiting processing on the distributed service architecture interface according to the current limiting rules.

[0006] In some embodiments, the method also includes: generating indicator data collection rules; obtaining node information of a distributed service architecture service provider, wherein the node information includes at least one distributed service architecture interface; distributing the indicator data collection rules to the distributed service architecture service provider, so that the distributed service architecture service provider performs indicator data collection according to the indicator data collection rules and at least one distributed service architecture interface; storing the collected indicator data and the current limiting threshold corresponding to the collected indicator data, and using the collected indicator data and the current limiting threshold corresponding to the collected indicator data as relevant indicator data.

[0007] In some implementations, before generating the indicator data collection rules, the method further includes: configuring basic information of the current-limiting resources; associating the distributed service architecture interface with the basic information of the current-limiting resources to obtain generation information for generating the indicator data collection rules.

[0008] In some embodiments, the distributed service architecture service provider includes a distributed service architecture indicator collector; the distributed service architecture service provider performs indicator data collection according to indicator data collection rules and at least one distributed service architecture interface, including: performing indicator data collection according to indicator data collection rules and at least one distributed service architecture interface through the distributed service architecture indicator collector; wherein, the distributed service architecture indicator collector performs the following processing when performing indicator data collection: obtaining target parameters and target distributed service architecture interfaces from distributed service architecture context information, and matching target indicator data collection rules; obtaining dimension values ​​for converting information points from target parameters according to target indicator data collection rules; recording the start time of the distributed service architecture request, and determining the indicator value when responding to the distributed service architecture request; encapsulating the dimension value and indicator value as information points, and sending the information points to the indicator aggregation module.

[0009] In some implementations, the indicator value includes the actual time taken by the distributed service architecture request, a counter for the total number of updated requests, and a counter for the number of updated failures in the event of an exception in the request.

[0010] In some implementations, the method further includes: an indicator aggregation module compressing and aggregating information points from multiple distributed service architectures.

[0011] In some embodiments, each of the at least one target distributed service architecture service provider includes a distributed service architecture flow limiter; at least one target distributed service architecture service provider performs flow limiting processing on the distributed service architecture interface according to the flow limiting rules, including: at least one target distributed service architecture service provider uses the distributed service architecture flow limiter to perform flow limiting processing on the distributed service architecture interface according to the flow limiting rules through a preset distributed cache component and a sliding time window flow limiting algorithm.

[0012] The second aspect of the present application provides a current limiting device based on a distributed service architecture, which includes: a generation module, which is used to respond to receiving a current limiting request, obtain relevant indicator data according to the request, and generate current limiting rules that match the relevant indicator data; a processing module, which is used to distribute the current limiting rules to at least one target distributed service architecture service provider based on the relevant indicator data, so that at least one target distributed service architecture service provider performs current limiting processing on the distributed service architecture interface according to the current limiting rules.

[0013] A third aspect of the present application provides an electronic device, including:

[0014] Processor; and

[0015] The memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method as described above.

[0016] A fourth aspect of the present application provides a computer-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor is caused to execute the method as described above.

[0017] The technical solution provided by the present application may include the following beneficial effects: it enables the distributed service architecture service provider to perform flow limiting processing on the distributed service architecture interface according to the flow limiting rules, thereby facilitating the unified management and control of the distributed service architecture interface and ensuring the consistency and real-time performance of the flow limiting strategy.

[0018] The technical solution of the present application can also: implement a business-level and multi-dimensional flow limiting strategy, so that by defining more fine-grained flow limiting rules, the flow limiting is more accurate and better meets the needs of different business scenarios.

[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and other objects, features and advantages of the present application will become more apparent by describing in more detail the exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.

[0021] Figure 1 It is a flow chart of a current limiting method based on a distributed service architecture shown in an embodiment of the present application;

[0022] Figure 2 It is a schematic diagram of the execution of the current limiting method based on the distributed service architecture shown in the embodiment of the present application;

[0023] Figure 3 is a structural schematic diagram of a current limiting device based on a distributed service architecture shown in an embodiment of the present application;

[0024] Figure 4 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0026] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0027] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0028] The current limiting solution that uses static methods such as setting thread pools cannot meet the needs of quickly responding to current limiting control in different business scenarios. At present, there is an urgent need to implement business-customized current limiting strategies for distributed service architecture interfaces based on business scenarios.

[0029] In response to the above problems, an embodiment of the present application provides a current limiting method based on a distributed service architecture, which enables the distributed service architecture service provider to perform current limiting processing on the distributed service architecture interface according to the current limiting rules, thereby facilitating the unified management and control of the distributed service architecture interface and ensuring the consistency and real-time performance of the current limiting strategy.

[0030] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0031] Figure 1 It is a flow chart of a current limiting method based on a distributed service architecture shown in an embodiment of the present application.

[0032] See also Figure 1 , a current limiting method based on a distributed service architecture, the method comprising:

[0033] Step 101, in response to receiving a current limiting request, obtaining relevant indicator data according to the request, and generating a current limiting rule matching the relevant indicator data.

[0034] Step 102, based on relevant indicator data, distribute the current limiting rules to at least one target distributed service architecture service provider, so that at least one target distributed service architecture service provider performs current limiting processing on the distributed service architecture interface according to the current limiting rules.

[0035] For example, the distributed service architecture may be the Dubbo open source distributed service architecture. The current limiting method based on the distributed service architecture may refer to the Dubbo service current limiting.

[0036] For example, a current limiting request may refer to a request for quickly implementing business-customized current limiting strategies for multiple Dubbo interfaces (i.e., distributed service architecture interfaces) for different business scenarios.

[0037] In some embodiments, relevant indicator data can be collected by a distributed service architecture service provider.

[0038] For example, the distributed service architecture service provider receives the indicator data collection rules, collects the visit volume, time consumption and other indicator data of the Dubbo interface from the dimensions of business scenario, work number / city / system, etc., and stores the collected indicator data. Furthermore, the corresponding flow limiting threshold can be set according to the collected indicator data.

[0039] In some embodiments, relevant indicator data can be used to generate current limiting rules.

[0040] For example, the flow limiting rules may include resource identification, system code, resource name, whether to enable, step size, collection dimension, and distributed service architecture interface included in the management and control.

[0041] In some embodiments, the current limiting rules are distributed to relevant target distributed service architecture service providers. After obtaining the current limiting rules, the relevant target distributed service architecture service providers can perform current limiting processing on the distributed service architecture interface to achieve current limiting control.

[0042] The current limiting method based on the distributed service architecture in the embodiment of the present application enables the distributed service architecture service provider to perform current limiting processing on the distributed service architecture interface according to the current limiting rules, thereby facilitating the unified management and control of the distributed service architecture interface and ensuring the consistency and real-time performance of the current limiting strategy; it can also implement business-level and multi-dimensional current limiting strategies, thereby making the current limiting more precise and better meeting the needs of different business scenarios by defining more fine-grained current limiting rules.

[0043] In some embodiments, the method also includes: generating indicator data collection rules; obtaining node information of a distributed service architecture service provider, wherein the node information includes at least one distributed service architecture interface; distributing the indicator data collection rules to the distributed service architecture service provider, so that the distributed service architecture service provider performs indicator data collection according to the indicator data collection rules and at least one distributed service architecture interface; storing the collected indicator data and the current limiting threshold corresponding to the collected indicator data, and using the collected indicator data and the current limiting threshold corresponding to the collected indicator data as relevant indicator data.

[0044] In some embodiments, before generating the indicator data collection rules, the method also includes: configuring basic information of the current-limiting resources; associating the distributed service architecture interface with the basic information of the current-limiting resources to obtain generation information for generating the indicator data collection rules.

[0045] For example, 1. When configuring the basic information of the flow-limiting resource, you can set the flow-limiting resource in combination with the business scenario. The configuration information may include the resource name (such as the front-end order query flow limit, the SMS verification code acquisition flow limit, the card replacement SMS verification code flow limit, the order item attribute flow limit, the latest information query flow limit, the mobile number selection flow limit, etc.), resource type (access flow limit), resource subtype (Dubbo), etc.

[0046] 2. Query the distributed service architecture interface and associate it with the current limiting resource.

[0047] 3. Obtain the basic information of the configured current limiting resources and the indicator data collection rules generated by the distributed service architecture interface.

[0048] 4. Query the nodes of the distributed service architecture interface-related service providers included in the business scenario management from the distributed service architecture registration center (application instance nodes that use the Dubbo protocol to provide services). Among them, the distributed service architecture service provider refers to the program that uses the Dubbo protocol to provide services, which is the core part of the Dubbo service architecture. The service provider achieves loose coupling and low coupling between services by providing remote procedure call services between service consumers and providers.

[0049] 5. Distribute the indicator data collection rules to the corresponding distributed service architecture service providers to guide each distributed service architecture service provider to collect indicator data such as the number of visits and time consumption of the DUBBO interface from dimensions such as business scenarios, work numbers / cities / systems according to the indicator data collection rules.

[0050] 6. Store the collected indicator data, and set a reasonable current limiting threshold value according to the actual collected indicator data; the collected indicator data and the current limiting threshold value corresponding to the collected indicator data are used as relevant indicator data.

[0051] The current limiting method based on the distributed service architecture in the embodiment of the present application can collect actual indicator data according to the indicator data collection rules, and can further set a reasonable current limiting threshold based on the actually collected indicator data, which is conducive to achieving reasonable current limiting control and making the implementation of current limiting control more effective.

[0052] In some embodiments, the distributed service architecture service provider includes a distributed service architecture indicator collector; the distributed service architecture service provider performs indicator data collection according to indicator data collection rules and at least one distributed service architecture interface, including: performing indicator data collection according to indicator data collection rules and at least one distributed service architecture interface through the distributed service architecture indicator collector; wherein, the distributed service architecture indicator collector performs the following processing when performing indicator data collection: obtaining target parameters and target distributed service architecture interfaces from the distributed service architecture context information, and matching target indicator data collection rules; obtaining dimension values ​​for converting information points from target parameters according to target indicator data collection rules; recording the start time of the distributed service architecture request, and determining the indicator value when responding to the distributed service architecture request; encapsulating the dimension value and indicator value as information points, and sending the information points to the indicator aggregation module.

[0053] It can be understood that the distributed service architecture service provider integrates a distributed service architecture indicator collector, and the distributed service architecture indicator collector collects indicator data according to indicator data collection rules and at least one distributed service architecture interface.

[0054] For example, before receiving a request, the distributed service architecture indicator collector obtains the Attachments parameter and the target Dubbo interface from the distributed service architecture context information; matches the corresponding indicator data collection rules from the cache; extracts the latitude values ​​needed to convert information points from the Attachments parameter according to the indicator data collection rules, which may include the work number, region, and system; and records the start time of the Dubbo request. And when responding to a distributed service architecture request: calculate the actual time taken by the distributed service architecture request, update the total request counter (increase by one), and update the failure counter (increase by one) if an exception occurs in the request.

[0055] Then, the above-collected dimension values ​​and the calculated indicator values ​​(such as the actual time consumed by the distributed service architecture request, the total number of update request counters, the number of update failure counters in the event of an abnormal request, etc.) are encapsulated into information points and sent to the indicator aggregation module for storage.

[0056] The current limiting method based on the distributed service architecture in the embodiment of the present application can receive indicator data collection rules through the distributed service architecture indicator collector to collect indicator data of the distributed service architecture interface.

[0057] In some embodiments, the indicator aggregation module can compress and aggregate information points from multiple distributed service architectures.

[0058] In order to reduce the storage of time series databases and improve the retrieval performance of indicator data, the indicator aggregation module can compress information points from multiple distributed service architectures and aggregate them using calculation methods such as SUM / AVG.

[0059] The current limiting method based on the distributed service architecture in the embodiment of the present application is beneficial to reducing the storage of the time series database and improving the retrieval performance of the indicator data by compressing and aggregating information points from multiple distributed service architectures.

[0060] In some embodiments, each of the at least one target distributed service architecture service provider includes a distributed service architecture flow limiter; at least one target distributed service architecture service provider performs flow limiting processing on the distributed service architecture interface according to the flow limiting rules, including: at least one target distributed service architecture service provider uses the distributed service architecture flow limiter to perform flow limiting processing on the distributed service architecture interface according to the flow limiting rules through a preset distributed cache component and a sliding time window flow limiting algorithm.

[0061] It can be understood that the distributed service architecture service provider integrates the distributed service architecture flow limiter and performs flow limiting processing through the distributed service architecture flow limiter, such as receiving flow limiting rules and implementing business flow control on the distributed service architecture interface of each business scenario from dimensions such as work number / city / system.

[0062] For example, the distributed service architecture limiter uses the distributed cache component to count the number of requests for high-performance access time windows, and uses a sliding time window limit algorithm to limit the distributed service architecture interface according to the limit rules.

[0063] The current limiting method based on the distributed service architecture in the embodiment of the present application performs current limiting processing on the distributed service architecture interface according to the current limiting rules by presetting the distributed cache component and the sliding time window current limiting algorithm, thereby realizing high-concurrency distributed business current limiting.

[0064] In order to better understand the present application, the content of the present application is further explained below in conjunction with the embodiments, but the present application is not limited to the following embodiments.

[0065] With the vigorous development of artificial intelligence, AI robot technology is increasingly being applied to business scenarios. Due to the surge in AI robot requests, system fluctuations are becoming more frequent, affecting the normal operation of the business. Business operations urgently require the rapid implementation of personalized business flow limiting strategies for multiple distributed service architecture interfaces based on business scenarios. For example, in the number selection query scenario, number selection query often involves many distributed service architecture interfaces, including number pool query, idle number query, etc. After AI robots are applied to business scenarios, the number selection business scenario triggers group flow control. In order to quickly and reasonably limit the flow of AI robots accessing the number selection query-related distributed service architecture interfaces to protect the healthy and stable operation of the IT system. Provide a flow limiting method based on a distributed service architecture to meet business operation requirements.

[0066] Figure 2 It is a schematic diagram of the execution of the current limiting method based on the distributed service architecture shown in the embodiment of the present application.

[0067] See also Figure 2 , consisting of an operation console 210, a rule synchronization processing module 220, a distributed service architecture indicator collector 230, a distributed service architecture flow limiter 240 and an indicator aggregation module 250.

[0068] Operation console 210: can be used to implement visualization functions such as visualized configuration management, monitoring views, and synchronous issuance of rules.

[0069] The rule synchronization processing module 220 can be used to receive the collection or current limiting rules issued by the console, and asynchronously synchronize the collection or current limiting rules to the distributed service architecture service node.

[0070] Distributed service architecture indicator collector 230: The distributed service architecture service node integrates the distributed service architecture indicator collector 230; the distributed service architecture indicator collector 230 can be used to receive collection rules, collect the access volume, time consumption and other indicator data of the distributed service architecture interface from the dimensions of business scenarios, work numbers / cities / systems, etc., and asynchronously report them to the indicator aggregation module 250.

[0071] Distributed service architecture flow limiter 240: The distributed service architecture service node integrates the distributed service architecture flow limiter 240; the distributed service architecture flow limiter 240 can be used to receive flow limiting rules and implement business flow control on the distributed service architecture interface of each business scenario from dimensions such as work number / city / system, etc.

[0072] The indicator aggregation module 250 receives the reported indicator data, aggregates and compresses the indicator data within the time window, and then stores it in the Prometheus system.

[0073] For example, in operation S1, current limiting resources are configured.

[0074] In operation S11, basic information of the current limiting resource is configured.

[0075] For example, when setting flow-limiting resources based on business scenarios, the specific configuration information may include resource name, resource type (access flow-limiting), resource subtype (distributed service architecture, dubbo), etc.

[0076] In operation S12, the service interface switch is queried and associated with the current limiting resource.

[0077] For example, query the existing distributed service architecture interfaces from the distributed service architecture registration center and include them in the flow control resources for management. For example, in the mobile number selection scenario, include the distributed service architecture interfaces such as number pool query, number query / pre-selection / pre-occupancy in the <mobile number selection flow control> resource for management.

[0078] In operation S2, the service request volume is collected.

[0079] In operation S21, the current limiting resource configuration and its service interface are queried.

[0080] It can be understood that based on operation S1, the set flow-limiting resources can be selected from the operation console 210 for synchronization, and the flow-limiting resource information and the distributed service architecture interface included in the management and control can be automatically queried.

[0081] In operation S22, an indicator data collection rule is generated.

[0082] For example, based on the above-mentioned current-limiting resource information and the distributed service architecture interface included in its management and control, an indicator collection rule is generated. The rule may include resource identification, system code, resource name, whether to enable, step size, collection dimension and inclusion in the distributed service architecture interface.

[0083] In operation S23, the indicator data collection rules are synchronized.

[0084] For example, the operation console 210 pushes the generated indicator data collection rules to the rule synchronization processing module 220. After receiving the collection rules, the rule synchronization processing module 220 can perform operation S24 to query the node list of the provider.

[0085] For example, the rule synchronization processing module 220 can query the node information of the distributed service architecture interface-related service providers included in the business scenario management from the distributed service architecture registration center (that is, the application instance nodes that use the distributed service architecture protocol to provide services), generate asynchronous synchronization tasks, and complete the full synchronization of all rules.

[0086] Furthermore, the rule synchronization processing module 220 can also monitor provider changes from the distributed service architecture registration center, and automatically generate asynchronous synchronization tasks when the provider changes, so as to complete the incremental synchronization and delivery of the collection rules.

[0087] In operation S25 , acquisition is asynchronously enabled.

[0088] The rule synchronization processing module 220 asynchronously synchronizes the indicator data collection rules related to the business scenario to the distributed service architecture indicator collector 230 integrated by the provider.

[0089] In operation S26, the indicator data collection rules are executed.

[0090] The distributed service architecture indicator collector 230 collects distributed service architecture request information points according to the enabled indicator data collection rules.

[0091] In operation S27, asynchronous reporting is performed.

[0092] After collection, the information point data is asynchronously reported to the indicator aggregation module 250.

[0093] Information points refer to a collection of indicators with the same dimensions in a specific business scenario, and are data structures for interaction between the distributed service architecture indicator collector 230 and the indicator aggregation module 250. For example, the total number of distributed service architecture interfaces, the number of failures, and the time consumption. These indicators are designed with the same dimensions of "type", "coding" and "interface" in the distributed service architecture interaction scenario, see Table 1.

[0094] Table 1

[0095]

[0096] The distributed service architecture indicator collector 230 works as follows:

[0097] 1. Before receiving the request: Get the Attachments parameter and the target distributed service architecture interface from the distributed service architecture context. Match the corresponding collection rules from the cache. According to the collection rules, extract the dimension values ​​required for converting information points from the Attachments parameter, including the employee number, region, and system. Record the start time of the distributed service architecture request.

[0098] 2. When requesting a response: Calculate the actual time taken for this request. Update the total request counter (increase by one). Check if any exception occurs. If an exception occurs during the request, update the failure counter (increase by one).

[0099] 3. Data processing and reporting: Encapsulate the above-collected dimension values ​​and calculated indicator values ​​(such as request duration, number of successes / failures, etc.) into information points, and push these information points to the module responsible for aggregation processing (i.e., indicator aggregation module 250).

[0100] In operation S28, the indicator data is aggregated and stored.

[0101] In the same time window, there is a situation where the same work number / city / system requests a certain distributed service architecture interface (with different parameters) multiple times, and these distributed service architecture interface requests are evenly distributed to the distributed service architecture service provider's various nodes in the distributed service architecture service framework for response. The indicator aggregation module 250 receives multiple copies of the distributed service architecture information point data reported by each distributed service architecture service provider node with the same dimension value, as shown in Table 2.

[0102] Table 2

[0103]

[0104] In order to reduce the storage of the time series database and improve the retrieval performance of the indicator data, the indicator aggregation module 250 compresses the information points from multiple nodes and aggregates them using calculation methods such as SUM / AVG, see Table 3.

[0105] Table 3

[0106]

[0107] Furthermore, the indicator aggregation module 250 provides exporter services, and Prometheus pulls indicators and completes storage.

[0108] In operation S3, the current limiting rule is enabled.

[0109] In operation S31, the service access volume is queried.

[0110] For example, query the business access volume of work number / city / system, configure the alarm strategy in the AlarmManager module of Prometheus, and issue alarm notifications in various ways. After the user receives the alarm information, he or she can find out the dimension value (work number / city / system) that causes the jump through the indicator fluctuation of the console distributed service architecture interface. The user can evaluate the reasonable current limiting threshold based on business experience and the indicator value range under normal circumstances.

[0111] In operation S32, a flow limiting rule is configured for accessing resources.

[0112] For example, the flow limiting rules are configured for work number / city / system access resources, and the mobile number selection flow limiting rules are shown in Table 4.

[0113] Table 4

[0114]

[0115]

[0116] In operation S33, the current limiting rules are synchronized.

[0117] In operation S34, the provider's node list is queried, see operation S24.

[0118] In operation S35 , current limiting is asynchronously enabled.

[0119] For example, the rule synchronization processing module 220 asynchronously synchronizes the flow limiting rules related to the business scenario to the distributed service architecture flow limiter integrated by all providers, and enables the distributed service architecture flow limiting.

[0120] For current limiting resources, see Table 5.

[0121] Table 5

[0122] Property Name Attribute Encoding type describe constraint Remark Current Limiting Rules rateLimitRule List <ratelimitrule> < / ratelimitrule> Current Limiting Rules ? Application capabilities rateLimitApi List <api> < / api> Application capabilities ?

[0123] For current limiting rules, see Table 6.

[0124] Table 6

[0125]

[0126]

[0127] For time rules, see Table 7.

[0128] Table 7

[0129]

[0130] In operation S36, a current limiting process is performed.

[0131] For example, the distributed service architecture current limiter 240 uses the number of requests in the high-performance access time window of the distributed cache component (CTGCACHE) to achieve high-concurrency distributed business current limiting; and adopts a sliding time window current limiting algorithm to perform current limiting on the distributed service architecture interface according to the distributed service architecture current limiting rules. The time window moves to the right along the time axis, and the number of requests in the time window is recorded in real time. When the number of requests in the window exceeds the allowed threshold, current limiting is performed and no further requests can be made.

[0132] In operation S37 , current limiting indicator collection is performed.

[0133] The distributed service architecture indicator collector 230 collects the distributed service architecture current limiting information points according to the enabled current limiting rules, see Table 8.

[0134] Table 8

[0135]

[0136] In operation S38, asynchronous reporting is performed.

[0137] That is, the information point data is asynchronously reported to the indicator aggregation module 250 .

[0138] In operation S39, the indicator data is aggregated and stored, see operation S28.

[0139] The current limiting method based on the distributed service architecture in the embodiment of the present application innovatively expands the native current limiting mechanism of the distributed service architecture and implements a business-level and multi-dimensional current limiting strategy. By defining more fine-grained current limiting rules, such as based on users, service interfaces, request sources, time periods, etc., current limiting is more accurate and better meets the needs of different business scenarios.

[0140] Corresponding to the aforementioned application function implementation method embodiment, the present application also provides a current limiting device, electronic device and corresponding embodiments based on a distributed service architecture.

[0141] Figure 3 It is a structural diagram of a current limiting device based on a distributed service architecture shown in an embodiment of the present application.

[0142] See also Figure 3 The current limiting device 300 based on the distributed service architecture of this embodiment includes a generating module 310 and a processing module 320 .

[0143] A generating module 310 is used to, in response to receiving a current limiting request, obtain relevant indicator data according to the request, and generate a current limiting rule matching the relevant indicator data;

[0144] The processing module 320 is used to distribute the current limiting rules to at least one target distributed service architecture service provider based on relevant indicator data, so that at least one target distributed service architecture service provider performs current limiting processing on the distributed service architecture interface according to the current limiting rules.

[0145] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated again here.

[0146] According to an embodiment of the present application, any multiple modules in the generation module 310 and the processing module 320 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the generation module 310 and the processing module 320 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the generation module 310 and the processing module 320 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0147] Figure 4 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.

[0148] See also Figure 4 , the electronic device 400 includes a memory 410 and a processor 420.

[0149] The processor 420 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0150] The memory 410 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage. Among them, ROM can store static data or instructions required by the processor 420 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 410 may include any combination of computer-readable storage media, including various types of semiconductor storage chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 410 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0151] The memory 410 stores executable codes, and when the executable codes are processed by the processor 420 , the processor 420 can execute part or all of the methods described above.

[0152] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.

[0153] Alternatively, the present application can also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium) on which executable code (or computer program or computer instruction code) is stored. When the executable code (or computer program or computer instruction code) is executed by a processor of an electronic device (or server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.

[0154] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A current limiting method based on a distributed service architecture, characterized in that: include: In response to receiving a current limiting request, obtaining relevant indicator data according to the request, and generating a current limiting rule matching the relevant indicator data; Based on the relevant indicator data, the current limiting rules are distributed to at least one target distributed service architecture service provider, so that the at least one target distributed service architecture service provider performs current limiting processing on the distributed service architecture interface according to the current limiting rules.

2. The method according to claim 1, characterized in that The method further comprises: Generate indicator data collection rules; Obtaining node information of a distributed service architecture service provider, wherein the node information includes at least one distributed service architecture interface; Distributing the indicator data collection rules to the distributed service architecture service provider, so that the distributed service architecture service provider performs indicator data collection according to the indicator data collection rules and the at least one distributed service architecture interface; The collected indicator data and the current limiting threshold corresponding to the collected indicator data are stored, and the collected indicator data and the current limiting threshold corresponding to the collected indicator data are used as the relevant indicator data.

3. The method according to claim 2, characterized in that Before generating the indicator data collection rule, the method further includes: Configure basic information of current limiting resources; The distributed service architecture interface is associated with the basic information of the current-limiting resource to obtain generation information for generating indicator data collection rules.

4. The method according to claim 2, characterized in that: The distributed service architecture service provider includes a distributed service architecture indicator collector; The distributed service architecture service provider collects the indicator data according to the indicator data collection rule and the at least one distributed service architecture interface, including: The distributed service architecture indicator collector performs indicator data collection according to the indicator data collection rule and the at least one distributed service architecture interface; wherein the distributed service architecture indicator collector performs the following processing when performing indicator data collection: Obtain target parameters and target distributed service architecture interface from distributed service architecture context information, and match target indicator data collection rules; According to the target indicator data collection rules, the dimension value used to convert the information point is obtained from the target parameter; Recording a start time of a distributed service architecture request and determining a metric value when responding to the distributed service architecture request; The dimension value and the indicator value are encapsulated as information points, and the information points are sent to an indicator aggregation module.

5. The method according to claim 4, characterized in that The indicator value includes the actual time consumed by the distributed service architecture request, a counter for the total number of update requests, and a counter for the number of update failures in the event of an abnormality in the request.

6. The method according to claim 4, characterized in that The method further comprises: The indicator aggregation module compresses and aggregates information points from multiple distributed service architectures.

7. The method according to claim 1, characterized in that Each of the at least one target distributed services architecture service provider comprises a distributed services architecture rate limiter; The at least one target distributed service architecture service provider performs current limiting processing on the distributed service architecture interface according to the current limiting rule, including: The at least one target distributed service architecture service provider utilizes the distributed service architecture current limiter to perform current limiting processing on the distributed service architecture interface according to the current limiting rules through a preset distributed cache component and a sliding time window current limiting algorithm.

8. A current limiting device based on a distributed service architecture, characterized in that: include: A generation module, configured to, in response to receiving a current limiting request, obtain relevant indicator data according to the request, and generate a current limiting rule matching the relevant indicator data; A processing module is used to distribute the current limiting rules to at least one target distributed service architecture service provider based on the relevant indicator data, so that the at least one target distributed service architecture service provider performs current limiting processing on the distributed service architecture interface according to the current limiting rules.

9. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having executable codes stored thereon, which, when executed by a processor of an electronic device, causes the processor to execute the method according to any one of claims 1 to 7.