Account quota control method and device, processor and electronic equipment
Through the client node, the transaction amount is judged and the limit change information is generated, the timeliness of account limits caused by distributed lock failure is solved, and real-time updates and efficient processing of limits are achieved.
Patent Information
- Application Number
- CN202310826183.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-06
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, when processing customer transaction requests through distributed locks, the distributed lock fails due to network fluctuations or node failures, and the customer account limit cannot be updated in time, resulting in poor timeliness of the account limit.
When receiving the transaction request, the client node determines whether the transaction amount exceeds the target account limit, generates limit change information, and sends it to the server node. The server node executes the transaction request based on the limit change information, and updates the target after success Account limit information, real-time update of limits is achieved through ETCD cluster and Netty long connection.
It reduces the number of transaction requests processed by the server nodes, avoids the accumulation of transaction requests, reduces the computing pressure of the server nodes, and improves the timeliness of account limits.
Smart Images

Figure CN119273356A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing, and in particular to a method, device, processor and electronic device for controlling account limits. Background Art
[0002] In the prior art, financial institutions generally control customer account limits in three ways: first, control customer account limits based on luna scripts and Redis distributed locks, but when using distributed locks, lock failure or lock conflict may cause lock failure (for example, transaction requests are blocked in the client for a long time, causing lock failure, Redis server clock drift or single node damage causing two nodes to hold the same lock, etc.), which in turn causes the problem that the customer's account limit cannot be updated in time; second, split a customer account with frequent transactions into multiple shadow accounts, and split the balance of the account into each shadow account. Each transaction request selects a suitable shadow account for transaction by hash, but this method will make the transaction request unable to be completed due to the low amount in a single shadow account, resulting in unsuccessful deduction, thereby affecting the customer's normal transaction; third, store the received transaction requests in the message queue, execute the transaction requests in the message queue in batches at regular intervals, and insert all detailed data of the account in batches, but when a large number of transaction requests are received, the transaction requests in the message queue cannot be processed in time due to the accumulation of a large number of transaction requests in the message queue, resulting in poor timeliness of the account limit.
[0003] Regarding the problem that when processing customer transaction requests through distributed locks in related technologies, the distributed locks become invalid due to network fluctuations or node failures, and the customer's account limits cannot be updated in time, resulting in poor timeliness of the account limits. No effective solution has been proposed yet. Summary of the invention
[0004] The main purpose of the present application is to provide an account limit control method, device, processor and electronic device to solve the problem in the related technology that when processing customer transaction requests through distributed locks, the distributed locks become invalid due to network fluctuations or node failures, and the customer's account limits cannot be updated in time, resulting in poor timeliness of the account limits.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for controlling an account limit is provided, the method comprising: upon receiving a transaction request, determining whether the transaction amount in the transaction request exceeds the limit value of a target account, wherein the target account refers to the transaction account in the transaction request, and the limit value represents the upper limit of the transaction amount of the target account; if the transaction amount does not exceed the limit value, generating limit change information of the target account according to the transaction request, wherein the limit change information refers to change information of the account transaction limit of the target account; sending the limit change information to a server node, wherein the server node executes the transaction request according to the limit change information to obtain an execution result of the transaction request; receiving the execution result returned by the server node, and if the execution result indicates that the transaction request is successfully executed, updating the limit information of the target account according to the execution result.
[0006] Furthermore, before determining whether the transaction amount in the transaction request exceeds the limit value of the target account, the method also includes: determining a limit rule, wherein the limit rule refers to the upper limit set by the financial institution for the transaction amount of the account transaction; determining historical limit change information of the account in the financial institution, and storing the historical limit change information in the ETCD cluster, wherein the historical limit change information represents the change information of the limit value in the historical transactions of the account in the financial institution.
[0007] Furthermore, determining whether the transaction amount in the transaction request exceeds the limit value of the target account includes: determining the transaction amount in the transaction request; obtaining the limit change information of the target account in the ETCD cluster; and determining whether the transaction amount in the transaction request exceeds the limit value of the target account based on the historical limit change information of the target account, the limit rule and the transaction amount.
[0008] Further, the limit change information is sent to the server node, wherein the server node executes the transaction request according to the limit change information, and obtains the execution result of the transaction request, including: determining a target limit rule corresponding to the transaction request in the limit rule; and sending the target limit rule to the server node based on the Netty long connection, wherein the server node executes the transaction request according to the target limit rule, and obtains the execution result of the transaction request.
[0009] Furthermore, before sending the target quota rule to the server node based on the Netty long connection, the method also includes: sending the node status of the server node to the ETCD cluster; sending the target quota rule to the server node based on the Netty long connection includes: determining the target server node in the server node according to the node status stored in the ETCD cluster; and sending the target quota rule to the target server node through a hash algorithm.
[0010] Further, the server node executes the transaction request according to the target limit rule, and the execution result of the transaction request includes: sending the limit change information to the message queue; according to the target limit rule, the target server node determines in turn whether the limit value of the limit change information in the message queue exceeds the limit value of the target account; if the limit value of the limit change information exceeds the limit value of the target account, it is determined that the transaction request corresponding to the limit change information has failed to execute; if the limit value of the limit change information does not exceed the limit value of the target account, the target server node updates the limit value of the target account according to the limit change information, and determines that the transaction request corresponding to the limit change information has been successfully executed.
[0011] Further, receiving the execution result returned by the server node, and when the execution result indicates that the transaction request is successfully executed, updating the limit information of the target account according to the execution result includes: receiving the execution result returned by the server node through the Netty long connection; and determining the updated limit information of the target account according to the execution result.
[0012] Furthermore, after the target service end node updates the limit value of the target account according to the limit change information and determines that the transaction request corresponding to the limit change information is successfully executed, the method also includes: every preset time period, controlling the target service end node to send the updated limit information of the target account to the ETCD cluster to update the limit change information of the target account in the ETCD cluster.
[0013] Furthermore, after determining the updated limit information of the target account based on the execution result, the method also includes: upon receiving other transaction requests from the target account, determining whether the transaction amount in the other transaction requests exceeds the current limit value of the target account based on the other transaction requests, the updated limit information of the target account and the limit rules.
[0014] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a control device for account limits is provided, the device comprising: a first determination unit, for determining, when a transaction request is received, whether the transaction amount in the transaction request exceeds the limit value of a target account, wherein the target account refers to the transaction account in the transaction request, and the limit value represents the upper limit of the transaction amount of the target account; a generation unit, for generating limit change information of the target account according to the transaction request when the transaction amount does not exceed the limit value, wherein the limit change information refers to change information of the account transaction limit of the target account; a sending unit, for sending the limit change information to a server node, wherein the server node executes the transaction request according to the limit change information to obtain an execution result of the transaction request; an updating unit, for receiving the execution result returned by the server node, and updating the limit information of the target account according to the execution result when the execution result indicates that the transaction request is successfully executed.
[0015] Furthermore, the device also includes: a second determination unit, used to determine the limit rule before determining whether the transaction amount in the transaction request exceeds the limit value of the target account, wherein the limit rule refers to the upper limit set by the financial institution for the transaction amount of the account transaction; a third determination unit, used to determine the historical limit change information of the account in the financial institution, and store the historical limit change information in the ETCD cluster, wherein the historical limit change information represents the change information of the limit value in the historical transactions of the account in the financial institution.
[0016] Furthermore, the first determination unit includes: a first determination subunit, used to determine the transaction amount in the transaction request; an acquisition subunit, used to obtain the limit change information of the target account in the ETCD cluster; and a second determination subunit, used to determine whether the transaction amount in the transaction request exceeds the limit value of the target account based on the historical limit change information of the target account, the limit rule and the transaction amount.
[0017] Furthermore, the sending unit includes: a third determination subunit, used to determine a target limit rule corresponding to the transaction request in the limit rule; a first sending subunit, used to send the target limit rule to the server node based on the Netty long connection, wherein the server node executes the transaction request according to the target limit rule to obtain the execution result of the transaction request.
[0018] Furthermore, the sending unit also includes: a second sending sub-unit, used to send the node status of the server node to the ETCD cluster before sending the target limit rule to the server node based on the Netty long connection; the first sending sub-unit includes: a first determination module, used to determine the target server node in the server node based on the node status stored in the ETCD cluster; a first sending module, used to send the target limit rule to the target server node through a hash algorithm.
[0019] Furthermore, the first sending sub-unit includes: a second sending module, used to send the limit change information to the message queue; a judgment module, used to judge by the target service end node in turn whether the limit value of the limit change information in the message queue exceeds the limit value of the target account according to the target limit rule; a second determination module, used to determine that the transaction request corresponding to the limit change information has failed to execute if the limit value of the limit change information exceeds the limit value of the target account; an update module, used to update the limit value of the target account according to the limit change information by the target service end node if the limit value of the limit change information does not exceed the limit value of the target account, and determine that the transaction request corresponding to the limit change information has been successfully executed.
[0020] Furthermore, the updating unit includes: a receiving subunit, used to receive the execution result returned by the server node through the Netty long connection; and a fourth determining subunit, used to determine the updated limit information of the target account according to the execution result.
[0021] Furthermore, the first sending sub-unit also includes: a third sending module, which is used to control the target service node to send the updated limit information of the target account to the ETCD cluster every preset time period after the target service node updates the limit value of the target account according to the limit change information and determines that the transaction request corresponding to the limit change information is successfully executed, so as to update the limit change information of the target account in the ETCD cluster.
[0022] Furthermore, the updating unit also includes: a fifth determination subunit, which is used to determine whether the transaction amount in the other transaction requests exceeds the current limit value of the target account based on the other transaction requests, the updated limit information of the target account and the limit rules after determining the updated limit information of the target account based on the execution result, when receiving other transaction requests from the target account.
[0023] In order to achieve the above objective, according to one aspect of the present application, a processor is provided, and the processor is used to run a program, wherein when the program is running, any of the above-mentioned account limit control methods is executed.
[0024] In order to achieve the above-mentioned purpose, according to one aspect of the present application, an electronic device is provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any of the account limit control methods described above.
[0025] Through the present application, the following steps are adopted: when a transaction request is received, determining whether the transaction amount in the transaction request exceeds the limit value of the target account, wherein the target account refers to the transaction account in the transaction request, and the limit value represents the upper limit of the transaction amount of the target account; when the transaction amount does not exceed the limit value, generating limit change information of the target account according to the transaction request, wherein the limit change information refers to the change information of the account transaction limit of the target account; sending the limit change information to a server node, wherein the server node executes the transaction request according to the limit change information to obtain the execution result of the transaction request; receiving the execution result returned by the server node, and when the execution result indicates that the transaction request is successfully executed, updating the limit information of the target account according to the execution result, thereby solving the problem in the related art that when a customer's transaction request is processed by a distributed lock, the distributed lock becomes invalid due to network fluctuations or node failures, and the customer's account limit cannot be updated in time, resulting in poor timeliness of the account limit. By having the client node judge the transaction request before the server node executes the transaction request, and screening the transaction requests whose transaction amount does not exceed the limit value of the target account, the number of transaction requests that the server node needs to process is reduced, and the problem of poor timeliness of account limits caused by accumulation of transaction requests is avoided. In addition, by generating incremental information when the limit value of the target account is changed (i.e., the limit change information mentioned above), the server node only needs to process incremental data and does not need to process the full data of the target account, which reduces the computing pressure of the server node, improves the efficiency of the server node in processing transaction requests, and further improves the timeliness of the account limit. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0027] Figure 1is a flowchart of a method for controlling an account limit provided in Example 1 of the present application;
[0028] Figure 2 is a schematic diagram of an optional account limit control method provided according to Embodiment 1 of the present application;
[0029] Figure 3 is a schematic diagram of a control device for account limits provided in Embodiment 2 of the present application;
[0030] Figure 4 This is a schematic diagram of an electronic device for controlling account limits provided in Example 5 of the present application. DETAILED DESCRIPTION
[0031] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0032] It should be noted that the user information (including but not limited to user device information, user personal information, user transaction information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, data submitted by users, data used in user transactions, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0033] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 creative work should fall within the scope of protection of this application.
[0034] 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 sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. 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 device comprising 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.
[0035] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0036] Etcd cluster is a highly available distributed key-value database with the following features: simple installation and configuration, and provides HTTP API for interaction, which is also easy to use; stores data in hierarchically organized directories, just like in a standard file system; monitors specific keys or directories for changes and responds to changed values; supports SSL certificate verification; according to the official benchmark data, a single instance supports 2k+ read operations per second; uses the raft algorithm to achieve the availability and consistency of distributed system data. At the same time, etcd cluster is written in Go language, which has excellent cross-platform support, very small binary files and a strong community.
[0037] Netty persistent connection is a network connection method based on TCP protocol, which allows a persistent connection to be established between the client and the server, rather than re-establishing the connection for each request. Using Netty persistent connection can realize real-time communication, push messages, real-time monitoring and other functions. In the traditional short connection mode, each client request needs to go through the steps of handshake, connection establishment, data transmission, and connection closing, and this connection method is relatively inefficient. Netty persistent connection can maintain the connection state after the connection is established, and can perform frequent data transmission, reducing the overhead of handshake and connection establishment, and improving the efficiency of data transmission.
[0038] Embodiment 1
[0039] The present invention is described below in conjunction with preferred implementation steps. Figure 1 is a flow chart of the method for controlling the account limit provided in Example 1 of the present application. Figure 1 As shown, the method comprises the following steps:
[0040] Step S101, upon receiving a transaction request, determining whether the transaction amount in the transaction request exceeds the limit value of the target account, wherein the target account refers to the transaction account in the transaction request, and the limit value indicates the upper limit of the transaction amount of the target account.
[0041] At present, when a financial institution processes a transaction request, the client node generally receives the transaction request, and the client node sends the received transaction request to the message queue, and the server node obtains and executes the transaction request from the message queue. In the first embodiment, in order to avoid the server node being blocked by the message queue due to the need to execute too many transaction requests, the client node needs to filter the transaction request before the server node executes the transaction request, and filter out the transaction request whose transaction amount exceeds the limit value of the target account. In addition to the system for processing transaction requests, the client node can also include application nodes of other systems (such as Figure 2 A server node is a node in a distributed computing cluster (such as Figure 2 Server node N1, server node N2 and other nodes).
[0042] Step S102, when the transaction amount does not exceed the limit value, generate limit change information of the target account according to the transaction request, wherein the limit change information refers to the change information of the account transaction limit of the target account.
[0043] In the first embodiment, if it is determined that the transaction amount of the transaction request does not exceed the limit value of the target account, the transaction request is sent to the server node, and the transaction request is executed by the server node. In order to reduce the amount of data processed when the server node executes the transaction request, it is necessary to generate the limit change information of the target account according to the transaction request, that is, the incremental information of the target account change limit, and the server node changes the limit value of the target account through the limit change information.
[0044] Step S103, sending the limit change information to the server node, wherein the server node executes the transaction request according to the limit change information to obtain the execution result of the transaction request.
[0045] In actual production activities, since financial institutions face a large number of customers, they need to deploy multiple client nodes and multiple server nodes to concurrently process transaction requests initiated by a large number of customers. In the first embodiment, after determining the limit change information, the limit change information needs to be sent to the message queue, so that at least one server node can obtain the limit change information from the message queue, and concurrently execute the transaction request corresponding to the limit change information, and obtain the execution result of the transaction request to ensure that the customer's transaction needs are met.
[0046] Step S104, receiving the execution result returned by the server node, and when the execution result indicates that the transaction request is successfully executed, updating the limit information of the target account according to the execution result.
[0047] In the first embodiment of the present invention, in order to ensure the timeliness of the account limits in the financial institution, it is necessary to update the limit information of the target account after determining the execution result of the transaction request, and synchronize the limit information of the target account to other systems or devices involved in the transaction request in the financial institution, such as client nodes, databases, cluster caches, and other locations.
[0048] In summary, the account limit control method provided in Example 1 of the present application determines, when a transaction request is received, whether the transaction amount in the transaction request exceeds the limit value of the target account, wherein the target account refers to the transaction account in the transaction request, and the limit value represents the upper limit of the transaction amount of the target account; when the transaction amount does not exceed the limit value, generates limit change information of the target account according to the transaction request, wherein the limit change information refers to the change information of the account transaction limit of the target account; sends the limit change information to the server node, wherein the server node executes the transaction request according to the limit change information to obtain the execution result of the transaction request; receives the execution result returned by the server node, and when the execution result indicates that the transaction request is successfully executed, updates the limit information of the target account according to the execution result, thereby solving the problem in the related art that when a customer's transaction request is processed by a distributed lock, the distributed lock becomes invalid due to network fluctuations or node failures, and the customer's account limit cannot be updated in time, resulting in poor timeliness of the account limit. By having the client node judge the transaction request before the server node executes the transaction request, and screening the transaction requests whose transaction amount does not exceed the limit value of the target account, the number of transaction requests that the server node needs to process is reduced, and the problem of poor timeliness of account limits caused by accumulation of transaction requests is avoided. In addition, by generating incremental information when the limit value of the target account is changed (i.e., the limit change information mentioned above), the server node only needs to process incremental data and does not need to process the full data of the target account, which reduces the computing pressure of the server node, improves the efficiency of the server node in processing transaction requests, and further improves the timeliness of the account limit.
[0049] Optionally, in the account limit control method provided in Example 1 of the present application, before determining whether the transaction amount in the transaction request exceeds the limit value of the target account, the above method also includes: determining the limit rule, wherein the limit rule refers to the upper limit set by the financial institution for the transaction amount of the account transaction; determining the historical limit change information of the account in the financial institution, and storing the historical limit change information in the ETCD cluster, wherein the historical limit change information represents the change information of the limit value in the historical transactions of the account in the financial institution.
[0050] In the first embodiment of the present invention, the limit rule refers to the upper limit of the transaction amount of a single transaction (or deposit / withdrawal operation) of a customer that is restricted by a financial institution. For example, the single limit value of a type of account in the bank by Bank A is 100,000 yuan, indicating that the account can only transfer or withdraw a maximum of 100,000 yuan in one transaction or operation; Bank A limits the limit value of transactions allowed for a type of account in the bank within a month to 100,000 yuan, indicating that the cumulative transaction amount of all transactions or operations of the account within a month cannot exceed 100,000 yuan. Historical limit change information refers to the limit change information when the limit value of a customer account in a financial institution changes before the financial institution executes a transaction request, for example, Account B reduces the upper limit of the transaction amount by 100 yuan on April 1; Account B reduces the upper limit of the transaction amount by 200 yuan on April 2.
[0051] It should be noted that financial institutions can adjust the limit rules based on factors such as transaction type, different account types and customer identity. At the same time, customers can also apply to financial institutions for limit changes, and financial institutions will handle customers' limit change applications based on actual conditions. After determining the limit rules, in order to continuously store and read the customer's limit rules, the limit rules can be persistently stored in the MySql database.
[0052] By determining the limit rules before the server node executes the transaction request, the transaction amount limit of the target account can be flexibly controlled according to the actual situation, which ensures the safety of customers' funds and reduces the transaction risks of financial institutions. At the same time, by determining the historical limit change information of the account and storing it in the ETCD cluster, the limit change information of the account can be viewed in real time in the ETCD cluster, which is also beneficial for the client node to determine whether it is necessary to generate the limit change information corresponding to the transaction request based on the limit rules and historical limit change information, reducing the computing pressure of the server node and improving the efficiency of the server node in processing transaction requests.
[0053] Optionally, in the account limit control method provided in Example 1 of the present application, determining whether the transaction amount in the transaction request exceeds the limit value of the target account includes: determining the transaction amount in the transaction request; obtaining the limit change information of the target account in the ETCD cluster; and determining whether the transaction amount in the transaction request exceeds the limit value of the target account based on the historical limit change information, limit rules and transaction amount of the target account.
[0054] In the first embodiment of the present invention, the client node determines whether the transaction amount in the transaction request exceeds the current limit value of the target account by obtaining the historical limit change information and limit rules of the target account. Specifically, account A initiates a transaction request B to transfer 100 yuan (i.e., the above-mentioned transaction amount) to account C. After receiving the transaction request B, the client node obtains the limit rule of account A from the MySql database, which is that the upper limit of the transaction amount per week is 500 yuan, and obtains from the ETCD cluster that the limit value of account A has changed 3 times this week, which is reduced by 50 yuan, 100 yuan, and 150 yuan respectively (i.e., the above-mentioned limit change information). The client node calculates the current limit value of account A as 200 yuan, and determines that the transaction amount of transaction request B of 100 yuan does not exceed the current limit value of account A of 200 yuan, so it is determined that the transaction amount in transaction request B does not exceed the limit value of account A.
[0055] By determining whether the transaction amount in the transaction request exceeds the limit value of the target account through limit rules and historical limit change information, the client node can filter out some transaction requests that do not need to be calculated by the server node based on the limit rules and historical limit change information, thereby reducing the computing pressure of the server node, improving the efficiency of the server node in executing transaction requests, and further improving the timeliness of the limit information of the target account.
[0056] Optionally, in the account limit control method provided in Example 1 of the present application, limit change information is sent to the server node, wherein the server node executes the transaction request based on the limit change information, and obtains the execution result of the transaction request, including: determining the target limit rule corresponding to the transaction request in the limit rule; sending the target limit rule to the server node based on the Netty long connection, wherein the server node executes the transaction request based on the target limit rule, and obtains the execution result of the transaction request.
[0057] In the first embodiment, the target limit rule indicates the limit rule applicable to the current transaction request among all the limit rules of the financial institution. When determining the target limit rule, the client node can determine the target limit rule corresponding to the transaction request based on the information contained in the current transaction request. For example, the financial institution contains limit rule A for a type 1 account and limit rule B for a type 2 account. When the account in the transaction request C is a type 1 account, the target limit rule is limit rule A. The target limit rule corresponding to the transaction request can also be determined based on the source of the transaction request. For example, the client node receives the transaction request C from the interface D, and the interface D corresponds to the limit rule E, and the target limit rule is the limit rule E.
[0058] In order to facilitate the server node to execute transaction requests, a connection can be established between the client node and the server node based on the Netty long connection. Then, after the client node obtains the target limit rule, the target limit rule is sent to the server node through the Netty long connection.
[0059] By determining the target limit rule, it is possible to determine whether the transaction request needs to be sent to the server node based on the target limit rule, and send the target limit rule to the server node through the Netty long connection, avoiding the server node from having to obtain the target limit rule again when processing the transaction request, reducing the workload of the server node, and also reducing the response time of the transaction request, thereby improving the efficiency of the server node in processing the transaction request.
[0060] Optionally, in the account limit control method provided in Example 1 of the present application, before sending the target limit rule to the server node based on the Netty long connection, the above method also includes: sending the node status of the server node to the ETCD cluster; sending the target limit rule to the server node based on the Netty long connection includes: determining the target server node in the server node based on the node status stored in the ETCD cluster; and sending the target limit rule to the target server node through a hash algorithm.
[0061] In the first embodiment of the present invention, in order to avoid a large load on a single server node, the node status of each server node can be sent to the ETCD cluster. Before the client node sends the target limit rule to the server node, the client node obtains the node status of each server node from the ETCD cluster, determines the target server node with a smaller load, and sends the target limit rule to the target server through a hash algorithm. Among them, the target server node can be a server node in an idle state, or a server node with a smaller load (for example, a server node with a node flow less than a preset value).
[0062] By sending the node status of the server node to the ETCD cluster, the ETCD cluster can quickly determine the target server node with a smaller current load. At the same time, the target limit rule is sent to the target server node through the hash algorithm, thereby achieving the effect of balancing the server node load, improving the efficiency of the server node in processing transaction requests, and thus achieving the effect of improving the timeliness of the account limit.
[0063] Optionally, in the account limit control method provided in Example 1 of the present application, the server node executes the transaction request according to the target limit rule, and the execution result of the transaction request obtained includes: sending the limit change information to the message queue; according to the target limit rule, the target server node determines in turn whether the limit value of the limit change information in the message queue exceeds the limit value of the target account; if the limit value of the limit change information exceeds the limit value of the target account, it is determined that the transaction request corresponding to the limit change information has failed to execute; if the limit value of the limit change information does not exceed the limit value of the target account, the target server node updates the limit value of the target account according to the limit change information, and determines that the transaction request corresponding to the limit change information has been successfully executed.
[0064] In this embodiment, in order to ensure the execution efficiency of transaction requests and the timeliness of account limits when a large number of transaction requests are initiated by customers, a large number of transaction requests may be processed by multiple server nodes.
[0065] Specifically, after multiple client nodes generate at least one limit change information, at least one limit change information can be sent to a message queue. Then, multiple server nodes can obtain the limit change information corresponding to the target limit rule from the message queue according to the target limit rule received from the Netty long connection. After each server node determines the limit change information to be processed, it determines whether the limit change information can be successfully changed according to the target limit rule, that is, whether the limit value of the limit change information exceeds the limit value of the target account corresponding to the limit change information.
[0066] For example, if the limit change information indicates that account A needs to pay 100 yuan, the limit value of account A needs to be deducted by 100 yuan accordingly, and the target limit rule indicates that the current limit value of account A is 500 yuan, the server node determines that the limit value of account A's limit change information, 100, does not exceed the current limit value of account A, 500, based on the historical limit change information, limit change information and target limit rule of account A, and further determines that the transaction request corresponding to the limit change information is successfully executed. If the target limit rule indicates that the current limit value of account A is 50 yuan, the server node determines that the limit value of account A's limit change information, 100, exceeds the current limit value of account A, 50, and further determines that the transaction request corresponding to the limit change information fails to execute.
[0067] By having multiple server nodes concurrently process the limit change information in the message queue, the efficiency of the server nodes in processing transaction requests is improved, thereby achieving the effect of improving the timeliness of the account limit.
[0068] Optionally, in the account limit control method provided in Example 1 of the present application, an execution result returned by the server node is received, and when the execution result indicates that the transaction request is successfully executed, the limit information of the target account is updated according to the execution result, including: receiving the execution result returned by the server node through a Netty long connection; and determining the updated limit information of the target account according to the execution result.
[0069] In the first embodiment of the present invention, after the server node determines the execution result of the transaction request, the execution result of the transaction request can be sent to the client node through the Netty long connection. The client receives the execution result of the transaction request, and can determine the current limit information of the account corresponding to the transaction request based on the execution result of the transaction request, and update the limit information of the account in the client node. Through the execution result returned by the server node, the limit information of the target account can be updated in the cache of the client node (such as the JVM cluster), which is beneficial for the client node to judge the transaction amount of the subsequent transaction request received from the target account.
[0070] Optionally, in the account limit control method provided in Example 1 of the present application, after the target service end node updates the limit value of the target account based on the limit change information and determines that the transaction request corresponding to the limit change information is successfully executed, the above method also includes: every preset time period, controlling the target service end node to send the updated limit information of the target account to the ETCD cluster to update the limit change information of the target account in the ETCD cluster.
[0071] In the first embodiment of the present invention, in order to maintain the timeliness of the account limit in the ETCD cluster, the target server node is required to maintain a real-time heartbeat with the ETCD cluster, that is, the limit value of the target account calculated in the target server node is sent to the ETCD cluster every preset period of time, so as to timely update the limit change information of the target account in the ETCD cluster. In addition, the target server node can also send the node status of its own node to the ETCD cluster every preset period of time, so that the client node can determine the server node with a smaller load in real time. By controlling the target server node to update the limit information and its own node status of the target account in the ETCD cluster every preset period of time, the timeliness of the limit information of the target account in the ETCD cluster is improved, and it is also beneficial for the client node to determine the server node with a smaller load in real time.
[0072] Optionally, in the account limit control method provided in Example 1 of the present application, after determining the updated limit information of the target account based on the execution result, the above method also includes: when receiving other transaction requests from the target account, determining whether the transaction amount in the other transaction requests exceeds the current limit value of the target account based on the other transaction requests, the updated limit information of the target account and the limit rules.
[0073] After the client node receives the updated limit information of the target account, if the client node receives a transaction request from the target account again (i.e., the other transaction request mentioned above), the limit information of the target account can be directly obtained from the cache of the client node, and then the limit change information of the target account can be determined. There is no need to obtain the limit change information of the target account from the ETCD cluster again, and then continue to determine whether the transaction amount of other transaction requests of the target account exceeds the current limit value of the target account.
[0074] By obtaining the current limit value of the target account in the client node, the limit change information of the target account can be directly determined without having to obtain the limit change information of the target account from the ETCD cluster again, thereby improving the efficiency of the client node in processing transaction requests and achieving the effect of improving the timeliness of the account limit.
[0075] Optionally, in the first embodiment, the process of controlling the account limit of the solution can be as follows: Figure 2 First, when the client node receives a transaction request, the client node (such as Figure 2 Application A-node A1, application A-node A2, application B-node B1, application B-node B2, cross-system application node) in the ETCD cluster determines whether the transaction amount in the transaction request exceeds the limit value of the target account according to the limit rules and historical limit change information in the ETCD cluster. Then, if the transaction amount does not exceed the limit value, the client node generates the limit change information of the target account according to the transaction request. Secondly, the limit change information is sent to the message queue. Finally, the server node (such as Figure 2 The server nodes N1, N2, N3, and N in the ETCD cluster execute the transaction request according to the limit change information, obtain the execution result of the transaction request, and update the limit change information of the target account in the ETCD cluster, and update the limit change information of the target account in the client node through the Netty long connection.
[0076] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0077] Embodiment 2
[0078] The second embodiment of the present application also provides a control device for account limits. It should be noted that the control device for account limits in the second embodiment of the present application can be used to execute the control method for account limits provided in the first embodiment of the present application. The following introduces the control device for account limits provided in the second embodiment of the present application.
[0079] Figure 3 Schematic diagram of a control device for account limits according to Embodiment 2 of the present application. Figure 3 As shown, the device includes: a first determining unit 301, a generating unit 302, a sending unit 303 and an updating unit 304.
[0080] Specifically, the first determination unit 301 is used to determine whether the transaction amount in the transaction request exceeds the limit value of the target account when a transaction request is received, wherein the target account refers to the transaction account in the transaction request, and the limit value indicates the upper limit of the transaction amount of the target account.
[0081] The generating unit 302 is used to generate the limit change information of the target account according to the transaction request when the transaction amount does not exceed the limit value, wherein the limit change information refers to the change information of the account transaction limit of the target account.
[0082] The sending unit 303 is used to send the limit change information to the server node, wherein the server node executes the transaction request according to the limit change information to obtain the execution result of the transaction request.
[0083] The updating unit 304 is used to receive the execution result returned by the server node, and when the execution result indicates that the transaction request is successfully executed, update the limit information of the target account according to the execution result.
[0084] The control device for account limits provided in the second embodiment of the present application determines, through the first determination unit 301, whether the transaction amount in the transaction request exceeds the limit value of the target account when a transaction request is received, wherein the target account refers to the transaction account in the transaction request, and the limit value indicates the upper limit of the transaction amount of the target account; the generation unit 302 generates limit change information of the target account according to the transaction request when the transaction amount does not exceed the limit value, wherein the limit change information refers to the change information of the account transaction limit of the target account; the sending unit 303 sends the limit change information to the server node, wherein the server node executes the transaction request according to the limit change information to obtain the execution result of the transaction request; the updating unit 304 receives the execution result returned by the server node, and updates the limit information of the target account according to the execution result when the execution result indicates that the transaction request is successfully executed, thereby solving the problem in the related art that when a distributed lock processes a customer's transaction request, the distributed lock becomes invalid due to network fluctuations or node failures, and the customer's account limit cannot be updated in time, resulting in poor timeliness of the account limit. By having the client node judge the transaction request before the server node executes the transaction request, and screening the transaction requests whose transaction amount does not exceed the limit value of the target account, the number of transaction requests that the server node needs to process is reduced, and the problem of poor timeliness of account limits caused by accumulation of transaction requests is avoided. In addition, by generating incremental information when the limit value of the target account is changed (i.e., the limit change information mentioned above), the server node only needs to process incremental data and does not need to process the full data of the target account, which reduces the computing pressure of the server node, improves the efficiency of the server node in processing transaction requests, and further improves the timeliness of the account limit.
[0085] Optionally, in the account limit control device provided in Example 2 of the present application, the above-mentioned device also includes: a second determination unit, used to determine the limit rule before determining whether the transaction amount in the transaction request exceeds the limit value of the target account, wherein the limit rule refers to the upper limit set by the financial institution for the transaction amount of the account transaction; a third determination unit, used to determine the historical limit change information of the account in the financial institution, and store the historical limit change information in the ETCD cluster, wherein the historical limit change information represents the change information of the limit value in the historical transactions of the account in the financial institution.
[0086] Optionally, in the account limit control device provided in Example 2 of the present application, the above-mentioned first determination unit 301 includes: a first determination sub-unit, used to determine the transaction amount in the transaction request; an acquisition sub-unit, used to obtain the limit change information of the target account in the ETCD cluster; a second determination sub-unit, used to determine whether the transaction amount in the transaction request exceeds the limit value of the target account based on the historical limit change information, limit rules and transaction amount of the target account.
[0087] Optionally, in the account limit control device provided in Example 2 of the present application, the above-mentioned sending unit 303 includes: a third determination subunit, used to determine the target limit rule corresponding to the transaction request in the limit rule; a first sending subunit, used to send the target limit rule to the server node based on the Netty long connection, wherein the server node executes the transaction request according to the target limit rule to obtain the execution result of the transaction request.
[0088] Optionally, in the account limit control device provided in Example 2 of the present application, the above-mentioned sending unit 303 also includes: a second sending sub-unit, used to send the node status of the server node to the ETCD cluster before sending the target limit rule to the server node based on the Netty long connection; the first sending sub-unit includes: a first determination module, used to determine the target server node in the server node based on the node status stored in the ETCD cluster; the first sending module, used to send the target limit rule to the target server node through a hash algorithm.
[0089] Optionally, in the account limit control device provided in Example 2 of the present application, the above-mentioned first sending sub-unit includes: a second sending module, used to send the limit change information to the message queue; a judgment module, used to determine, by the target service end node, whether the limit value of the limit change information in the message queue exceeds the limit value of the target account in turn according to the target limit rule; a second determination module, used to determine that the transaction request corresponding to the limit change information has failed to execute if the limit value of the limit change information exceeds the limit value of the target account; an update module, used to update the limit value of the target account according to the limit change information by the target service end node if the limit value of the limit change information does not exceed the limit value of the target account, and determine that the transaction request corresponding to the limit change information has been successfully executed.
[0090] Optionally, in the account limit control device provided in Example 2 of the present application, the above-mentioned update unit 304 includes: a receiving subunit, used to receive the execution result returned by the server node through a Netty long connection; and a fourth determination subunit, used to determine the updated limit information of the target account based on the execution result.
[0091] Optionally, in the account limit control device provided in Example 2 of the present application, the above-mentioned first sending sub-unit also includes: a third sending module, which is used to control the target service end node to send the updated limit information of the target account to the ETCD cluster every preset time period after the target service end node updates the limit value of the target account based on the limit change information, and determines that the transaction request corresponding to the limit change information is successfully executed, so as to update the limit change information of the target account in the ETCD cluster.
[0092] Optionally, in the account limit control device provided in Example 2 of the present application, the above-mentioned updating unit 304 also includes: a fifth determination subunit, which is used to determine the updated limit information of the target account based on the execution result, and when receiving other transaction requests from the target account, determine whether the transaction amount in other transaction requests exceeds the current limit value of the target account based on other transaction requests, the updated limit information of the target account and the limit rules.
[0093] The control device for the account limit includes a processor and a memory. The first determination unit 301, the generation unit 302, the sending unit 303 and the updating unit 304 are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
[0094] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the timeliness of the account limit can be improved by adjusting the kernel parameters.
[0095] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0096] Embodiment 3 of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, a method for controlling an account limit is implemented.
[0097] A fourth embodiment of the present invention provides a processor, which is used to run a program, wherein the method for controlling account limits is executed when the program is running.
[0098] like Figure 4 As shown, embodiment 5 of the present invention provides an electronic device, the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: in the case of receiving a transaction request, determining whether the transaction amount in the transaction request exceeds the limit value of the target account, wherein the target account refers to the transaction account in the transaction request, and the limit value indicates the upper limit of the transaction amount of the target account; in the case where the transaction amount does not exceed the limit value, generating limit change information of the target account according to the transaction request, wherein the limit change information refers to the change information of the account transaction limit of the target account; sending the limit change information to the server node, wherein the server node executes the transaction request according to the limit change information, and obtains the execution result of the transaction request; receiving the execution result returned by the server node, and in the case where the execution result indicates that the transaction request is successfully executed, updating the limit information of the target account according to the execution result.
[0099] When the processor executes the program, the following steps are also implemented: before determining whether the transaction amount in the transaction request exceeds the limit value of the target account, the above method also includes: determining the limit rule, wherein the limit rule refers to the upper limit set by the financial institution for the transaction amount of the account transaction; determining the historical limit change information of the account in the financial institution, and storing the historical limit change information in the ETCD cluster, wherein the historical limit change information represents the change information of the limit value in the historical transaction of the account in the financial institution.
[0100] When the processor executes the program, the following steps are also implemented: Determining whether the transaction amount in the transaction request exceeds the limit value of the target account includes: determining the transaction amount in the transaction request; obtaining the limit change information of the target account in the ETCD cluster; determining whether the transaction amount in the transaction request exceeds the limit value of the target account based on the historical limit change information, limit rules and transaction amount of the target account.
[0101] When the processor executes the program, the following steps are also implemented: sending the limit change information to the server node, wherein the server node executes the transaction request according to the limit change information, and obtains the execution result of the transaction request, including: determining the target limit rule corresponding to the transaction request in the limit rule; sending the target limit rule to the server node based on the Netty long connection, wherein the server node executes the transaction request according to the target limit rule, and obtains the execution result of the transaction request.
[0102] When the processor executes the program, the following steps are also implemented: before sending the target limit rule to the server node based on the Netty long connection, the above method also includes: sending the node status of the server node to the ETCD cluster; sending the target limit rule to the server node based on the Netty long connection includes: determining the target server node in the server node according to the node status stored in the ETCD cluster; sending the target limit rule to the target server node through a hash algorithm.
[0103] When the processor executes the program, the following steps are also implemented: the server node executes the transaction request according to the target limit rule, and the execution result of the transaction request includes: sending the limit change information to the message queue; according to the target limit rule, the target server node determines in turn whether the limit value of the limit change information in the message queue exceeds the limit value of the target account; if the limit value of the limit change information exceeds the limit value of the target account, it is determined that the transaction request corresponding to the limit change information has failed to execute; if the limit value of the limit change information does not exceed the limit value of the target account, the target server node updates the limit value of the target account according to the limit change information, and determines that the transaction request corresponding to the limit change information has been successfully executed.
[0104] When the processor executes the program, the following steps are also implemented: receiving the execution result returned by the server node, and when the execution result indicates that the transaction request is successfully executed, updating the limit information of the target account according to the execution result, including: receiving the execution result returned by the server node through the Netty long connection; and determining the updated limit information of the target account according to the execution result.
[0105] When the processor executes the program, the following steps are also implemented: after the target server node updates the limit value of the target account based on the limit change information and determines that the transaction request corresponding to the limit change information is successfully executed, the above method also includes: every preset time period, controlling the target server node to send the updated limit information of the target account to the ETCD cluster to update the limit change information of the target account in the ETCD cluster.
[0106] When the processor executes the program, the following steps are also implemented: after determining the updated limit information of the target account based on the execution result, the above method also includes: when receiving other transaction requests from the target account, determining whether the transaction amount in the other transaction requests exceeds the current limit value of the target account based on the other transaction requests, the updated limit information of the target account and the limit rules.
[0107] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0108] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: when a transaction request is received, determining whether the transaction amount in the transaction request exceeds the limit value of the target account, wherein the target account refers to the transaction account in the transaction request, and the limit value represents the upper limit of the transaction amount of the target account; when the transaction amount does not exceed the limit value, generating limit change information of the target account based on the transaction request, wherein the limit change information refers to the change information of the account transaction limit of the target account; sending the limit change information to a server node, wherein the server node executes the transaction request based on the limit change information and obtains an execution result of the transaction request; receiving the execution result returned by the server node, and when the execution result indicates that the transaction request is successfully executed, updating the limit information of the target account based on the execution result.
[0109] When executed on a data processing device, it is also suitable for executing a program that initializes the following method steps: before determining whether the transaction amount in the transaction request exceeds the limit value of the target account, the above method also includes: determining the limit rule, wherein the limit rule refers to the upper limit set by the financial institution for the transaction amount of the account transaction; determining the historical limit change information of the account in the financial institution, and storing the historical limit change information in the ETCD cluster, wherein the historical limit change information represents the change information of the limit value in the historical transactions of the account in the financial institution.
[0110] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: determining whether the transaction amount in a transaction request exceeds the limit value of a target account, including: determining the transaction amount in the transaction request; obtaining the limit change information of the target account in the ETCD cluster; determining whether the transaction amount in the transaction request exceeds the limit value of the target account based on the historical limit change information, limit rules and transaction amount of the target account.
[0111] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: sending limit change information to a server node, wherein the server node executes a transaction request based on the limit change information, and obtains an execution result of the transaction request, including: determining a target limit rule corresponding to the transaction request in the limit rule; sending the target limit rule to the server node based on a Netty long connection, wherein the server node executes the transaction request based on the target limit rule, and obtains an execution result of the transaction request.
[0112] When executed on a data processing device, it is also suitable for executing a program that initializes the following method steps: before sending the target limit rule to the server node based on the Netty long connection, the above method also includes: sending the node status of the server node to the ETCD cluster; sending the target limit rule to the server node based on the Netty long connection includes: determining the target server node in the server node according to the node status stored in the ETCD cluster; sending the target limit rule to the target server node through a hash algorithm.
[0113] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: the server node executes a transaction request according to the target limit rule, and the execution result of the transaction request obtained includes: sending the limit change information to the message queue; according to the target limit rule, the target server node determines in turn whether the limit value of the limit change information in the message queue exceeds the limit value of the target account; if the limit value of the limit change information exceeds the limit value of the target account, it is determined that the transaction request corresponding to the limit change information has failed to execute; if the limit value of the limit change information does not exceed the limit value of the target account, the target server node updates the limit value of the target account according to the limit change information, and determines that the transaction request corresponding to the limit change information has been successfully executed.
[0114] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: receiving an execution result returned by a server node, and when the execution result indicates that the transaction request is successfully executed, updating the limit information of the target account according to the execution result, including: receiving the execution result returned by the server node through a Netty long connection; and determining the updated limit information of the target account according to the execution result.
[0115] When executed on a data processing device, it is also suitable for executing a program that initializes the following method steps: after the target service node updates the limit value of the target account based on the limit change information and determines that the transaction request corresponding to the limit change information is successfully executed, the above method also includes: every preset time period, controlling the target service node to send the updated limit information of the target account to the ETCD cluster to update the limit change information of the target account in the ETCD cluster.
[0116] When executed on a data processing device, it is also suitable for executing an initialized program having the following method steps: after determining the updated limit information of the target account based on the execution result, the above method also includes: when receiving other transaction requests of the target account, determining whether the transaction amount in the other transaction requests exceeds the current limit value of the target account based on the other transaction requests, the updated limit information of the target account and the limit rules.
[0117] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0118] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0119] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0120] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0121] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0122] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0123] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0124] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0125] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0126] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for controlling account limits, characterized in that: include: In the case of receiving a transaction request, determining whether the transaction amount in the transaction request exceeds the limit value of the target account, wherein the target account refers to the transaction account in the transaction request, and the limit value indicates the upper limit of the transaction amount of the target account; If the transaction amount does not exceed the limit value, generating limit change information of the target account according to the transaction request, wherein the limit change information refers to change information of the account transaction limit of the target account; Sending the limit change information to a server node, wherein the server node executes the transaction request according to the limit change information to obtain an execution result of the transaction request; The execution result returned by the service end node is received, and when the execution result indicates that the transaction request is successfully executed, the limit information of the target account is updated according to the execution result.
2. The method according to claim 1, characterized in that Before determining whether the transaction amount in the transaction request exceeds the limit value of the target account, the method further includes: Determine a limit rule, wherein the limit rule refers to the upper limit set by the financial institution on the transaction amount of the account transaction; Determine historical limit change information of the account in the financial institution, and store the historical limit change information in the ETCD cluster, wherein the historical limit change information represents change information of the limit value in the historical transactions of the account in the financial institution.
3. The method according to claim 2, characterized in that Determining whether the transaction amount in the transaction request exceeds the limit value of the target account includes: Determining a transaction amount in the transaction request; Obtain historical limit change information of the target account in the ETCD cluster; Determine whether the transaction amount in the transaction request exceeds the limit value of the target account based on the historical limit change information of the target account, the limit rule and the transaction amount.
4. The method according to claim 2, characterized in that: The limit change information is sent to the server node, wherein the server node executes the transaction request according to the limit change information, and the execution result of the transaction request is obtained including: In the limit rule, determining a target limit rule corresponding to the transaction request; The target quota rule is sent to the server node based on the Netty long connection, wherein the server node executes the transaction request according to the target quota rule to obtain the execution result of the transaction request.
5. The method according to claim 4, characterized in that Before sending the target quota rule to the server node based on the Netty long connection, the method further includes: sending the node status of the server node to the ETCD cluster; Sending the target quota rule to the server node based on the Netty long connection includes: determining a target server node in the server node according to the node status stored in the ETCD cluster; and sending the target quota rule to the target server node through a hash algorithm.
6. The method according to claim 5, characterized in that The server node executes the transaction request according to the target limit rule, and obtains the execution result of the transaction request including: Sending the limit change information to a message queue; According to the target quota rule, the target service end node determines in sequence whether the quota value of the quota change information in the message queue exceeds the quota value of the target account; If the limit value of the limit change information exceeds the limit value of the target account, determining that the transaction request corresponding to the limit change information fails to execute; If the limit value of the limit change information does not exceed the limit value of the target account, the target service end node updates the limit value of the target account according to the limit change information, and determines that the transaction request corresponding to the limit change information is executed successfully.
7. The method according to claim 4, characterized in that Receiving the execution result returned by the server node, and when the execution result indicates that the transaction request is successfully executed, updating the limit information of the target account according to the execution result includes: Receive the execution result returned by the server node through the Netty long connection; The updated limit information of the target account is determined according to the execution result.
8. The method according to claim 6, characterized in that After the target service end node updates the limit value of the target account according to the limit change information and determines that the transaction request corresponding to the limit change information is successfully executed, the method further includes: After each preset time period, the target service end node is controlled to send the updated limit information of the target account to the ETCD cluster to update the limit change information of the target account in the ETCD cluster.
9. The method according to claim 7, characterized in that: After determining the updated limit information of the target account according to the execution result, the method further includes: When other transaction requests of the target account are received, it is determined whether the transaction amount in the other transaction requests exceeds the current limit value of the target account according to the other transaction requests, the updated limit information of the target account and the limit rule.
10. A device for controlling account limits, characterized in that: include: a first determining unit, configured to determine, upon receiving a transaction request, whether a transaction amount in the transaction request exceeds a limit value of a target account, wherein the target account refers to a transaction account in the transaction request, and the limit value indicates an upper limit of a transaction amount of the target account; a generating unit, configured to generate limit change information of the target account according to the transaction request if the transaction amount does not exceed the limit value, wherein the limit change information refers to change information of the account transaction limit of the target account; A sending unit, configured to send the limit change information to a server node, wherein the server node executes the transaction request according to the limit change information to obtain an execution result of the transaction request; An updating unit is used to receive the execution result returned by the service end node, and when the execution result indicates that the transaction request is successfully executed, update the limit information of the target account according to the execution result.
11. A processor, characterized in that: The processor is used to run a program, wherein the program executes the account limit control method according to any one of claims 1 to 9 when running.
12. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the account limit control method described in any one of claims 1 to 9.