Dynamic distribution method of fusing strategy, server, storage medium and program product

By dynamically allocating the circuit breaker strategy, the adaptive strategy is determined based on the request path of the query request, which solves the problem of inappropriate technology of circuit breaker strategy and query request, and improves the stability and service quality of the server.

CN119645968APending Publication Date: 2025-03-18KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411931837.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When an existing server processes query requests, the same circuit breaker policy cannot adapt to different types of query requests, resulting in frequent or delayed triggering of circuit breakers, affecting server stability and service quality.

Method used

By dynamically allocating the circuit breaker policy, the corresponding application software or query type is determined based on the request path of the query request, and the corresponding circuit breaker policy is found or configured in the database to be assigned to the query request.

Benefits of technology

It effectively avoids frequent or delayed triggering of circuit breakers caused by inadequate adaptation of circuit breakers and query requests, and improves server stability and service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645968A_ABST
    Figure CN119645968A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic distribution method of a fusing strategy, a server, a storage medium and a program product. The method comprises the following steps: receiving a query request sent by a terminal, wherein the query request comprises a request path; determining application software corresponding to the query request according to the request path; determining whether a first fusing strategy corresponding to the application software exists in a database or not; and if the first fusing strategy corresponding to the application software exists in the database, distributing the first fusing strategy to the query request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of fuse technology, and more particularly to a method for dynamically allocating fuse strategies, a server, a storage medium, and a program product. Background Art

[0002] With the advancement and development of technology, a fuse policy is usually set in the server used for information query. When the server receives an abnormal query request, the server will perform a fuse operation on the abnormal query request based on the fuse policy to avoid exhaustion of server resources.

[0003] Currently, the server uses the same circuit breaker policy for all query requests, which may cause the circuit breaker policy to be incompatible with certain query requests. For example, for a certain type of query request, the circuit breaker time provided by the circuit breaker policy may not meet the regular query operations of this type of query request, resulting in frequent circuit breaker triggering of this type of query request. For another example, for another type of query request, the circuit breaker time provided by the circuit breaker policy may far exceed the processing time of this type of query request under normal circumstances, resulting in a delay in triggering the circuit breaker for this type of query request, which will not effectively prevent server overload.

[0004] Therefore, how to assign appropriate circuit breaker strategies to different query requests has become a problem that needs to be solved urgently. Summary of the invention

[0005] The present disclosure provides a method, server, storage medium and program product for dynamically allocating a fuse strategy.

[0006] According to a first aspect of the present disclosure, a method for dynamically allocating fuse policies is provided, the method comprising: receiving a query request sent by a terminal, the query request comprising a request path; determining an application software corresponding to the query request according to the request path; determining whether a first fuse policy corresponding to the application software exists in a database; if a first fuse policy corresponding to the application software exists in the database, allocating the first fuse policy to the query request.

[0007] In the first aspect, in the solution provided by the present disclosure, the fuse strategy can be configured for different application software in advance, and after receiving the query request corresponding to the application software, the fuse strategy corresponding to the application software can be assigned to the query request corresponding to the application software. Therefore, the technical solution of the present disclosure can avoid technical problems such as frequent triggering of fuses or delayed triggering of fuses due to the incompatibility of the fuse strategy with the query request, and can effectively improve the stability and service quality of the server.

[0008] According to the method for dynamically allocating fuse policies of at least one embodiment of the present disclosure, the method also includes: if the first fuse policy corresponding to the application software does not exist in the database, determining the query type corresponding to the query request according to the request path; determining whether there is a second fuse policy corresponding to the query type in the database; if the second fuse policy corresponding to the query type exists in the database, allocating the second fuse policy to the query request.

[0009] According to the method for dynamically allocating circuit breaker policies of at least one embodiment of the present disclosure, the method further includes: if there is no second circuit breaker policy corresponding to the query type in the database, allocating a default circuit breaker policy to the query request.

[0010] According to the dynamic allocation method of the circuit breaker strategy of at least one embodiment of the present disclosure, the method also includes: determining the query type corresponding to the query request according to the request path; when the query type belongs to the slow query type, determining the first thread pool corresponding to the slow query type, and allocating the idle thread resources in the first thread pool to the query request; when the query type belongs to the quick query type, determining the second thread pool corresponding to the quick query type, and allocating the idle thread resources in the second thread pool to the query request.

