CN115936686A - Distributed accounting processing system, method, device, server and medium - Google Patents

Distributed accounting processing system, method, device, server and medium Download PDF

Info

Publication number
CN115936686A
CN115936686A CN202211547337.5A CN202211547337A CN115936686A CN 115936686 A CN115936686 A CN 115936686A CN 202211547337 A CN202211547337 A CN 202211547337A CN 115936686 A CN115936686 A CN 115936686A
Authority
CN
China
Prior art keywords
data node
request
account
node
posting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211547337.5A
Other languages
Chinese (zh)
Inventor
朱逸清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Financial Technology Co Ltd
Original Assignee
Bank of China Financial 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 Bank of China Financial Technology Co Ltd filed Critical Bank of China Financial Technology Co Ltd
Priority to CN202211547337.5A priority Critical patent/CN115936686A/en
Publication of CN115936686A publication Critical patent/CN115936686A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application discloses a distributed accounting processing system, a method, a device, a server and a medium, which can be applied to the distributed field or the financial field. The distributed accounting processing system comprises electronic equipment and a plurality of machine rooms, wherein each machine room comprises a master data node and a slave data node, the master data node has a writing function, namely a function of processing an accounting processing request, and the slave data node does not have the writing function; therefore, different accounting processing requests can be processed by the main data nodes in different machine rooms, and compared with the prior art that different accounting processing requests are processed by the data nodes in the same machine room, the occurrence of the stuck phenomenon is greatly reduced.

Description

