CN117221235A - API flow allocation method, device, equipment and storage medium in financial business system - Google Patents

API flow allocation method, device, equipment and storage medium in financial business system Download PDF

Info

Publication number
CN117221235A
CN117221235A CN202311300624.0A CN202311300624A CN117221235A CN 117221235 A CN117221235 A CN 117221235A CN 202311300624 A CN202311300624 A CN 202311300624A CN 117221235 A CN117221235 A CN 117221235A
Authority
CN
China
Prior art keywords
api
flow
quota
traffic
financial service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311300624.0A
Other languages
Chinese (zh)
Inventor
黄章力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202311300624.0A priority Critical patent/CN117221235A/en
Publication of CN117221235A publication Critical patent/CN117221235A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the application discloses an API flow allocation method, device, equipment and storage medium in a financial business system, wherein the method comprises the following steps: collecting the flow of the API in real time, and comparing the flow with the initial flow quota of the API; if the flow exceeds the initial flow quota, acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model; the API flow allocation model outputs flow allocation quota and adjustment frequency of the API according to the input flow and the financial service type; updating the initial flow quota of the API according to the flow quota and the adjustment frequency, and obtaining the flow quota after the API is allocated. The method can reasonably allocate and adjust the quota of the API according to the real-time flow of the API and the requirements of the financial service type, avoid overload of the system, and has the advantages of simple implementation, high flexibility and improvement of the overall performance and response speed of the system.

Description