[0011] According to the dynamic allocation method of the circuit breaker strategy of at least one embodiment of the present disclosure, the application software corresponding to the query request is determined according to the request path, including: obtaining a configuration file based on the request path, the configuration file including the application software corresponding to the query request; obtaining the application software corresponding to the query request in the configuration file.

[0012] According to at least one embodiment of the present disclosure, a method for dynamically allocating circuit breaker policies determines a query type corresponding to a query request according to a request path, including: obtaining a configuration file based on the request path, the configuration file including a query type corresponding to the query request; and obtaining the query type corresponding to the query request in the configuration file.

[0013] According to the method for dynamically allocating fuse strategies of at least one embodiment of the present disclosure, the method also includes: receiving a first fuse strategy and a first instruction, the first instruction being used to instruct that the first fuse strategy be allocated to application software in a database; establishing a mapping relationship between the application software and the first fuse strategy; and storing the mapping relationship between the application software and the first fuse strategy in a database.

[0014] According to the method for dynamically allocating fuse policies of at least one embodiment of the present disclosure, the method also includes: receiving a second instruction, the second instruction is used to instruct to delete the first fuse policy corresponding to the application software in the database; deleting the first fuse policy corresponding to the application software in the database.

[0015] According to the method for dynamically allocating fuse strategies of at least one embodiment of the present disclosure, the method also includes: receiving a third fuse strategy and a third instruction, the third instruction being used to instruct that the first fuse strategy corresponding to the application software be updated to the third fuse strategy in the database; deleting the first fuse strategy corresponding to the application software in the database; establishing a mapping relationship between the application software and the third fuse strategy; and storing the mapping relationship between the application software and the third fuse strategy in the database.

[0016] According to the method for dynamically allocating circuit breaker strategies of at least one embodiment of the present disclosure, the method also includes: receiving a second circuit breaker strategy and a fourth instruction, the fourth instruction being used to instruct that the second circuit breaker strategy be allocated to a query type in a database; establishing a mapping relationship between the query type and the second circuit breaker strategy; and storing the mapping relationship between the query type and the second circuit breaker strategy in a database.

[0017] According to the method for dynamically allocating circuit breaker strategies of at least one embodiment of the present disclosure, the method also includes: receiving a fifth instruction, the fifth instruction is used to instruct to delete the second circuit breaker strategy corresponding to the query type in the database; deleting the second circuit breaker strategy corresponding to the query type in the database.

[0018] According to the method for dynamically allocating circuit breaker strategies of at least one embodiment of the present disclosure, the method also includes: receiving a fourth circuit breaker strategy and a sixth instruction, the sixth instruction being used to instruct that the second circuit breaker strategy corresponding to the query type be updated to the fourth circuit breaker strategy in the database; deleting the second circuit breaker strategy corresponding to the query type in the database; establishing a mapping relationship between the query type and the fourth circuit breaker strategy; and storing the mapping relationship between the query type and the fourth circuit breaker strategy in the database.

[0019] According to the dynamic allocation method of circuit breaker strategies of at least one embodiment of the present disclosure, the first circuit breaker strategy includes: when the response time of the query request is greater than a first threshold, interrupting the execution of the query request; when the request error rate corresponding to the application software in a first time period is greater than a second threshold, blocking all query requests corresponding to the application software in a second time period.

[0020] According to the dynamic allocation method of the circuit breaker strategy of at least one embodiment of the present disclosure, the second circuit breaker strategy includes: when the response time of the query request is greater than the third threshold, interrupting the execution of the query request; when the request error rate corresponding to the query type in the third time period is greater than the fourth threshold, blocking all query requests corresponding to the query type in the fourth time period.

[0021] According to the dynamic allocation method of the circuit breaker strategy of at least one embodiment of the present disclosure, the default circuit breaker strategy includes: when the response time of the query request is greater than the fifth threshold, interrupting the execution of the query request; when the request error rate corresponding to the request path within the fifth time period is greater than the sixth threshold, blocking all query requests corresponding to the request path within the sixth time period.

[0022] According to a second aspect of the present disclosure, a server is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the dynamic allocation method of the fuse strategy of any embodiment of the present disclosure.

[0023] According to a third aspect of the present disclosure, a readable storage medium is provided, in which execution instructions are stored. When the execution instructions are executed by a processor, the method for dynamically allocating a fuse strategy in any embodiment of the present disclosure is implemented.

