Flow control method and device of payment system, electronic equipment and storage medium
By obtaining and comparing the flow control policy and rule information in the payment system and determining the control strategy of the target service interface, the problems of low flexibility and poor stability of the existing payment system flow control methods are solved, and more efficient and stable flow control effects are achieved.
Patent Information
- Application Number
- CN202411810257.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-11
AI Technical Summary
The existing payment system has low flexibility and poor stability, and cannot efficiently adapt to the dynamic capital scenario needs, resulting in the system being unable to achieve high-quality services in complex scenarios.
By obtaining the service flow control policy, interface call information corresponding to the target service request and the target service interface target rule information, comparing multiple interface parameter information and rule threshold information, determining the target control policy of the target service interface, and performing service request flow control based on this policy.
It improves the flexibility, accuracy and stability of service request traffic control, ensures that the interface service quality is not affected by traffic peaks or abnormal traffic, and improves the stability and service quality of the system.
Smart Images

Figure CN119599649A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of payment technology, and in particular to a flow control method, device, electronic device and storage medium of a payment system. Background Art
[0002] In payment and financial systems, loss control is a key task in business operations. However, current loss control technologies face challenges in practical applications, such as complex implementation, high maintenance costs, and inconsistent systems. In addition, the standardization and unification issues in the fund management process have long existed and are difficult to be completely resolved.
[0003] The existing extension solutions are not compatible with business scenarios and cannot efficiently adapt to dynamic funding scenario requirements. In the prior art, there are many interface business request flow control methods corresponding to payment scenarios, which cannot respond to different user needs for interface flow control, have poor flexibility, and have unstable control, which makes the system unable to provide high-quality services in complex scenarios, reducing the system's service quality. Therefore, a new flow control method is needed. Summary of the invention
[0004] In view of this, the embodiments of the present invention provide a flow control method, device, electronic device and storage medium for a payment system to solve technical problems such as low flexibility and poor stability in flow control of the payment system.
[0005] One aspect of the present invention provides a flow control method for a payment system, the method comprising the following steps:
[0006] Obtaining a business flow control strategy, interface call information corresponding to a target business request, and target rule information corresponding to a target business interface; the business flow control strategy includes multiple flow control strategies, and the multiple flow control strategies are different flow control strategies set in a payment system based on system stability requirements; the interface call information includes multiple interface parameter information; the target rule information is rule information set based on target business requirements of a target user, and the target rule information includes multiple rule threshold information;
[0007] Based on the multiple interface parameter information and the multiple rule threshold information, corresponding comparison is performed to obtain corresponding comparison results of each interface parameter information;
[0008] Based on the corresponding comparison results of each interface parameter information, a target control policy of the target service interface is determined from the multiple flow control policies, and service request flow control of the target service interface is performed based on the target control policy.
[0009] Another aspect of the present invention provides a flow control method device for a demand payment system, wherein the device package acquisition module is used to acquire a payment flow control strategy, interface call information corresponding to a target business interface, and target rule information corresponding to the target business interface; the business flow control strategy includes multiple flow control strategies, and the multiple flow control strategies are different flow control strategies set in the payment system based on system stability requirements; the interface call information includes multiple interface parameter information; the target rule information is rule information set based on the target business requirements of the target user, and the target rule information includes multiple rule threshold information;
[0010] A comparison module, used for performing corresponding comparison based on the plurality of interface parameter information and the plurality of rule threshold information to obtain a corresponding comparison result of each interface parameter information;
[0011] A control module is used to determine a target control strategy of the target service interface from the multiple flow control strategies based on the corresponding comparison results of each interface parameter information, and perform service request flow control of the target service interface based on the target control strategy.
[0012] Another aspect of the present invention provides an electronic device, comprising:
[0013] processor;
[0014] a memory for storing instructions executable by the processor;
[0015] The processor is configured to execute the instructions to implement any of the flow control methods described above.
[0016] Another aspect of the present invention provides a computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute any of the flow control methods described above.
[0017] The present invention provides a flow control method, device, electronic device and storage medium for a payment system, which improves the real-time performance of obtaining target rule information and the flexibility of setting target rule information by acquiring a business flow control strategy, interface call information corresponding to a target business request and target rule information corresponding to a target business interface set based on target business requirements of a target user; further, based on multiple interface parameter information and multiple rule threshold information, a corresponding comparison is performed to obtain a corresponding comparison result for each interface parameter information, thereby achieving flexibility and accuracy in determining the corresponding comparison result; further, based on the corresponding comparison result for each interface parameter information, a target control strategy for a target business interface is determined from multiple flow control strategies, and business request flow control for the target business interface is performed based on the target control strategy, thereby improving the flexibility, accuracy and stability of business request flow control, ensuring that the interface service quality is not affected by flow peaks or abnormal flow, ensuring the service quality of the target business interface, and further improving the stability, service quality and user experience of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 is a flow chart of a flow control method of a payment system provided according to an exemplary embodiment;
[0020] Figure 2 is a schematic diagram of a process for obtaining interface call information provided according to an exemplary embodiment;
[0021] Figure 3 is a schematic diagram of a process for determining target rule information provided according to an exemplary embodiment;
[0022] Figure 4 is a flow chart of obtaining a corresponding comparison result of each interface parameter information according to an exemplary embodiment;
[0023] Figure 5 is a flow chart of determining a target control strategy for a target service interface according to an exemplary embodiment;
[0024] Figure 6 is a flow chart of adjusting a target control strategy based on a current traffic load and a traffic load range according to an exemplary embodiment;
[0025] Figure 7 It is a structural diagram of a flow control method and device of a payment system provided according to an exemplary embodiment. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Figure 1 1 is a flow chart of a flow control method of a payment system provided according to an exemplary embodiment. The following describes an embodiment of a flow control method of a payment system of the present application, taking the server as the execution subject. Specifically, Figure 1 As shown, the method includes:
[0029] S101: Acquire a service flow control policy, interface call information corresponding to a target service request, and target rule information corresponding to a target service interface.
[0030] In a specific embodiment, the business flow control strategy may be an interface business flow control strategy set in the payment system, and the business flow control strategy may include multiple flow control strategies, and the multiple flow control strategies may be different flow control strategies set in the payment system based on system stability requirements; the interface call information may include multiple interface parameter information; the target rule information may be rule information set based on the target business requirements of the target user, and the target rule information may include multiple rule threshold information; the target business requirement may be the target user's demand information for the target business; the target business request may be a request issued by the target user for the target business; the target business interface may be an interface for servicing the target business request;
[0031] Specifically, during the operation of the payment project, when the target user sends a target business request to the target business interface, the business flow control strategy, the interface call information corresponding to the target business request and the target rule information corresponding to the target business interface are obtained; optionally, during the operation of the payment project, the payment project corresponds to many business scenarios, and the target user corresponds to many business needs. Accordingly, the target user sends the corresponding target business request to the target business interface in the corresponding business scenario based on the business needs; optionally, when the payment project is started, the server will load the JAR package related to the payment project. Optionally, specifically, the Java reflection mechanism is referenced in the payment project. Optionally, the Java reflection mechanism allows the project program to check and operate the internal structure of the class at runtime. Specifically, when the payment project is started, the payment project uses the dynamic class loading method to load the JAR package in the payment project. Specifically, the payment project will obtain the configuration file corresponding to the payment project. , and then dynamically load the JAR package corresponding to the payment project based on the dependency information in the configuration file. The system will load local configuration files (such as application.yml or application.properties) and remote configuration files (such as Apollo or Nacos). Optionally, the dependency information between the payment project and the JAR package is defined in the configuration file of the payment project. Specifically, the dependency information can be the association relationship between the payment project and the JAR package. Correspondingly, after the payment project is started, the JAR package related to the flow control starts to run. Further, the target user sets the target rule information according to business needs. Specifically, the target user sets the configuration file information of the payment project, and accordingly, sets the target rule information. Further, when the target user sends a target business request, the interface call information corresponding to the target business request and the target rule information corresponding to the target business interface are obtained based on the target business request of the target user.
[0032] Figure 2 FIG. 1 is a flow chart of obtaining interface call information according to an exemplary embodiment. In an optional embodiment, the interface call information may further include interface address information, and the target rule information may further include location restriction information, such as Figure 2 As shown, the above method may also include:
[0033] S201: Determine the access result of the target service interface based on the interface address information and the location restriction information;
[0034] S203: When the access result indicates that the target service interface is accessible, obtain interface call information corresponding to the target service request.
[0035] In a specific embodiment, the interface address information may be the path name parameter information of the target business interface, and the location restriction information may be the restriction information on the interface address area. Optionally, the location restriction information includes multiple restriction locations. Specifically, the interface address information is matched with the multiple restriction locations in the location restriction information to determine whether the interface address information of the target business interface is in the location restriction information. If the location restriction information does not contain the interface address information, the access result is determined to be that the target business interface is accessible. If the location restriction information contains the interface address information, the access result is determined to be that the target business interface is inaccessible. Furthermore, if the access result indicates that the target business interface is accessible, the interface call information corresponding to the target business request is obtained.
[0036] In the above embodiment, by screening the interface address information of the target business interface, determining that the target business interface is accessible, and then obtaining the interface call information corresponding to the target business request, the rigor and security of the interface access are improved, thereby improving the rigor of obtaining the interface call information.
[0037] Figure 3 FIG. 1 is a flow chart of determining target rule information according to an exemplary embodiment. In an optional embodiment, Figure 3 As shown, the above method may also include:
[0038] S301: Obtaining a request interface name, a plurality of preset rule information, and an information identifier corresponding to each preset rule information of a target service request;
[0039] S303: Based on the request interface name and the information identifier corresponding to each preset rule information, name identifier matching is performed to determine target rule information corresponding to the target service interface from multiple preset rule information.
[0040] In a specific embodiment, the request interface name may be a service interface name of a target business request; the plurality of preset rule information may be preset rule information corresponding to the plurality of business interfaces; the information identifier corresponding to each preset rule information may be an identifier of each preset rule information, and optionally, the information identifier corresponding to each preset rule information includes information such as a rule information name and a rule information number of the preset rule information;
[0041] Specifically, the request interface name of the target business interface required for the target business request is obtained. Optionally, the interface request name is generally the interface name of the target business interface. Optionally, the association relationship between the target business interface and the target rule information is defined in the configuration file of the payment project. Specifically, the association can be based on the interface name of the target business interface and the rule information name of the target rule information, or based on the interface number of the target business interface and the rule information number of the target rule information. Accordingly, the target business interface can be determined based on the request interface name in the target business request. Furthermore, name identifier matching is performed based on the request interface name and the information identifier corresponding to each preset rule information, and the target rule information corresponding to the target business interface is determined from multiple preset rule information.
[0042] In the above embodiment, target rule information is determined from multiple preset rule information by matching identification information, and then service request flow control of the target service interface is performed based on the target rule information, thereby improving the accuracy and convenience of service request flow control.
[0043] S103: Perform corresponding comparison based on the multiple interface parameter information and the multiple rule threshold information to obtain corresponding comparison results for each interface parameter information.
[0044] In a specific embodiment, multiple interface parameter information and multiple rule threshold information are compared accordingly, that is, each interface parameter information is compared with the preset rule threshold information corresponding to each interface parameter information in multiple preset rule threshold information, so as to obtain the corresponding comparison result of each interface parameter information.
[0045] Figure 4 is a flowchart of obtaining a corresponding comparison result of each interface parameter information according to an exemplary embodiment. In an optional embodiment, the multiple interface parameter information includes the current request frequency, the current response time and the current abnormality rate, and the multiple rule threshold information includes the request frequency threshold, the response time threshold and the abnormality rate threshold; Figure 4 As shown, the above-mentioned corresponding comparison is performed based on the multiple interface parameter information and the multiple rule threshold information to obtain the corresponding comparison result of each interface parameter information, which may include:
[0046] S401: Compare the current request frequency with the request frequency threshold to obtain a corresponding comparison result of the current request frequency;
[0047] S403: Compare the current response time with the response time threshold to obtain a corresponding comparison result of the current response time;
[0048] S405: Compare the current abnormality rate with the abnormality rate threshold to obtain a corresponding comparison result of the current abnormality rate.
[0049] In a specific embodiment, the current request frequency may be the number of target business requests that the target business interface needs to request per second; the request frequency threshold may be the maximum number of target business requests that the target business interface can receive at the current moment; the current response time may be the time required for the target business request to request the target business interface service; the response time threshold may be the maximum time that the target business interface can respond to the target business request; the current exception rate may be the number of exception messages that appear in the process of the target business requesting the target business interface; the exception rate threshold may be the maximum number of exception messages in the process of the target business interface service;
[0050] Specifically, the current request frequency in multiple interface call parameters is compared with the request frequency threshold in the target rule information to determine the corresponding comparison result of the current request frequency; the current response time in multiple interface call parameters is compared with the response time threshold in the target rule information to obtain the corresponding comparison result of the current response time; the current exception rate in multiple interface call parameters is compared with the exception rate threshold in the target rule information to obtain the corresponding comparison result of the current exception rate.
[0051] In the above embodiment, by comparing each interface call parameter in multiple interface call parameters with the corresponding rule threshold information in the target rule information, the diversity and rigor of determining the corresponding comparison results are improved, and further, the real-time and flexibility of the traffic control of the target business interface are improved.
[0052] In an optional embodiment, the interface call information further includes a user level, the target rule information further includes special grouping information, and the method further includes:
[0053] The request frequency threshold corresponding to the target service request is determined based on the user level and the special group information.
[0054] In a specific embodiment, the user level may be the membership level of the target user. Optionally, the user level may be divided into first-level membership, second-level membership, third-level membership and other levels. Specifically, a request frequency threshold may be assigned to the target user based on the user level of the target user; special grouping information may include request frequency threshold information corresponding to target users of different levels; when the target service request of the target user is obtained, the user level of the target user is obtained from the interface call information. Optionally, the user level of the target user is the user level carried when the target user sends the interface call information corresponding to the target service request. Optionally, a request frequency threshold is assigned to the target user based on the user level of the target user. Specifically, the target rule information includes special grouping information. Accordingly, the user level of the target user is matched with the special grouping information in the target rule information. Further, the request frequency threshold corresponding to the target service request is obtained.
[0055] In the above embodiment, the request frequency threshold corresponding to the target service request is determined by the user level and special group information of the target user, so that the comparison between the current request frequency and the request frequency threshold is more accurate, thereby improving the accuracy of the service request flow control of the target service interface.
[0056] S105: Based on the corresponding comparison result of each interface parameter information, determine a target control strategy of the target service interface from multiple flow control strategies, and perform service request flow control of the target service interface based on the target control strategy.
[0057] In a specific embodiment, when the corresponding comparison results of the current request frequency, the current response time and the current exception rate are obtained, based on the corresponding comparison results of each interface parameter information, the target control strategy of the target business interface is determined from multiple flow control strategies, and the business request flow control of the target business interface is performed based on the target control strategy.
[0058] Figure 5 is a flow chart of determining a target control strategy for a target service interface according to an exemplary embodiment. In an optional embodiment, the plurality of flow control strategies may include a flow limiting strategy, an alarm strategy, and a fuse strategy; Figure 5 As shown, the above-mentioned determination of the target control strategy of the target service interface from multiple flow control strategies based on the corresponding comparison results of each interface parameter information may include:
[0059] S501: When the corresponding comparison result of the current request frequency indicates that the current request frequency is greater than the request frequency threshold, determining that the target control strategy is a current limiting strategy;
[0060] S503: When the corresponding comparison result of the current response time indicates that the current response time is greater than the response time threshold, determining the target control strategy to be an alarm strategy;
[0061] S505: When the corresponding comparison result of the current abnormality rate indicates that the current abnormality rate is greater than the abnormality rate threshold, determine that the target control strategy is a fuse strategy.
[0062] In a specific embodiment, the current limiting strategy may be to reject the request and return an error response. Optionally, the error response may be to return a 429 status code, that is, to inform the target user that there are too many requests and the response time is too long; the alarm strategy may be to warn the target user, return the default value, and stop accessing the faulty interface for a short period of time; the fuse strategy may be to stop accessing the faulty interface for a short period of time, respond to the core functions, and downgrade the non-core functions, that is, the non-core functions perform simplified responses;
[0063] Specifically, in the case where the corresponding comparison result of each interface call parameter is obtained as mentioned above, the target control strategy is determined based on the corresponding comparison result of each interface parameter. Specifically, when the corresponding comparison result of the current request frequency indicates that the current request frequency is greater than the request frequency threshold, the target control strategy is determined to be a current limiting strategy; when the corresponding comparison result of the current response time indicates that the current response time is greater than the response time threshold, the target control strategy is determined to be an alarm strategy; when the corresponding comparison result of the current abnormality rate indicates that the current abnormality rate is greater than the abnormality rate threshold, the target control strategy is determined to be a fuse strategy. Optionally, in the present application, if multiple interface call parameters are compared with the target rule information, and there are multiple interface call parameters that are greater than the corresponding multiple rule information thresholds in the target rule information, they can be processed in an overlapping manner. Specifically, if the corresponding comparison result of the current request frequency indicates that the current request frequency When the current request frequency is greater than the request frequency threshold, and the corresponding comparison result of the current response time indicates that the current response time is greater than the response time threshold, the corresponding target control strategy can be determined as the superposition effect of the current limiting strategy and the alarm strategy, that is, informing the target user that there are too many current requests, warning the target user, returning to the default value, and stopping access to the fault interface for a short time; optionally, if the corresponding comparison result of the current request frequency indicates that the current request frequency is greater than the request frequency threshold, the corresponding comparison result of the current response time indicates that the current response time is greater than the response time threshold, and the corresponding comparison result of the current abnormality rate indicates that the current abnormality rate is greater than the abnormality rate threshold, the corresponding target control strategy can be determined as the superposition effect of the current limiting strategy, the alarm strategy and the fuse strategy, that is, informing the target user that there are too many current requests, warning the target user, and stopping access to the fault interface for a short time, responding to core functions, and downgrading non-core functions, that is, simplifying the response of non-core functions.
[0064] In the above embodiment, based on different corresponding comparison results, the business request flow control of the target business interface is performed based on different target control strategies, so as to achieve flexibility in business request flow control, and then dynamically adjust system resource allocation, and realize rapid adaptation of control strategies for different traffic scenarios, thereby improving the stability of business request flow control, and then improving the stability of the system and the quality of service.
[0065] Figure 6 FIG. 1 is a flow chart of adjusting a target control strategy based on a current traffic load and a traffic load range according to an exemplary embodiment. Figure 6 As shown, the above-mentioned target control strategy-based service request flow control of the target service interface may include:
[0066] S601: Obtain the current traffic load and traffic load range of the target service interface;
[0067] S603: Based on the current traffic load and the traffic load range, a range is determined, an adjustment strategy of a target service interface is determined, and a target control strategy is adjusted based on the adjustment strategy.
[0068] In a specific embodiment, the current traffic load may be the traffic load of the target service interface at the end of the traffic control of the target control strategy on the target service interface; the traffic load range may be the range between the maximum traffic value and the minimum traffic value that the target service interface can carry; specifically, after the traffic control of the target control strategy is performed on the target service request of the target service interface, the current traffic load and the traffic load range of the target service interface are obtained, and further, the current traffic load is compared with the traffic load range, that is, the maximum traffic value and the minimum traffic value of the current traffic load and the load traffic range are compared respectively, to determine whether the current traffic load is less than the maximum traffic value of the load traffic range and whether it is greater than the load traffic The minimum flow value of the load flow range, further, when the current flow load is less than the maximum flow value of the load flow range and greater than the minimum flow value of the load flow range, stop controlling the service request flow of the target service interface, and when the current flow load is not less than the maximum flow value of the load flow range or the current flow load is not greater than the minimum flow value of the load flow range, re-acquire the interface call parameters of the target service request and the target rule information of the target service interface, compare the interface call parameters with the target rule information, redetermine the adjustment strategy of the current target service interface, and accordingly, redetermine the target control strategy, and further, control the service request flow of the target service interface based on the redetermined target control strategy.
[0069] In the above embodiment, after the service request flow control is performed, the current flow load and the preset flow load range of the target service interface are obtained to determine whether flow control is still needed. Accordingly, the target control strategy is adjusted, and then the service request flow control of the target service interface is performed based on the re-determined target control strategy, thereby ensuring the service quality of the target service interface and improving the stability, accuracy and real-time performance of the service request flow control.
[0070] It can be seen from the technical solutions provided by the above embodiments of the present application that the technical solutions of the present application obtain the business flow control strategy, the interface call information corresponding to the target business request and the target rule information corresponding to the target business interface, and the business flow control strategy includes multiple flow control strategies, and the multiple flow control strategies are different flow control strategies set in the payment system based on the system stability requirements, the interface call information includes multiple interface parameter information, the target rule information is the rule information set based on the target business requirements of the target user, and the target rule information includes multiple rule threshold information, thereby improving the real-time performance of obtaining the target rule information, and obtaining the target rule information set based on user requirements, thereby improving the efficiency of setting the target Flexibility of rule information; further, based on multiple interface parameter information and multiple rule threshold information, corresponding comparisons are performed to obtain corresponding comparison results for each interface parameter information; flexibility and accuracy in determining corresponding comparison results are achieved, and further, based on the corresponding comparison results for each interface parameter information, the target control strategy for the target business interface is determined from multiple traffic control strategies, and the business request traffic control for the target business interface is performed based on the target control strategy, thereby improving the flexibility, accuracy and stability of the business request traffic control, thereby ensuring the service quality of the target business interface, and further, improving the stability of the system, ensuring the service quality of the system, and maintaining high-quality interface services.
[0071] In an optional embodiment, the flow control method in the present application may also be applicable to other different system scenarios, such as business scenarios of management systems, etc., and the embodiments of this specification do not specifically limit this.
[0072] Figure 7 is a schematic diagram of a flow control device according to an exemplary embodiment. The following describes an embodiment of a flow control device of the present application, taking the server as the execution subject. Specifically, Figure 7 As shown, the device comprises:
[0073] The acquisition module 701 is used to acquire the payment flow control strategy, the interface call information corresponding to the target business interface and the target rule information corresponding to the target business interface; the business flow control strategy includes multiple flow control strategies, and the multiple flow control strategies are different flow control strategies set in the payment system based on the system stability requirements; the interface call information includes multiple interface parameter information; the target rule information is the rule information set based on the target business requirements of the target user, and the target rule information includes multiple rule threshold information;
[0074] A comparison module 703, configured to perform a corresponding comparison based on the plurality of interface parameter information and the plurality of rule threshold information to obtain a corresponding comparison result for each interface parameter information;
[0075] The control module 705 is used to determine the target control strategy of the target service interface from the multiple flow control strategies based on the corresponding comparison results of each interface parameter information, and perform service request flow control of the target service interface based on the target control strategy.
[0076] In an optional embodiment, the multiple interface parameter information includes the current request frequency, the current response time and the current abnormality rate, and the multiple rule threshold information includes the request frequency threshold, the response time threshold and the abnormality rate threshold; the above-mentioned comparison module 703 may include:
[0077] A frequency comparison unit, configured to compare the current request frequency with the request frequency threshold to obtain a corresponding comparison result of the current request frequency;
[0078] A time comparison unit, used for comparing the current response time with the response time threshold to obtain a corresponding comparison result of the current response time;
[0079] The abnormality comparison unit is used to compare the current abnormality rate with the abnormality rate threshold to obtain a corresponding comparison result of the current abnormality rate.
[0080] In an optional embodiment, the multiple flow control strategies include a flow limiting strategy, an alarm strategy, and a fuse strategy; the control module 705 may include:
[0081] a current limiting unit, configured to determine that the target control strategy is a current limiting strategy when the corresponding comparison result of the current request frequency indicates that the current request frequency is greater than the request frequency threshold;
[0082] An alarm unit, configured to determine that the target control strategy is an alarm strategy when the corresponding comparison result of the current response time indicates that the current response time is greater than the response time threshold;
[0083] A fusing unit is used to determine that the target control strategy is a fusing strategy when the corresponding comparison result of the current abnormality rate indicates that the current abnormality rate is greater than the abnormality rate threshold.
[0084] In an optional embodiment, the interface call information further includes a user level, the target rule information further includes special grouping information, and the comparison module 703 may further include:
[0085] A determination unit is used to determine the request frequency threshold corresponding to the target service request based on the user level and the special group information.
[0086] In an optional embodiment, the above device may further include:
[0087] An identification acquisition module, used to obtain the request interface name of the target service request, multiple preset rule information and information identification corresponding to each preset rule information;
[0088] The rule determination module is used to perform name identifier matching based on the request interface name and the information identifier corresponding to each preset rule information, and determine the target rule information corresponding to the target service interface from the multiple preset rule information.
[0089] In an optional embodiment, the interface call information further includes interface address information, the target rule information further includes location restriction information, and the above-mentioned apparatus may further include:
[0090] An access module, used to determine an access result of the target service interface based on the interface address information and the location restriction information;
[0091] The interface information acquisition module is used to acquire the interface call information corresponding to the target service request when the access result indicates that the target service interface is accessible.
[0092] In an optional embodiment, the control module 705 may further include:
[0093] A load acquisition unit, used to acquire the current traffic load and traffic load range of the target service interface;
[0094] An adjustment unit is used to perform range determination based on the current traffic load and the traffic load range, determine an adjustment strategy for the target service interface, and adjust the target control strategy based on the adjustment strategy.
[0095] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0096] In an exemplary embodiment, an electronic device is also provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the flow control method of the payment system in the embodiment of the present disclosure.
[0097] In an exemplary embodiment, a computer-readable storage medium is also provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the flow control method of the payment system in the embodiment of the present disclosure.
[0098] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the flow control method of the payment system provided in the above various optional implementations.
[0099] It is understandable that in the specific implementation of this application, user-related data is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0100] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0101] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0102] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A flow control method for a payment system, characterized in that: The method comprises: Obtaining a business flow control strategy, interface call information corresponding to a target business request, and target rule information corresponding to a target business interface; the business flow control strategy includes multiple flow control strategies, and the multiple flow control strategies are different flow control strategies set in a payment system based on system stability requirements; the interface call information includes multiple interface parameter information; the target rule information is rule information set based on target business requirements of a target user, and the target rule information includes multiple rule threshold information; Based on the multiple interface parameter information and the multiple rule threshold information, corresponding comparison is performed to obtain corresponding comparison results of each interface parameter information; Based on the corresponding comparison results of each interface parameter information, a target control policy of the target service interface is determined from the multiple flow control policies, and service request flow control of the target service interface is performed based on the target control policy.
2. The method according to claim 1, characterized in that The multiple interface parameter information includes current request frequency, current response time and current abnormality rate, and the multiple rule threshold information includes request frequency threshold, response time threshold and abnormality rate threshold; The performing corresponding comparison based on the plurality of interface parameter information and the plurality of rule threshold information to obtain the corresponding comparison result of each interface parameter information includes: Compare the current request frequency with the request frequency threshold to obtain a corresponding comparison result of the current request frequency; Compare the current response time with the response time threshold to obtain a corresponding comparison result of the current response time; The current abnormality rate is compared with the abnormality rate threshold to obtain a corresponding comparison result of the current abnormality rate.
3. The method according to claim 2, characterized in that The multiple flow control strategies include a flow limiting strategy, an alarm strategy, and a fuse strategy; the determining the target control strategy of the target service interface from the multiple flow control strategies based on the corresponding comparison result of each interface parameter information includes: In a case where the corresponding comparison result of the current request frequency indicates that the current request frequency is greater than the request frequency threshold, determining that the target control strategy is a current limiting strategy; In a case where the corresponding comparison result of the current response time indicates that the current response time is greater than the response time threshold, determining that the target control strategy is an alarm strategy; When the corresponding comparison result of the current abnormality rate indicates that the current abnormality rate is greater than the abnormality rate threshold, the target control strategy is determined to be a fuse strategy.
4. The method according to claim 2, characterized in that: The interface call information also includes a user level, the target rule information also includes special grouping information, and the method further includes: The request frequency threshold corresponding to the target service request is determined based on the user level and the special group information.
5. The method according to claim 1, characterized in that The method further comprises: Obtaining a request interface name, a plurality of preset rule information, and an information identifier corresponding to each preset rule information of the target service request; Based on the request interface name and the information identifier corresponding to each preset rule information, name identifier matching is performed, and the target rule information corresponding to the target service interface is determined from the multiple preset rule information.
6. The method according to claim 1, characterized in that The interface call information further includes interface address information, the target rule information further includes location restriction information, and the method further includes: Determining an access result of the target service interface based on the interface address information and the location restriction information; When the access result indicates that the target service interface is accessible, the interface call information corresponding to the target service request is obtained.
7. The method according to claim 1, characterized in that The performing of the service request flow control of the target service interface based on the target control strategy includes: Obtaining the current traffic load and traffic load range of the target service interface; Based on the current traffic load and the traffic load range, a range determination is performed to determine an adjustment strategy for the target service interface, and the target control strategy is adjusted based on the adjustment strategy.
8. A flow control device, characterized in that: The device comprises: An acquisition module is used to acquire a payment flow control strategy, interface call information corresponding to a target business interface, and target rule information corresponding to the target business interface; the business flow control strategy includes multiple flow control strategies, and the multiple flow control strategies are different flow control strategies set in the payment system based on system stability requirements; the interface call information includes multiple interface parameter information; the target rule information is rule information set based on target business requirements of target users, and the target rule information includes multiple rule threshold information; A comparison module, used for performing corresponding comparison based on the plurality of interface parameter information and the plurality of rule threshold information to obtain a corresponding comparison result of each interface parameter information; A control module is used to determine a target control strategy of the target service interface from the multiple flow control strategies based on the corresponding comparison results of each interface parameter information, and perform service request flow control of the target service interface based on the target control strategy.
9. An electronic device, characterized in that: include: Controller; a memory for storing instructions executable by the controller; Wherein, the controller is configured to execute the instructions to implement the flow control method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a controller of an electronic device, the electronic device is enabled to execute the flow control method as claimed in any one of claims 1 to 7.