Distributed accounting processing system, method, device, server and medium
Technical Field
The present application relates to the field of distribution, and more particularly, to a distributed accounting processing system, method, apparatus, server, and medium.
Background
The accounting processing request refers to a request for transferring accounts to a payee by a payer, and the accounting processing request exists in a payment application scene and a transfer application scene; the data nodes currently executing the accounting processing request are located in the same machine room.
When accounting processing requests are more, a data node in a machine room often has a stuck phenomenon.
Disclosure of Invention
In view of the above, the present application provides a distributed accounting processing system, method, apparatus, server and medium.
In order to achieve the above purpose, the present application provides the following technical solutions:
according to a first aspect of embodiments of the present disclosure, there is provided a distributed accounting processing system, including:
the system comprises electronic equipment and a financial processing server, wherein the electronic equipment is used for receiving an account processing request, and the account processing request comprises a payer account, a payee account and a transaction amount; calculating a first node identifier corresponding to the payer account; searching a first machine room identifier corresponding to the first node identifier from a corresponding relation between a node identifier of a preset main data node with a read-write function and the machine room identifier; sending the accounting processing request to a first master data node, wherein the first master data node is a master data node with the first node identifier in a first machine room with the first machine room identifier;
the first machine room comprises the first master data node and a first slave data node, and the first slave data node has no writing function;
the first primary data node is used for deducting the transaction amount from the balance corresponding to the payer account; calculating a second node identifier corresponding to the payee account; searching a second machine room identifier corresponding to the second node identifier from the preset corresponding relation; sending an account entry request to a second main data node, wherein the account entry request is a request for entering the transaction amount in a balance corresponding to a payee account, and the second main data node is a main data node with a second node identifier in a second machine room with the second machine room identifier;
the second computer room comprises a second master data node and a second slave data node, and the second slave data node does not have a writing function;
the data stored in the first machine room is the same as the data stored in the second machine room;
and the second main data node is used for feeding back the successful posting information if the transaction amount is posted in the balance of the account of the payee.
According to a second aspect of the embodiments of the present disclosure, there is provided a distributed accounting processing method, applied to a first master data node, including:
receiving an account processing request, wherein the account processing request comprises a payer account, a payee account and a transaction amount, and a first node identifier corresponding to the payer account is a node identifier of the first primary data node;
deducting the transaction amount from a balance corresponding to the payer account;
calculating a second node identifier corresponding to the payee account;
searching a second machine room identifier corresponding to the second node identifier from a corresponding relation between a node identifier of a preset main data node with a read-write function and the machine room identifier;
sending an account entry request to a second main data node, wherein the account entry request is a request for entering the transaction amount in a balance corresponding to a payee account;
the second primary data node is a primary data node with a second node identifier in a second machine room with the second machine room identifier, and the posting request is a basis for posting the transaction amount in the balance of the payee account by the second primary data node.
According to a third aspect of the embodiments of the present disclosure, there is provided a distributed accounting processing apparatus, applied to a first master data node, including:
the system comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving an account processing request, the account processing request comprises a payer account, a payee account and a transaction amount, and a first node identifier corresponding to the payer account is a node identifier of a first primary data node;
the deduction module is used for deducting the transaction amount from the balance corresponding to the payer account;
the calculation module is used for calculating a second node identifier corresponding to the payee account;
the searching module is used for searching a second machine room identifier corresponding to the second node identifier from the corresponding relation between the node identifier of the preset main data node with the reading and writing functions and the machine room identifier;
a sending module, configured to send an account entry request to a second master data node, where the account entry request is a request for entering the transaction amount into a balance corresponding to an account of a payee;
the second primary data node is a primary data node with a second node identifier in a second machine room with the second machine room identifier, and the posting request is a basis for posting the transaction amount in the balance of the payee account by the second primary data node.
According to a fourth aspect of embodiments of the present disclosure, there is provided a server including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the distributed accounting processing method of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium in which instructions, when executed by a processor of a server, enable the server to perform the distributed accounting processing method according to the first aspect.
According to the technical scheme, the distributed accounting processing system comprises electronic equipment and a plurality of machine rooms, wherein each machine room comprises a master data node and a slave data node, the master data node has a writing function, namely has a function of processing an accounting processing request, and the slave data node does not have the writing function; therefore, different accounting processing requests can be processed by the main data nodes in different machine rooms, and compared with the prior art that different accounting processing requests are processed by the data nodes in the same machine room, the occurrence of the stuck phenomenon is greatly reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only the embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is an architecture diagram of a distributed accounting processing system according to an embodiment of the present application;
fig. 2 is a signaling diagram of a distributed accounting processing method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a message queue according to an embodiment of the present application;
fig. 4 is a schematic diagram of a structure of a service queue according to an embodiment of the present application;
fig. 5 is a block diagram illustrating a distributed accounting processing apparatus applied to a first master data node in accordance with an example embodiment;
FIG. 6 is a block diagram illustrating an apparatus for a server of a first master data node in accordance with an example embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As shown in fig. 1, an architecture diagram of a distributed accounting processing system provided in an embodiment of the present application includes: electronic equipment 11, a first machine room 12, and a second machine room 13.
In an alternative implementation, the electronic device 11 may be any electronic product that can interact with a user through one or more modes of a keyboard, a touch pad, a touch screen, a remote controller, a voice interaction device, or a handwriting device, for example, a mobile phone, a tablet computer, a palm computer, a personal computer, a wearable device, a smart television, and the like. For example, the electronic device 11 may be operated with a client, which may be an application client or a web page version client.
In an alternative implementation, the user may purchase through the electronic device 11, and at this time, the accounting processing request may be generated, that is, the user is a payer and the merchant is a payee; in an optional implementation manner, the user may pay for life through the electronic device 11, such as electricity or water or phone charges, and at this time, an account processing request may be generated, that is, the user is a payer, and the national grid or tap water company or the telecommunication business hall is a payee; in an alternative implementation, the user may perform the transfer operation through the electronic device 11, and at this time, the accounting processing request may be generated, that is, the user is the payer and the transfer object is the payee.
In an optional implementation manner, the electronic device 11 may be a server, or may be a server cluster composed of multiple servers, or may be a cloud computing service center. The electronic device 11 may receive the accounting processing request transmitted by the terminal device. For example, the user may shop through the terminal device, and at this time, an accounting processing request may be generated, that is, the user is a payer and the merchant is a payee; for example, the user may pay for life through the terminal device, such as electricity or water or telephone, and at this time, an account processing request may be generated, that is, the user is a payer, and the national grid or tap water company or the telecommunication business hall is a payee; for example, the user may perform a transfer operation through the terminal device, and at this time, an accounting processing request may be generated, that is, the user is a payer and the transfer object is a payee.
It will be appreciated that multiple rooms may be included in the distributed accounting processing system, with different rooms located in different geographical locations.
Illustratively, each machine room includes: one or more master data nodes, and one or more slave data nodes. The main data node is a node with a reading function and a writing function, namely, data stored in the main data node can be read, data can be written in the main data node, or original data stored in the main data node can be changed; a slave data node refers to a node that has a read function but no write function, i.e., data stored from the slave data node can be read, but data cannot be written in the slave data node.
If the same computer room comprises a plurality of master data nodes and a plurality of slave data nodes, node identifications of the master data nodes are different, node identifications of the slave data nodes are different, and node identifications of the master data nodes and the slave data nodes are different.
For example, the master data node may be one server, a server cluster composed of a plurality of servers, or a cloud computing service center.
The slave data node may be, for example, one server, a server cluster composed of a plurality of servers, or a cloud computing service center.
For example, the data stored in different computer rooms are the same, the different computer rooms are backed up with each other, and the data stored in each computer room is required to be processed synchronously at regular intervals.
The first machine room includes: a first master data node 121 and a first slave data node 122, and a second computer room includes: a second master data node 131 and a second slave data node 132.
The number of first master data nodes and the number of first slave data nodes contained in the first machine room are not limited in the embodiment of the application; the number of second master data nodes and the number of second slave data nodes contained in the second computer room are not limited in the embodiments of the present application.
It can be understood that, in an accounting processing request, a payer account and a payee account are involved, and a primary data node storing data of the payer account and a primary data node storing the payee account may be located in different machine rooms or may be located in the same machine room; if the two machines rooms are located in different machine rooms, for one accounting processing request, the two machines are involved, and in the embodiment of the present application, the two machines are referred to as a first machine room and a second machine room.
The interaction between the electronic device, the first computer room, and the second computer room is described below with reference to the architecture diagram shown in fig. 1.
As shown in fig. 2, a signaling diagram of a distributed accounting processing method provided in an embodiment of the present application includes the following steps S201 to S209.
Step S201: the electronic device 11 receives an accounting processing request that includes a payer account number, a payee account number, and a transaction amount.
Step S202: the electronic device 11 calculates a first node identifier corresponding to the payer account.
In an optional implementation manner, the total number of data nodes included in different machine rooms is the same, in this application, a master data node and a slave data node are collectively referred to as a data node, and the first node identifier = the total number of data nodes included in the payer account mod machine room.
Step S203: the electronic device 11 searches for a first machine room identifier corresponding to the first node identifier from a preset correspondence between the node identifier of the main data node having the read-write function and the machine room identifier.
For example, the node identifiers of the data nodes in different machine rooms are the same, if the first machine room includes 8 data nodes, and the node identifiers of the 8 data nodes are 00, 01, 02, 03, 04, 05, 06, 07 in turn, then the node identifier set of the first machine room is {00, 01, 02, 03, 04, 05, 06, 07}; the second computer room includes 8 data nodes, and node identifiers of the 8 data nodes are 00, 01, 02, 03, 04, 05, 06, 07 in sequence, then a node identifier set of the second computer room is {00, 01, 02, 03, 04, 05, 06, 07}, and the node identifier set of the first computer room is the same as the node identifier set of the second computer room.
Under the condition that the node identification sets of the data nodes contained in different machine rooms are the same, the node identifications of the main data nodes in different machine rooms are different; the node identifiers of different main data nodes in the same machine room are different; however, there are cases where the node identifications of the master data node and the slave data node located in different rooms are the same, for example, it is assumed that the node identification of the master data node located in the first room is 00 and the node identification of the slave data node located in the second room is 00. Since the master data node has a write function, the machine room identifier where the master data node corresponding to the first node identifier is located needs to be searched, that is, step S203 is executed.
Illustratively, the node identifiers of the data nodes contained in different computer rooms are different.
Step S204: the electronic device 11 sends the accounting processing request to a first master data node, where the first master data node is a master data node having the first node identifier in a first machine room having the first machine room identifier.
Step S205: the first primary data node 121 deducts the transaction amount from the balance corresponding to the payer account.
As will be appreciated, the accounting processing request includes a debit request to deduct the transaction amount from the balance of the payer account, and an entry request to enter the transaction amount at the balance of the payee account; if the check-in request is executed first and then the deduction request is executed, if the check-in request is executed successfully but the deduction request is executed unsuccessfully, the bank loss is caused; if the deduction request is executed first and then the posting request is executed, if the deduction request is executed successfully and the posting request is executed unsuccessfully, the bank can easily perform conflict and cannot cause user loss and bank loss, and therefore the deduction request needs to be executed first and then the posting request needs to be executed in the accounting processing process, and therefore the electronic device 11 preferentially obtains the first primary data node for processing the deduction operation of the payment account.
In summary, the financial processing request is divided into the withholding request and the posting request, and the withholding request is executed first, and then the posting request is executed, so that the fund loss of the bank can be avoided.
Step S206: the first primary data node 121 calculates a second node identifier corresponding to the payee account.
In an optional implementation manner, the total number of data nodes contained in different machine rooms is the same, in the application, a master data node and a slave data node are collectively referred to as a data node, and a second node identifier = the total number of data nodes contained in a payee account mod machine room.
Step S207: the first primary data node 121 searches for a second machine room identifier corresponding to the second node identifier from the preset corresponding relationship.
It can be understood that the first primary data node storing the data of the payee account and the second primary data node storing the data of the payer account may be different, for example, the first primary data node and the second primary data node are different, and since the first primary data node does not store the data of the payee account, the entry request cannot be executed, and therefore the machine room identifier of the machine room where the second primary data node is located needs to be searched.
Step S208: the first primary data node 121 sends an account entry request to the second primary data node, where the account entry request is a request for entering the transaction amount in the balance corresponding to the payee account.
The second master data node is a master data node with the second node identifier in a second machine room with the second machine room identifier.
For example, if the first machine room identifier is the same as the second machine room identifier, it is indicated that the first master data node and the second master data node are located in the same machine room, and at this time, the first master data node may directly send the posting request to the second master data node.
For example, if the first machine room identifier is the same as the second machine room identifier, and the first node identifier is the same as the second node identifier, which indicates that the first master data node and the second master data node are the same master data node, the first master data node may execute the posting request.
For example, if the first machine room identifier and the second machine room identifier are different, which indicates that the first master data node and the second master data node are located in different machine rooms, the accounting processing request needs to be processed across the machine rooms.
Step S209: and if the transaction amount is posted in the balance of the payee account by the second primary data node 131, feeding back posting success information.
The distributed accounting processing system provided by the embodiment of the application comprises electronic equipment and a plurality of machine rooms, wherein each machine room comprises a master data node and a slave data node, the master data node has a writing function, namely a function of processing an accounting processing request, and the slave data node does not have the writing function; therefore, different accounting processing requests can be processed by the main data nodes in different machine rooms, and compared with the prior art that different accounting processing requests are processed by the data nodes in the same machine room, the occurrence of the stuck phenomenon is greatly reduced.
In the embodiment of the application, the allocation mode of the accounting processing request is as follows: the accounting processing request is distributed to the payment account carried by the accounting processing request, namely, the first node identification corresponding to the account of the payer is calculated, and the first machine room identification corresponding to the first node identification can be searched due to the fact that the corresponding relation between the node identification of the main data node with the reading and writing function and the machine room identification is preset, so that the accounting processing request is distributed to the first main data node with the first node identification in the first machine room with the first machine room identification.
In the embodiment of the application, two requests included in the accounting processing request are processed separately, where the two requests are: a debit request to debit the transaction amount from the balance of the payer account, and an entry request to enter the transaction amount at the balance of the payee account. The method and the device for processing the withholding request firstly process the withholding request and then process the posting request, and can avoid the fund loss of a bank.
It can be understood that, if the first master data node and the second master data node are located in different machine rooms, because the different machine rooms are located at different geographical locations, a situation that a network is unstable may exist, so that the first machine room does not receive the posting success information fed back by the second master data node, at this time, a transaction detail state corresponding to the posting request may be that the transaction is unknown, and there are various situations that the transaction is unknown, and during subsequent manual intervention, which is not known, causes intervention failure. Based on this, the present application provides a method comprising the following steps A1 to A2.
Step A1: and the first main data node stores the posting request into a message queue, and sets the state of the posting request as unsent.
Step A2: and the first main data node sends the posting request which is not sent in the message queue to the second main data node.
Fig. 3 is a schematic diagram of a message queue according to an embodiment of the present application.
As shown in fig. 3, N posting requests are stored in the message queue, and the N posting requests correspond to different accounting processing requests. N is a positive integer greater than or equal to 1.
The N posting requests are respectively as follows: an account-entering request 1, an account-entering request 2, …, an account-entering request N; the states of the N posting requests are respectively as follows: during non-transmission and transmission, … is not transmitted.
For example, the first master data node may access the message queue at regular intervals to obtain an accounting request whose status is unsent.
In an optional implementation manner, if the first primary data node is the same as the second primary data node, the first primary data node may process the deduction request and the posting request; in an optional implementation manner, if the first master data node and the second master data node are different but located in the same machine room, the first master data node may directly send the posting request to the second master data node.
Illustratively, the first primary data node includes a message queue.
In an alternative implementation manner, if the first master data node and the second master data node are located in different machine rooms, step A2 includes the following steps a21 to a23.
Step A21: and the first main data node sends the account-in message which is not sent in the message queue to the queue server.
Each computer room illustratively comprises one or more queue servers, and the queue server may be, for example, one server, a server cluster composed of a plurality of servers, or a cloud computing service center.
Step A22: and if the first main data node receives the successfully received message which is fed back by the queue server and represents that the posting request is successfully received, setting the state of the posting request as sent.
Illustratively, the first primary data node may update the status of the posting request in the message queue.
Step A23: and if the first main data node does not receive the successfully received message fed back by the queue server, setting the status of the accounting request as sending.
In an optional implementation manner, the queue server is configured to send the posting request to the second master data node.
In an optional implementation manner, the process of the queue server in executing sending the posting request to the second master data node includes the following steps B1 to B3.
Step B1: and storing the posting request into a service queue, and setting the state of the posting request as processing.
And step B2: and sending the accounting request with the state of processing in the service queue to the second main data node.
And step B3: and if the posting success information fed back by the second main data node is received, setting the transaction detail state corresponding to the posting request as finished.
And step B4: and if the posting success information fed back by the second main data node is not received, maintaining the transaction detail state corresponding to the posting request as processing.
It is understood that the status of the posting requests stored by the message queue includes: unsent, transmitting, transmitted. The transaction detail state of the posting request stored in the business queue comprises: completed and in process.
If the transaction detail state corresponding to the subsequent posting request is transaction-unknown, manual intervention can be performed through the state of the posting request stored in the message queue and the transaction detail state of the posting request stored in the service queue, for example, if the state of the posting request is 'unsent', the posting request is manually sent; if the status of the posting request is 'sending', trying to send the posting request again; and if the status of the posting request is 'sent', checking the transaction detail status of the posting request stored in the service queue, and if the transaction detail status of the posting request is 'processing', indicating that the posting success information fed back by the second main data node is not received, then, presenting a problem to the second main data node.
In an alternative implementation, the first machine room further comprises: and the display device is used for displaying the state of the posting request stored in the message queue and displaying the transaction detail state corresponding to the posting request stored in the business queue. So that the manual intervention transaction detail state is the account processing request with an unknown transaction.
In an alternative implementation, the queue server further has a retry mechanism, which specifically includes the following steps C1 to C3.
Step C1: and if the posting success information fed back by the second main data node is not received, updating the sent times corresponding to the posting requests stored in the service queue.
And step C2: and determining a retransmission interval corresponding to the posting request based on the sent times.
In an optional implementation manner, retransmission intervals corresponding to different sent times are the same, for example, the retransmission interval is 5 seconds, and after the posting request is sent, if the posting success information is not received within a preset time period, the posting request is retransmitted at an interval of 5 seconds again.
In an alternative implementation, the retransmission intervals corresponding to different sent times are different, for example, the retransmission interval = sent times × preset duration.
And C3: and sending the posting request after the retransmission interval is spaced, and feeding back the posting request to the step B3.
Fig. 4 is a schematic diagram of a structure of a service queue according to an embodiment of the present application.
The service queue includes transaction detail states of N posting requests, as shown in fig. 4, the transaction detail state corresponding to the posting request 1 is completed, and the number of times the posting request 1 has been sent is 3; the transaction detail status corresponding to the posting request 2 is in process, and the number of times the posting request 2 has been sent is 3.
The following describes steps C1 to C3 by taking the posting request 2 as an example.
Assuming that the sent times corresponding to the posting request 2 stored in the service queue is 3, the queue server selects the posting request 2 with the transaction detail state in processing from the service queue, and sends the posting request 2 to the second master data node again, and at this time, the sent times corresponding to the posting request 2 stored in the updated service queue is 4.
It can be understood that after the posting request is resent for a certain number of times, if the posting success information is still not received, the posting request is resent, and the probability that the posting success information can be received is extremely low, so that the upper limit of the sent number of times can be set, that is, if the sent number of times corresponding to the posting request is less than or equal to the preset threshold, the posting request can be resent.
The method is described in detail in the embodiments disclosed in the present application, and the method of the present application can be implemented by various types of apparatuses, so that an apparatus is also disclosed in the present application, and the following detailed description is given of specific embodiments.
Fig. 5 is a block diagram illustrating a distributed accounting processing apparatus applied to a first master data node, according to an example embodiment. Referring to fig. 5, the apparatus includes: a receiving module 51, a deducting module 52, a calculating module 53, a searching module 54 and a sending module 55.
The receiving module 51 is configured to receive an accounting processing request, where the accounting processing request includes a payer account, a payee account, and a transaction amount, and a first node identifier corresponding to the payer account is a node identifier of the first primary data node.
And the deduction module 52 is configured to deduct the transaction amount from a balance corresponding to the payer account.
And the calculating module 53 is configured to calculate a second node identifier corresponding to the payee account.
And the searching module 54 is configured to search a second machine room identifier corresponding to the second node identifier from a preset correspondence between the node identifier of the master data node having the read-write function and the machine room identifier.
And a sending module 55, configured to send an account entry request to the second master data node, where the account entry request is a request for entering the transaction amount in a balance corresponding to the payee account.
The second primary data node is a primary data node with a second node identifier in a second machine room with the second machine room identifier, and the posting request is a basis for posting the transaction amount in the balance of the payee account by the second primary data node.
In an optional implementation manner, the sending module includes:
and the setting unit is used for storing the posting request to a message queue and setting the state of the posting request as unsent.
And the sending unit is used for sending the accounting request with the state of unsent in the message queue to the second main data node.
In an optional implementation manner, the sending unit includes:
a sending subunit, configured to send, to the second master data node, the posting message whose status is unsent in the message queue through a queue server;
the first setting subunit is configured to set the status of the posting request to be sent if the posting message is successfully received after the feedback from the queue server is received;
and the second setting subunit is configured to set the status of the accounting request as being sent if the accounting message is not received and successfully received, which is fed back by the queue server.
With regard to the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
FIG. 6 is a block diagram illustrating an apparatus for a server of a first primary data node in accordance with an example embodiment.
Servers include, but are not limited to: a processor 61, a memory 62, a network interface 63, an I/O controller 64, and a communication bus 65.
It should be noted that the structure of the server shown in fig. 6 is not limited to the server, and the server may include more or less components than those shown in fig. 6, or some components may be combined, or a different arrangement of components may be used, as will be understood by those skilled in the art.
The following describes each component of the server in detail with reference to fig. 6:
the processor 61 is a control center of the server, connects various parts of the entire server using various interfaces and lines, performs various functions of the server and processes data by operating or executing software programs and/or modules stored in the memory 62 and calling data stored in the memory 62, thereby performing overall monitoring of the server. Processor 61 may include one or more processing units; illustratively, the processor 61 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 61.
Processor 61 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention, or the like;
the Memory 62 may include a Memory, such as a Random-Access Memory (RAM) 621 and a Read-Only Memory (ROM) 622, and may also include a mass storage device 623, such as at least 1 disk Memory. Of course, the server may also include hardware needed for other services.
The memory 62 is configured to store instructions executable by the processor 61. The processor 61 described above has a function of executing a distributed accounting processing method applied to the first master data node.
A wired or wireless network interface 63 is configured to connect the server to a network.
The processor 61, the memory 62, the network interface 63, and the I/O controller 64 may be connected to each other by a communication bus 65, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc.
In an exemplary embodiment, the server may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described distributed accounting processing method.
In an exemplary embodiment, the disclosed embodiments provide a storage medium comprising instructions, such as a memory 62 comprising instructions, executable by a processor 61 of a server to perform the above-described method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided a computer-readable storage medium directly loadable into an internal memory of a computer, such as the memory 62 described above, and containing software code which, when loaded and executed by a computer, is able to carry out the distributed accounting processing method described above.
In an exemplary embodiment, there is also provided a computer program product directly loadable into an internal memory of a computer, such as a memory included in the server, and containing software code, which is loaded into and executed by the computer to implement the distributed accounting processing method described above.
It should be noted that the distributed accounting processing system, method, apparatus, server and medium provided by the present invention may be used in the distributed field or the financial field. The foregoing is merely an example, and does not limit the application fields of the distributed accounting processing system, method, apparatus, server and medium provided by the present invention.
Note that the features described in the embodiments in the present specification may be replaced with or combined with each other. For the embodiments of the apparatus or system, since they are substantially similar to the embodiments of the method, the description is simple, and reference may be made to the partial description of the embodiments of the method for relevant points.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (13)