[0024] According to a fourth aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for dynamically allocating a fuse strategy according to any embodiment of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0026] Figure 1 An application scenario of a method for dynamically allocating fuse policies according to an embodiment of the present disclosure is shown.

[0027] Figure 2 The figure shows an overall flow chart of a method M100 for dynamically allocating fuse policies according to an embodiment of the present disclosure.

[0028] Figure 3 A schematic diagram of the overall process of a method M200 for dynamically allocating fuse policies according to another embodiment of the present disclosure is shown.

[0029] Figure 4 It is a schematic block diagram of the structure of a dynamic allocation device for fuse strategies according to an embodiment of the present disclosure.

[0030] Figure 5 It is a schematic block diagram of the structure of a server 3000 according to another embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] The present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is understood that the specific examples described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.

[0032] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0033] Currently, the server uses the same circuit breaker policy for all query requests, which may cause the circuit breaker policy to be incompatible with some query requests.

[0034] For example, assuming that the server's fuse policy sets the response time for query requests to 2 seconds, query requests corresponding to different application software may not match this response time.

[0035] For the query request of application software A, the normal query time in the server is usually 1.5 seconds to 3 seconds, and it is considered a query abnormality when it exceeds 3 seconds. After the server receives the query request of application software A, based on the server's fuse policy, as long as the processing time of the query request of application software A exceeds 2 seconds, the fuse will be triggered, which will cause many normal query requests to be judged as abnormal query requests, causing the server to frequently trigger the fuse, thereby affecting the normal query operation of application software A.

[0036] For the query request of application software B, the normal query time in the server is usually between 0.5 seconds and 1 second. If it exceeds 1 second, it is considered a query abnormality. After the server receives the query request of application software B, based on the server's fuse policy, the fuse will only be triggered if the processing time of the query request of application software B exceeds 2 seconds. This will cause many abnormal query requests to fail to be identified in time by the current fuse policy, that is, the server thread resources occupied by these abnormal query requests cannot be released in time. If the query requests of application software B access the server in a concentrated manner, then the query requests of application software B may occupy and exhaust the server's thread resources. Therefore, for the query requests of application software B, the current fuse policy cannot effectively prevent server overload.

[0037] To this end, the present disclosure proposes a method for dynamically allocating a fuse strategy, which can configure fuse strategies for different application software in advance, and after receiving a query request corresponding to the application software, can allocate the fuse strategy corresponding to the application software to the query request corresponding to the application software. Therefore, the technical solution of the present disclosure can avoid technical problems such as frequent triggering of fuses or delayed triggering of fuses due to the incompatibility of fuse strategies with query requests, and can effectively improve the stability and service quality of the server.

[0038] In order to facilitate understanding of the contents of the embodiments of the present disclosure, some technical terms used in the embodiments of the present disclosure are described below.

[0039] Circuit breaker strategy: It is a protection mechanism designed to prevent the server from continuing to bear excessive traffic pressure under high load or abnormal conditions, which may cause system crash or performance degradation. The circuit breaker strategy automatically triggers the circuit breaker to limit the traffic to a controllable range, thereby protecting the system from further damage.

[0040] Figure 1 The application scenario of the dynamic allocation method of the fuse strategy of an embodiment of the present disclosure is shown. In this application scenario, a server 101, a database 102, a network 103, a mobile phone 104 and a computer 105 are mainly shown, and the mobile phone 104 and the computer 105 can communicate with the server 101 through the network 103.

[0041] exist Figure 1 In the example shown, when a user is using application software A on mobile phone 104, in order to obtain information in application software A, the user can click the query button n1 in application software A. Application software A will generate a query request q1 corresponding to the query button n1. At this time, mobile phone 104 will send the query request q1 to server 101 through network 103.

[0042] After the server 101 receives the query request q1, the server 101 parses the request path j1 in the query request q1, obtains the configuration file p1 based on the request path j1, and obtains the application software A corresponding to the query request q1 in the configuration file p1.

[0043] At this time, the server 101 needs to determine whether there is a first fuse policy R1 corresponding to the application software A in the database 102. If the first fuse policy R1 corresponding to the application software A exists in the database 102, it means that the query request q1 corresponding to the application software A requires a special fuse policy, and the server 101 will assign the first fuse policy R1 to the query request q1.

