[go: up one dir, main page]

CN113421163A - Account checking method, account checking application cluster and related client - Google Patents

Account checking method, account checking application cluster and related client Download PDF

Info

Publication number
CN113421163A
CN113421163A CN202110788105.8A CN202110788105A CN113421163A CN 113421163 A CN113421163 A CN 113421163A CN 202110788105 A CN202110788105 A CN 202110788105A CN 113421163 A CN113421163 A CN 113421163A
Authority
CN
China
Prior art keywords
client
transaction data
serial number
reconciliation
actual
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.)
Granted
Application number
CN202110788105.8A
Other languages
Chinese (zh)
Other versions
CN113421163B (en
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110788105.8A priority Critical patent/CN113421163B/en
Publication of CN113421163A publication Critical patent/CN113421163A/en
Application granted granted Critical
Publication of CN113421163B publication Critical patent/CN113421163B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Multi Processors (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明公开了一种对账方法、对账应用集群和相关客户端,涉及计算机技术领域。该方法的一具体实施方式包括:对账应用集群中的第一客户端在收到交易数据后,根据对账应用集群中各客户端的状态,选择可对交易数据执行对账的一个或多个目标客户端;第一客户端将目标客户端的实际序列号与收到的交易数据的标识关联存储到预设存储系统,以供对账应用集群中的各客户端查询;在对账应用集群中的第二客户端查询到目标客户端的实际序列号为第二客户端的实际序列号后,由第二客户端对收到的交易数据执行对账。该实施方式能够基于分布式对账的方案提高对账效率,保障对账系统的高利用率,避免重复对账。

Figure 202110788105

The invention discloses an account reconciliation method, an account reconciliation application cluster and a related client, and relates to the technical field of computers. A specific implementation of the method includes: after receiving the transaction data, the first client in the reconciliation application cluster selects one or more clients that can perform reconciliation on the transaction data according to the status of each client in the reconciliation application cluster target client; the first client associates the actual serial number of the target client with the identifier of the received transaction data and stores it in a preset storage system for each client in the reconciliation application cluster to query; in the reconciliation application cluster After the second client finds that the actual serial number of the target client is the actual serial number of the second client, the second client performs reconciliation on the received transaction data. This embodiment can improve the reconciliation efficiency based on the distributed reconciliation scheme, ensure high utilization rate of the reconciliation system, and avoid repeated reconciliation.

Figure 202110788105

Description

Account checking method, account checking application cluster and related client
Technical Field
The invention relates to the technical field of computers, in particular to an account checking method, an account checking application cluster and a related client.
Background
At present, there are two schemes for account checking: the first scheme is offline reconciliation, namely after all the reconciliation participants (such as transaction systems, financial systems, fund systems and other systems) are completely checked out and closed, generating offline billing data, extracting files or data from all the participants by the reconciliation system, and performing reconciliation according to reconciliation logic; and the second scheme is real-time reconciliation, namely, when each reconciliation participant generates the data to be reconciled, the reconciliation system performs data polling according to the real-time bill data of one or more parties until the reconciliation data of all the participants are acquired and then is uniformly reconciled.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
the account checking efficiency is low, the high utilization rate of the account checking system cannot be guaranteed, and the problem of repeated account checking exists.
Disclosure of Invention
In view of this, embodiments of the present invention provide an account checking method, an account checking application cluster, and a related client, which can improve account checking efficiency, ensure high utilization rate of an account checking system, and avoid repeated account checking.
To achieve the above object, according to an aspect of an embodiment of the present invention, a reconciliation method is provided.
A reconciliation method comprising: after a first client in the reconciliation application cluster receives transaction data, one or more target clients capable of performing reconciliation on the transaction data are selected according to the state of each client in the reconciliation application cluster; the first client stores the actual serial number of the target client and the identification of the received transaction data in a preset storage system in an associated manner so as to be inquired by each client in the reconciliation application cluster; and after the second client in the reconciliation application cluster inquires that the actual serial number of the target client is the actual serial number of the second client, performing reconciliation on the received transaction data by the second client.
Optionally, the method further comprises: and each client in the reconciliation application cluster is respectively registered as a temporary ordered node with the distributed service cluster to obtain respective actual serial number, and the corresponding relation between the actual serial number of the client and the state of the client is saved in the distributed service cluster.
Optionally, after receiving the transaction data, the first client in the reconciliation application cluster selects one or more target clients capable of performing reconciliation on the transaction data according to the state of each client in the reconciliation application cluster, where the selecting includes: after receiving transaction data, a first client in the reconciliation application cluster acquires the state of each client in the reconciliation application cluster from the distributed service cluster so as to select an idle client from the reconciliation application cluster, wherein the idle client is a client in an idle state; the first client sorts the acquired idle clients to determine the logic serial numbers of the idle clients and stores the corresponding relation between the logic serial numbers of the idle clients and the actual serial numbers; determining the logic serial numbers of the one or more target clients according to a preset algorithm by using the identification of the transaction data and the logic serial numbers of the idle clients; and determining the actual serial numbers of the one or more target clients according to the corresponding relation between the logic serial numbers and the actual serial numbers of the idle clients so as to select the one or more target clients according to the actual serial numbers.
Optionally, the identification of the transaction data is a serial number of the transaction data; the determining the logic sequence numbers of the one or more target clients according to a preset algorithm by using the identification of the transaction data and the logic sequence numbers of the idle clients comprises: and calculating the hash value of the serial number of the transaction data, and obtaining the logic serial numbers of the one or more target clients by taking a module of the hash value of the serial number of the transaction data on the number of the idle clients.
Optionally, the associating, by the first client, the actual serial number of the target client and the identifier of the received transaction data with each other is stored in a preset storage system, where the storing includes: the first client generates a task execution identifier comprising an actual serial number of the target client and an identifier of the received transaction data; and inquiring whether the task execution identifier exists in the preset storage system, and adding the task execution identifier to the preset storage system under the condition that the task execution identifier does not exist.
Optionally, the first client generates the task execution identifier by splicing an actual serial number of the target client with the identifier of the received transaction data, and sets a state of the task execution identifier to an unlocked state after the task execution identifier is added to the preset storage system.
Optionally, before querying the association relationship between the actual serial number of the client and the transaction data identifier from the preset storage system, each client in the reconciliation application cluster queries respective state of the distributed service cluster and determines that the respective state is idle.
Optionally, before performing reconciliation on the received transaction data by the second client, the method includes: the second client determines that the state of the task execution identifier comprising the actual serial number of the second client is an unlocked state, and then changes the state of the task execution identifier into a locked state; after reconciling, by the second client, the received transaction data, comprising: if the account checking is successful, the second client deletes the task execution identifier comprising the actual serial number of the second client from the preset storage system; and if the account checking is unsuccessful, the second client changes the state of the task execution identifier comprising the actual serial number of the second client into an unlocked state.
Optionally, the method further comprises: and monitoring a change event of the distributed service cluster through a timing task, and resetting the association relationship between the actual serial number of the client and the transaction data identifier in the preset storage system according to the updated actual serial number of the client after monitoring that the actual serial number of the client is changed.
According to another aspect of the embodiments of the present invention, a reconciliation application cluster is provided.
A reconciliation application cluster comprising a plurality of clients, wherein: the first client is used for selecting one or more target clients capable of performing account checking on the transaction data according to the state of each client in the account checking application cluster after receiving the transaction data; the first client is further used for storing the actual serial number of the target client and the identification of the received transaction data in a preset storage system in an associated manner so as to be inquired by each client in the reconciliation application cluster; and the second client is used for executing account checking on the received transaction data after inquiring that the actual serial number of the target client is the actual serial number of the second client.
Optionally, each client registers as a temporary ordered node with the distributed service cluster, so as to obtain an actual serial number of each client, and stores a corresponding relationship between the actual serial number of the client and a state of the client in the distributed service cluster.
Optionally, the first client is further configured to: after transaction data are received, acquiring the state of each client in the reconciliation application cluster from the distributed service cluster, and selecting an idle client from the reconciliation application cluster, wherein the idle client is a client in an idle state; sequencing the acquired idle clients to determine the logic serial numbers of the idle clients and storing the corresponding relation between the logic serial numbers of the idle clients and the actual serial numbers; determining the logic serial numbers of the one or more target clients according to a preset algorithm by using the identification of the transaction data and the logic serial numbers of the idle clients; and determining the actual serial numbers of the one or more target clients according to the corresponding relation between the logic serial numbers and the actual serial numbers of the idle clients so as to select the one or more target clients according to the actual serial numbers.
Optionally, the identification of the transaction data is a serial number of the transaction data; the first client is further configured to: and calculating the hash value of the serial number of the transaction data, and obtaining the logic serial numbers of the one or more target clients by taking a module of the hash value of the serial number of the transaction data on the number of the idle clients.
Optionally, the first client is further configured to: generating a task execution identifier comprising an actual serial number of the target client and an identifier of the received transaction data; and inquiring whether the task execution identifier exists in the preset storage system, and adding the task execution identifier to the preset storage system under the condition that the task execution identifier does not exist.
Optionally, the first client is further configured to: and generating the task execution identifier by splicing the actual serial number of the target client with the identifier of the received transaction data, and setting the state of the task execution identifier to be an unlocked state after the task execution identifier is added to the preset storage system.
Optionally, before querying the association relationship between the client actual serial number and the transaction data identifier from the preset storage system, each client in the reconciliation application cluster is further configured to: and respectively inquiring respective states of the distributed service clusters, and determining that the respective states are idle.
Optionally, before performing reconciliation on the received transaction data, the second client is further configured to: determining that the state of the task execution identifier comprising the actual serial number of the second client is an unlocked state, and then changing the state of the task execution identifier into a locked state; after performing reconciliation on the received transaction data, the second client is further configured to: if the account checking is successful, deleting the task execution identifier comprising the actual serial number of the second client from the preset storage system; and if the account checking is unsuccessful, changing the state of the task execution identifier comprising the actual serial number of the second client into an unlocked state.
Optionally, a change event of the distributed service cluster is monitored through a timing task, and after monitoring that an actual serial number of a client changes, the first client is further configured to: and resetting the incidence relation between the actual serial number of the client and the transaction data identifier in the preset storage system according to the updated actual serial number of the client.
According to another aspect of the embodiment of the invention, a client in a reconciliation application cluster is provided.
A client in a reconciliation application cluster, comprising: the account checking client selecting module is used for selecting one or more target clients capable of performing account checking on the received transaction data according to the state of each client in the account checking application cluster after the transaction data are received; the correlation storage module is used for storing the actual serial number of the target client and the received identification of the transaction data in a preset storage system in a correlation manner so as to be inquired by each client in the reconciliation application cluster, wherein the preset storage system is used for storing the correlation relationship between the actual serial number of each client and each transaction data identification; and the reconciliation execution module is used for acquiring detailed data of corresponding transaction data according to the identification of the transaction data associated with the inquired actual serial number for reconciliation after the actual serial number inquired from the preset storage system is the actual serial number of the client.
According to yet another aspect of an embodiment of the present invention, an electronic device is provided.
An electronic device, comprising: one or more processors; a memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the reconciliation method provided by embodiments of the invention.
According to yet another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer-readable medium, on which a computer program is stored, which, when executed by a processor, implements the reconciliation method provided by an embodiment of the invention.
One embodiment of the above invention has the following advantages or benefits: after receiving the transaction data, a first client in the reconciliation application cluster selects one or more target clients capable of performing reconciliation on the transaction data according to the state of each client in the reconciliation application cluster; the method comprises the steps that a first client stores an actual serial number of a target client and a received identification of transaction data in a preset storage system in an associated mode so as to be inquired by each client in a reconciliation application cluster; and after the second client in the reconciliation application cluster inquires that the actual serial number of the target client is the actual serial number of the second client, the second client performs reconciliation on the received transaction data. The account checking efficiency can be improved, the high utilization rate of the account checking system is guaranteed, and repeated account checking is avoided.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a reconciliation method according to one embodiment of the present invention;
FIG. 2 is a schematic diagram of client registration according to one embodiment of the invention;
FIG. 3 is a flow diagram of a reconciliation method according to one embodiment of the invention;
FIG. 4 is a schematic flow diagram of selecting a target client according to one embodiment of the invention;
FIG. 5 is a flow diagram of a get reconciliation task according to one embodiment of the invention;
FIG. 6 is a flow diagram of performing reconciliation tasks in accordance with one embodiment of the present invention;
FIG. 7 is a flow diagram of monitoring change events according to one embodiment of the invention;
FIG. 8 is an architecture diagram of a reconciliation application cluster, in accordance with one embodiment of the present invention;
FIG. 9 is a schematic diagram of the main modules of a client in a reconciliation application cluster, according to one embodiment of the present invention;
FIG. 10 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 11 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, the reconciliation method according to an embodiment of the present invention mainly includes the following steps S101 to S103.
Step S101: after the first client in the reconciliation application cluster receives the transaction data, one or more target clients capable of performing reconciliation on the transaction data are selected according to the state of each client in the reconciliation application cluster.
And each client in the reconciliation application cluster is respectively registered as a temporary ordered node with the distributed service cluster to obtain respective actual serial number, and the corresponding relation between the actual serial number of the client and the state of the client is saved in the distributed service cluster.
After receiving the transaction data, the first client in the reconciliation application cluster selects one or more target clients capable of performing reconciliation on the transaction data according to the state of each client in the reconciliation application cluster, which may include: after receiving the transaction data, a first client in the reconciliation application cluster acquires the state of each client in the reconciliation application cluster from the distributed service cluster so as to select an idle client from the reconciliation application cluster, wherein the idle client is a client in an idle state; the first client sorts the acquired idle clients to determine the logic serial numbers of the idle clients, wherein the logic serial numbers are the client serial numbers determined by sorting the idle clients, and the corresponding relation between the logic serial numbers of the idle clients and the actual serial numbers is stored; determining the logic serial numbers of one or more target clients according to a preset algorithm by using the identification of the transaction data and the logic serial numbers of the idle clients; and determining the actual serial numbers of one or more target clients according to the corresponding relation between the logic serial numbers and the actual serial numbers of the idle clients so as to select one or more target clients according to the actual serial numbers.
The identification of the transaction data is the serial number of the transaction data; determining the logic serial numbers of one or more target clients according to a preset algorithm by using the identification of the transaction data and the logic serial numbers of the idle clients, which may include: and calculating the hash value of the serial number of the transaction data, and obtaining the logic serial numbers of one or more target clients by taking a module of the hash value of the serial number of the transaction data on the number of the idle clients.
And monitoring a change event of the distributed service cluster through a timing task, and resetting the association relationship between the actual serial number of the client and the transaction data identifier in the preset storage system according to the updated actual serial number of the client after monitoring that the actual serial number of the client is changed.
Step S102: and the first client stores the actual serial number of the target client and the received identification of the transaction data in a preset storage system in an associated manner so as to be inquired by each client in the reconciliation application cluster.
The first client stores the actual serial number of the target client and the identifier of the received transaction data in a preset storage system in an associated manner, which may include: the first client generates a task execution identifier comprising an actual serial number of the target client and an identifier of the received transaction data; and inquiring whether the task execution identifier exists in a preset storage system, and adding the task execution identifier to the preset storage system under the condition that the task execution identifier does not exist.
The first client may generate the task execution identifier by splicing an actual serial number of the target client with the identifier of the received transaction data, and set a state of the task execution identifier to an unlocked state after the task execution identifier is added to the preset storage system.
Step S103: and after the second client in the reconciliation application cluster inquires that the actual serial number of the target client is the actual serial number of the second client, the second client performs reconciliation on the received transaction data.
Before querying the association relationship between the actual serial number of the client and the transaction data identifier from the preset storage system, each client in the reconciliation application cluster can query the distributed service cluster for respective state and determine that the respective state is idle.
Before reconciling the received transaction data by the second client, the method may include: the second client determines that the state of the task execution identifier including the actual serial number of the second client is an unlocked state, and then changes the state of the task execution identifier to a locked state.
After reconciling, by the second client, the received transaction data, may include: if the account checking is successful, the second client deletes the task execution identifier comprising the actual serial number of the second client from the preset storage system; and if the account checking is unsuccessful, the second client changes the state of the task execution identifier comprising the actual serial number of the second client into an unlocked state.
Each client in the reconciliation application cluster can be used as a first client and also can be used as a second client.
Fig. 2 is a schematic diagram of client registration according to one embodiment of the invention.
As shown in fig. 2, the distributed service cluster is, for example, a zookeeper cluster (zk cluster for short), and the reconciliation application cluster is a cluster formed by clients (clients), each client being a reconciliation application. And each client in the reconciliation application cluster is respectively registered as a temporary ordered node with the distributed service cluster to obtain respective actual serial number, and the corresponding relation between the actual serial number of the client and the state of the client is saved in the distributed service cluster. Specifically, all application clients (i.e., clients) participating in reconciliation are registered to the zk cluster, and are registered as temporary ordered nodes during registration, and each client obtains an actual serial number allocated by the zk cluster, as shown in { znodeName } _0000000001 in fig. 2, where znodeName is a name of a temporary node, and 0000000001 is a serial number allocated by a zk cluster self-owned mechanism, i.e., an actual serial number of one client; establishing a first key-value pair for each client, wherein the key of the first key-value pair is the actual serial number of the client, the value is the state of the ip of the client and the client, the state of the client can be an IDLE state (IDLE) and a BUSY state (BUSY), and the state of the client is defaulted to be the IDLE state. The first key-value pair is shown as client _0000000069:192.168.1.1& IDLE in FIG. 2, wherein 0000000069 is the actual serial number of the current client, 192.168.1.1 is the ip of the current client, and IDLE is the status of the current client.
Fig. 3 is a flow chart diagram of a reconciliation method according to an embodiment of the invention.
As shown in fig. 3, a system architecture for implementing the reconciliation method of the embodiment of the present invention mainly includes a data receiving module, a data preloading module, a core reconciliation logic module, a reset worker module, a data cache (redis), and a Database (DB). The data receiving module is responsible for receiving transaction data, selecting one or more target clients capable of performing account checking on the transaction data according to the state of each client in the account checking application cluster, and storing the actual serial number of the target client and the received identification of the transaction data in a preset storage system in an associated manner so as to be inquired by each client in the account checking application cluster; the data preloading module is mainly responsible for judging whether a current client is in an idle state on a zk cluster, if so, unconditionally acquiring a preset number (such as 1000) of task execution identifiers from the redis, judging a locking state and a real receiving transaction serial number in the task execution identifiers, if the current client is in an unlocked state and the real receiving transaction serial number is an actual serial number of the current client on the zk cluster, changing the locking state of the task execution identifiers in the redis from unlocked to locked, placing the task execution identifiers in a memory queue of the current client, obtaining corresponding transaction data from a database in batch by a transaction detail loading thread of the current client according to the real receiving transaction serial number in the task execution identifiers, and then loading the transaction data into a memory of the current client; the core reconciliation logic module is mainly responsible for completing reconciliation logic on the transaction data to be reconciled according to the business rules and generating reconciliation result information; the resetting worker module is mainly responsible for monitoring a change event of the distributed service cluster through a timing task, and when the change of an actual serial number of the client is monitored, the association relation between the actual serial number of the client and the transaction data identifier in the preset storage system is reset according to the updated actual serial number of the client.
Each client in the reconciliation application cluster in the embodiment of the present invention may have the functions of the data receiving module, the data preloading module, the core reconciliation logic module, and the worker resetting module, specifically, the data receiving module has the functions of the reconciliation client selecting module and the associated storage module of the client in the following embodiment, the core reconciliation logic module has the function of the reconciliation executing module of the client in the following embodiment, and the functions of the modules mentioned in this embodiment may refer to the description of the following embodiment.
For each client, the transaction data may be received, or a certain transaction data may be checked, and the transaction data received by the same client may be different from or the same as the transaction data actually checked by the same client, that is, the first client and the second client may be the same or different clients in the above embodiment.
For the same transaction data, the transaction data is received, and according to the state of each client in the reconciliation application cluster, one or more target clients capable of performing reconciliation on the transaction data are selected as first clients, and the client actually performing reconciliation on the transaction data is selected as a second client.
Fig. 4 is a flow diagram of selecting a target client according to one embodiment of the invention.
As shown in fig. 4, a first client in the reconciliation application cluster receives transaction data, which is specifically real-time received transaction data, and then selects one or more target clients capable of performing reconciliation on the transaction data according to the state of each client in the reconciliation application cluster. The embodiment of the invention executes reconciliation, specifically, reconciliation is performed on transaction data (namely, real transaction data) received by a first client and transaction data to be received acquired through an RPC interface or from a local memory, because the real transaction data is generated after the transaction data to be received is generated, the real transaction data is used as a trigger point of a process, after receiving the real transaction data, any client acquires all actual serial numbers of idle clients on a zk cluster (namely, the step of acquiring all active clients on zk in FIG. 4), and logically sequences all the idle clients to acquire the logical serial numbers of the idle clients, and stores the association relationship between the logical serial numbers and the actual serial numbers of the idle clients. According to a preset algorithm, a logical serial number of a client (namely a target client) for processing the account checking task corresponding to the actual received transaction serial number is determined through the actual received transaction serial number (namely the identification of the transaction data), and an actual serial number of the client on a zk cluster is determined through the incidence relation between the logical serial number of the client and the actual serial number, wherein the preset algorithm can be used for obtaining the logical serial number of the client for processing the account checking task corresponding to the actual received transaction serial number by taking a modulus of a hash value (hash value) of the actual received transaction serial number to the number of idle clients.
And storing the actual serial number of the target client and the identification of the received transaction data in a preset storage system in an associated manner. The preset storage system may specifically be redis, specifically, establish a second key-value pair for each reconciliation task, where a key (key) of the second key-value pair is a task execution identifier, specifically, generated by splicing an actual serial number of a target client with an actual transaction serial number, see the step of assembling a transaction data serial number clientSeq _ transitionald in fig. 4, and the assembled transaction data serial number is a task execution identifier, where clientSeq represents the actual serial number of the client, the transitionald represents the actual transaction serial number, and a value (value) of the second key-value pair is a state of the reconciliation task, that is, a state of the task execution identifier, specifically, may be a locked state (locked) or an unlocked state (unlocked), a state of the reconciliation task is considered as an unlocked state, and a format of the second key-value pair stored in the redis may be: clientSeq _ transportid: unlock, wherein the clientSeq indicates the actual serial number of the client, the transcationId indicates the actual transaction serial number of the real transaction, and unlock indicates that the status of the reconciliation task is the unlocked status. After the task execution identifier is locked in a redis mode, the second key value pair key: clientSeq _ transcationId, value: lock status is the locked state (locked). And searching whether the task execution identifier exists in the redis, if not, storing the task execution identifier in the redis, and if so, not storing the task execution identifier in the redis so as to prevent duplication. And storing (persisting) the detailed data (namely the actual transaction data) of the actual transaction flow corresponding to the actual transaction flow number into a Database (DB).
Fig. 5 is a flow diagram of a get reconciliation task according to one embodiment of the invention.
As shown in fig. 5, each client (i.e., application client) in the reconciliation application cluster queries respective state from the distributed service cluster, and after determining that the respective state is idle, queries an association relationship between an actual serial number of the client and a transaction data identifier from a preset storage system. Specifically, whether the current client is in an idle state on the zk cluster is judged, and if not, the process is terminated; if yes, the current client obtains a preset number (for example, 1000) of task execution identifiers unconditionally from the redis (see fig. 5 for a step of taking the transaction serial number from the redis). And judging the locking state and the real-time receiving transaction serial number in the task execution identifier, if the locking state and the real-time receiving transaction serial number are the actual serial numbers of the current client on the zk cluster, changing the locking state of the task execution identifier in the redis from unlocked to locked, and placing the task execution identifier in the memory queue of the current client. The current client obtains the corresponding transaction data (indicating the real transaction data) in batch from the database according to the real transaction serial number in the task execution identifier through the transaction detail loading thread of the client, and refer to the step of obtaining the data in the DB according to the serial number in fig. 5. And then loading the transaction data into the memory of the client to check the account.
FIG. 6 is a flow diagram of performing reconciliation tasks in accordance with one embodiment of the present invention.
As shown in fig. 6, the client performs reconciliation on the received transaction data. Specifically, the current client takes out the task execution identifier to be checked from the fixed end of the memory queue through its own checking thread, see the step of fetching from the queue of the client memory in fig. 6; acquiring corresponding receivable transaction data and real transaction data through an RPC interface or a local memory according to the real transaction serial number in the task execution identifier, checking account according to an account checking logic, judging whether the account checking is successful, deleting the task execution identifier from the redis if the account checking is successful, referring to the step of removing the serial number from the redis, and storing an account checking result into a database, namely, persisting the account checking result to a DB; and if the account checking is unsuccessful, changing the state of the task execution identifier in the redis from locked to unlocked, namely releasing the lock in the redis.
FIG. 7 is a flow diagram of monitoring change events, according to one embodiment of the invention.
As shown in fig. 7, a change event of the distributed service cluster (zk) is monitored through a timing task, and after the change of the actual serial number of the client is monitored, the association relationship between the actual serial number of the client and the transaction data identifier in the preset storage system is reset according to the updated actual serial number of the client. Specifically, the state change event of the zk cluster is monitored by the timed task, the actual serial number of the changed client before the change is obtained (that is, the step of obtaining the changed client serial number in fig. 7), according to the actual serial number (clientSeq) of the target client included in the task execution identifier in the redis, the target client capable of performing reconciliation on the transaction data is reselected from the actual received transaction serial number corresponding to the actual serial number before the change of the changed client, and the actual serial number of the target client and the received identification of the transaction data are stored in the preset storage system in a related manner, that is, the step of reallocating the client serial number according to the latest client number on the zk in fig. 7 is performed on the data.
FIG. 8 is an architecture diagram of a reconciliation application cluster in accordance with one embodiment of the present invention.
As shown in fig. 8, a reconciliation application cluster 800 of an embodiment of the invention comprises a plurality of clients, of which a first client 801 and a second client 802 are exemplarily shown in fig. 8.
The first client 801 is configured to, after receiving the transaction data, select one or more target clients capable of performing reconciliation on the transaction data according to the status of each client in the reconciliation application cluster.
The first client 801 is further configured to store the actual serial number of the target client and the identifier of the received transaction data in a preset storage system in an associated manner, so as to be queried by each client in the reconciliation application cluster.
The second client 802 is configured to perform reconciliation on the received transaction data after querying that the actual serial number of the target client is the actual serial number of the second client.
In one embodiment, each client registers as a temporary ordered node with the distributed service cluster respectively to obtain an actual serial number of each client, and the corresponding relation between the actual serial number of the client and the state of the client is stored in the distributed service cluster.
In one embodiment, the first client is further configured to: after receiving the transaction data, acquiring the state of each client in the reconciliation application cluster from the distributed service cluster so as to select an idle client from the reconciliation application cluster, wherein the idle client is a client with an idle state; sequencing the acquired idle clients to determine the logic serial numbers of the idle clients, and storing the corresponding relation between the logic serial numbers of the idle clients and the actual serial numbers; determining the logic serial numbers of one or more target clients according to a preset algorithm by using the identification of the transaction data and the logic serial numbers of the idle clients; and determining the actual serial numbers of one or more target clients according to the corresponding relation between the logic serial numbers and the actual serial numbers of the idle clients so as to select one or more target clients according to the actual serial numbers.
In one embodiment, the identification of the transaction data is a serial number of the transaction data; the first client is further configured to: and calculating the hash value of the serial number of the transaction data, and obtaining the logic serial numbers of one or more target clients by taking a module of the hash value of the serial number of the transaction data on the number of the idle clients.
In one embodiment, the first client is further configured to: generating a task execution identifier comprising an actual serial number of the target client and an identifier of the received transaction data; and inquiring whether the task execution identifier exists in a preset storage system, and adding the task execution identifier to the preset storage system under the condition that the task execution identifier does not exist.
In one embodiment, the first client is further configured to: and generating a task execution identifier by splicing the actual serial number of the target client with the identifier of the received transaction data, and setting the state of the task execution identifier to be an unlocked state after the task execution identifier is added to a preset storage system.
In one embodiment, before each client in the reconciliation application cluster querying the association relationship between the client actual serial number and the transaction data identifier from the preset storage system, the method further comprises: and respectively inquiring respective states of the distributed service clusters, and determining that the respective states are idle.
In one embodiment, before performing reconciliation on the received transaction data, the second client is further configured to: determining that the state of the task execution identifier comprising the actual serial number of the second client is an unlocked state, and then changing the state of the task execution identifier into a locked state; after performing reconciliation on the received transaction data, the second client is further configured to: if the account checking is successful, deleting the task execution identifier comprising the actual serial number of the second client from the preset storage system; and if the account checking is unsuccessful, changing the state of the task execution identifier comprising the actual serial number of the second client into an unlocked state.
In one embodiment, the change event of the distributed service cluster is monitored through a timing task, and after the actual serial number of the client is monitored to be changed, the first client is further used for: and resetting the incidence relation between the actual serial number of the client and the transaction data identifier in the preset storage system according to the updated actual serial number of the client.
In addition, in the embodiment of the present invention, the detailed implementation content of the reconciliation application cluster has been described in detail in the above reconciliation method, so that repeated content herein is not described again.
Fig. 9 is a schematic diagram of main modules of a client in a reconciliation application cluster according to an embodiment of the present invention.
As shown in fig. 9, a client 900 in the reconciliation application cluster according to an embodiment of the present invention mainly includes: a reconciliation client selection module 901, an association storage module 902 and a reconciliation execution module 903.
The reconciliation client selecting module 901 is configured to, after receiving the transaction data, select one or more target clients capable of performing reconciliation on the received transaction data according to the state of each client in the reconciliation application cluster.
The association storage module 902 is configured to store the actual serial number of the target client and the identifier of the received transaction data in an association manner to a preset storage system, so as to be queried by each client in the reconciliation application cluster, where the preset storage system is configured to store an association relationship between the actual serial number of each client and each transaction data identifier.
The reconciliation executing module 903 is configured to, after the actual serial number queried from the preset storage system is the actual serial number of the client, obtain detailed data of the corresponding transaction data according to the identifier of the transaction data associated with the queried actual serial number to perform reconciliation.
The client 900 may further include a data preloading module and a reset worker module, and specific functions may be described in the above embodiments.
In addition, in the embodiment of the present invention, the detailed implementation content of the client in the reconciliation application cluster has been described in detail in the foregoing reconciliation method, so that the repeated content is not described again.
Fig. 10 illustrates an exemplary system architecture 1000 to which the reconciliation method, the reconciliation application cluster or related clients of embodiments of the invention can be applied.
As shown in fig. 10, the system architecture 1000 may include terminal devices 1001, 1002, 1003, a network 1004, and a server 1005. The network 1004 is used to provide a medium for communication links between the terminal devices 1001, 1002, 1003 and the server 1005. Network 1004 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 1001, 1002, 1003 to interact with a server 1005 via a network 1004 to receive or transmit messages or the like. The terminal devices 1001, 1002, 1003 may have installed thereon various messenger client applications such as shopping applications, web browser applications, search applications, instant messenger, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 1001, 1002, 1003 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 1005 may be a server that provides various services, such as a backend management server (for example only) that supports shopping websites browsed by users using the terminal devices 1001, 1002, 1003. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the reconciliation method provided by the embodiment of the present invention is generally executed by the server 1005, and accordingly, the reconciliation application cluster or the relevant client is generally disposed in the server 1005.
It should be understood that the number of terminal devices, networks, and servers in fig. 10 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 11, shown is a block diagram of a computer system 1100 suitable for use with a terminal device or server implementing an embodiment of the present invention. The terminal device or the server shown in fig. 11 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 11, the computer system 1100 includes a Central Processing Unit (CPU)1101, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1102 or a program loaded from a storage section 1108 into a Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data necessary for the operation of the system 1100 are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An input/output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input portion 1106 including a keyboard, mouse, and the like; an output portion 1107 including a signal output unit such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 1108 including a hard disk and the like; and a communication section 1109 including a network interface card such as a LAN card, a modem, or the like. The communication section 1109 performs communication processing via a network such as the internet. A driver 1110 is also connected to the I/O interface 1105 as necessary. A removable medium 1111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1110 as necessary, so that a computer program read out therefrom is mounted into the storage section 1108 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 1109 and/or installed from the removable medium 1111. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 1101.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a reconciliation client selection module, an association storage module and a reconciliation execution module. The names of these modules do not form a limitation on the modules themselves in some cases, for example, the reconciliation client selection module can also be described as "a module for selecting one or more target clients that can perform reconciliation on received transaction data according to the status of each client in the reconciliation application cluster after the transaction data is received".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: after receiving the transaction data, a first client in the reconciliation application cluster selects one or more target clients capable of performing reconciliation on the transaction data according to the state of each client in the reconciliation application cluster; the method comprises the steps that a first client stores an actual serial number of a target client and a received identification of transaction data in a preset storage system in an associated mode so as to be inquired by each client in a reconciliation application cluster; and after the second client in the reconciliation application cluster inquires that the actual serial number of the target client is the actual serial number of the second client, the second client performs reconciliation on the received transaction data.
According to the technical scheme of the embodiment of the invention, after receiving transaction data, a first client in the reconciliation application cluster selects one or more target clients capable of performing reconciliation on the transaction data according to the state of each client in the reconciliation application cluster; the method comprises the steps that a first client stores an actual serial number of a target client and a received identification of transaction data in a preset storage system in an associated mode so as to be inquired by each client in a reconciliation application cluster; and after the second client in the reconciliation application cluster inquires that the actual serial number of the target client is the actual serial number of the second client, the second client performs reconciliation on the received transaction data. The account checking efficiency can be improved, the high utilization rate of the account checking system is guaranteed, and repeated account checking is avoided.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (21)

1.一种对账方法,其特征在于,包括:1. A method for reconciliation, comprising: 对账应用集群中的第一客户端在收到交易数据后,根据所述对账应用集群中各客户端的状态,选择可对所述交易数据执行对账的一个或多个目标客户端;After receiving the transaction data, the first client in the reconciliation application cluster selects one or more target clients that can perform reconciliation on the transaction data according to the status of each client in the reconciliation application cluster; 所述第一客户端将所述目标客户端的实际序列号与收到的交易数据的标识关联存储到预设存储系统,以供所述对账应用集群中的各客户端查询;The first client stores the actual serial number of the target client in association with the identifier of the received transaction data in a preset storage system, so that each client in the account reconciliation application cluster can query; 在所述对账应用集群中的第二客户端查询到所述目标客户端的实际序列号为所述第二客户端的实际序列号后,由所述第二客户端对所述收到的交易数据执行对账。After the second client in the account reconciliation application cluster finds that the actual serial number of the target client is the actual serial number of the second client, the second client checks the received transaction data Perform reconciliation. 2.根据权利要求1所述的方法,其特征在于,还包括:2. The method of claim 1, further comprising: 所述对账应用集群中的各客户端分别向分布式服务集群注册为临时有序节点,以得到各自的实际序列号,并在所述分布式服务集群中保存所述客户端的实际序列号与所述客户端的状态的对应关系。Each client in the reconciliation application cluster is registered as a temporary ordered node with the distributed service cluster to obtain their actual serial number, and the actual serial number of the client and the actual serial number of the client are stored in the distributed service cluster. The corresponding relationship of the state of the client. 3.根据权利要求2所述的方法,其特征在于,所述对账应用集群中的第一客户端在收到交易数据后,根据所述对账应用集群中各客户端的状态,选择可对所述交易数据执行对账的一个或多个目标客户端,包括:3 . The method according to claim 2 , wherein after receiving the transaction data, the first client in the account reconciliation application cluster selects a client that can be reconciled according to the status of each client in the account reconciliation application cluster. 4 . One or more target clients that perform reconciliation of the transaction data, including: 所述对账应用集群中的第一客户端在收到交易数据后,从所述分布式服务集群获取所述对账应用集群中各客户端的状态,以从所述对账应用集群中选出空闲客户端,所述空闲客户端为状态为空闲的客户端;After receiving the transaction data, the first client in the account reconciliation application cluster obtains the status of each client in the account reconciliation application cluster from the distributed service cluster, so as to select from the account reconciliation application cluster an idle client, the idle client is a client whose state is idle; 所述第一客户端对获取的各空闲客户端排序,以确定所述空闲客户端的逻辑序号,并保存所述空闲客户端的逻辑序号与实际序列号的对应关系;The first client sorts the acquired idle clients to determine the logical sequence numbers of the idle clients, and saves the correspondence between the logical sequence numbers of the idle clients and the actual sequence numbers; 利用所述交易数据的标识和所述空闲客户端的逻辑序号,按照预设算法确定所述一个或多个目标客户端的逻辑序号;Using the identifier of the transaction data and the logical sequence number of the idle client, determine the logical sequence number of the one or more target clients according to a preset algorithm; 根据所述空闲客户端的逻辑序号与实际序列号的对应关系,确定所述一个或多个目标客户端的实际序列号,以根据实际序列号选出所述一个或多个目标客户端。According to the corresponding relationship between the logical serial numbers of the idle clients and the actual serial numbers, the actual serial numbers of the one or more target clients are determined, so as to select the one or more target clients according to the actual serial numbers. 4.根据权利要求3所述的方法,其特征在于,所述交易数据的标识为所述交易数据的流水号;4. The method according to claim 3, wherein the identifier of the transaction data is the serial number of the transaction data; 所述利用所述交易数据的标识和所述空闲客户端的逻辑序号,按照预设算法确定所述一个或多个目标客户端的逻辑序号,包括:The use of the identifier of the transaction data and the logical sequence number of the idle client to determine the logical sequence number of the one or more target clients according to a preset algorithm, including: 计算所述交易数据的流水号的哈希值,通过所述交易数据的流水号的哈希值对所述空闲客户端的数量取模,得到所述一个或多个目标客户端的逻辑序号。Calculate the hash value of the serial number of the transaction data, and modulo the number of idle clients by the hash value of the serial number of the transaction data to obtain the logical sequence numbers of the one or more target clients. 5.根据权利要求2所述的方法,其特征在于,所述第一客户端将所述目标客户端的实际序列号与收到的交易数据的标识关联存储到预设存储系统,包括:5. The method according to claim 2, wherein the first client stores the actual serial number of the target client in association with the identifier of the received transaction data in a preset storage system, comprising: 所述第一客户端生成包括所述目标客户端的实际序列号以及所述收到的交易数据的标识的任务执行标识;The first client generates a task execution identifier including the actual serial number of the target client and the identifier of the received transaction data; 在所述预设存储系统中查询是否已存在该任务执行标识,在不存在该任务执行标识的情况下,将该任务执行标识添加到所述预设存储系统。It is queried in the preset storage system whether the task execution identifier already exists, and if the task execution identifier does not exist, the task execution identifier is added to the preset storage system. 6.根据权利要求5所述的方法,其特征在于,所述第一客户端通过将所述目标客户端的实际序列号与所述收到的交易数据的标识拼接,来生成所述任务执行标识,且在将所述任务执行标识添加到所述预设存储系统之后,设置所述任务执行标识的状态为未锁定状态。6. The method according to claim 5, wherein the first client generates the task execution identification by splicing the actual serial number of the target client with the identification of the received transaction data , and after adding the task execution flag to the preset storage system, set the state of the task execution flag to an unlocked state. 7.根据权利要求6所述的方法,其特征在于,所述对账应用集群中的各客户端在从所述预设存储系统中查询客户端实际序列号与交易数据标识的关联关系之前,分别向所述分布式服务集群查询各自的状态,并确定各自的状态为空闲。7. The method according to claim 6, wherein, before each client in the account reconciliation application cluster inquires about the association between the client's actual serial number and the transaction data identifier from the preset storage system, Inquire about the respective statuses from the distributed service cluster, and determine that the respective statuses are idle. 8.根据权利要求6所述的方法,其特征在于,由所述第二客户端对所述收到的交易数据执行对账之前,包括:8. The method according to claim 6, wherein before performing reconciliation on the received transaction data by the second client, the method comprises: 所述第二客户端确定包括所述第二客户端的实际序列号的任务执行标识的状态为未锁定状态,然后将该任务执行标识的状态变更为锁定状态;The second client determines that the state of the task execution identifier including the actual serial number of the second client is an unlocked state, and then changes the state of the task execution identifier to a locked state; 由所述第二客户端对所述收到的交易数据执行对账之后,包括:After the second client performs reconciliation on the received transaction data, it includes: 若对账成功,则所述第二客户端将包括所述第二客户端的实际序列号的任务执行标识从所述预设存储系统中删除;若所述对账不成功,则所述第二客户端将包括所述第二客户端的实际序列号的任务执行标识的状态变更为未锁定状态。If the reconciliation is successful, the second client deletes the task execution identifier including the actual serial number of the second client from the preset storage system; if the reconciliation is unsuccessful, the second client The client changes the state of the task execution identifier including the actual sequence number of the second client to an unlocked state. 9.根据权利要求2所述的方法,其特征在于,还包括:9. The method of claim 2, further comprising: 通过定时任务监控所述分布式服务集群的变更事件,当监控到客户端的实际序列号变更后,按照更新后的客户端实际序列号,重置所述预设存储系统中客户端实际序列号与交易数据标识的关联关系。The change event of the distributed service cluster is monitored through a scheduled task, and when the actual serial number of the client is monitored, the actual serial number of the client in the preset storage system is reset according to the updated actual serial number of the client. The association of transaction data identifiers. 10.一种对账应用集群,其特征在于,包括多个客户端,其中:10. An account reconciliation application cluster, comprising a plurality of clients, wherein: 第一客户端用于在收到交易数据后,根据对账应用集群中各客户端的状态,选择可对所述交易数据执行对账的一个或多个目标客户端;The first client is configured to, after receiving the transaction data, select one or more target clients that can perform reconciliation on the transaction data according to the status of each client in the reconciliation application cluster; 所述第一客户端还用于将所述目标客户端的实际序列号与收到的交易数据的标识关联存储到预设存储系统,以供所述对账应用集群中的各客户端查询;The first client is further configured to associate and store the actual serial number of the target client and the identifier of the received transaction data in a preset storage system, so as to be queried by each client in the account reconciliation application cluster; 第二客户端用于在查询到所述目标客户端的实际序列号为所述第二客户端的实际序列号后,对所述收到的交易数据执行对账。The second client is configured to perform reconciliation on the received transaction data after inquiring that the actual serial number of the target client is the actual serial number of the second client. 11.根据权利要求10所述的对账应用集群,其特征在于,11. The account reconciliation application cluster according to claim 10, wherein, 各所述客户端分别向分布式服务集群注册为临时有序节点,以得到各自的实际序列号,并在所述分布式服务集群中保存所述客户端的实际序列号与所述客户端的状态的对应关系。Each of the clients registers with the distributed service cluster as a temporary ordered node to obtain their actual serial number, and saves the actual serial number of the client and the state of the client in the distributed service cluster. Correspondence. 12.根据权利要求11所述的对账应用集群,其特征在于,所述第一客户端还用于:12. The account reconciliation application cluster according to claim 11, wherein the first client is further used for: 在收到交易数据后,从所述分布式服务集群获取所述对账应用集群中各客户端的状态,以从所述对账应用集群中选出空闲客户端,所述空闲客户端为状态为空闲的客户端;After receiving the transaction data, obtain the status of each client in the account reconciliation application cluster from the distributed service cluster, so as to select an idle client from the account reconciliation application cluster, and the idle client is in a state of idle client; 对获取的各空闲客户端排序,以确定所述空闲客户端的逻辑序号,并保存所述空闲客户端的逻辑序号与实际序列号的对应关系;Sorting the acquired idle clients to determine the logical sequence numbers of the idle clients, and save the correspondence between the logical sequence numbers of the idle clients and the actual sequence numbers; 利用所述交易数据的标识和所述空闲客户端的逻辑序号,按照预设算法确定所述一个或多个目标客户端的逻辑序号;Using the identifier of the transaction data and the logical sequence number of the idle client, determine the logical sequence number of the one or more target clients according to a preset algorithm; 根据所述空闲客户端的逻辑序号与实际序列号的对应关系,确定所述一个或多个目标客户端的实际序列号,以根据实际序列号选出所述一个或多个目标客户端。According to the corresponding relationship between the logical serial numbers of the idle clients and the actual serial numbers, the actual serial numbers of the one or more target clients are determined, so as to select the one or more target clients according to the actual serial numbers. 13.根据权利要求12所述的对账应用集群,其特征在于,所述交易数据的标识为所述交易数据的流水号;13. The account reconciliation application cluster according to claim 12, wherein the identifier of the transaction data is the serial number of the transaction data; 所述第一客户端还用于:The first client is also used for: 计算所述交易数据的流水号的哈希值,通过所述交易数据的流水号的哈希值对所述空闲客户端的数量取模,得到所述一个或多个目标客户端的逻辑序号。Calculate the hash value of the serial number of the transaction data, and modulo the number of the idle clients by using the hash value of the serial number of the transaction data to obtain the logical serial number of the one or more target clients. 14.根据权利要求11所述的对账应用集群,其特征在于,所述第一客户端还用于:14. The account reconciliation application cluster according to claim 11, wherein the first client is further used for: 生成包括所述目标客户端的实际序列号以及所述收到的交易数据的标识的任务执行标识;generating a task execution identification including the actual serial number of the target client and the identification of the received transaction data; 在所述预设存储系统中查询是否已存在该任务执行标识,在不存在该任务执行标识的情况下,将该任务执行标识添加到所述预设存储系统。It is queried in the preset storage system whether the task execution identifier already exists, and if the task execution identifier does not exist, the task execution identifier is added to the preset storage system. 15.根据权利要求14所述的对账应用集群,其特征在于,所述第一客户端还用于:15. The account reconciliation application cluster according to claim 14, wherein the first client is further used for: 通过将所述目标客户端的实际序列号与所述收到的交易数据的标识拼接,来生成所述任务执行标识,且在将所述任务执行标识添加到所述预设存储系统之后,设置所述任务执行标识的状态为未锁定状态。The task execution ID is generated by splicing the actual serial number of the target client with the ID of the received transaction data, and after adding the task execution ID to the preset storage system, set the task execution ID. The status of the task execution flag described above is unlocked. 16.根据权利要求15所述的对账应用集群,其特征在于,所述对账应用集群中的各客户端在从所述预设存储系统中查询客户端实际序列号与交易数据标识的关联关系之前,还用于:分别向所述分布式服务集群查询各自的状态,并确定各自的状态为空闲。16 . The account reconciliation application cluster according to claim 15 , wherein each client in the account reconciliation application cluster queries the association between the client’s actual serial number and the transaction data identifier from the preset storage system. 17 . Before the relationship, it is also used for: querying the distributed service cluster for the respective statuses, and determining that the respective statuses are idle. 17.根据权利要求15所述的对账应用集群,其特征在于,所述对所述收到的交易数据执行对账之前,所述第二客户端还用于:17 . The account reconciliation application cluster according to claim 15 , wherein, before performing the account reconciliation on the received transaction data, the second client is further used for: 17 . 确定包括所述第二客户端的实际序列号的任务执行标识的状态为未锁定状态,然后将该任务执行标识的状态变更为锁定状态;determining that the state of the task execution identifier including the actual serial number of the second client is an unlocked state, and then changing the state of the task execution identifier to a locked state; 所述对所述收到的交易数据执行对账之后,所述第二客户端还用于:After the reconciliation is performed on the received transaction data, the second client is further used for: 若对账成功,则将包括所述第二客户端的实际序列号的任务执行标识从所述预设存储系统中删除;若所述对账不成功,则将包括所述第二客户端的实际序列号的任务执行标识的状态变更为未锁定状态。If the reconciliation is successful, the task execution identifier including the actual serial number of the second client is deleted from the preset storage system; if the reconciliation is unsuccessful, the actual sequence of the second client is included. The status of the task execution ID of No. is changed to the unlocked state. 18.根据权利要求11所述的对账应用集群,其特征在于,通过定时任务监控所述分布式服务集群的变更事件,当监控到客户端的实际序列号变更后,所述第一客户端还用于:18 . The account reconciliation application cluster according to claim 11 , wherein the change event of the distributed service cluster is monitored through a scheduled task, and when the actual serial number of the client is monitored to change, the first client also Used for: 按照更新后的客户端实际序列号,重置所述预设存储系统中客户端实际序列号与交易数据标识的关联关系。According to the updated actual serial number of the client, the association relationship between the actual serial number of the client and the transaction data identifier in the preset storage system is reset. 19.如权利要求11至18中任一项所述的对账应用集群中的客户端,其特征在于,包括:19. The client in the account reconciliation application cluster according to any one of claims 11 to 18, characterized in that, comprising: 对账客户端选择模块,用于在收到交易数据后,根据对账应用集群中各客户端的状态,选择可对收到的交易数据执行对账的一个或多个目标客户端;The reconciliation client selection module is used to select one or more target clients that can perform reconciliation on the received transaction data according to the status of each client in the reconciliation application cluster after receiving the transaction data; 关联存储模块,用于将所述目标客户端的实际序列号与所述收到的交易数据的标识关联存储到预设存储系统,以供所述对账应用集群中的各客户端查询,其中,所述预设存储系统用于保存各客户端实际序列号与各交易数据标识之间的关联关系;an associated storage module, configured to associate and store the actual serial number of the target client and the identifier of the received transaction data in a preset storage system for query by each client in the account reconciliation application cluster, wherein, The preset storage system is used to save the association relationship between the actual serial numbers of each client and each transaction data identifier; 对账执行模块,用于在从所述预设存储系统查询到的实际序列号为本客户端的实际序列号后,根据与所述查询到的实际序列号关联的交易数据的标识,获取对应的交易数据的明细数据以进行对账。The account reconciliation execution module is used to obtain the corresponding transaction data according to the identifier of the transaction data associated with the actual serial number queried after the actual serial number queried from the preset storage system is the actual serial number of the client. Details of transaction data for reconciliation. 20.一种电子设备,其特征在于,包括:20. An electronic device, characterized in that, comprising: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,storage means for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-9中任一所述的方法。The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9. 21.一种计算机可读介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-9中任一所述的方法。21. A computer-readable medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the method according to any one of claims 1-9 is implemented.
CN202110788105.8A 2021-07-13 2021-07-13 A reconciliation method, reconciliation application cluster and related client Active CN113421163B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110788105.8A CN113421163B (en) 2021-07-13 2021-07-13 A reconciliation method, reconciliation application cluster and related client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110788105.8A CN113421163B (en) 2021-07-13 2021-07-13 A reconciliation method, reconciliation application cluster and related client

Publications (2)

Publication Number Publication Date
CN113421163A true CN113421163A (en) 2021-09-21
CN113421163B CN113421163B (en) 2025-01-07

Family

ID=77720792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110788105.8A Active CN113421163B (en) 2021-07-13 2021-07-13 A reconciliation method, reconciliation application cluster and related client

Country Status (1)

Country Link
CN (1) CN113421163B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116600026A (en) * 2023-04-26 2023-08-15 中国工商银行股份有限公司 Data transmission method, device, electronic device, medium and program product

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020026416A1 (en) * 2000-08-25 2002-02-28 Provinse Shirely J. System and method for account reconciliation
US6810385B1 (en) * 1999-10-26 2004-10-26 Forecourt Communications Group Method and apparatus using consumer idle time for productive activities
US20070083444A1 (en) * 2000-03-07 2007-04-12 American Express Travel Related Services Company, Inc. System and method for automatic reconciliation of transaction account spend
US7340421B1 (en) * 2000-12-22 2008-03-04 General Electric Company Account reconciliation methods and systems
CN105719182A (en) * 2016-01-18 2016-06-29 北京京东尚科信息技术有限公司 Automatic account checking method and automatic account checking system
CN107729553A (en) * 2017-11-07 2018-02-23 北京京东金融科技控股有限公司 System data account checking method and device, storage medium, electronic equipment
CN110457311A (en) * 2019-07-05 2019-11-15 中国平安财产保险股份有限公司 Automatically generate method, server and the storage medium of reconciliation file
CN111291002A (en) * 2020-03-05 2020-06-16 深圳市网心科技有限公司 File account checking method and device, computer equipment and storage medium
CN111597197A (en) * 2020-06-29 2020-08-28 腾讯科技(深圳)有限公司 Data reconciliation method and device between databases, storage medium and electronic equipment
CN111861482A (en) * 2020-09-22 2020-10-30 支付宝(杭州)信息技术有限公司 Block chain account checking method and system
CN112783845A (en) * 2021-01-15 2021-05-11 天津五八到家货运服务有限公司 Data reconciliation system, method, device and medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6810385B1 (en) * 1999-10-26 2004-10-26 Forecourt Communications Group Method and apparatus using consumer idle time for productive activities
US20070083444A1 (en) * 2000-03-07 2007-04-12 American Express Travel Related Services Company, Inc. System and method for automatic reconciliation of transaction account spend
US20020026416A1 (en) * 2000-08-25 2002-02-28 Provinse Shirely J. System and method for account reconciliation
US7340421B1 (en) * 2000-12-22 2008-03-04 General Electric Company Account reconciliation methods and systems
CN105719182A (en) * 2016-01-18 2016-06-29 北京京东尚科信息技术有限公司 Automatic account checking method and automatic account checking system
CN107729553A (en) * 2017-11-07 2018-02-23 北京京东金融科技控股有限公司 System data account checking method and device, storage medium, electronic equipment
CN110457311A (en) * 2019-07-05 2019-11-15 中国平安财产保险股份有限公司 Automatically generate method, server and the storage medium of reconciliation file
CN111291002A (en) * 2020-03-05 2020-06-16 深圳市网心科技有限公司 File account checking method and device, computer equipment and storage medium
CN111597197A (en) * 2020-06-29 2020-08-28 腾讯科技(深圳)有限公司 Data reconciliation method and device between databases, storage medium and electronic equipment
CN111861482A (en) * 2020-09-22 2020-10-30 支付宝(杭州)信息技术有限公司 Block chain account checking method and system
CN112783845A (en) * 2021-01-15 2021-05-11 天津五八到家货运服务有限公司 Data reconciliation system, method, device and medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘雄文;: "多区块链交易分发和事件处理的系统方案", 计算机科学, no. 2, 15 November 2018 (2018-11-15), pages 590 - 593 *
弓宝拴: "推行电子对账系统 提升运营管理水平", 《农业发展与金融》, no. 6, 16 June 2019 (2019-06-16), pages 55 - 56 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116600026A (en) * 2023-04-26 2023-08-15 中国工商银行股份有限公司 Data transmission method, device, electronic device, medium and program product
CN116600026B (en) * 2023-04-26 2025-12-02 中国工商银行股份有限公司 Data transmission methods, apparatus, electronic devices, media and software products

Also Published As

Publication number Publication date
CN113421163B (en) 2025-01-07

Similar Documents

Publication Publication Date Title
CN111061680B (en) A method and device for data retrieval
CN112860451A (en) Multi-tenant data processing method and device based on SaaS
CN113361838B (en) Business risk control method, device, electronic device and storage medium
CN111277639B (en) Method and device for maintaining data consistency
CN112948138B (en) A method and device for processing messages
CN111126948A (en) Processing method and device for approval process
CN113868687B (en) A method and device for managing task processing progress
CN110909022A (en) A data query method and device
CN111478781B (en) Message broadcasting method and device
CN112235423A (en) Cross-chain transaction processing method and device, electronic equipment and storage medium
CN111460129A (en) Method and device for generating identification, electronic equipment and storage medium
CN114860721A (en) Index data construction method and device
CN113541987A (en) A method and apparatus for updating configuration data
CN110389976B (en) Multi-interface data scheduling method and device
CN113114768A (en) Service request processing method, device and system
CN113421163B (en) A reconciliation method, reconciliation application cluster and related client
CN113553206B (en) Data event execution method and device, electronic equipment and computer readable medium
CN113726885B (en) Flow quota adjusting method and device
CN118260329A (en) Method, apparatus, device and computer readable medium for processing business data table
CN115168289B (en) Operating methods and apparatus for a document system
CN117333170A (en) Service processing method, device, electronic equipment and storage medium
CN112181937A (en) Data transmission method and device
CN113760487B (en) Service processing method and device
CN113110898A (en) Transaction task execution method and device
CN113778504A (en) Publishing method, publishing system and routing device

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
GR01 Patent grant
GR01 Patent grant