1. A distributed accounting processing system, comprising:
the system comprises electronic equipment and a financial processing server, wherein the electronic equipment is used for receiving an account processing request, and the account processing request comprises a payer account, a payee account and a transaction amount; calculating a first node identifier corresponding to the payer account; searching a first machine room identifier corresponding to the first node identifier from a corresponding relation between a node identifier of a preset main data node with a read-write function and the machine room identifier; sending the accounting processing request to a first master data node, wherein the first master data node is a master data node with the first node identifier in a first machine room with the first machine room identifier;
the first machine room comprises the first master data node and a first slave data node, and the first slave data node has no writing function;
the first primary data node is used for deducting the transaction amount from the balance corresponding to the payer account; calculating a second node identifier corresponding to the payee account; searching a second machine room identifier corresponding to the second node identifier from the preset corresponding relation; sending an account posting request to a second main data node, wherein the account posting request is a request for posting the transaction amount in a balance corresponding to a payee account, and the second main data node is a main data node with a second node identifier in a second machine room with the second machine room identifier;
the second computer room comprises a second master data node and a second slave data node, and the second slave data node does not have a writing function;
the data stored in the first machine room is the same as the data stored in the second machine room;
and the second main data node is used for feeding back the successful posting information if the transaction amount is posted in the balance of the account of the payee.
2. The distributed accounting processing system of claim 1, wherein the first master data node, when performing the step of sending the accounting request to the second master data node, is specifically configured to:
storing the posting request to a message queue, and setting the state of the posting request as unsent;
and sending the accounting request with the state of unsent in the message queue to the second main data node.
3. The distributed accounting processing system of claim 2, wherein the first machine room further comprises: a queue server;
the first primary data node, when executing the step of sending the posting request that is not sent in the message queue to the second primary data node, is specifically configured to:
sending the account-entering message which is not sent in the message queue to the queue server;
if a successfully received message which represents that the posting request is successfully received and is fed back by the queue server is received, setting the state of the posting request as sent;
if the successfully received message fed back by the queue server is not received, setting the status of the posting request as sending;
and the queue server is used for sending the posting request to the second main data node.
4. The distributed accounting processing system of claim 3, wherein the queue server, when executing the step of sending the accounting request to the second primary data node, is specifically configured to:
storing the posting request into a business queue, and setting the state of the posting request as processing;
sending the posting request with the state in processing in the service queue to the second main data node;
if the posting success information fed back by the second main data node is received, setting the transaction detail state corresponding to the posting request as completed;
and if the successful posting information fed back by the second main data node is not received, maintaining the transaction detail state corresponding to the posting request as in processing.
5. The distributed accounting processing system of claim 4, wherein the queue server is further configured to:
if the successful posting information fed back by the second main data node is not received, updating the sent times corresponding to the posting requests stored in the service queue;
determining a retransmission interval corresponding to the posting request based on the sent times;
and sending the posting request after the retransmission interval is spaced, and feeding back to the step, if the posting success information fed back by the second main data node is received, setting the transaction detail state corresponding to the posting request as completed.
6. The distributed accounting processing system of claim 5, further comprising:
and if the sent times are less than or equal to a preset threshold value, executing a step of determining a retransmission interval corresponding to the posting request based on the sent times.
7. The distributed accounting processing system of any one of claims 4 to 6, wherein the first machine room further comprises:
and the display device is used for displaying the state of the posting request stored in the message queue and displaying the transaction detail state corresponding to the posting request stored in the business queue.
8. A distributed accounting processing method is applied to a first master data node, and comprises the following steps:
receiving an account processing request, wherein the account processing request comprises a payer account, a payee account and a transaction amount, and a first node identifier corresponding to the payer account is a node identifier of the first primary data node;
deducting the transaction amount from a balance corresponding to the payer account;
calculating a second node identifier corresponding to the payee account;
searching a second machine room identifier corresponding to the second node identifier from a corresponding relation between a node identifier of a preset main data node with a read-write function and the machine room identifier;
sending an account entry request to a second main data node, wherein the account entry request is a request for entering the transaction amount in a balance corresponding to a payee account;
the second primary data node is a primary data node with a second node identifier in a second machine room with the second machine room identifier, and the posting request is a basis for posting the transaction amount in the balance of the payee account by the second primary data node.
9. The distributed accounting processing method of claim 8, wherein the step of sending the accounting request to the second master data node comprises:
storing the posting request to a message queue, and setting the state of the posting request as unsent;
and sending the posting request with the status of unsent in the message queue to the second master data node.
10. The distributed accounting processing method of claim 9, wherein the step of sending the accounting request with the status of unsent in the message queue to the second primary data node comprises:
sending the account-entering information which is not sent in the information queue to the second main data node through a queue server;
if the posting message is successfully received after the feedback of the queue server is received, setting the state of the posting request as sent;
and if the posting message is not received and successfully received, the state of the posting request is set as sending.
11. A distributed accounting processing device, applied to a first master data node, includes:
the system comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving an account processing request, the account processing request comprises a payer account, a payee account and a transaction amount, and a first node identifier corresponding to the payer account is a node identifier of a first primary data node;
the deduction module is used for deducting the transaction amount from the balance corresponding to the account number of the payer;
the calculation module is used for calculating a second node identifier corresponding to the payee account;
the searching module is used for searching a second machine room identifier corresponding to the second node identifier from the corresponding relation between the node identifier of the preset main data node with the reading and writing functions and the machine room identifier;
the sending module is used for sending an account entry request to the second main data node, wherein the account entry request is a request for entering the transaction amount in the balance corresponding to the account of the payee;
the second primary data node is a primary data node with a second node identifier in a second machine room with the second machine room identifier, and the posting request is a basis for posting the transaction amount in the balance of the payee account by the second primary data node.
12. A server, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the distributed accounting processing method of any one of claims 8 to 10.
13. A computer readable storage medium, instructions in which, when executed by a processor of a server, enable the server to perform the distributed accounting processing method of any one of claims 8 to 10.
CN202211547337.5A 2022-12-05 2022-12-05 Distributed accounting processing system, method, device, server and medium Pending CN115936686A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211547337.5A CN115936686A (en) 2022-12-05 2022-12-05 Distributed accounting processing system, method, device, server and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211547337.5A CN115936686A (en) 2022-12-05 2022-12-05 Distributed accounting processing system, method, device, server and medium