[0044] Then, the server 101 determines whether to trigger a circuit breaker for the query request q1 based on the first circuit breaker policy R1.

[0045] For example, assuming that the normal query time of application software A's query request in the server is between 1.5 seconds and 3 seconds, and it is considered a query abnormality only when it exceeds 3 seconds. Therefore, it is reasonable to set the response time for application software A's query request to 3 seconds.

[0046] Therefore, the first fuse policy R1 can be configured as follows: when the response time of the query request q1 is greater than 3 seconds, the execution of the query request q1 is interrupted. Moreover, when the request error rate corresponding to the application software A is greater than 50% in 1 minute, all query requests corresponding to the application software A are blocked within 10 minutes.

[0047] based on Figure 1 As can be seen from the example shown, server 101 can avoid technical problems such as frequent triggering of circuit breakers or delayed triggering of circuit breakers due to the incompatibility of circuit breaker policies with query requests, and can effectively improve the stability and service quality of server 101.

[0048] exist Figure 1 In the example shown, when a user is using application software B on computer 105, in order to obtain information in application software B, the user can click a query button n2 in application software B. Application software B will generate a query request q2 corresponding to query button n2. At this time, computer 105 will send query request q2 to server 101 via network 103.

[0049] After the server 101 receives the query request q2, the subsequent execution process of the server 101 is similar to the execution process of the server 101 receiving the query request q1. Please refer to the execution process of the server 101 receiving the query request q1.

[0050] Figure 2 FIG. 1 is a schematic diagram showing the overall process of a method M100 for dynamically allocating a fuse strategy according to an embodiment of the present disclosure. Figure 2 The method shown includes steps S110 to S140. The method can be Figure 1 The server 101 shown is executed.

[0051] Specifically, Figure 2 The methods shown include: S110: Receive a query request sent by a terminal.

[0052] The terminal may be a mobile phone, tablet computer, laptop computer, desktop computer, etc. The query request is sent by the application software installed in the terminal, and the query request includes a request path.

[0053] S120: Determine the application software corresponding to the query request according to the request path.

[0054] Specifically, the application software corresponding to the query request can be determined according to the request path in the following manner: first, a configuration file is obtained based on the request path, the configuration file including the application software corresponding to the query request. Then, the application software corresponding to the query request in the configuration file is obtained.

[0055] S130: Determine whether there is a first fuse policy corresponding to the application software in the database.

[0056] Among them, the fuse policies may be configured in advance for different application software, and after receiving the query request corresponding to the application software, the fuse policy corresponding to the application software may be allocated to the query request corresponding to the application software.

[0057] Of course, for some application software, the default circuit breaker policy can be used without additional configuration of the circuit breaker policy. Whether it is necessary to configure additional circuit breaker policies for application software can be determined according to business needs.

[0058] Specifically, the first fuse strategy may include the following: when the response time of the query request is greater than the first threshold, interrupt the execution of the query request. When the request error rate corresponding to the application software in the first time period is greater than the second threshold, block all query requests corresponding to the application software in the second time period.

[0059] S140: If a first fuse policy corresponding to the application software exists in the database, assign the first fuse policy to the query request.

[0060] Among them, if there is a first fuse policy corresponding to the application software in the database, it means that the application software requires an additional fuse policy, then the first fuse policy pre-configured for the application software in the database can be assigned to the query request, so that the server can determine whether to trigger the fuse for the query request based on the first fuse policy.

[0061] exist Figure 2 In the example shown, the server can pre-configure fuse policies for different application software, and after receiving the query request corresponding to the application software, the fuse policy corresponding to the application software can be assigned to the query request corresponding to the application software. Therefore, the technical solution disclosed in the present invention can avoid technical problems such as frequent triggering of fuses or delayed triggering of fuses due to the incompatibility of the fuse policy with the query request corresponding to the application software, and can effectively improve the stability and service quality of the server.

[0062] exist Figure 2After S110 shown, that is, after the server receives the query request sent by the terminal, the server can also determine the query type corresponding to the query request according to the request path. When the server determines that the query type belongs to the slow query type, it determines the first thread pool corresponding to the slow query type, and allocates the idle thread resources in the first thread pool to the query request. When the server determines that the query type belongs to the quick query type, it determines the second thread pool corresponding to the quick query type, and allocates the idle thread resources in the second thread pool to the query request.

