Data processing method and device, computer equipment, readable storage medium and program product
By using message middleware to decouple transaction processing and accounting processes in financial business systems, the problem of high business logic complexity during the daily cutting period in traditional systems is solved, and the 7*24-hour business continuity and the effect of reducing maintenance complexity is achieved.
Patent Information
- Application Number
- CN202510012080.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-25
AI Technical Summary
During the daily cutting period, due to the high complexity of the business logic of the system dual table design, the core system maintenance complexity is high, making it difficult to meet the 7*24-hour business continuity needs.
When receiving a transaction request in the core system, the message middleware is used to set the confirmation operation of the accounting date of the transaction to the accounting process, so that the transaction processing process and the accounting process are decoupled and separated.
When the accounting date is day-cut, transaction requests do not need to immediately determine the accounting date, which avoids complex business logic mapping, reduces the maintenance complexity of the core business system, and ensures 7*24-hour business continuity.
Smart Images

Figure CN119887418A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and in particular to a data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of the core business systems and financial services of banks or financial institutions, as well as the technical realization of convenient financial business services such as mobile banking, financial business systems need to meet the needs of 7*24 hours business operation.
[0003] In traditional technology, when a business system receives a business request, it first confirms the accounting date corresponding to the business request. During the day-cutting period of the core business system, the core business system adopts a dual-table design of the AB table. When the core business system performs day-cutting, the status of table A is set to static, and table B is used to temporarily store the amount. After the day-cutting is completed, table A is enabled and based on the complex business logic mapping relationship, the information stored in table B is synchronized and mapped to table A to determine the accounting date corresponding to the business request.
[0004] However, in the current traditional technology, the business logic complexity of the system's dual-table design is high, and the data in the distributed system needs to be vertically split, which further increases the business logic complexity of the core system, resulting in a high complexity in the maintenance of the core system. Summary of the invention
[0005] Based on this, it is necessary to provide a data processing method, apparatus, computer device, computer-readable storage medium and computer program product to address the above technical issues.
[0006] In a first aspect, the present application provides a data processing method, comprising:
[0007] Obtaining a transaction request initiated by a client, and determining transaction information corresponding to the transaction request;
[0008] If the transaction processing result of the transaction request is that the transaction processing is successful, a transaction accounting message is generated according to the transaction information; the transaction accounting message includes accounting elements for calculating the accounting date;
[0009] The transaction accounting message is published to the message middleware, and when the consumer corresponding to the transaction accounting message is in an idle state, the accounting date corresponding to the transaction request is determined according to the accounting elements in the transaction accounting message.
[0010] In one embodiment, obtaining a transaction request initiated by a client and determining transaction information corresponding to the transaction request includes:
[0011] Obtaining a transaction request and natural time initiated by a client, and parsing the transaction request to obtain initial transaction information contained in the transaction request;
[0012] The natural time is determined as the transaction date of the transaction request, and the transaction date is added to the initial transaction information to obtain the transaction information corresponding to the transaction request.
[0013] In one embodiment, the transaction request includes a transaction record and a transaction date; if the transaction processing result of the transaction request is that the transaction processing is successful, before generating a transaction settlement message according to the transaction information, the method further includes:
[0014] Registering the transaction record according to the transaction date;
[0015] Perform transaction processing on the transaction request to obtain a transaction processing result corresponding to the transaction request.
[0016] In one embodiment, performing transaction processing on the transaction request to obtain a transaction processing result corresponding to the transaction request includes:
[0017] Determining a transaction type corresponding to the transaction request;
[0018] Calling a target event corresponding to the transaction type according to the transaction type;
[0019] The transaction request is processed according to the target event. If the target event completes the processing of the transaction request, the transaction processing result corresponding to the transaction request is determined as a successful transaction processing.
[0020] In one embodiment, when the consumer corresponding to the transaction accounting message is in an idle state, determining the accounting date corresponding to the transaction request according to the accounting elements in the transaction accounting message includes:
[0021] When the consumer corresponding to the transaction settlement message is in an idle state, the transaction settlement message is parsed according to the consumer to obtain the settlement elements contained in the transaction settlement message;
[0022] A target conversion rule is selected from candidate conversion rules according to the accounting element, and the accounting element is mapped and converted according to the target conversion rule to obtain an accounting date corresponding to the transaction request.
[0023] In one embodiment, when the consumer corresponding to the transaction accounting message is in an idle state, after determining the accounting date corresponding to the transaction request according to the accounting elements in the transaction accounting message, the method further includes:
[0024] Determine the business attribute corresponding to the transaction request, and if the business attribute is a target business attribute, obtain the accounting element according to the message middleware;
[0025] Generate accounting entries corresponding to the transaction request according to the accounting elements, and register the accounting entries.
[0026] In a second aspect, the present application further provides a data processing device, comprising:
[0027] A first acquisition module, configured to acquire a transaction request initiated by a client and determine transaction information corresponding to the transaction request;
[0028] A generating module, configured to generate a transaction accounting message according to the transaction information if the transaction processing result of the transaction request is that the transaction processing is successful; the transaction accounting message includes an accounting element for calculating an accounting date;
[0029] A determination module is used to publish the transaction accounting message to the message middleware, and when the consumer corresponding to the transaction accounting message is in an idle state, determine the accounting date corresponding to the transaction request according to the accounting elements in the transaction accounting message.
[0030] In one embodiment, the first acquisition module is specifically used to acquire a transaction request and natural time initiated by a client, and parse the transaction request to obtain initial transaction information included in the transaction request;
[0031] The natural time is determined as the transaction date of the transaction request, and the transaction date is added to the initial transaction information to obtain the transaction information corresponding to the transaction request.
[0032] In one embodiment, the transaction request includes a transaction record and a transaction date; and the device further includes:
[0033] A first registration module, used for registering the transaction record according to the transaction date;
[0034] The transaction processing module is used to perform transaction processing on the transaction request and obtain a transaction processing result corresponding to the transaction request.
[0035] In one of the embodiments, the transaction processing module is specifically used to determine the transaction type corresponding to the transaction request;
[0036] Calling a target event corresponding to the transaction type according to the transaction type;
[0037] The transaction request is processed according to the target event. If the target event completes the processing of the transaction request, the transaction processing result corresponding to the transaction request is determined as a successful transaction processing.
[0038] In one embodiment, the determining module is specifically configured to parse the transaction settlement message according to the consumer to obtain the settlement elements included in the transaction settlement message when the consumer corresponding to the transaction settlement message is in an idle state;
[0039] A target conversion rule is selected from candidate conversion rules according to the accounting element, and the accounting element is mapped and converted according to the target conversion rule to obtain an accounting date corresponding to the transaction request.
[0040] In one embodiment, the device further comprises:
[0041] A second acquisition module is used to determine the business attribute corresponding to the transaction request, and if the business attribute is a target business attribute, acquire the accounting element according to the message middleware;
[0042] The second registration module generates a calculation accounting entry corresponding to the transaction request according to the calculation elements, and registers the calculation accounting entry.
[0043] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0044] Obtaining a transaction request initiated by a client, and determining transaction information corresponding to the transaction request;
[0045] If the transaction processing result of the transaction request is that the transaction processing is successful, a transaction accounting message is generated according to the transaction information; the transaction accounting message includes accounting elements for calculating the accounting date;
[0046] The transaction accounting message is published to the message middleware, and when the consumer corresponding to the transaction accounting message is in an idle state, the accounting date corresponding to the transaction request is determined according to the accounting elements in the transaction accounting message.
[0047] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0048] Obtaining a transaction request initiated by a client, and determining transaction information corresponding to the transaction request;
[0049] If the transaction processing result of the transaction request is that the transaction processing is successful, a transaction accounting message is generated according to the transaction information; the transaction accounting message includes accounting elements for calculating the accounting date;
[0050] The transaction accounting message is published to the message middleware, and when the consumer corresponding to the transaction accounting message is in an idle state, the accounting date corresponding to the transaction request is determined according to the accounting elements in the transaction accounting message.
[0051] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0052] Obtaining a transaction request initiated by a client, and determining transaction information corresponding to the transaction request;
[0053] If the transaction processing result of the transaction request is that the transaction processing is successful, a transaction accounting message is generated according to the transaction information; the transaction accounting message includes accounting elements for calculating the accounting date;
[0054] The transaction accounting message is published to the message middleware, and when the consumer corresponding to the transaction accounting message is in an idle state, the accounting date corresponding to the transaction request is determined according to the accounting elements in the transaction accounting message.
[0055] The above data processing method, device, computer equipment, computer readable storage medium and computer program product obtain the transaction request initiated by the client, determine the transaction information corresponding to the transaction request; if the transaction processing result of the transaction request is successful, generate a transaction accounting message according to the transaction information; the transaction accounting message contains accounting elements for calculating the accounting date; publish the transaction accounting message to the message middleware, and when the consumer corresponding to the transaction accounting message is in an idle state, determine the accounting date corresponding to the transaction request according to the accounting elements in the transaction accounting message. With this method, when the core system receives the transaction request, the confirmation operation of the accounting date of the transaction is set in the accounting process through the message middleware, so that the transaction processing process is decoupled from the accounting process. Furthermore, when the accounting date is cut, the transaction request does not need to immediately determine the accounting date of the transaction request, avoiding the use of a double table design with complex business logic mapping to determine the accounting date, and can reduce the maintenance complexity of the core business system while ensuring 7*24 hours of business continuity. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 An application environment diagram of a data processing method in an embodiment;
[0058] Figure 2 A schematic diagram of decoupling and separating a transaction processing process from an accounting process in one embodiment;
[0059] Figure 3 A schematic diagram of a process of determining transaction information of a transaction request in one embodiment;
[0060] Figure 4 A schematic diagram of a process for determining a transaction processing result in one embodiment;
[0061] Figure 5 A flowchart of specific steps for determining a transaction processing result in another embodiment;
[0062] Figure 6 A schematic diagram of a process for determining an accounting date in one embodiment;
[0063] Figure 7 A schematic diagram of a process for generating and registering accounting entries in an embodiment;
[0064] Figure 8 is a structural block diagram of a data processing device in one embodiment;
[0065] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0067] In traditional technology, the core business systems of banks and other financial institutions use FlashCopy, AB tables, dual balances and other methods to achieve business continuity in order to achieve 7*24 hours of business operation. FlashCopy can create a point-in-time copy to meet the bank's need to obtain a static data copy for the end of the day when the day is cut, without affecting the online operation of customer business. However, this method has certain limitations. Since there are multiple databases and multiple copies in the distributed architecture, FlashCopy is difficult to apply to the distributed architecture.
[0068] On this basis, the distributed architecture generally uses the AB table with a dual-table design. When the system is cut daily, Table A is static, and the amount incurred is temporarily stored in Table B. After the daily cut is completed, Table A is enabled and starts to pursue the account based on the information in Table B. Specifically, Table A is enabled and based on the complex business logic mapping relationship, the information stored in Table B is synchronized and mapped to Table A to determine the accounting date corresponding to the business request. However, the business logic complexity of the dual-table design of the system is relatively high, and the data in the distributed system needs to be vertically segmented, and the business logic complexity of the core system is even higher.
[0069] The double balance mode adds a new last balance field (referring to the last balance of the day) to calculate the previous day's end-of-day balance at the end of the day. This balance calculation method is more complicated, and the table structure design is also more complicated.
[0070] When the core system receives a transaction request, the application sets the confirmation operation of the accounting date of the transaction in the accounting process through the message middleware, so that the transaction processing process is decoupled from the accounting process. Furthermore, when the accounting date is cut, the transaction request does not need to immediately determine the accounting date of the transaction request, avoiding the use of a double table design with complex business logic mapping to determine the accounting date, and can reduce the maintenance complexity of the core business system while ensuring 7*24 hours of business continuity.
[0071] In one embodiment, Figure 1 As shown, a data processing method is provided. This embodiment takes the method applied to a server as an example. It can be understood that the method can also be applied to a system including a terminal and a server and implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0072] Step 102: Obtain the transaction request initiated by the client and determine the transaction information corresponding to the transaction request.
[0073] In an embodiment of the present application, the client may be a teller client of a bank or financial institution, or a mobile client of a user. The client receives a transaction request initiated by a teller, or receives a transaction request initiated by a user of a bank or financial institution. The request typically includes basic information of the transaction, such as transaction type, account number, amount, date, etc.
[0074] Specifically, the server receives the transaction request from the client through the network interface, which may be HTTP (HyperText Transfer Protocol), TCP (Transmission Control Protocol) or IP (Internet Protocol Address). The transaction request may be in a format such as JSON or XML. The server processes the transaction request according to the specific components or modules used for message processing, and parses the transaction request to obtain the corresponding data structure that the server can process, for example, using the JSON parsing library to parse the transaction request into a Java object or Python dictionary. The parsed data is mapped to the transaction request object defined within the system (for example, the TransactionRequest class in Java).
[0075] In addition, the server also needs to perform data validity verification, business rule verification, and authority verification on the transaction request to determine whether the current transaction request is successfully processed. Among them, for data validity, the server verifies whether the parsed data meets the business rules and data format requirements, for example, whether the transaction amount is a positive number, whether the account format is correct, etc.; for business rules, the server verifies whether the transaction request meets the requirements of the business rules according to the business rules, for example, whether the account exists, whether there is enough balance for transfer, etc.; for authority, the server verifies whether the user who initiated the transaction request has the authority to perform the operation, for example, whether the bank teller has the authority to handle a specific type of transaction. Then, the server obtains the transaction processing result for the current transaction request.
[0076] Step 104: If the transaction processing result of the transaction request is that the transaction processing is successful, a transaction settlement message is generated according to the transaction information.
[0077] The transaction accounting message includes accounting elements used to calculate the accounting date.
[0078] In the embodiment of the present application, after processing the transaction request, the server will return a processing result. If the transaction processing result is "transaction processing successful", it means that the transaction request has been completed as expected, and the funds have been transferred from the source account to the target account or the corresponding accounting processing has been performed. Furthermore, when the transaction processing result of the transaction request is that the transaction processing is successful, the server extracts the transaction information from the transaction request that has been successfully processed, extracts the accounting elements used for accounting from the transaction information, and generates the transaction accounting message corresponding to the current transaction request based on the accounting elements.
[0079] In a specific embodiment, the server obtains the processing result of the transaction request from the transaction processing module. The processing result can be represented by a data structure such as an enumeration type or a Boolean value. For example, the successful transaction processing status is represented by a Boolean value true or a specific enumeration value SUCCESS. Then, the server checks the transaction processing result corresponding to the transaction request to determine whether the transaction processing result is "transaction processing successful". If the transaction processing result indicates that the transaction failed or an error occurred, the step of generating a transaction settlement message is skipped, and the failure logic is directly processed (for example, recording an error log, notifying the client, etc.).
[0080] When the server completes the processing of the transaction request and feedbacks that the transaction processing result of the transaction request is successful, the server constructs a transaction accounting message. Specifically, a data structure representing the transaction accounting message is defined in the server. After the server completes the processing of the transaction request, it instantiates the transaction information in the transaction request according to the data structure corresponding to the transaction accounting message, fills the transaction information in the transaction message into the data structure of the transaction accounting message, and generates a transaction accounting message corresponding to the current transaction request.
[0081] Step 106, publish the transaction accounting message to the message middleware, and when the consumer corresponding to the transaction accounting message is in an idle state, determine the accounting date corresponding to the transaction request according to the accounting elements in the transaction accounting message.
[0082] In the embodiment of the present application, after completing the construction of the message accounting message, the server publishes the transaction accounting message to the message middleware, thereby decoupling the transaction processing and the accounting processing, so that the transaction processing and the accounting processing do not affect each other. Figure 2As shown, when the server receives a transaction request, it is not necessary to immediately calculate and determine the accounting date corresponding to the transaction request. Instead, the accounting date corresponding to the transaction request will be determined based on the accounting elements in the transaction accounting message during the internal accounting time when the consumer corresponding to the transaction accounting message is idle. Specifically, the message middleware is a message queue system used to transmit messages between different applications or server components. The accounting system or other related server components (referred to as consumers) subscribe to various messages of the message middleware, including transaction accounting messages. After the server publishes the transaction flow and account information to the outside world through message events, the specific content is that after the account processing is completed, an event message containing accounting elements is generated (the event message can be a transaction accounting message or an event processing message). The message format is divided into three parts: general attributes, business header attributes, and business body attributes. General attributes include event type, event source, event time, event address, etc. Business header attributes include order type, order number, transaction date, transaction time, etc. Business body attributes include transaction information such as order number, scenario code, transaction time, and accounting elements such as accounting amount, currency, product information, voucher type, and expense information. The event is published by calling the message middleware, and event consumers can subscribe to consume and use it. If the message fails to be written, it will be resent by the scheduled task until the message is pushed successfully.
[0083] Among them, the accounting date is different from the date when the transaction message is generated. The accounting date depends on specific accounting policies and rules. Accounting policies and rules can be dynamically configured to adapt to the business needs of banks or financial institutions in different scenarios and different businesses. For example, the determination of the accounting date is a dynamic process. The server will map the transaction date to the accounting date according to predefined rules and configurations. Alternatively, some transactions may need to be accounted for on the next business day, while others may need to be processed immediately.
[0084] In the above data processing method, when the core system receives a transaction request, the confirmation operation of the accounting date of the transaction is set in the accounting process through the message middleware, so that the transaction processing process is decoupled from the accounting process. Furthermore, when the accounting date is cut, the transaction request does not need to immediately determine the accounting date of the transaction request, avoiding the use of a double table design with complex business logic mapping to determine the accounting date, and can reduce the maintenance complexity of the core business system while ensuring 7*24 hours of business continuity.
[0085] In an exemplary embodiment, Figure 3As shown, step 102 includes steps 302 to 304. Among them:
[0086] Step 302, obtaining the transaction request and natural time initiated by the client, and parsing the transaction request to obtain the initial transaction information contained in the transaction request.
[0087] In the embodiment of the present application, the server obtains the transaction request initiated by the client, and at the same time, the server obtains the natural time when the transaction request is received. The natural time is the computer time. Specifically, the server can obtain the current system time by calling the time acquisition function (for example, new Date() or System.currentTimeMillis()), and, according to business requirements, the time format can be the ISO 8601 standard format (for example, 2024-11-27T12:07:46.252Z) or other custom formats. At the same time, the server can register the transaction flow. Secondly, the server executes the business process corresponding to the transaction request to realize transaction processing, and the computer time is uniformly used as the transaction time and date in the transaction processing.
[0088] The server parses the transaction request to obtain information other than the transaction date, including information related to funds and accounts, such as transaction type, account number, amount, transaction description, customer ID, etc. Specifically, the server parses the JSON data or other formatted data in the HTTP request body corresponding to the transaction request to extract key information from the transaction request.
[0089] Step 304, determine the natural time as the transaction date of the transaction request, and add the transaction date to the initial transaction information to obtain the transaction information corresponding to the transaction request.
[0090] In an embodiment of the present application, the server determines the natural time as the transaction date corresponding to the transaction request, and fills the transaction date into the corresponding field in the initial transaction information, completes the data structure update of the initial transaction date, and obtains the complete transaction information corresponding to the transaction request.
[0091] In this embodiment, by acquiring and parsing the transaction request, recording the natural time and determining it as the transaction date, complete transaction information is formed, which ensures the integrity and accuracy of the transaction processing and lays the foundation for the subsequent determination of the accounting date corresponding to the transaction request.
[0092] In an exemplary embodiment, the transaction request includes a transaction record and a transaction date; Figure 4 As shown, before step 104, the method further includes steps 402 to 404. Among them:
[0093] Step 402, register the transaction record according to the transaction date.
[0094] In an embodiment of the present application, the server extracts the transaction date from the complete transaction information, which may be the transactionDate field extracted from the complete transaction information, and creates a new transaction record in the server's database. For example, the server inserts the complete transaction information into the transactions table.
[0095] Step 404: perform transaction processing on the transaction request to obtain a transaction processing result corresponding to the transaction request.
[0096] In the embodiment of the present application, the server extracts the transaction field corresponding to the transaction type from the complete transaction information, and determines the transaction type corresponding to the current transaction request, such as transfer, payment, recharge, etc. Then, the server calls the corresponding transaction processing logic according to the transaction type. For example, for a transfer transaction, the server needs to deduct the corresponding amount from the source account, transfer the amount to the target account, and update the balances corresponding to the source account and the target account in the database.
[0097] In this embodiment, by registering the transaction record in the system database, and executing the actual transaction processing according to the transaction request, and finally generating the transaction processing result, the persistence of the transaction record and the accuracy of the transaction processing can be guaranteed. At the same time, after the server determines the transaction processing result corresponding to the transaction request, it triggers the calculation of the subsequent accounting date only when the transaction request is successfully processed, avoiding the calculation of the accounting date immediately after each transaction request is received, which can reduce the resource consumption of the server and improve the overall transaction processing performance of the server.
[0098] In an exemplary embodiment, Figure 5 As shown, step 305 includes steps 502 to 506. Among them:
[0099] Step 502: Determine the transaction type corresponding to the transaction request.
[0100] In an embodiment of the present application, the server determines the transaction type corresponding to the transaction request according to the transaction information in the transaction request. For example, the server determines the transaction type according to the value of the transactionType field.
[0101] Step 504: Call the target event corresponding to the transaction type according to the transaction type.
[0102] In an embodiment of the present application, a mapping relationship between transaction types and target events is predefined in the server, and the mapping relationship can be stored through a hash table or an enumeration class. The server determines the target event corresponding to the transaction type of the current transaction request based on the mapping relationship between the transaction type and the target event, and calls the target event corresponding to the transaction type based on the reflection mechanism. Among them, the target event is the business processing logic corresponding to the transaction type. For example, transaction types include transfer transactions, which transfer money from one account to another; payment transactions, which are usually used for bill payments or online shopping payments; recharge transactions, which are used to recharge electronic wallets or prepaid accounts; withdrawal transactions, which withdraw funds from electronic wallets or accounts to bank accounts; deposit transactions, which deposit funds into bank accounts; refund transactions, which return funds to users; bill payment transactions, which are used to pay water, electricity, gas and other bills; subscription transactions, which are used to pay subscription fees on a regular basis.
[0103] Step 506 , performing transaction processing on the transaction request according to the target event. If the target event completes the processing of the transaction request, the transaction processing result corresponding to the transaction request is determined as successful transaction processing.
[0104] In the embodiment of the present application, the server calls the target event and executes the target event handler corresponding to the target event to perform transaction processing on the transaction request. The server passes the detailed information of the transaction request to the target event handler, and the target event handler will be responsible for performing specific operations related to the transaction type. During the execution of the target event handler, the server monitors the processing results of the target event handler. The target event handler will perform a series of operations to complete the acceptance of the transaction request, such as verifying account information, checking balances, recording transactions, etc. After the target event handler completes the processing of the transaction request, it determines its processing results. If the target event handler successfully completes all necessary operations and does not encounter any errors or exceptions, then the transaction processing result corresponding to the transaction request is determined to be considered that the transaction request has been successfully processed, that is, the processing operation implemented by the target event handler corresponding to the transaction message has been recorded, and the relevant account balance has been updated. Finally, the server records the status of the transaction processing. If the transaction processing is successful, the unique identifier of the transaction (e.g., transaction ID) can be recorded in the server log for subsequent query and management.
[0105] In this embodiment, after determining the transaction processing result corresponding to the transaction request, the calculation of the subsequent accounting date is triggered only when the transaction request is processed successfully, avoiding the calculation of the accounting date immediately after each transaction request is received, thereby reducing the resource consumption of the server and improving the overall transaction processing performance of the server.
[0106] In an exemplary embodiment, Figure 6 As shown, step 106 includes steps 602 to 604. Among them:
[0107] Step 602: When the consumer corresponding to the transaction settlement message is in an idle state, the transaction settlement message is parsed according to the consumer to obtain the settlement elements contained in the transaction settlement message.
[0108] In an embodiment of the present application, the server has a consumer who subscribes to transaction accounting messages, and the consumer is a service or process that performs consumption processing on the transaction accounting messages. The server monitors the current status of the consumer corresponding to the transaction accounting message in real time. Ensure that the consumer can receive and process new transaction accounting messages when it is not currently processing other tasks and is in an idle state. Once the consumer is in an idle state, the consumer automatically detects whether there is a transaction accounting message in the message middleware. If there is a transaction accounting message, the consumer obtains the transaction accounting message from the message middleware and parses it. The parsing process includes reading the data fields in the message and extracting the accounting elements contained in the message.
[0109] Step 604 , select a target conversion rule from the candidate conversion rules according to the accounting element, and perform mapping conversion on the accounting element according to the target conversion rule to obtain the accounting date corresponding to the transaction request.
[0110] In the embodiment of the present application, the accounting date can be configured according to the accounting department's requirements to achieve flexible accounting of transactions. Specifically, a set of candidate conversion rules is maintained in the server, and the candidate conversion rules are used to map and convert accounting elements into other formats or data structures to adapt to different accounting systems or processes. The consumer selects a suitable target conversion rule from the candidate conversion rules based on the characteristics of the extracted accounting elements, and applies the target conversion rule to map and convert the accounting elements, for example, the transformation of the data format, the calculation or reclassification of the data value, etc. One of the results of the mapping conversion is to determine the accounting date corresponding to the transaction request. The accounting date is the key information used in the accounting record to identify the time when the transaction occurs. It can be adjusted according to specific accounting rules (such as month-end settlement) based on the actual date of the transaction. After obtaining the accounting date, the consumer can use it together with other conversion results as a transaction request. When the date is the accounting date, the server performs accounting verification on the complete accounting information in the transaction request through the consumer of the transaction accounting message, and then realizes the decoupling of transaction processing and accounting processing by setting the determination process of the accounting date in the internal accounting processing flow.
[0111] In this embodiment, by configuring consumers who subscribe to transaction accounting messages in the server, the consumer status is monitored in real time to ensure that they automatically receive and parse transaction accounting messages when they are idle, and extract accounting elements. Subsequently, the target conversion rule is selected from the candidate conversion rules according to the characteristics of the accounting elements, and the conversion accounting elements are flexibly mapped, including determining the accounting date, so as to achieve flexible accounting of transactions, decouple transaction processing and accounting processing, and achieve 7*24 hours of business continuity under the distributed architecture, reduce the complexity of the core business system, and make business rules (for example, interest calculation) strictly calculated according to the natural date, thereby improving customer experience.
[0112] In an exemplary embodiment, Figure 7 As shown, after step 107, the method further includes steps 702 to 704. Among them:
[0113] Step 702, determine the business attribute corresponding to the transaction request, if the business attribute is the target business attribute, obtain the accounting element according to the message middleware.
[0114] In an embodiment of the present application, first, the server determines the business attributes corresponding to the transaction request. Business attributes refer to the specific business type or category to which the transaction request belongs, for example, "salary payment", "sales order", "purchase warehousing", etc. The business attributes are clearly identified in the transaction request, or can be inferred based on certain characteristics of the transaction request. After determining the business attributes, the server determines whether the business attributes corresponding to the transaction request are target business attributes. The target business attribute is a type of business attribute that is pre-set and requires special processing. For example, business attributes that may require special processing include "large fund transfers", "cross-border transactions", etc. Furthermore, if the business attribute is determined to be a target business attribute, the server will obtain relevant accounting elements based on the message middleware.
[0115] Step 704: Generate accounting entries corresponding to the transaction request according to the accounting elements, and register the accounting entries.
[0116] In the embodiment of the present application, the server generates accounting entries corresponding to the transaction request based on the obtained accounting elements. Accounting entries are the basic unit in accounting records, which are used to record the debit and credit sides of each transaction and their amounts. The generated accounting entries usually include information such as the debit and credit accounts, amounts, dates, etc.
[0117] The generated accounting entries need to be registered to update the relevant accounts and balances in the accounting system. The registration process usually includes writing the entry information into the accounting database and performing corresponding verification and confirmation to ensure the accuracy and completeness of the data. After the registration is completed, the server records the registration results, including whether it is successful and whether subsequent processing is required, for subsequent auditing, reporting or troubleshooting.
[0118] In this embodiment, accounting entries corresponding to transaction requests are generated based on accounting elements and registered, which can ensure that transaction requests are correctly accounted for in accordance with specific business attributes, and generate and register corresponding accounting entries, which can ensure the accuracy and consistency of accounting data and support subsequent financial analysis and decision-making.
[0119] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0120] Based on the same inventive concept, the embodiment of the present application also provides a data processing device for implementing the data processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more data processing device embodiments provided below can refer to the limitations on the data processing method above, and will not be repeated here.
[0121] In an exemplary embodiment, Figure 8 As shown, a data processing device 800 is provided, comprising: a first acquisition module 801, a generation module 802 and a determination module 803, wherein:
[0122] The first acquisition module 801 is used to acquire a transaction request initiated by a client and determine transaction information corresponding to the transaction request;
[0123] A generating module 802 is used to generate a transaction accounting message according to the transaction information if the transaction processing result of the transaction request is that the transaction processing is successful; the transaction accounting message includes an accounting element for calculating an accounting date;
[0124] The determination module 803 is used to publish the transaction accounting message to the message middleware, and when the consumer corresponding to the transaction accounting message is in an idle state, determine the accounting date corresponding to the transaction request according to the accounting elements in the transaction accounting message.
[0125] In one embodiment, the first acquisition module 801 is specifically used to acquire the transaction request and natural time initiated by the client, and parse the transaction request to obtain the initial transaction information included in the transaction request;
[0126] The natural time is determined as the transaction date of the transaction request, and the transaction date is added to the initial transaction information to obtain the transaction information corresponding to the transaction request.
[0127] In one embodiment, the transaction request includes a transaction record and a transaction date; the apparatus 800 further includes:
[0128] A first registration module, used to register transaction records according to transaction dates;
[0129] The transaction processing module is used to process the transaction request and obtain the transaction processing result corresponding to the transaction request.
[0130] In one embodiment, the transaction processing module is specifically used to determine the transaction type corresponding to the transaction request;
[0131] Call the target event corresponding to the transaction type according to the transaction type;
[0132] The transaction request is processed according to the target event. If the target event completes the processing of the transaction request, the transaction processing result corresponding to the transaction request is determined as a successful transaction processing.
[0133] In one embodiment, the determination module 803 is specifically used to parse the transaction accounting message according to the consumer when the consumer corresponding to the transaction accounting message is in an idle state, and obtain the accounting elements included in the transaction accounting message;
[0134] A target conversion rule is selected from candidate conversion rules according to the accounting element, and the accounting element is mapped and converted according to the target conversion rule to obtain an accounting date corresponding to the transaction request.
[0135] In one embodiment, the apparatus 800 further includes:
[0136] The second acquisition module is used to determine the business attribute corresponding to the transaction request, and if the business attribute is the target business attribute, obtain the accounting element according to the message middleware;
[0137] The second registration module generates accounting entries corresponding to the transaction request according to the accounting elements, and registers the accounting entries.
[0138] Each module in the above data processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0139] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a data processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0140] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0141] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0142] Obtain the transaction request initiated by the client and determine the transaction information corresponding to the transaction request;
[0143] If the transaction processing result of the transaction request is that the transaction processing is successful, a transaction accounting message is generated according to the transaction information; the transaction accounting message includes accounting elements for calculating the accounting date;
[0144] The transaction accounting message is published to the message middleware. When the consumer corresponding to the transaction accounting message is in an idle state, the accounting date corresponding to the transaction request is determined according to the accounting elements in the transaction accounting message.
[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0146] Obtain the transaction request and natural time initiated by the client, parse the transaction request, and obtain the initial transaction information contained in the transaction request;
[0147] The natural time is determined as the transaction date of the transaction request, and the transaction date is added to the initial transaction information to obtain the transaction information corresponding to the transaction request.
[0148] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0149] Register transaction records according to transaction dates;
[0150] Perform transaction processing on the transaction request and obtain the transaction processing result corresponding to the transaction request.
[0151] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0152] Determine the transaction type corresponding to the transaction request;
[0153] Call the target event corresponding to the transaction type according to the transaction type;
[0154] The transaction request is processed according to the target event. If the target event completes the processing of the transaction request, the transaction processing result corresponding to the transaction request is determined as a successful transaction processing.
[0155] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0156] When the consumer corresponding to the transaction accounting message is in an idle state, the transaction accounting message is parsed according to the consumer to obtain the accounting elements contained in the transaction accounting message;
[0157] A target conversion rule is selected from candidate conversion rules according to the accounting element, and the accounting element is mapped and converted according to the target conversion rule to obtain an accounting date corresponding to the transaction request.
[0158] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0159] Determine the business attribute corresponding to the transaction request. If the business attribute is the target business attribute, obtain the accounting element according to the message middleware.
[0160] Generate accounting entries corresponding to transaction requests based on accounting elements and register the accounting entries.
[0161] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0162] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0163] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0164] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0165] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0166] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data processing method, characterized in that: The method comprises: Obtaining a transaction request initiated by a client, and determining transaction information corresponding to the transaction request; If the transaction processing result of the transaction request is that the transaction processing is successful, a transaction accounting message is generated according to the transaction information; the transaction accounting message includes accounting elements for calculating the accounting date; The transaction accounting message is published to the message middleware, and when the consumer corresponding to the transaction accounting message is in an idle state, the accounting date corresponding to the transaction request is determined according to the accounting elements in the transaction accounting message.
2. The method according to claim 1, characterized in that: The obtaining of the transaction request initiated by the client and determining the transaction information corresponding to the transaction request includes: Obtaining a transaction request and natural time initiated by a client, and parsing the transaction request to obtain initial transaction information contained in the transaction request; The natural time is determined as the transaction date of the transaction request, and the transaction date is added to the initial transaction information to obtain the transaction information corresponding to the transaction request.
3. The method according to claim 1, characterized in that The transaction request includes a transaction record and a transaction date; if the transaction processing result of the transaction request is that the transaction processing is successful, before generating a transaction settlement message according to the transaction information, the method further includes: Registering the transaction record according to the transaction date; Perform transaction processing on the transaction request to obtain a transaction processing result corresponding to the transaction request.
4. The method according to claim 3, characterized in that The performing transaction processing on the transaction request to obtain a transaction processing result corresponding to the transaction request includes: Determining a transaction type corresponding to the transaction request; Calling a target event corresponding to the transaction type according to the transaction type; The transaction request is processed according to the target event. If the target event completes the processing of the transaction request, the transaction processing result corresponding to the transaction request is determined as a successful transaction processing.
5. The method according to claim 1, characterized in that When the consumer corresponding to the transaction accounting message is in an idle state, determining the accounting date corresponding to the transaction request according to the accounting elements in the transaction accounting message includes: When the consumer corresponding to the transaction settlement message is in an idle state, the transaction settlement message is parsed according to the consumer to obtain the settlement elements contained in the transaction settlement message; A target conversion rule is selected from candidate conversion rules according to the accounting element, and the accounting element is mapped and converted according to the target conversion rule to obtain an accounting date corresponding to the transaction request.
6. The method according to claim 1, characterized in that When the consumer corresponding to the transaction accounting message is in an idle state, after determining the accounting date corresponding to the transaction request according to the accounting elements in the transaction accounting message, the method further includes: Determine the business attribute corresponding to the transaction request, and if the business attribute is a target business attribute, obtain the accounting element according to the message middleware; Generate accounting entries corresponding to the transaction request according to the accounting elements, and register the accounting entries.
7. A data processing device, characterized in that: The device comprises: A first acquisition module, configured to acquire a transaction request initiated by a client and determine transaction information corresponding to the transaction request; A generating module, configured to generate a transaction accounting message according to the transaction information if the transaction processing result of the transaction request is that the transaction processing is successful; the transaction accounting message includes an accounting element for calculating an accounting date; A determination module is used to publish the transaction accounting message to the message middleware, and when the consumer corresponding to the transaction accounting message is in an idle state, determine the accounting date corresponding to the transaction request according to the accounting elements in the transaction accounting message.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.