Publications (1)

Publication Number Publication Date
CN115936686A true CN115936686A (en) 2023-04-07

Family

ID=86698605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211547337.5A Pending CN115936686A (en) 2022-12-05 2022-12-05 Distributed accounting processing system, method, device, server and medium

Country Status (1)

Country Link
CN (1) CN115936686A (en)

Similar Documents

Publication Publication Date Title
CN109949111B (en) Electronic bill identification distribution method, electronic bill generation method, device and system
US10387856B2 (en) Online payment method, system, and apparatus
US11038975B2 (en) Information pushing method and device
CN110020846B (en) Transfer service processing method and system
CN111553699B (en) Resource scheduling method and device
CN115145587A (en) Product parameter checking method and device, electronic equipment and storage medium
CN112884181A (en) Quota information processing method and device
CN115936686A (en) Distributed accounting processing system, method, device, server and medium
CN111341039B (en) Card-retaining processing method and system, client and server
CN109559240B (en) Method, device and equipment for preventing repeated payment of premium and readable storage medium
CN114612212A (en) Business processing method, device and system based on risk control
CN111897822A (en) Account state information processing method and device, electronic equipment and storage medium
CN111210349A (en) Virtual asset transfer hosting method and device, electronic equipment and storage medium
CN112053227B (en) Information processing method, information processing device, second electronic equipment and storage medium
CN106570734B (en) Game transaction request processing method and device
CN111833036B (en) Method, apparatus, device and computer readable medium for judging repeat transaction
CN116440504B (en) Game resource processing method, device and storage medium
CN117611154A (en) Service request processing method and device, electronic equipment and storage medium
CN108256989B (en) Data display method and system of fund preparation system
CN114841690A (en) Deduction processing method and device, electronic equipment and computer readable medium
CN116720972A (en) System docking method and device, electronic equipment and storage medium
CN117333170A (en) Service processing method, device, electronic equipment and storage medium
CN115619337A (en) Method and device for processing signed report data, electronic equipment and storage medium
CN118014264A (en) Service flow deployment method and device, electronic equipment and storage medium
CN113643016A (en) Information merging method, device, electronic equipment, medium and product

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