[0063] Among them, the query types corresponding to the query request mainly include hbese query, mysql query and indicator query. hbese query and mysql query belong to the fast query type, and indicator query belongs to the slow query type. This is because the query request corresponding to hbese query and mysql query has relatively simple query content, and the query request response time is usually short, so hbese query and mysql query belong to the fast query type. The query request corresponding to the indicator query has relatively complex query content, and the query request response time is usually long, so the indicator query belongs to the slow query type.

[0064] In order to prevent the query requests corresponding to the slow query type from being concentrated in a certain period of time and occupying a large number of server thread resources, it is necessary to split the server thread resources into two or more parts. If the server thread resources are split into two parts, a first thread pool and a second thread pool can be established respectively. The first thread pool mainly allocates thread resources for query requests corresponding to the slow query type, and the second thread pool mainly allocates thread resources for query requests corresponding to the fast query type.

[0065] After the thread resources of the server are split into the first thread pool and the second thread pool, even if the query requests corresponding to the slow query type are concentrated in a certain period of time, only the thread resources of the first thread pool will be exhausted, and the query requests corresponding to the fast query type will not be affected from obtaining the thread resources of the second thread pool. Therefore, the technical solution disclosed in the present invention can avoid the problem that the query requests corresponding to the slow query type are affected by the concentrated request of the query requests corresponding to the fast query type to reasonably obtain thread resources.

[0066] exist Figure 2 Before S110 shown, the fuse strategies corresponding to different application software may be configured in the database.

[0067] When adding the first fuse policy corresponding to the application software in the database, the server is required to implement it in the following manner: receiving the first fuse policy and the first instruction, the first instruction is used to indicate that the first fuse policy is assigned to the application software in the database. Establishing a mapping relationship between the application software and the first fuse policy. Storing the mapping relationship between the application software and the first fuse policy in the database.

[0068] When deleting the first fuse policy corresponding to the application software in the database, the server needs to implement it in the following manner: receiving a second instruction, the second instruction is used to instruct to delete the first fuse policy corresponding to the application software in the database. Deleting the first fuse policy corresponding to the application software in the database.

[0069] When updating the first fuse policy corresponding to the application software in the database, the server is required to implement it in the following manner: receiving the third fuse policy and the third instruction, the third instruction is used to instruct to update the first fuse policy corresponding to the application software to the third fuse policy in the database. Delete the first fuse policy corresponding to the application software in the database. Establish a mapping relationship between the application software and the third fuse policy. Store the mapping relationship between the application software and the third fuse policy in the database.

[0070] Figure 3 FIG. 2 is a schematic diagram showing the overall process of a method M200 for dynamically allocating a fuse strategy according to another embodiment of the present disclosure. Figure 3 The method shown includes steps S210 to S240, Figure 3 Steps S210 to S230 in Figure 2 After step S140. The method may be Figure 1 The server 101 shown is executed.

[0071] Specifically, Figure 3 The methods shown include: S210: If the first fuse policy corresponding to the application software does not exist in the database, determine the query type corresponding to the query request according to the request path.

[0072] When the first fuse policy corresponding to the application software does not exist in the database, it means that there is no need to allocate the first fuse policy to the query request corresponding to the application software.

[0073] However, in order to determine whether it is necessary to allocate the second fuse policy to the query request corresponding to the query type, it is also necessary to determine the query type corresponding to the query request according to the request path.

[0074] Specifically, the query type corresponding to the query request can be determined according to the request path in the following manner: first, a configuration file is obtained based on the request path, the configuration file including the query type corresponding to the query request. Secondly, the query type corresponding to the query request in the configuration file is obtained.

[0075] As mentioned above, the query types corresponding to query requests mainly include hbese queries, mysql queries, and indicator queries.

[0076] S220. Determine whether there is a second fuse policy corresponding to the query type in the database.

[0077] Among them, if the second fuse policy corresponding to the query type exists in the database, it means that the second fuse policy needs to be allocated to the query request corresponding to the query type.

[0078] S230: If a second fuse policy corresponding to the query type exists in the database, assign the second fuse policy to the query request.

[0079] Among them, after the server assigns the second fuse policy to the query request, the server can determine whether to trigger the fuse for the query request based on the second fuse policy.