API flow allocation method, device, equipment and storage medium in financial business system
Technical Field
The application belongs to the technical field of software of computers and network products, and particularly relates to an API flow allocation method, device, equipment and storage medium in a financial business system.
Background
The API flow quota management in the financial business system is mainly used for opening the flow limit set by an API interface in the financial business system and dynamically adjusting according to the actual business requirements so as to keep balance and effectively utilize resources in the financial business system.
At present, the API flow quota management is mainly to provide an API gateway and a flow management service, so that the quota management of the API flow is realized, and the flow with a certain scale can be dealt with. However, the financial service system generally has a complex architecture and various service scenarios, and when the API flow quota management is performed in the financial service system, integration and coordination between multiple systems need to be processed, which increases implementation complexity and API flow quota management flexibility.
Content of the application
The embodiment of the application provides an API flow allocation method, device, equipment and storage medium in a financial service system, which solve the problems of complex implementation and low flexibility when API flow quota management is performed in the financial service system.
The embodiment of the application provides an API flow allocation method in a financial service system, which comprises the following steps:
collecting the flow of an API in real time, and comparing the flow with the initial flow quota of the API;
if the flow exceeds the initial flow quota, acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model;
the API flow allocation model outputs flow allocation quota and adjustment frequency of the API according to the input flow and the financial service type;
updating the initial flow quota of the API according to the flow quota and the adjusting frequency to obtain the flow quota after the API is allocated.
Further, before inputting the flow into the API flow allocation model if the flow exceeds the initial flow quota, the method further includes:
acquiring historical data of the flow quota after the API is allocated, marking initial quota, flow quota, adjustment frequency, financial service type, request amount, response time and error rate on the historical data, and dividing the marked historical data into a training set, a verification set and a test set;
pre-training the API flow allocation model based on the training set to obtain a primary API flow allocation model;
optimizing the primary API flow allocation model based on the verification set to obtain optimization parameters of the primary API flow allocation model; determining the primary API flow allocation model corresponding to the optimization parameters as a medium-level API flow allocation model;
and testing and optimizing the medium-level API flow allocation model based on the test set to obtain a trained API flow allocation model.
Further, the API flow allocation model outputs the flow allocation quota and the adjustment frequency of the API according to the input flow and the financial service type; updating the initial flow quota of the API according to the flow quota and the adjustment frequency, and before obtaining the allocated flow quota of the API, the method further comprises:
and acquiring the load quantity of the API in the observation window.
Further, updating the initial flow quota of the API according to the flow quota and the adjustment frequency, and obtaining the flow quota after the API is allocated includes:
dividing the flow adjustment quota and the adjustment frequency into a plurality of adjustment grades according to the load quantity;
and sequentially updating the initial flow quota of the API according to the plurality of allocation levels to obtain the flow quota after the allocation of the API.
Further, the method further includes, before the collecting the flow of the API in real time and comparing the flow with the flow quota of the API;
acquiring a financial service type corresponding to the flow in the API;
and calling the initial flow quota of the API from a quota database according to the name of the API and the financial service type.
Further, before the flow quota of the API is called according to the name of the API from the quota database, the method further includes:
configuring the initial flow quota of all APIs in the financial business system according to the financial business type;
and generating a quota database according to the financial service type, the name of the API corresponding to the financial service type and the initial flow quota.
Further, the method further includes, before the collecting, in real time, the flow of the API and comparing the flow with the initial flow quota of the API:
receiving an API request, analyzing the API request, and obtaining credential information;
comparing the credential information with prestored credential information, and calling an API management interface corresponding to the API request according to the API request if the credential information is consistent with the prestored credential information.
The embodiment of the application also provides an API flow allocation device in the financial business system, which comprises:
the comparison module is used for collecting the flow of the API in real time and comparing the flow with the initial flow quota of the API;
the input module is used for acquiring the financial service type of the flow if the flow exceeds the initial flow quota, and inputting the flow and the financial service type into an API flow allocation model;
the output module is used for outputting the flow adjustment quota and the adjustment frequency of the API according to the input flow and the financial service type by the API flow adjustment model;
and the updating module is used for updating the initial flow quota of the API according to the flow adjustment quota and the adjustment frequency to obtain the flow quota after the API is adjusted.
The embodiment of the application also provides an API flow allocation device in the financial business system, which comprises: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line;
the at least one processor invokes the instructions in the memory to cause an API flow deployment device in the financial services system to perform the steps of:
collecting the flow of an API in real time, and comparing the flow with the initial flow quota of the API;
if the flow exceeds the initial flow quota, acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model;
the API flow allocation model outputs flow allocation quota and adjustment frequency of the API according to the input flow and the financial service type;
updating the initial flow quota of the API according to the flow quota and the adjusting frequency to obtain the flow quota after the API is allocated.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the following steps when being executed by a processor:
collecting the flow of an API in real time, and comparing the flow with the initial flow quota of the API;
if the flow exceeds the initial flow quota, acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model;
the API flow allocation model outputs flow allocation quota and adjustment frequency of the API according to the input flow and the financial service type;
updating the initial flow quota of the API according to the flow quota and the adjusting frequency to obtain the flow quota after the API is allocated.
The embodiment of the application has the following beneficial effects:
the embodiment of the application provides an API flow allocation method in a financial service system, which is implemented by comparing the flow of an acquired API with the initial flow quota of the API in real time; triggering flow quota adjustment when the acquired flow exceeds the initial flow quota, and acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model; acquiring the flow adjustment quota and adjustment frequency of the API through an API flow adjustment model; updating the initial flow quota of the API according to the flow quota and the adjustment frequency, and obtaining the flow quota after the API is allocated. The method can reasonably allocate and adjust the quota of the API according to the real-time flow of the API and the requirements of financial service types, avoid overload of the system, improve the overall performance and response speed of the system, and has simple implementation and high flexibility, thereby being applicable to different flow and service scene requirements. The API flow allocation device, equipment and storage medium in the financial business system provided by the embodiment of the application can also realize the effects.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Wherein:
FIG. 1 is a diagram of an application environment for API flow adaptation in a financial transaction system according to one embodiment of the present application;
fig. 2 is a schematic flow chart of an API flow allocation method in a financial service system according to an embodiment of the present application;
fig. 3 is a schematic flow chart of obtaining a flow quota after API deployment according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an API flow allocation device in a financial service system according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an API flow allocation apparatus in a financial service system according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a computer readable storage medium according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
For ease of understanding, the relevant terms to which the present application relates are first described below.
(1) The API (Application Programming Interface, application program interface) is a predefined interface (e.g. function, HTTP interface) or a convention that refers to the engagement of different components of a software system. To provide a set of routines that applications and developers can access based on certain software or hardware without having to access source code or understand the details of the internal operating mechanisms.
(2) Traffic refers to the total number of packets in a certain period of time.
As shown in fig. 1, an application environment diagram of API flow allocation in a financial service system according to an embodiment of the present application is shown. Referring to fig. 1, the API flow allocation method in a financial service system is applied to an API flow allocation system in a financial service system. The API traffic allocation system in the financial service system includes a server 120 and a terminal device cluster, where the terminal device cluster may include one or more terminal devices, and in this embodiment, the number of terminal devices is not limited. As shown in fig. 1, the plurality of terminal devices may specifically include a terminal device 1, a terminal device 2, …, a terminal device n; the terminal device 1, the terminal devices 2, … and the terminal device n are all connected with the server 120 through the network 130, so that each terminal device can perform data interaction with the server 120 through the network 130.
Terminal device 1, terminal devices 2, …, terminal device n may be: intelligent terminals such as smart phones, tablet computers, notebook computers, desktop computers, intelligent televisions and the like.
The server 120 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligence platforms, and the like.
The network 130 may be a wired network or a wireless network. In some embodiments of the present application, the wired or wireless network described above uses standard communication techniques and/or protocols. The network may be the Internet, but may be any network including, but not limited to, a wide area network, a metropolitan area network, a regional network, a third generation partnership project (3rd Generation Partnership Project,3GPP), a long term evolution (Long Term Evolution LTE), a worldwide interoperability for microwave access (Worldwide Interoperability for Microwave Access WiMAX), or a computer network communication based on the TCP/IP protocol family (TCP/IPProtocol Suite TCP/IP), the user datagram protocol (User Datagram Protocol UDP), or the like.
Terminal equipment 1, terminal equipment 2, … and terminal equipment n collect the flow of the API in real time, then the collected flow of the API is sent to a server 120, and the server 120 compares the flow with the initial flow quota of the API; if the flow exceeds the initial flow quota, acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model; the API flow allocation model outputs flow allocation quota and adjustment frequency of the API according to the input flow and the financial service type; updating the initial flow quota of the API according to the flow quota and the adjustment frequency, and obtaining the flow quota after the API is allocated.
As shown in fig. 2, a flow chart of an API flow allocation method in a financial service system according to an embodiment of the present application is shown, where the method includes:
step S201, collecting the flow of the API in real time, and comparing the flow with the initial flow quota of the API;
specifically, in this embodiment, the open bank is used as an entry for dynamic quota management of API traffic and integrates with the associated service platform, and at the same time, the open bank provides an API interface, so that the associated service platform can obtain quota information and related statistics through API call. The flow monitoring component or the API gateway is deployed in an application program of an open bank to collect flow data of the API in real time, wherein the flow data comprises request times, average response time, maximum response time, flow request times per second QPS, error information and the like. And then aggregate analysis is carried out on the collected flow data, aggregate statistics is carried out on the flow data through aggregation, the aggregate request times, average response time, user activities and the like are carried out according to time windows (such as seconds, hours, days and the like), common aggregate operations comprise summation, average, maximum/minimum value and count and the like, and the request times, the average response time and the like are calculated through an aggregate result. The aggregate analysis can be realized by a log analysis tool, a monitoring system and the like.
The collected traffic is compared to an initial traffic quota of the API, where the initial traffic quota of the API may be set by analyzing historical data of the API such as request frequency, response time, and error rate. When the flow is compared with the initial flow quota of the API, the collected flow data can be compared with the initial flow quota through a quota comparison function, and a comparison result is returned.
Step S202, if the flow exceeds the initial flow quota, acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model;
specifically, in this embodiment, during comparison, if the API flow collected in a certain time window exceeds the initial flow quota of the API in the time window, that is, the critical point for triggering quota adjustment, the financial service type corresponding to the flow is obtained, and the flow and the financial service type are input into the API flow allocation model at the same time.
In this embodiment, if the API flow collected in a certain time window exceeds the initial flow quota of the API in the time window, an alarm may be given by means of mail, sms, message notification, etc., to notify an operation and maintenance manager that a flow abnormality or quota overrun occurs.
In this embodiment, when the detection is performed, the detection may be performed by single-point anomaly detection or trend anomaly detection, and the collected flow data is compared with a set initial flow quota, and whether the initial flow quota is exceeded is detected, and if the initial flow quota is exceeded, the API flow allocation is triggered.
Step S203, the API flow allocation model outputs flow allocation quota and adjustment frequency of the API according to the input flow and the financial service type;
specifically, in this embodiment, historical flow data of the API is collected, an API flow allocation model is obtained according to the historical flow data, and the API flow allocation model can output an adaptively adjusted flow allocation quota and an adaptively adjusted frequency according to the input flow data and the financial service type, so as to balance the utilization rate and performance of resources.
Step S204, updating the initial flow quota of the API according to the flow quota and the adjustment frequency, and obtaining the flow quota after the API is allocated.
Specifically, in this embodiment, the initial flow quota of the API is adjusted according to the flow quota and the adjustment frequency output by the API flow allocation model, so that the flow quota of the API can process the flow requirement corresponding to the current financial service.
According to the API flow allocation method in the financial service system, the flow of the acquired API is compared with the initial flow quota of the API in real time; triggering flow quota adjustment when the acquired flow exceeds the initial flow quota, and acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model; acquiring the flow adjustment quota and adjustment frequency of the API through an API flow adjustment model; updating the initial flow quota of the API according to the flow quota and the adjustment frequency, and obtaining the flow quota after the API is allocated. The method can reasonably allocate and adjust the quota of the API according to the real-time flow of the API and the requirements of financial service types, avoid overload of the system, improve the overall performance and response speed of the system, and has simple implementation and high flexibility, thereby being applicable to different flow and service scene requirements.
In some embodiments, prior to step S202, the method further comprises:
acquiring historical data of flow quota after API allocation, marking initial quota, flow quota, adjustment frequency, financial service type, request amount, response time and error rate on the historical data, and dividing the marked historical data into a training set, a verification set and a test set;
pre-training the API flow allocation model based on the training set to obtain a primary API flow allocation model;
optimizing the primary API flow allocation model based on the verification set to obtain optimization parameters of the primary API flow allocation model; determining a primary API flow allocation model corresponding to the optimization parameters as a medium-level API flow allocation model;
and testing and optimizing the medium-level API flow allocation model based on the test set to obtain a trained API flow allocation model.
Specifically, in this embodiment, historical flow quota data after API allocation when each financial service in the financial service system can be normally handled is collected, initial quota, flow quota, adjustment frequency, financial service type, request amount, response time, error rate and the like are marked on the historical flow quota data, the marked historical data is divided into a training set, a verification set and a test set, and an API flow allocation model is trained and optimized through the training set, the verification set and the test set, so that the API flow allocation model can identify periodicity or trending of flow in each financial service type. Based on the trained API flow allocation model, the API flow quota can be dynamically adjusted.
In some embodiments, after step S203, before step S204, further comprising:
the load quantity of the API in the observation window is obtained.
Specifically, in this embodiment, the load condition of a certain period of time may be tracked through the sliding window, the current load state is determined according to the load request number and the load response time in the sliding window, and the API flow quota is adjusted according to the state of the load, for example, when the load is running, the API flow quota may be adjusted more, or else, the API flow quota may be adjusted less.
In some embodiments, as shown in fig. 3, a flow chart for obtaining a flow quota after API deployment according to an embodiment of the present application is shown, and step S204 includes:
step S2041, dividing flow adjustment quota and adjustment frequency into a plurality of adjustment grades according to the load quantity;
step S2042, sequentially updating the initial flow quota of the API according to the plurality of allocation levels to obtain the flow quota after the allocation of the API.
Specifically, in this embodiment, the flow adjustment quota and the adjustment frequency may be divided into a plurality of adjustment levels according to the load number; if the flow adjustment quota and the adjustment frequency can be increased in a gradual way, the flow adjustment quota and the adjustment frequency can be smoothly transited, the instability of the system is reduced, if the load quantity is more, the adjustment grade can be more densely divided, and if the load quantity is less, the adjustment grade is less.
In this embodiment, information such as a load mode, a peak period, and a duration may also be counted, so as to provide a basis for API flow quota adjustment.
An automatic telescoping mechanism can be configured, a back-end service instance is dynamically added or removed according to the traffic condition, and a load equalizer is used for uniformly distributing traffic to available servers, so that load balancing and high availability are ensured.
In some embodiments, prior to step S201, the method further comprises:
acquiring financial service types corresponding to the flows in the API;
and calling the initial flow quota of the API according to the name of the API and the financial service type from the quota database.
In some embodiments, prior to step S201, the method further comprises:
configuring initial flow quota of all APIs in the financial business system according to the financial business type;
and generating a quota database according to the financial service type, the name of the API corresponding to the financial service type and the initial flow quota.
Specifically, in this embodiment, an initial flow quota is performed for all APIs in the financial service system according to the financial service type, and the initial flow quota and the name of the API corresponding to the financial service type are stored according to the financial service type, and a database is generated. When the initial flow quota of the API is obtained, the initial flow quota can be called from the database through the name of the API.
In some embodiments, prior to step S201, the method further comprises:
receiving an API request, analyzing the API request, and obtaining credential information;
comparing the credential information with prestored credential information, and calling an API management interface corresponding to the API request according to the API request if the credential information is consistent with the prestored credential information.
Specifically, in this embodiment, when a user initiates an API flow request, after receiving the API request, the server parses the API request to obtain credential information, compares the credential information with pre-stored credential information, and determines whether to allow the user to continuously access the API resource according to the comparison result, if so, the request is continuously executed; otherwise, returning corresponding identity verification error codes or messages.
In this embodiment, a mapping relationship between the user, the authority level of the user calling the API, and the quota may also be established. And determining quota limit corresponding to each user or authority level, and storing the quota limit in a database. When processing an API request, according to a user or authority level, corresponding quota limit is retrieved, and a corresponding API management interface is called to acquire the quota limit by querying a mapping relation table. If the user's request does not exceed the quota limit, the request is allowed to continue execution. Otherwise, an appropriate error code or message may be returned prompting the merchant that the quota limit has been reached.
By integrating identity authentication and authorization services, it is ensured that only authenticated and authorized users can access the API interface, quota is allocated based on user or authority level, and safety and compliance of quota are realized. And the system can also support multi-dimensional quota management based on users, time periods, areas and the like, and realize more refined flow control and quota management.
As shown in fig. 4, a schematic structural diagram of an API flow allocation device in a financial service system according to an embodiment of the present application is shown, where the device 400 includes:
the comparison module 401 is configured to collect the flow of the API in real time, and compare the flow with the initial flow quota of the API;
an input module 402, configured to obtain a financial service type of the flow if the flow exceeds an initial flow quota, and input the flow and the financial service type into an API flow allocation model;
the output module 403 is configured to output a flow adjustment quota and an adjustment frequency of the API according to the input flow and the financial service type by using the API flow adjustment model;
the updating module 404 is configured to update an initial flow quota of the API according to the flow quota and the adjustment frequency, and obtain a flow quota after the API is allocated.
In some embodiments, the apparatus further comprises:
the training module is used for acquiring the historical data of the flow quota after the API is allocated, labeling the initial quota, the flow quota, the adjustment frequency, the financial service type, the request amount, the response time and the error rate of the historical data, and dividing the labeled historical data into a training set, a verification set and a test set;
pre-training the API flow allocation model based on the training set to obtain a primary API flow allocation model;
optimizing the primary API flow allocation model based on the verification set to obtain optimization parameters of the primary API flow allocation model; determining a primary API flow allocation model corresponding to the optimization parameters as a medium-level API flow allocation model;
and testing and optimizing the medium-level API flow allocation model based on the test set to obtain a trained API flow allocation model.
In some embodiments, the apparatus further comprises:
and the load acquisition module is used for acquiring the load quantity of the API in the observation window.
In some embodiments, the update module is further to:
dividing flow adjustment quota and adjustment frequency into a plurality of adjustment grades according to the load quantity;
and sequentially updating the initial flow quota of the API according to the plurality of allocation levels to obtain the flow quota after the allocation of the API.
In some embodiments, the apparatus further comprises:
the first acquisition module is used for acquiring financial service types corresponding to the flow in the API;
and calling the initial flow quota of the API according to the name of the API and the financial service type from the quota database.
In some embodiments, the apparatus further comprises:
the generation module is used for configuring initial flow quota of all APIs in the financial business system according to the financial business type;
and generating a quota database according to the financial service type, the name of the API corresponding to the financial service type and the initial flow quota.
In some embodiments, the apparatus further comprises:
the second acquisition module is used for receiving the API request, analyzing the API request and acquiring the credential information;
comparing the credential information with prestored credential information, and calling an API management interface corresponding to the API request according to the API request if the credential information is consistent with the prestored credential information.
For other details of implementing the above technical solution by each module in the API flow allocation apparatus in the financial service system, reference may be made to the description of the API flow allocation method in the financial service system provided above, which is not repeated herein.
As shown in fig. 5, a schematic structural diagram of an API flow allocation device in a financial service system according to an embodiment of the present application, where the API flow allocation device 500 may have relatively large differences according to different configurations or performances, may include one or more processors (central processing units, CPU) 501 (e.g., one or more processors) and a memory 502, and one or more storage media 503 (e.g., one or more mass storage devices) storing application programs 5031 or data 5032. Wherein the memory 502 and the storage medium 503 may be transitory or persistent. The program stored on the storage medium 503 may include one or more modules (not shown), each of which may include a series of instruction operations for the API flow deployment device 500 in the financial services system. Still further, the processor 501 may be configured to communicate with the storage medium 503 to execute a series of instruction operations in the storage medium 503 on the API flow deployment device 500 in a financial services system to implement the following steps:
collecting the flow of the API in real time, and comparing the flow with the initial flow quota of the API;
if the flow exceeds the initial flow quota, acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model;
the API flow allocation model outputs flow allocation quota and adjustment frequency of the API according to the input flow and the financial service type;
updating the initial flow quota of the API according to the flow quota and the adjustment frequency, and obtaining the flow quota after the API is allocated.
The API flow deployment device 500 in a financial services system may also include one or more power supplies 504, one or more wired or wireless network interfaces 505, one or more input/output interfaces 506, and/or one or more operating systems 5033, such as Windows service, mac OS X, unix, linux, freeBSD, and the like. It will be appreciated by those skilled in the art that the configuration of the API flow deployment device in the financial transaction system shown in fig. 5 is not limiting of the API flow deployment device in the financial transaction system provided by the present application, and may include more or fewer components than shown, or may be combined with certain components, or may be arranged with different components.
For further details regarding implementation of the above technical solution by the processor 501 in the API flow allocation device in the financial service system, reference may be made to the description of the above provided API flow allocation method in the financial service system, which is not repeated herein.
In some embodiments, as shown in fig. 6, a schematic structural diagram of a computer readable storage medium according to an embodiment of the present application is provided, where a readable computer program 601 is stored on the storage medium; the computer program 601 may be stored in the storage medium in the form of a software product, and includes several instructions to cause a computer device (which may be a personal computer, a service machine, or a network device, etc.) or a processor (processor) to perform the following steps:
collecting the flow of the API in real time, and comparing the flow with the initial flow quota of the API;
if the flow exceeds the initial flow quota, acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model;
the API flow allocation model outputs flow allocation quota and adjustment frequency of the API according to the input flow and the financial service type;
updating the initial flow quota of the API according to the flow quota and the adjustment frequency, and obtaining the flow quota after the API is allocated.
And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a magnetic or optical disk, a ROM (Read-Only Memory), a RAM (Random Access Memory), or a terminal device such as a computer, a service machine, a mobile phone, or a tablet.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. An API flow allocation method in a financial service system, the method comprising:
collecting the flow of an API in real time, and comparing the flow with the initial flow quota of the API;
if the flow exceeds the initial flow quota, acquiring the financial service type of the flow; inputting the flow and the financial business type into an API flow allocation model;
the API flow allocation model outputs flow allocation quota and adjustment frequency of the API according to the input flow and the financial service type;
updating the initial flow quota of the API according to the flow quota and the adjusting frequency to obtain the flow quota after the API is allocated.
2. The method for allocating API traffic in a financial services system according to claim 1, wherein said method further comprises, before inputting said traffic into an API traffic allocation model if said traffic exceeds said initial traffic quota:
acquiring historical data of the flow quota after the API is allocated, marking initial quota, flow quota, adjustment frequency, financial service type, request amount, response time and error rate on the historical data, and dividing the marked historical data into a training set, a verification set and a test set;
pre-training the API flow allocation model based on the training set to obtain a primary API flow allocation model;
optimizing the primary API flow allocation model based on the verification set to obtain optimization parameters of the primary API flow allocation model; determining the primary API flow allocation model corresponding to the optimization parameters as a medium-level API flow allocation model;
and testing and optimizing the medium-level API flow allocation model based on the test set to obtain a trained API flow allocation model.
3. The method for allocating API traffic in a financial service system according to claim 1, wherein said API traffic allocation model outputs a traffic allocation quota and an adjustment frequency of said API according to said inputted traffic and said financial service type; updating the initial flow quota of the API according to the flow quota and the adjustment frequency, and before obtaining the allocated flow quota of the API, the method further comprises:
and acquiring the load quantity of the API in the observation window.
4. The method for allocating API traffic in a financial service system according to claim 3, wherein updating the initial traffic quota of the API according to the traffic quota and the adjustment frequency, and obtaining the traffic quota after API allocation comprises:
dividing the flow adjustment quota and the adjustment frequency into a plurality of adjustment grades according to the load quantity;
and sequentially updating the initial flow quota of the API according to the plurality of allocation levels to obtain the flow quota after the allocation of the API.
5. The method for allocating API traffic in a financial services system according to claim 1, wherein said collecting the traffic of an API in real time, and before comparing said traffic with the traffic quota of said API, said method further comprises;
acquiring a financial service type corresponding to the flow in the API;
and calling the initial flow quota of the API from a quota database according to the name of the API and the financial service type.
6. The method for allocating API traffic in a financial services system according to claim 5, wherein said method further comprises, before said allocating said traffic quota of said API according to said API name from a quota database:
configuring the initial flow quota of all APIs in the financial business system according to the financial business type;
and generating a quota database according to the financial service type, the name of the API corresponding to the financial service type and the initial flow quota.
7. The method for allocating API traffic in a financial services system according to claim 1, wherein said collecting the traffic of an API in real time, before comparing said traffic with an initial traffic quota of said API, said method further comprises:
receiving an API request, analyzing the API request, and obtaining credential information;
comparing the credential information with prestored credential information, and calling an API management interface corresponding to the API request according to the API request if the credential information is consistent with the prestored credential information.
8. An API flow deployment device in a financial transaction system, said device comprising:
the comparison module is used for collecting the flow of the API in real time and comparing the flow with the initial flow quota of the API;
the input module is used for acquiring the financial service type of the flow if the flow exceeds the initial flow quota, and inputting the flow and the financial service type into an API flow allocation model;
the output module is used for outputting the flow adjustment quota and the adjustment frequency of the API according to the input flow and the financial service type by the API flow adjustment model;
and the updating module is used for updating the initial flow quota of the API according to the flow adjustment quota and the adjustment frequency to obtain the flow quota after the API is adjusted.
9. An API flow allocation apparatus in a financial service system, the API flow allocation apparatus in a financial service system comprising: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line;
the at least one processor invoking the instructions in the memory to cause an API flow deployment device in the financial services system to perform the steps of the API flow deployment method in the financial services system of any of claims 1-7.
10. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of the API flow deployment method in a financial services system according to any of claims 1-7.
CN202311300624.0A 2023-10-08 2023-10-08 API flow allocation method, device, equipment and storage medium in financial business system Pending CN117221235A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311300624.0A CN117221235A (en) 2023-10-08 2023-10-08 API flow allocation method, device, equipment and storage medium in financial business system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311300624.0A CN117221235A (en) 2023-10-08 2023-10-08 API flow allocation method, device, equipment and storage medium in financial business system

