Method and system for processing resource data, device and storage medium
By implementing fine-grained circuit breaker management on resource data under the transaction interface, the problem of overall system unavailability caused by interface anomalies in existing technologies has been solved, thus ensuring system stability and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-01
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, when data or resource data for a specific business scenario under an interface becomes abnormal during the transaction process, the entire interface is typically circuit-broken, causing data or resource data for other sub-business scenarios to become unavailable, thus affecting the overall availability of the system and user experience.
For each type of resource, the total number of uses and the number of usage failures are collected, the usage failure rate is calculated, and it is determined whether a preset threshold has been reached. If the threshold is reached, a circuit breaker is triggered, and if the circuit breaker duration reaches a preset duration threshold, the circuit breaker is closed to ensure the stability and availability of the system.
This system enables circuit breaking of data when a certain business data in the system is abnormal, ensuring the overall availability of the system and the user experience, without affecting the use of other data, and ensuring the stability of the transaction process and the user experience.
Smart Images

Figure CN114153644B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of big data technology, and in particular to a method, system, device and storage medium for resource data processing. Background Technology
[0002] In today's internet businesses, the execution process of each transaction, display, and payment is extremely complex. For example, in e-commerce, when a user clicks the payment confirmation button at the checkout, it may involve the coordinated processing of hundreds of systems. During this collaborative process, various anomalies can occur at any time, such as interface timeouts or system bugs. Each anomaly affects the user's current transaction process and experience, and can even impact GMV (Gross Merchandise Volume).
[0003] In existing technical methods, when an anomaly occurs, the entire interface is typically circuit-broken. For example, when an anomaly occurs, the upstream interface circuit-breaks the currently called interface, and no further requests are made. However, this technique of circuit-breaking at the interface level is not suitable for all business scenarios. For instance, under the same transaction-related interface, which retrieves multiple types of resource data or sub-business scenario data, if an anomaly occurs in one of the sub-business scenario data or resource data under that interface, circuit-breaking that interface would render all other sub-business scenario data or resource data under that interface unavailable. Summary of the Invention
[0004] To solve the above-mentioned technical problems, or at least partially solve them, embodiments of this disclosure provide a method, system, device, and storage medium for resource data processing.
[0005] In a first aspect, embodiments of this disclosure provide a method for processing resource data, applied to an interface associated with a transaction, the interface being used to retrieve multiple types of resources, the method comprising:
[0006] For each type of resource, collect the total number of times the resource was used and the number of times it failed to be used for that type.
[0007] Determine the failure rate of the current type of resource based on the total number of times the resource is used and the number of times it fails to be used.
[0008] Determine whether the failure rate of the current type of resource has reached a preset failure rate threshold:
[0009] When the failure rate of the current type of resource reaches the failure rate threshold, the current type of resource is circuit-broken.
[0010] In one possible implementation, the method further includes:
[0011] For resources that have already been suspended, the cumulative suspension duration of the resources;
[0012] Determine whether the circuit breaker duration for the resource has reached the preset duration threshold:
[0013] When the circuit breaker duration of a resource reaches a preset duration threshold, the current resource will be shut down via circuit breaker.
[0014] In one possible implementation, collecting the number of times the current type of resource has failed to be used includes: in response to the reason for the failure of the current type of resource being that the configuration information of the current resource is incorrect, accumulating the number of times the current type of resource has failed to be used.
[0015] In one possible implementation, the method further includes: in response to the reason for the failure to use the current type of resource being that the interface corresponding to the current type of resource timed out, performing a circuit breaker on the interface corresponding to the current type of resource, without accumulating the number of resource usage failures.
[0016] In one possible implementation, before collecting the total number of uses and failures of the current type of resource, the method further includes:
[0017] In response to a received resource query request, based on a known list of circuit-breaking resources, determine whether the resource matching the query request is in a circuit-breaking state:
[0018] When the resource is in a circuit breaker state, the current resource is not displayed;
[0019] When the resource is not in a circuit breaker state, the current resource is displayed for trading purposes.
[0020] In one possible implementation, the known list of circuit breaker resources is obtained through the following steps:
[0021] Collect the circuit breaker status of all resources, and aggregate all circuit-breaker resources into a known list of circuit-breaker resources to determine whether the resource matching the resource query request is in a circuit-breaker state.
[0022] In one possible implementation, before determining whether the resource matching the resource query request is in a circuit-breaking state based on a known list of circuit-breaking resources, the method further includes:
[0023] Determine whether the resource matched by the resource query request corresponds to the transaction order and trader information in the resource query request:
[0024] When the resource matched by the resource query request corresponds to the transaction order and trader information in the resource query request, the step of determining whether the resource matched by the resource query request is in a circuit breaker state is executed.
[0025] Secondly, embodiments of this disclosure provide a resource data processing system applied to a transaction-related interface, the interface being used to retrieve multiple types of resources, the system comprising:
[0026] The scheduler is used to collect the total number of times the resource is used and the number of times it fails for each type of resource; determine the failure rate of the resource for the current type based on the total number of times the resource is used and the number of times it fails; and determine whether the failure rate of the resource for the current type reaches a preset failure rate threshold. When the failure rate of the resource for the current type reaches the failure rate threshold, the resource for the current type is circuit-broken.
[0027] In one possible implementation, the system further includes:
[0028] The user side provides the total number of times resources of the current type have been used and the number of times they have failed to be used.
[0029] The query terminal, in response to a received resource query request, determines from the known list of circuit-breaking resources gathered by the scheduler whether the resource matching the query request is in a circuit-breaking state. If the resource is not in a circuit-breaking state, it displays the current resource for transaction use.
[0030] Thirdly, embodiments of this disclosure provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0031] Memory, used to store computer programs;
[0032] The processor, when executing a program stored in memory, implements the above-described method for processing resource data.
[0033] Fourthly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the resource data processing method described above.
[0034] Compared with the prior art, the technical solutions provided in this disclosure have at least some or all of the following advantages:
[0035] The resource data processing method and system described in this disclosure are applied to an interface associated with transactions. The interface is used to retrieve multiple types of resources. For each type of resource, the total number of uses and the number of failed uses of the current type of resource are collected. The failure rate of the current type of resource is determined based on the total number of uses and the number of failed uses. It is then determined whether the failure rate of the current type of resource reaches a preset failure rate threshold. When the failure rate of the current type of resource reaches the failure rate threshold, the current type of resource is circuit-broken. This allows for data circuit breaking when a certain business data, a certain sub-scenario data, or even a certain type of data in the system becomes abnormal, ensuring the overall availability and stability of the system, ensuring that the user experience is not affected, and not impacting the use of other data. Attached Figure Description
[0036] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0037] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0038] Figure 1 A schematic flowchart of a method for processing resource data according to an embodiment of the present disclosure is shown.
[0039] Figure 2 A schematic flowchart of a method for processing resource data according to another embodiment of the present disclosure is shown.
[0040] Figure 3 A schematic flowchart of a method for processing resource data according to yet another embodiment of the present disclosure is shown.
[0041] Figure 4 A schematic flowchart of a method for processing resource data according to yet another embodiment of the present disclosure is shown.
[0042] Figure 5 This schematic diagram illustrates the structural block diagram of a resource data processing system in the prior art;
[0043] Figure 6 This schematically illustrates a structural block diagram of a system for processing resource data according to an embodiment of the present disclosure;
[0044] Figure 7(a) schematically illustrates the workflow of a user end of a resource data processing system according to an embodiment of the present disclosure;
[0045] Figure 7(b) schematically illustrates the workflow of the scheduler of a resource data processing system according to an embodiment of the present disclosure;
[0046] Figure 7(c) schematically illustrates the workflow of the query terminal of a resource data processing system according to an embodiment of the present disclosure; and
[0047] Figure 8 A schematic block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0049] See Figure 1 The embodiments of this disclosure provide a method for processing resource data, applied to an interface associated with a transaction, the interface being used to retrieve multiple types of resources, the method comprising the following steps:
[0050] S1, for each type of resource, collect the total number of times the resource was used and the number of times it failed to be used;
[0051] In practical applications, multiple types of resources can be multiple types of coupons. The total number of uses and the number of failed uses here refer to the total number of uses and the number of failed uses for a single coupon.
[0052] S2, determine the failure rate of the current type of resource based on the total number of times the current type of resource is used and the number of times it fails to be used;
[0053] S3, determine whether the failure rate of the current type of resource reaches a preset failure rate threshold:
[0054] If so, proceed to step S4;
[0055] If not, then no response will be given;
[0056] S4, circuit breaking for the current type of resource;
[0057] S5, for resources that have already been circuit-broken, the cumulative circuit-broken duration of the resources;
[0058] S6, determine whether the circuit breaker duration of the resource has reached the preset duration threshold:
[0059] If so, proceed to step S7;
[0060] If not, proceed to step S8;
[0061] S7, shuts down the circuit-broken resource;
[0062] S8 keeps the already melted resources in a melted state.
[0063] In this embodiment, see Figure 2 In step S1, collecting the number of failed uses of the current type of resource includes:
[0064] S21, In response to the reason that the current type of resource usage failure is due to incorrect configuration information of the current resource, the cumulative number of resource usage failures is calculated;
[0065] In practical applications, errors in the current resource configuration information may include situations where the rules configured for the current resource depend on other downstream interfaces, or problems with the downstream interfaces prevent the current resource from being called and verified.
[0066] S22, in response to the reason that the failure to use the current type of resource is due to the timeout problem of the interface corresponding to the resource, the interface corresponding to the current type of resource is circuit-broken, and the number of failures to use the resource is not accumulated.
[0067] In practical applications, interface timeouts are defined as follows: Both the resource caller and the resource provider can set an interface timeout period. Taking the resource caller as an example, if the resource caller needs to call a remote interface, in order to ensure service quality, a timeout period for calling the interface is generally set. For example, the timeout period for calling the interface is set to 1 second. If no result is received after 1 second after calling the remote interface, then it is considered that the interface has timed out.
[0068] In this embodiment, see Figure 3 In step S1, before collecting the total number of uses and the number of usage failures of the current type of resource, the method further includes:
[0069] S31, in response to the received resource query request, based on the known list of circuit-breaking resources, determine whether the resource matching the resource query request is in a circuit-breaking state:
[0070] If so, proceed to step S32;
[0071] If not, proceed to step S33;
[0072] S32, do not display the current resource;
[0073] S33 displays the current resources used for transactions.
[0074] In this embodiment, see Figure 4 In step S31, the known list of circuit breaker resources is obtained through the following steps:
[0075] S41, collect the circuit breaker status of all resources;
[0076] S42, gather all the circuit-broken resources into a known list of circuit-broken resources, which is used to determine whether the resource matching the resource query request is in a circuit-broken state.
[0077] In this embodiment, before determining whether the resource matching the resource query request is in a circuit-breaking state based on the known list of circuit-breaking resources in step S33, the method further includes:
[0078] Determine whether the resource matched by the resource query request corresponds to the transaction order and trader information in the resource query request:
[0079] When the resource matched by the resource query request corresponds to the transaction order and trader information in the resource query request, the step of determining whether the resource matched by the resource query request is in a circuit breaker state is executed.
[0080] Based on the same inventive concept, a resource data processing system provided in a second exemplary embodiment of this disclosure is applied to an interface associated with a transaction, the interface being used to retrieve multiple types of resources, the system including a scheduler, a user end, and a query end.
[0081] In this embodiment, the scheduler is used to collect the total number of times the resource of the current type is used and the number of times it fails to be used for each type of resource; determine the failure rate of the current type of resource based on the total number of times the resource is used and the number of times it fails to be used; and determine whether the failure rate of the current type of resource reaches a preset failure rate threshold. When the failure rate of the current type of resource reaches the failure rate threshold, the current type of resource is circuit-broken.
[0082] In practical applications, the total number of times resources of the current type are used and the number of times they fail to be used are collected in real time, stored in Redis, and the data is summarized and processed. Finally, the data is saved to ZooKeeper (hereinafter referred to as zk) for broadcast.
[0083] In this embodiment, the user end is used to provide the total number of times the resource of the current type has been used and the number of times it has failed to be used.
[0084] In this embodiment, the query terminal is used to respond to a received resource query request, determine from the known list of circuit-breaking resources collected by the scheduler whether the resource matching the resource query request is in a circuit-breaking state, and if the resource is not in a circuit-breaking state, display the current resource for transaction use.
[0085] In this embodiment, the scheduler is also used for:
[0086] For resources that have already been suspended, the cumulative suspension duration of the resources;
[0087] Determine whether the circuit breaker duration for the resource has reached the preset duration threshold:
[0088] When the circuit breaker duration of a resource reaches a preset duration threshold, the current resource will be shut down via circuit breaker.
[0089] In this embodiment, the user terminal is also used for:
[0090] The reason for the failure to use the current type of resource is that the configuration information of the current resource is incorrect, and the cumulative number of failures to use the current type of resource is recorded.
[0091] In this embodiment, the user terminal is also used for:
[0092] If the failure to use the current type of resource is due to a timeout in the interface corresponding to the current resource type, the interface corresponding to the current type of resource will be circuit-broken, and the number of resource failures will not be accumulated.
[0093] In this embodiment, the query terminal is also used for:
[0094] In response to a received resource query request, based on a known list of circuit-breaking resources, determine whether the resource matching the query request is in a circuit-breaking state:
[0095] When the resource is in a circuit breaker state, the current resource is not displayed;
[0096] When the resource is not in a circuit breaker state, the current resource is displayed for trading purposes.
[0097] In this embodiment, the scheduler is also used for:
[0098] Collect the circuit breaker status of all resources, and aggregate all circuit-breaker resources into a known list of circuit-breaker resources to determine whether the resource matching the resource query request is in a circuit-breaker state.
[0099] In this embodiment, the user terminal is also used for:
[0100] Before determining whether the resource matching the resource query request is in a circuit breaker state based on the known list of circuit breaker resources, it is determined whether the resource matching the resource query request corresponds to the transaction order and trader information in the resource query request:
[0101] When the resource matched by the resource query request corresponds to the transaction order and trader information in the resource query request, the step of determining whether the resource matched by the resource query request is in a circuit breaker state is executed.
[0102] In this embodiment, see Figure 5 and Figure 6 In the application scenario where resources are coupons, the workflow of the resource data processing system disclosed herein was compared with that of existing technologies.
[0103] Application scenario: The system provides users with a variety of coupons, each with its own usage scenario. Users will use different coupons when purchasing different products. When a certain coupon is abnormal due to data, system or other issues, it will be promptly disconnected and taken offline, while other coupons will not be affected.
[0104] See Figure 5 In the current application scenarios, there are two main parts: the "coupon query terminal" and the "coupon usage terminal." The interaction process between the two is as follows:
[0105] The coupon search interface filters coupons based on basic information such as order and user when a transaction begins, and displays the matching results to the user.
[0106] On the coupon usage side, when a user makes a payment, the system uses the displayed coupon. First, it verifies the coupon's validity (this is usually the same as the query, verifying the coupon based on the order and user information), writes the usage result to the DB (Database), and then returns the final result to the calling end.
[0107] Figure 5 The system shown cannot achieve the following effect: For example, if there are five coupons (A_1, A_2, A_3, A_4, and A_5) available for users, due to an operational configuration error, coupon A_3 may be displayed to users, but the user will be prompted with a failure message when trying to use it for payment, severely impacting the user experience. In this scenario, coupon A_3 needs to be blocked, while the other four coupons (A_1, A_2, A_4, and A_5) should remain unaffected and can be used normally.
[0108] Therefore, to add a business-based circuit breaker and degradation function to the system, see [link / reference]. Figure 6The overall interaction flow is as follows: The system flow is divided into three parts: "Coupon Inquiry Terminal", "Coupon Usage Terminal", and "Scheduler". These three parts are explained in the order of system circuit breaker degradation: "Coupon Usage Terminal", "Scheduler", and "Coupon Inquiry Terminal".
[0109] See Figure 7(a), coupon usage interface:
[0110] The data collection section is the core. When a user uses a coupon, after the validity is verified and the data is written to the database, the data is collected. This collection mainly involves calculating the total number of times the coupon has been used and the number of failed uses. The total number of uses is recorded for every transaction, while failed uses are only counted when a transaction fails. It's important to note that the scenario for counting failures must be clearly defined. Only transactions where the failure is due to the coupon itself are counted. If a timeout issue between systems causes a failure, it should not be counted, otherwise all coupons will be affected by the circuit breaker. Regarding system timeout issues, an interface-level circuit breaker, such as Hystrix, is used, which triggers the circuit breaker based on the interface's return code.
[0111] After collecting the necessary statistics, the Redis `incr` function is used for storage, with the total number of uses and the number of failures saved separately. Once the data is saved, the usage result is returned to the calling interface. It's important to note that exceptions may occur during data collection, but these exceptions are handled using an asynchronous thread to ensure they don't affect the return result to the calling interface. When using Redis (an open-source, ANSI C-based, network-enabled, in-memory or persistent, log-structured key-value database that provides APIs for multiple languages), the key can be prefixed with the coupon number, and the value can be the total number of coupon uses and the cumulative number of failures.
[0112] See Figure 7(b), scheduler:
[0113] The scheduler (which can execute scheduled tasks, with the system executing code at regular intervals) periodically summarizes and statistically analyzes the data collected from the "coupon usage end." First, let's analyze the "data acquisition" link in the diagram: the scheduler periodically retrieves the collected data from Redis and determines whether a coupon has reached the circuit breaker threshold based on the ratio of failure counts to total usage counts. For example, if it's pre-defined that a circuit breaker will be triggered when the failure rate reaches 50%, then when the failure count / total usage count is greater than or equal to 50%, it indicates that the circuit breaker threshold has been reached and the coupon needs to be triggered.
[0114] The following explains the process of "obtaining current and suspended coupons": When the scheduler is processing, some coupons may already be in a suspended state. Some of these coupons still need to be suspended, while others will be released after a certain period of suspension (similar to the open and close operations in a circuit breaker). It is necessary to analyze these currently suspended coupons to identify those that still need to be suspended and those that need to be closed in the subsequent operations. This analysis can be based on the duration of a coupon's suspension. For example, if the validity period of a suspension is pre-defined as 1 minute, then based on the suspension duration of each currently suspended coupon, if it has reached 1 minute, it will be closed; otherwise, it will remain suspended.
[0115] After collecting data through the above two steps, a new list of coupons requiring circuit breaking is obtained. These coupons are then pushed to ZooKeeper (a typical distributed data consistency solution; distributed applications can use ZooKeeper to implement functions such as data publishing / subscription, load balancing, naming services, distributed coordination / notification, cluster management, master election, distributed locks, and distributed queues). The push includes the current time information, and the time can be used to calculate whether the circuit breaker should be activated.
[0116] See Figure 7(c), coupon query interface:
[0117] In the query process, the business system receives the circuit breaker list data broadcast by ZooKeeper and saves it to the server memory. When a coupon is matched, the system checks whether the coupon is in the circuit breaker list. If it is, the current coupon is not returned; otherwise, the current coupon is returned.
[0118] The system in this embodiment can be a computer software platform, etc.
[0119] The system in this embodiment can achieve fine-grained circuit breaking through the above collaborative processing, and can quickly break circuits based on abnormal situations. It can also perform special processing on different business data in the same system process. For example, when a certain data is abnormal, only that data is broken and downgraded, while other data remains unaffected.
[0120] The system in this embodiment compares... Figure 5 and Figure 6 It can be seen that the development cost is low, the system access cost is low, the learning cost is low, and it does not have much impact on the original business, requiring no major modifications.
[0121] After receiving broadcast data, the query end of the system in this embodiment performs in-memory calculations, which has no performance loss for the overall process, and the circuit breaker is quickly tripped within seconds to ensure user experience.
[0122] The system in this embodiment can be used not only in the coupon circuit breaker scenario, but also in other scenarios.
[0123] In this embodiment, different circuit breaker schemes are determined based on different abnormal situations. When a severe timeout occurs, the downstream interface needs to be circuit-broken to protect it. When the abnormality belongs to an individual business, the entire interface cannot be downgraded. For example, in e-commerce systems, coupons are often used. There are hundreds or thousands of coupons. When a user fails to use a coupon due to a data problem, it is circuit-broken and downgraded without affecting the use of other coupons. It can perform business circuit breaking for different business types and different data in the business system to ensure the availability of the overall interface through business circuit breaking. The circuit breaking of a single data does not affect other related data and business.
[0124] It is worth noting that the resources in this embodiment can be virtual resources such as goods.
[0125] The specific implementation process of the functions and roles of each part in the above system can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0126] For the system embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0127] Based on the same inventive concept, referring to Figure 8 As shown, the third exemplary embodiment of this disclosure provides an electronic device including a processor 1110, a communication interface 1120, a memory 1130, and a communication bus 1140, wherein the processor 1110, the communication interface 1120, and the memory 1130 communicate with each other through the communication bus 1140.
[0128] Memory 1130 is used to store computer programs;
[0129] When processor 1110 executes a program stored in memory 1130, it implements the following method for processing resource data:
[0130] Collect the total number of times the resource was used and the number of times it failed to be used;
[0131] The resource failure rate is determined based on the total number of times the resource is used and the number of times it fails to be used.
[0132] Determine whether the failure rate of the resource reaches a preset failure rate threshold:
[0133] When the failure rate of the resource reaches the failure rate threshold, the current resource is circuit-broken.
[0134] The aforementioned communication bus 1140 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, it is represented by only one thick line in the figure, but this does not indicate that there is only one bus or one type of bus.
[0135] The communication interface 1120 is used for communication between the above-mentioned electronic device and other devices.
[0136] The memory 1130 may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory 1130 may also be at least one storage device located remotely from the aforementioned processor 1110.
[0137] The processor 1110 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0138] Based on the same inventive concept, a fourth exemplary embodiment of this disclosure also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the resource data processing method described above.
[0139] The computer-readable storage medium may be included in the device / apparatus described in the above embodiments; or it may exist independently and not assembled into the device / apparatus. The computer-readable storage medium carries one or more programs that, when executed, implement the resource data processing method according to the embodiments of this disclosure.
[0140] According to embodiments of this disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0141] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0142] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method of resource data processing, characterized by, The method is applied to an interface associated with a transaction, the interface being used to call multiple types of resources, and the method comprises: For each type of resource, collecting the total number of uses and the number of use failures of the current type of resource; Determining the use failure rate of the current type of resource according to the total number of uses and the number of use failures of the current type of resource; Judging whether the use failure rate of the current type of resource reaches a preset use failure rate threshold: When the use failure rate of the current type of resource reaches the use failure rate threshold, fusing the current type of resource; Before the collecting the total number of uses and the number of use failures of the current type of resource, the method further comprises: In response to a received resource query request, judging whether the resource matched with the resource query request is in a fused state based on a known fused resource list: When the resource is in the fused state, not displaying the current resource; When the resource is not in the fused state, displaying the current resource for transaction use.
2. The method of claim 1, wherein, The method further comprises: For the fused resource, accumulating the fused duration of the resource; Judging whether the fused duration of the resource reaches a preset duration threshold: When the fused duration of the resource reaches the preset duration threshold, fusing and closing the current resource.
3. The method of claim 1, wherein, The collecting the number of use failures of the current type of resource comprises: in response to the reason for the use failure of the current type of resource being that the configuration information of the current resource is incorrect, accumulating the number of use failures of the current type of resource.
4. The method of claim 3, wherein, The method further comprises: in response to the reason for the use failure of the current type of resource being that the interface corresponding to the current type of resource times out, fusing the interface corresponding to the current type of resource, and not accumulating the number of use failures of the resource.
5. The method of claim 1, wherein, The known fused resource list is obtained by the following steps: Collecting the fused states of all resources, and collecting all the fused resources into the known fused resource list for judging whether the resource matched with the resource query request is in the fused state.
6. The method of claim 1, wherein, Before judging whether the resource matched with the resource query request is in the fused state based on the known fused resource list, the method further comprises: Judging whether the resource matched with the resource query request corresponds to the information of a transaction order and a transaction person in the resource query request: When the resource matched with the resource query request corresponds to the information of the transaction order and the transaction person in the resource query request, performing the step of judging whether the resource matched with the resource query request is in the fused state.
7. A system for resource data processing, characterized by The system is applied to an interface associated with a transaction, the interface being used to call multiple types of resources, and the system comprises: The scheduler is configured to, for each type of resource, collect a total number of usage times and a number of failure times of the current type of resource; determine a failure rate of the current type of resource according to the total number of usage times and the number of failure times of the current type of resource; determine whether the failure rate of the current type of resource reaches a preset failure rate threshold; and perform fuse on the current type of resource when the failure rate of the current type of resource reaches the failure rate threshold. Before the collection of the total number of usage times and the number of failure times of the current type of resource, the system further comprises: in response to a received resource query request, determining whether a resource matched with the resource query request is in a fuse state based on a known fuse resource list; when the resource is in the fuse state, not displaying the current resource; and when the resource is not in the fuse state, displaying the current resource for transaction use.
8. The system of claim 7, wherein, The system further comprises: a use end configured to provide the total number of usage times and the number of failure times of the current type of resource; a query end configured to, in response to a received resource query request, determine whether a resource matched with the resource query request is in a fuse state from a known fuse resource list collected by the scheduler, and display the current resource for transaction use when the resource is not in the fuse state.
9. An electronic device, comprising: The system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus. The memory is configured to store a computer program. The processor is configured to execute the program stored in the memory to implement the method for processing resource data according to any one of claims 1-6.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method for processing resource data according to any one of claims 1-6.
Citation Information
Patent Citations
Method, device, apparatus and computer-readable storage medium for fusing service resources
CN109240765A
Method for reducing time consumption of calling service
CN112783926A