[0080] Specifically, the second fuse strategy may include the following: when the response time of the query request is greater than the third threshold, interrupt the execution of the query request. When the request error rate corresponding to the query type in the third time period is greater than the fourth threshold, block all query requests corresponding to the query type in the fourth time period.

[0081] S240: If the second fuse policy corresponding to the query type does not exist in the database, assign a default fuse policy to the query request.

[0082] Among them, if the second fuse policy corresponding to the query type does not exist in the database, it means that there is no need to assign the second fuse policy to the query request corresponding to the query type. The default fuse policy can be assigned to the query request, and the server can determine whether to trigger the fuse for the query request based on the default fuse policy.

[0083] Specifically, the default fuse policy may include the following: when the response time of the query request is greater than the fifth threshold, interrupt the execution of the query request. When the request error rate corresponding to the request path in the fifth time period is greater than the sixth threshold, block all query requests corresponding to the request path in the sixth time period.

[0084] exist Figure 3 In the example shown, the server can pre-configure fuse policies for different query types, and after receiving a query request corresponding to a query type, the server can assign the fuse policy corresponding to the query type to the query request corresponding to the query type. Therefore, the technical solution disclosed in the present invention can avoid technical problems such as frequent triggering of fuses or delayed triggering of fuses due to the incompatibility of the fuse policy with the query request corresponding to the query type, and can effectively improve the stability and service quality of the server.

[0085] exist Figure 3 Before S210 shown, fuse policies corresponding to different query types may be configured in the database.

[0086] When adding the second fuse policy corresponding to the query type in the database, the server is required to implement it in the following manner: receiving the second fuse policy and a fourth instruction, the fourth instruction is used to indicate that the second fuse policy is assigned to the query type in the database. Establishing a mapping relationship between the query type and the second fuse policy. Storing the mapping relationship between the query type and the second fuse policy in the database.

[0087] When deleting the second fuse policy corresponding to the query type in the database, the server needs to implement it in the following manner: receiving a fifth instruction, the fifth instruction is used to instruct to delete the second fuse policy corresponding to the query type in the database. Deleting the second fuse policy corresponding to the query type in the database.

[0088] When updating the second fuse policy corresponding to the query type in the database, the server is required to implement it in the following manner: receiving the fourth fuse policy and the sixth instruction, the sixth instruction is used to instruct to update the second fuse policy corresponding to the query type to the fourth fuse policy in the database. Delete the second fuse policy corresponding to the query type in the database. Establish a mapping relationship between the query type and the fourth fuse policy. Store the mapping relationship between the query type and the fourth fuse policy in the database.

[0089] See also Figure 4 As shown, Figure 4 It is a schematic block diagram of the structure of a dynamic allocation device for fuse strategies according to an embodiment of the present disclosure.

[0090] like Figure 4 As shown, the dynamic allocation device of the fuse strategy includes: The receiving module 110 is configured to receive a query request sent by a terminal, where the query request includes a request path.

[0091] The determination module 120 is used to determine the application software corresponding to the query request according to the request path, and determine whether there is a first fuse policy corresponding to the application software in the database.

[0092] The allocation module 130 is configured to allocate the first fuse policy to the query request if the first fuse policy corresponding to the application software exists in the database.

[0093] The above-mentioned dynamic allocation device for fuse strategies may be in the form of computer software, and each module of the above-mentioned dynamic allocation device for fuse strategies may be implemented by a computer software module.

[0094] The implementation process of the functions and effects of each module in the dynamic allocation device of the above-mentioned fuse strategy is specifically detailed in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0095] See also Figure 5 As shown, Figure 5It is a schematic block diagram of the structure of a server 3000 according to another embodiment of the present disclosure.

[0096] The hardware structure of the server 3000 can be implemented using a bus architecture. The bus architecture can include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 3100 connects various circuits including one or more processors 3200, memory 3300, and / or hardware modules together. The bus 3100 can also connect various other circuits 3400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.

[0097] The bus 3100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. A bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one connecting line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0098] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.

[0099] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part.

[0100] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

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

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

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

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

[0105] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.

[0106] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0107] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.

Claims

1. A method for dynamically allocating a circuit breaker strategy, characterized in that: include: receiving a query request sent by a terminal, wherein the query request includes a request path; Determining the application software corresponding to the query request according to the request path; Determine whether there is a first fuse policy corresponding to the application software in the database; If the first fuse policy corresponding to the application software exists in the database, the first fuse policy is assigned to the query request.

2. The method according to claim 1, characterized in that The method further comprises: If the first fuse policy corresponding to the application software does not exist in the database, determining the query type corresponding to the query request according to the request path; Determine whether there is a second fuse policy corresponding to the query type in the database; If a second fuse policy corresponding to the query type exists in the database, the second fuse policy is assigned to the query request.

3. The method according to claim 2, characterized in that The method further comprises: If the second fuse policy corresponding to the query type does not exist in the database, a default fuse policy is assigned to the query request.

4. The method according to claim 1, characterized in that The method further comprises: Determining a query type corresponding to the query request according to the request path; When the query type belongs to the slow query type, determining a first thread pool corresponding to the slow query type, and allocating idle thread resources in the first thread pool to the query request; When the query type belongs to the quick query type, a second thread pool corresponding to the quick query type is determined, and idle thread resources in the second thread pool are allocated to the query request.

5. The method according to claim 1, characterized in that Determining the application software corresponding to the query request according to the request path includes: Acquire a configuration file based on the request path, where the configuration file includes the application software corresponding to the query request; Obtain the application software corresponding to the query request in the configuration file.

6. The method according to claim 2, characterized in that Determining the query type corresponding to the query request according to the request path includes: Acquire a configuration file based on the request path, where the configuration file includes a query type corresponding to the query request; Obtain the query type corresponding to the query request in the configuration file.

7. The method according to any one of claims 1 to 6, characterized in that: Optionally, the method further includes: receiving the first fuse policy and a first instruction, wherein the first instruction is used to instruct to assign the first fuse policy to the application software in a database; establishing a mapping relationship between the application software and the first fuse policy; and storing the mapping relationship between the application software and the first fuse policy in a database; Optionally, the method further includes: receiving a second instruction, the second instruction being used to instruct to delete the first fuse policy corresponding to the application software in the database; deleting the first fuse policy corresponding to the application software in the database; Optionally, the method further includes: receiving a third fuse policy and a third instruction, wherein the third instruction is used to instruct to update the first fuse policy corresponding to the application software to the third fuse policy in the database; deleting the first fuse policy corresponding to the application software in the database; establishing a mapping relationship between the application software and the third fuse policy; and storing the mapping relationship between the application software and the third fuse policy in the database; Optionally, the method further includes: receiving the second fuse policy and a fourth instruction, the fourth instruction being used to instruct to assign the second fuse policy to the query type in a database; establishing a mapping relationship between the query type and the second fuse policy; and storing the mapping relationship between the query type and the second fuse policy in a database; Optionally, the method further includes: receiving a fifth instruction, the fifth instruction being used to instruct to delete the second fuse policy corresponding to the query type in the database; deleting the second fuse policy corresponding to the query type in the database; Optionally, the method further includes: receiving a fourth fuse policy and a sixth instruction, wherein the sixth instruction is used to instruct that the second fuse policy corresponding to the query type is updated to the fourth fuse policy in the database; deleting the second fuse policy corresponding to the query type in the database; establishing a mapping relationship between the query type and the fourth fuse policy; and storing the mapping relationship between the query type and the fourth fuse policy in the database; Optionally, the first fuse strategy includes: when the response time of the query request is greater than a first threshold, interrupting the execution of the query request; when the request error rate corresponding to the application software in the first time period is greater than a second threshold, blocking all query requests corresponding to the application software in the second time period; Optionally, the second fuse strategy includes: when the response time of the query request is greater than a third threshold, interrupting the execution of the query request; when the request error rate corresponding to the query type in the third time period is greater than a fourth threshold, blocking all query requests corresponding to the query type in the fourth time period; Optionally, the default fuse strategy includes: when the response time of the query request is greater than a fifth threshold, interrupting the execution of the query request; when the request error rate corresponding to the request path within the fifth time period is greater than a sixth threshold, blocking all query requests corresponding to the request path within the sixth time period.

8. A server, characterized in that: include: a memory storing a computer program; as well as A processor, wherein the processor executes the computer program stored in the memory, so that the processor executes the method for dynamically allocating fuse strategies according to any one of claims 1 to 7.

9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the dynamic allocation method of the fuse strategy described in any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for dynamically allocating fuse strategies according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Network request forwarding method and device, storage medium and electronic equipment

    CN121125325A