Publications (1)

Publication Number Publication Date
CN117221235A true CN117221235A (en) 2023-12-12

Family

ID=89048108

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311300624.0A Pending CN117221235A (en) 2023-10-08 2023-10-08 API flow allocation method, device, equipment and storage medium in financial business system

Country Status (1)

Country Link
CN (1) CN117221235A (en)

Similar Documents

Publication Publication Date Title
CN110535777B (en) Access request control method and device, electronic equipment and readable storage medium
CN108965381B (en) Nginx-based load balancing implementation method and device, computer equipment and medium
US10609045B2 (en) Autonomic incident triage prioritization by performance modifier and temporal decay parameters
CN105282047B (en) Access request processing method and device
CN110798472B (en) Data leakage detection method and device
US10404558B2 (en) Adaptive allocation for dynamic reporting rates of log events to a central log management server from distributed nodes in a high volume log management system
CN110730136B (en) Method, device, server and storage medium for realizing flow control
CN110266510B (en) Network control strategy generation method and device, network control method and storage medium
US20110138037A1 (en) Techniques for web server management
CN110830280B (en) Micro-service gateway device and method and electronic equipment
US20210136095A1 (en) Application programming interface platform management using machine learning
CN112181541A (en) Data processing method and device, electronic equipment and storage medium
US11025709B2 (en) Load processing method and apparatus
US11297105B2 (en) Dynamically determining a trust level of an end-to-end link
CN111756644A (en) Hot spot current limiting method, system, equipment and storage medium
US11146447B2 (en) Method and apparatus of establishing computer network monitoring criteria
CN114640700B (en) Calling frequency control method and device
CN106612263B (en) Method and equipment for processing application access request
CN115952398B (en) Traditional calculation method, system and storage medium based on data of Internet of things
CN117221235A (en) API flow allocation method, device, equipment and storage medium in financial business system
CN115643264A (en) Load balancing method, device and equipment based on core load and storage medium
CN117221398A (en) Conversion method, device, equipment and storage medium for request data in financial business
CN115361170A (en) Data processing method, device, equipment and storage medium
CN115474168A (en) Message unified sending method, device, equipment and medium
CN115730327A (en) Frequency limiting method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination