Loan transaction processing method and device and electronic equipment
By introducing business state locks and segmented transaction states, the problem of idempotent control difficulties caused by strong database lock dependence in high concurrency scenarios is solved, and precise capital idempotent control and system stability are achieved.
Patent Information
- Application Number
- CN202411478896.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-11
AI Technical Summary
In high concurrency scenarios, when controlling the loan transaction interaction process through database locks, the database dependence is too strong, making it difficult to accurately control the idempotent logic, resulting in the problem of repeated sending of funds or suspending the card order.
Introduce business status locks, and subdivide the transaction status of loan transactions (such as to be sent, pending, fund processing, successful fund processing, and failed fund processing), so as to refine the processing process and status control to avoid database locks. Idepotential control failure caused by failure.
Reduce dependence on database performance, accurately control fund idempotence, avoid repeated sending problems, and improve system stability and transaction accuracy.
Smart Images

Figure CN119417594A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and in particular to a method for processing loan affairs and a device and electronic equipment thereof. Background Art
[0002] In the financial system architecture, the interaction between the loan system and the core system, payment system, etc. is crucial. The two usually interact with each other through real-time interfaces. During the interface interaction process, the interaction with the core system is generally a synchronous interface, and the interaction with the payment system and the acquiring system is an asynchronous interface. The status returned by the service provider is success, failure, processing, or other abnormal status. If the applicant controls the status abnormally, it will lead to problems such as long or short funds, or no final state for a long time. There is a risk of repeated fund sending or card order suspension, which may cause some transaction problems.
[0003] In the related art, in order to solve the above-mentioned problems existing in the interaction process, it is proposed to control the interaction process of loan transactions through database locks. This method can alleviate the risk of repeated fund sending or card order suspension caused by anomalies in the interaction process to a certain extent, but it also has certain disadvantages. This solution is highly dependent on the database and relies on the application of the database as an idempotence judgment condition. It is usually prone to problems in the initialization state. When the loan system interacts with the core or payment system, if the database lock fails or the database suddenly fails to link in a high concurrency state, and network jitter occurs when the two systems interact, causing lost messages, etc., it is impossible to control the idempotence of funds and determine the correct final state of funds.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method for processing loan transactions, a device thereof, and an electronic device, so as to at least solve the technical problems in the related art that, when processing loan transactions, the interaction process is controlled by a database lock, the dependence on the database is too strong, and it is difficult to accurately control the idempotent logic in a high concurrency scenario.
[0006] According to one aspect of an embodiment of the present invention, a method for processing a loan transaction is provided, comprising: traversing the loan transactions in an out-of-account table, determining the loan transactions in a first transaction state, and obtaining loan data corresponding to the loan transactions in the first transaction state to obtain target loan data, wherein the first transaction state indicates that the transaction state of the loan transaction is in a pending state; updating the transaction state of the loan transaction corresponding to the target loan data to a second transaction state, wherein the second transaction state indicates that the transaction state of the loan transaction is in a pending state; performing message assembly on the target loan data in the second transaction state to obtain a request message, and calling a service party interface to send the request message to a service party, and obtaining a response result of the service party; and updating the transaction state of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result to obtain the updated out-of-account table.
[0007] Optionally, after obtaining the target loan data, the method further includes: performing database lock control on the target loan data to obtain the locked target loan data.
[0008] Optionally, the transaction status also includes at least: a third transaction status, a fourth transaction status, a fifth transaction status, a sixth transaction status, and a seventh transaction status, wherein the third transaction status indicates that the transaction status of the loan transaction is in a funds processing state, the fourth transaction status indicates that the transaction status of the loan transaction is in a funds processing success state, the fifth transaction status indicates that the transaction status of the loan transaction is in a funds processing failure state, the sixth transaction status indicates that the transaction status of the loan transaction is in an unresponsive state, and the seventh transaction status indicates that the transaction status of the loan transaction is in an abnormal response state.
[0009] Optionally, the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-pocket table based on the response result includes: when the response result indicates that the loan transaction is in funds processing, updating the transaction status of the loan transaction in the out-of-pocket table to a third transaction status.
[0010] Optionally, the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result also includes: when the response result indicates that the loan transaction is in the process of successful fund processing, updating the transaction status of the loan transaction in the out-of-account table to a fourth transaction status; and performing accounting processing on the loan transaction based on the response result and the fourth transaction status.
[0011] Optionally, the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result also includes: when the response result indicates that the loan transaction is in a state of fund processing failure, updating the transaction status of the loan transaction in the out-of-account table to a fifth transaction status; and performing accounting processing on the loan transaction based on the response result and the fifth transaction status.
[0012] Optionally, the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result also includes: if no response result from the service party is received within a preset time period, updating the transaction status of the loan transaction in the out-of-account table to a sixth transaction status; calling an exception troubleshooting interface, and performing an exception troubleshooting on the loan transaction in the sixth transaction status through the exception troubleshooting interface.
[0013] Optionally, the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result also includes: when the response result indicates that the service party has responded abnormally, updating the transaction status of the loan transaction in the out-of-account table to a seventh transaction status; calling an abnormality troubleshooting interface, and performing an abnormality troubleshooting on the loan transaction in the seventh transaction status through the abnormality troubleshooting interface.
[0014] According to another aspect of an embodiment of the present invention, there is also provided a processing device for loan transactions, comprising: an acquisition unit, configured to traverse the loan transactions in an out-of-account table, determine the loan transactions in a first transaction state, and acquire the loan data corresponding to the loan transactions in the first transaction state to obtain target loan data, wherein the first transaction state indicates that the transaction state of the loan transaction is in a pending state; a first update unit, configured to update the transaction state of the loan transaction corresponding to the target loan data to a second transaction state, wherein the second transaction state indicates that the transaction state of the loan transaction is in a pending state; a sending unit, configured to perform message assembly on the target loan data in the second transaction state to obtain a request message, call a service party interface to send the request message to the service party, and obtain a response result of the service party; a second update unit, configured to update the transaction state of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result to obtain the updated out-of-account table.
[0015] Optionally, the loan transaction processing device further includes: a first control module, configured to perform database lock control on the target loan data to obtain the locked target loan data.
[0016] Optionally, the transaction status also includes at least: a third transaction status, a fourth transaction status, a fifth transaction status, a sixth transaction status, and a seventh transaction status, wherein the third transaction status indicates that the transaction status of the loan transaction is in a funds processing state, the fourth transaction status indicates that the transaction status of the loan transaction is in a funds processing success state, the fifth transaction status indicates that the transaction status of the loan transaction is in a funds processing failure state, the sixth transaction status indicates that the transaction status of the loan transaction is in an unresponsive state, and the seventh transaction status indicates that the transaction status of the loan transaction is in an abnormal response state.
[0017] Optionally, the second updating unit includes: a first updating module, configured to update the transaction status of the loan transaction in the outgoing table to a third transaction status when the response result indicates that the loan transaction is in funds processing.
[0018] Optionally, the second update unit also includes: a second update module, used to update the transaction status of the loan transaction in the outgoing table to a fourth transaction status when the response result indicates that the loan transaction is in the process of successful fund processing; and a first accounting module, used to perform accounting processing on the loan transaction based on the response result and the fourth transaction status.
[0019] Optionally, the second update unit also includes: a third update module, used to update the transaction status of the loan transaction in the outgoing table to a fifth transaction status when the response result indicates that the loan transaction is in a state of fund processing failure; and a second accounting module, used to perform accounting processing on the loan transaction based on the response result and the fifth transaction status.
[0020] Optionally, the second update unit also includes: a fourth update module, used to update the transaction status of the loan transaction in the outgoing table to a sixth transaction status if no response result is received from the service party within a preset time period; a first troubleshooting module, used to call an abnormality troubleshooting interface, and perform abnormality troubleshooting on the loan transaction in the sixth transaction status through the abnormality troubleshooting interface.
[0021] Optionally, the second update unit also includes: a fifth update module, used to update the transaction status of the loan transaction in the out-of-pocket table to a seventh transaction status when the response result indicates that the service party has responded abnormally; a second troubleshooting module, used to call an abnormality troubleshooting interface, and perform an abnormality troubleshooting on the loan transaction in the seventh transaction status through the abnormality troubleshooting interface.
[0022] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned loan transaction processing methods.
[0023] In the present application, the following steps are performed: traversing the loan transactions in the out-of-account table, determining the loan transactions in the first transaction state, and obtaining the loan data corresponding to the loan transactions in the first transaction state to obtain the target loan data, wherein the first transaction state indicates that the transaction state of the loan transaction is in a pending state, and then updating the transaction state of the loan transaction corresponding to the target loan data to a second transaction state, wherein the second transaction state indicates that the transaction state of the loan transaction is in a pending state, and then assembling the target loan data in the second transaction state to obtain a request message, and calling the service provider interface to send the request message to the service provider, and obtaining the response result of the service provider, and finally updating the transaction state of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result to obtain an updated out-of-account table.
[0024] In the present application, when processing loan transactions, the actual situation of the loan transactions in the out-of-account table is distinguished through the status lock, and the loan transactions in the pending and pending states are distinguished based on the first transaction state and the second transaction state, so as to avoid the failure of idempotent control due to the failure of the database lock, which causes the problem of repeated sending, thereby achieving the technical effect of reducing the dependence on database performance and accurately controlling the idempotence of funds, thereby solving the technical problem in the related technology that when processing loan transactions, the interaction process is controlled by the database lock, the dependence on the database is too strong, and it is difficult to accurately control the idempotent logic in high concurrency scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0026] Figure 1 is a flow chart of an optional method for processing a loan transaction according to an embodiment of the present invention;
[0027] Figure 2 It is a schematic diagram of an optional loan transaction synchronization interaction process according to the prior art;
[0028] Figure 3 It is a schematic diagram of an optional asynchronous interaction process of a loan transaction according to the prior art;
[0029] Figure 4is a schematic diagram of an optional asynchronous interaction process of a loan transaction according to an embodiment of the present invention;
[0030] Figure 5 is a schematic diagram of an optional loan transaction processing device according to an embodiment of the present invention;
[0031] Figure 6 The present invention is a hardware structure block diagram of an electronic device (or mobile device) for processing a loan transaction according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] To facilitate those skilled in the art to understand the present invention, some terms or nouns involved in the embodiments of the present invention are explained below:
[0035] Idempotence means that no matter how many times the same fund operation (such as transfer, payment, loan, etc.) is performed, the fund status and the results recorded by the system should be the same, and no additional fund changes or record errors will be generated due to repeated operations.
[0036] Synchronous interface, after the real-time interface is sent successfully, the service party can directly return the final result.
[0037] For asynchronous interfaces, after the real-time interface is sent successfully, the service provider may not directly return the final result, and it is necessary to re-initiate the query interface to query the result.
[0038] It should be noted that the loan affairs processing method and device in the present application can be used in the financial technology field when loan affairs are processed based on status markings, and can also be used in any field other than the financial technology field when loan affairs are processed based on status markings. The application field of the loan affairs processing method and device in the present application is not limited.
[0039] It should be noted that the relevant 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 information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0040] It should be noted that in this application, when collecting and analyzing customer information, corresponding operation entrances are provided for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0041] The following embodiments of the present invention can be applied to various loan transaction processing systems / applications / devices. The present invention introduces a business status lock, refines the processing flow and state control of loan transactions, does not rely solely on database locks or simple state records, but sets a state feedback mechanism in each key link, thereby achieving precise idempotent control of fund transactions and ensuring the security and consistency of fund operations.
[0042] The present invention is described in detail below in conjunction with various embodiments.
[0043] Embodiment 1
[0044] According to an embodiment of the present invention, an embodiment of a method for processing a loan transaction is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0045] Figure 1 is a flowchart of an optional method for processing a loan transaction according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0046] Step S101, traverse the loan transactions in the outgoing account table, determine the loan transactions in the first transaction state, and obtain the loan data corresponding to the loan transactions in the first transaction state to obtain the target loan data.
[0047] It should be noted that the outgoing account table is a database table used by financial institutions to record and manage various transactions and statuses during the loan issuance process. It contains key information such as loan account number, loan amount, issuance date, payee information, transaction status, etc., and is used to track the loan issuance process of each loan transaction, from the initial state (pending) to the final state of successful or failed loan issuance. Each row of the outgoing account table represents a loan transaction. By updating the status and accounting data of these loan transactions, the system can ensure that the loan issuance process is correctly controlled and recorded to avoid repeated loans or situations where the loan issuance fails and cannot be tracked.
[0048] In the related art, in order to control the idempotence problem of loan transactions, the loan transactions in the out-of-account table are controlled through database locks. When the loan system attempts to process a loan transaction, it will first try to obtain the lock of the relevant data in the database. If the lock is successful, the system will continue to execute the transaction process, such as updating the loan status, accounting, sending loan instructions, etc. In this process, other concurrent transaction requests will not be able to modify the locked data, thereby ensuring the consistency and accuracy of the loan transaction. If the database lock mechanism is improperly designed or the system fails, such as the failure of the database lock to lock the loan data in the out-of-account table, or the failure to update the transaction status in time after the lock is released, this may cause the same loan transaction to be repeatedly processed by multiple concurrent requests, resulting in repeated issuance or deduction of funds, affecting the security of funds and the accuracy of transactions.
[0049] Specifically, Figure 2 is a schematic diagram of an optional loan transaction synchronization interaction process according to the prior art, such as Figure 2 As shown, the loan system interacts with the core system through a synchronous interface. The loan system receives the user's loan request, and after the user's credit verification is passed, the loan transaction is recorded in the outgoing account table. The loan system selects the pending data in the outgoing account table, and after the database lock control, calls the interactive interface to make loans through the core system, and obtains the results returned by the core system in real time. According to the returned results, it is determined whether to record the account. If the returned results indicate that the funds are in other states, such as no such transaction, the account will not be recorded. If the returned results indicate that the funds are in a final state and the funds are successfully released, the loan transaction will be recorded. If the returned results indicate that the funds are in a final state and the funds fail to be released, the account will not be recorded.
[0050] Figure 3is a schematic diagram of an optional asynchronous interaction process of a loan transaction according to the prior art, such as Figure 3 As shown, the loan system selects the data to be processed in the outgoing account table, and after being controlled by the database lock, calls the interactive interface, and performs operations such as loan payment through the payment system. During the funds processing process of the payment system, the loan system can query the payment system for the transaction status of the loan transaction through the query result, and obtain the return result of the payment system through the query. If the return result indicates that the funds are in a non-final state, such as there is no such transaction or the transaction is being processed, no processing is performed and the query continues. If the return result indicates that the funds are in a final state and the funds are paid successfully, the loan transaction is recorded. If the return result indicates that the funds are in a final state and the funds payment fails, no recording is performed.
[0051] Based on the above application scenarios, when the loan system interacts with the core or payment system, if the database lock fails or the database connection fails suddenly under high concurrency, and network jitter occurs when the two systems interact, causing message loss, etc., it will be impossible to control the idempotence of funds and determine the correct final state. The following example illustrates:
[0052] First, the problem caused by database lock failure. Figure 2 and Figure 3 The loan system failed to obtain the pending data in the outgoing account table and perform database lock control. Under high concurrency conditions, the database lock failed. Through the polling sending logic, fund transactions will be sent repeatedly for fund lending or payment, resulting in the inability to control the fund idempotent logic, thereby causing the risk of repeated fund sending.
[0053] Second, the database connection is suddenly disconnected, causing the status setting to fail. Figure 2 and Figure 3 After the loan system successfully sends the data to the service provider (core system or loan system), the database status update fails, which will lead to the inability to identify the status that has been sent. Through the polling sending logic, the fund loan transaction is repeatedly sent, resulting in the inability to control the idempotent logic, thereby causing the risk of repeated fund sending.
[0054] Therefore, although database locks are an important means of controlling the idempotence of loan transactions, they may cause transaction delays or failures in high-concurrency scenarios, and cannot effectively prevent duplicate transactions when the lock mechanism is improperly designed or the system fails. To solve these problems, the embodiments of the present invention adopt a more sophisticated state control mechanism and introduce business state locks to supplement or replace traditional database locks to improve system stability and transaction accuracy.
[0055] It should be noted that the embodiment of the present invention uses the first transaction status to represent the loan transaction whose transaction status is in the waiting to be sent state. When the loan system performs polling, it selects the loan transaction in the first transaction status in the outgoing account table, thereby obtaining the loan data of the loan transaction in the first transaction status, and obtaining the target loan data for this interaction.
[0056] Optionally, after obtaining the target loan data, the method further includes: performing database lock control on the target loan data to obtain the locked target loan data.
[0057] It should be noted that after acquiring the target loan data, the embodiment of the present invention also needs to perform database lock control on the target loan data. The database lock allows the target loan data to be locked during interaction, preventing other concurrent operations from modifying the same target loan data until the original operation is completed and the lock is released.
[0058] Step S102: updating the transaction status of the loan transaction corresponding to the target loan data to a second transaction status.
[0059] It should be noted that before the target loan data is locked and sent to the service provider that interacts with the loan system, the transaction status of the loan transaction corresponding to the target loan data in the outgoing table needs to be updated to the second transaction status. The second transaction status indicates that the transaction status of the loan transaction is in a pending state, that is, it is sent to the service provider for processing.
[0060] Optionally, the transaction status also includes at least: a third transaction status, a fourth transaction status, a fifth transaction status, a sixth transaction status, and a seventh transaction status, wherein the third transaction status indicates that the transaction status of the loan transaction is in a funds processing state, the fourth transaction status indicates that the transaction status of the loan transaction is in a funds processing success state, the fifth transaction status indicates that the transaction status of the loan transaction is in a funds processing failure state, the sixth transaction status indicates that the transaction status of the loan transaction is in an unresponsive state, and the seventh transaction status indicates that the transaction status of the loan transaction is in an abnormal response state.
[0061] It should be noted that, in addition to the first transaction status and the second transaction status, the embodiment of the present invention also subdivides the status of the loan transaction during the processing, updates the transaction status of the loan transaction according to the processing result returned by the service provider, and can view the status of the loan transaction in real time. Different processing operations are taken for loan transactions in different transaction statuses to ensure the accuracy of loan transaction processing.
[0062] Specifically, the transaction status of the loan transaction may include a third transaction status, a fourth transaction status, a fifth transaction status, a sixth transaction status, and a seventh transaction status.
[0063] The third transaction status indicates that the loan transaction has been sent out from the loan system and is being processed by the core system, payment system or acquiring system. This means that the transfer or adjustment of funds is in progress but has not yet been completed. The introduction of this status helps the system identify which transactions are being executed and avoids sending instructions repeatedly when the final confirmation is not received, thereby reducing the waste of network resources and potential financial risks.
[0064] Fourth transaction status: When the loan transaction passes all processing stages and the funds have been accurately transferred from the bank account to the designated collection account, or the loan repayment has been successfully deducted, the system will mark the transaction as being in the successful funds processing status. This status confirms the final success of the transaction and is one of the most critical states in the loan operation. It not only updates the status of the loan, but also triggers subsequent accounting, customer notification and other operations, ensuring the integrity of the transaction process and business continuity.
[0065] When a loan transaction encounters an insurmountable obstacle, such as insufficient account balance, incorrect receiving account information, system failure, etc., resulting in the inability to correctly transfer funds, the service provider will return the result of failed fund processing, and the loan system will update the transaction status of the loan transaction to the fifth transaction status. The record of this status allows the system and operator to identify the cause of the transaction failure and take appropriate remedial measures, such as notifying the customer to supplement the information, retrying the operation, or canceling the transaction.
[0066] After the loan transaction is sent, if the core system, payment system or acquiring system does not return any response (including success, failure or processing status) within the preset time, the system will mark the transaction status of the loan transaction as the sixth transaction status. This situation may be caused by network delays, temporary unavailability of services or high system load. By recording the sixth transaction status, the system can automatically or manually initiate a retry mechanism to ensure that the transaction can be processed correctly and to promptly discover and resolve potential inter-system communication problems.
[0067] When a loan transaction is sent, if the response received from the core system, payment system, or acquiring system does not conform to the expected format or contains an error code, the system will mark the transaction status of the loan transaction as the seventh transaction status. Response exceptions may be caused by server errors, data format mismatches, or inter-system protocol issues. Recording the seventh transaction status helps the system identify and isolate problems. Through log analysis and exception handling processes, system failures can be quickly located and repaired to avoid continued impact on user services.
[0068] In short, by introducing these detailed transaction states, the loan system can more finely monitor the life cycle of each transaction, from the initiation, processing, to the final confirmation of the transaction, as well as various abnormal situations that may be encountered during the processing. At the same time, different solutions are configured for different transaction states. The system can automatically process and record loan transactions according to the transaction status of the loan transaction. This state control mechanism not only enhances the stability of the system and the security of transactions, but also provides rich data points.
[0069] Step S103, assembling the target loan data in the second transaction state into a message to obtain a request message, calling the service provider interface to send the request message to the service provider, and obtaining a response result from the service provider.
[0070] It should be noted that the target loan data in the second transaction state is assembled into a message. The target loan data may specifically include key field information related to the loan transaction, such as the loan amount, payee information, loan type, and transaction serial number. The system will first check each field in the target loan data to ensure that their data types are consistent with the service interface requirements. If the data types do not match, the system will perform corresponding conversions, such as converting date objects to string format, or converting floating point numbers to fixed-precision string representations, to meet the format requirements of the service interface.
[0071] In addition to type conversion, the system also needs to organize the data into the format required by the service interface. For example, if the service interface requires a message in JSON format, the system will convert the target loan data into JSON format. The formatting process may include field sorting, data segmentation, and the use of specific delimiters to ensure that the structure and content of the message meet the expectations of the service provider.
[0072] In order to protect sensitive information and ensure the security of data transmission, the loan system usually encrypts the request message. For example, symmetric encryption or asymmetric encryption algorithms are used, and appropriate keys are selected for data encryption. The encryption process ensures the security of the message during transmission, and even if the message is intercepted, sensitive information will not be leaked. After the service party receives the message, it will also perform a corresponding decryption process to obtain the original data. The loan system can also use digital signature technology, such as hash algorithms (such as SHA-256) combined with private keys to sign the entire message, and generate a signature value attached to the message. After receiving the message, the service party will use the public key provided by the loan system to verify the message to ensure that the message has not been tampered with and is indeed from a trusted loan system.
[0073] In addition, the header and tail information of the message contains metadata such as message type, version number, sending time, timeout settings, etc., which are crucial for the service provider to correctly parse and process the message. The loan system will automatically add this information when the message is generated according to the communication protocol requirements of the service provider interface. For example, the header may contain a transaction serial number to uniquely identify each transaction, and the tail may contain a checksum to detect errors in the data transmission process. The final generation of the message usually requires the above-processed data to be serialized, that is, converted into a transmittable format. This may mean converting structured data objects into text strings (such as JSON, XML format), or binary format. The serialization process ensures that the data can be transmitted through the network interface.
[0074] Finally, the loan system will use the network protocol supported by the service provider interface to send the request message to the service provider, which includes but is not limited to the core system and payment system.
[0075] After receiving the request message from the loan system, the service provider performs operations such as loan issuance or payment according to the field information carried in the message, and automatically or passively returns the response result to the loan system according to the synchronous interface or asynchronous interface. The loan system will determine the real-time transaction status of the loan transaction based on the response result of the service provider, and adopt different processing methods based on different transaction statuses.
[0076] Step S104, based on the response result, the transaction status of the loan transaction corresponding to the target loan data in the outgoing account table is updated to obtain an updated outgoing account table.
[0077] It should be noted that the embodiment of the present invention makes a fine division of the status of the loan transaction. Depending on the different response results returned by the service provider, the transaction status corresponding to the loan transaction is also different, and the subsequent operations performed on the loan transaction are also different.
[0078] Optionally, the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-pocket table based on the response result includes: when the response result indicates that the loan transaction is in funds processing, updating the transaction status of the loan transaction in the out-of-pocket table to a third transaction status.
[0079] It should be noted that the service provider interacting through the synchronous interface will directly return the processing result of the loan request. The service provider interacting through the asynchronous interface can return the real-time processing result of the loan request through the query interface through the query request of the loan system. Specifically, if the response result indicates that the loan transaction is in the process of fund processing, it means that the service provider has started to process the fund transfer but has not yet completed it. The loan system recognizes that the response result is in the process of fund processing, and it is necessary to update the status information of the loan transaction in the outgoing table to the third transaction status, and continue to query until the service provider completes the fund processing.
[0080] Optionally, the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result also includes: when the response result indicates that the loan transaction is in the process of successful fund processing, updating the transaction status of the loan transaction in the out-of-account table to a fourth transaction status; and performing accounting processing on the loan transaction based on the response result and the fourth transaction status.
[0081] It should be noted that if the response result of the service party indicates that the loan transaction is in the case of successful fund processing, indicating that the loan is successfully issued or the payment is successful, etc., the loan system will update the transaction status of the loan transaction in the outgoing account table to the fourth transaction status, and parse the response result to determine the transaction data involved in the execution of the loan transaction by the service party, and then perform accounting processing on the loan transaction in the fourth transaction status, which may include updating the balance of the customer account (if the loan is successfully issued, increase the balance of the customer account; if the repayment is successful, reduce the balance of the customer account), recording the transaction history, generating corresponding accounting vouchers, etc. Accounting processing ensures the accuracy and consistency of the internal accounts of financial institutions, as well as the synchronization of accounts with external systems.
[0082] Optionally, the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-pocket table based on the response result also includes: when the response result indicates that the loan transaction is in a state of fund processing failure, updating the transaction status of the loan transaction in the out-of-pocket table to a fifth transaction status; and performing accounting processing on the loan transaction based on the response result and the fifth transaction status.
[0083] It should be noted that if the response result returned by the service provider indicates that the funds processing of the loan transaction has failed, the loan system will update the transaction status of the loan transaction in the outgoing table to the fifth transaction status after identifying the status of failed funds processing, and parse the response result, obtain the funds processing parameters, and perform accounting processing on the loan transaction in the fifth transaction status according to the funds processing parameters, record the detailed information of the failed transaction, and update the customer account status (for example, for a loan failure, it may be necessary to retain the customer's credit limit and not perform the loan operation; for a repayment failure, it may be necessary to rearrange the repayment plan or notify the customer of the account problem). Subsequently, the loan transaction with failed funds processing needs to be requested to be processed again from the service provider.
[0084] Optionally, the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-pocket table based on the response result also includes: if no response result is received from the service party within a preset time period, updating the transaction status of the loan transaction in the out-of-pocket table to a sixth transaction status; calling an exception troubleshooting interface, and performing an exception troubleshooting on the loan transaction in the sixth transaction status through the exception troubleshooting interface.
[0085] It should be noted that due to network failure or delay, service party system overload or failure, etc., the loan system may not receive the response result of the service party for a long time after sending the request message, and an exception of no response from the service party may occur. In this case, if the loan system does not receive the response result of the service party within the preset time after sending the request message, the transaction status of the loan transaction in the outgoing table will be updated to the sixth transaction status, and the exception troubleshooting interface will be called to access the service party to obtain the reason for the non-response, so as to perform exception troubleshooting.
[0086] Optionally, the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result also includes: when the response result indicates that the service party responds abnormally, updating the transaction status of the loan transaction in the out-of-account table to the seventh transaction status; calling the exception troubleshooting interface, and performing an exception troubleshooting on the loan transaction in the seventh transaction status through the exception troubleshooting interface.
[0087] It should be noted that in the interactive process of the loan system, the abnormal response of the service party is a situation that cannot be ignored. It may be caused by a variety of factors, such as system errors of the service party, network failures, data format mismatch, etc. For this type of response, the system must have a corresponding processing mechanism to ensure the stability of the transaction and the integrity of the data. After receiving the response result, the loan system parses the response result. If the response result shows that the service party returns an unknown status code or data format error and other information, it indicates that the service party has an abnormal response. The loan system needs to update the transaction status of the loan transaction in the outgoing table to the seventh transaction status. At the same time, the embodiment of the present invention provides a manual compensation mechanism. The loan system can access the service party through the abnormality investigation interface to determine the specific abnormal cause, so as to conduct abnormality investigation.
[0088] Figure 4 is a schematic diagram of an optional asynchronous interaction process of a loan transaction according to an embodiment of the present invention, such as Figure 4As shown, when the embodiment of the present invention processes the loan transaction, the loan system first initiates polling of the outgoing account table to obtain the transaction status of the loan transaction in the outgoing account table, obtains the loan transaction with the transaction status of the pending state 00, extracts the target loan data in the 00 state, first performs database lock control on the target loan data, then updates the transaction status of the 00 pending target loan data to the pending state 01, and then assembles the message to send to the payment system (or other service providers). The status is updated according to the return result of the service provider, and the return result includes returning to the final state and returning to the non-final state. The return to the final state includes two results: successful fund processing 03 and failed fund processing 04. The loan transactions in the 03 and 04 states are accounted for. The return to the non-final state includes three situations: funds processing 02, no response from the service provider 03, and abnormal response from the service provider 06. For the loan transaction that returns to the non-final state, the non-final state query continues. At the same time, a manual compensation mechanism is configured for the 05 and 06 states, and the service provider can be accessed through the abnormal investigation interface to perform abnormal investigation. The process of synchronous interaction between the loan system and the core system is similar to the above process.
[0089] The pseudo code for processing loan transactions in the embodiment of the present invention is represented as follows:
[0090] The polling processing logic starts:
[0091] Open transaction:
[0092] Try{
[0093] 1. Add database lock to the business:
[0094] Update the outgoing account table set the serial number field = the serial number field where the serial number = the outgoing account serial number to be loaned
[0095] 2. Check the business transaction status:
[0096] I f(Outgoing information transaction status = 01 or 02) {"Processing"; no further processing}
[0097] el se if (transaction status of outgoing information = 03) {"Funds processed successfully"; business processing}
[0098] el se if (outgoing information transaction status == 04) {"Fund processing failed"; business processing}
[0099] el se if (transaction status of outgoing information == 05 or 06) {"issue warning"}
[0100] el se if (outgoing information == 00) {
[0101] 3Send core or payment;
[0102] Business verification and message assembly;
[0103] Set the transaction status to pending sent 02 and submit the status data;
[0104] Sending service party;
[0105] 4. Result processing (only process the result):
[0106] I f (Service Response Result == Processing Success 03) {
[0107] Update transaction status to (Fund status processing 03)
[0108] }
[0109] el se if (service response result == processing failure 04) {
[0110] Update transaction status to (Fund status processing 04)
[0111] }
[0112] el se if (service response result == send no response 05) {
[0113] Update transaction status to (send no response 05)
[0114] }
[0115] el se if (service response result == send response exception 06) {
[0116] Update transaction status to (send response exception 06)
[0117] }
[0118] el se if (Service Response Result == Fund Status Processing 02) {
[0119] Update transaction status to (Fund status processing 02)
[0120] }
[0121] }catch(){
[0122] Things are rolled back;
[0123] throw an exception;
[0124] }
[0125] Through the above steps, the loan transactions in the out-of-account table are traversed, the loan transactions in the first transaction state are determined, and the loan data corresponding to the loan transactions in the first transaction state are obtained to obtain the target loan data, wherein the first transaction state indicates that the transaction state of the loan transaction is in a pending state, and then the transaction state of the loan transaction corresponding to the target loan data is updated to a second transaction state, wherein the second transaction state indicates that the transaction state of the loan transaction is in a pending state, and then the target loan data in the second transaction state is message assembled to obtain a request message, and the service party interface is called to send the request message to the service party, and the response result of the service party is obtained, and finally the transaction state of the loan transaction corresponding to the target loan data in the out-of-account table is updated based on the response result to obtain an updated out-of-account table.
[0126] In this embodiment, when processing loan transactions, the actual situation of the loan transactions in the out-of-account table is distinguished through the status lock, and the loan transactions in the to-be-sent and to-be-processed states are distinguished based on the first transaction status and the second transaction status, so as to avoid the problem of repeated sending caused by the failure of idempotent control due to the failure of the database lock, thereby achieving the technical effect of reducing the dependence on database performance and accurately controlling the idempotence of funds, thereby solving the technical problem in the related technology that when processing loan transactions, the interaction process is controlled by the database lock, the dependence on the database is too strong, and it is difficult to accurately control the idempotent logic in a high concurrency scenario.
[0127] The following is a detailed description in conjunction with another embodiment.
[0128] Embodiment 2
[0129] A loan transaction processing device provided in this embodiment includes multiple implementation units, each implementation unit corresponds to each implementation step in the above-mentioned embodiment 1. Its specific implementation method and beneficial effects can refer to the above-mentioned method embodiment and will not be repeated here.
[0130] Figure 5 is a schematic diagram of an optional loan transaction processing device according to an embodiment of the present invention, such as Figure 5 As shown, the processing device of the loan transaction may include: an acquisition unit 51, a first update unit 52, a sending unit 53, and a second update unit 54, wherein:
[0131] The acquisition unit 51 is used to traverse the loan transactions in the outgoing account table, determine the loan transactions in the first transaction state, and acquire the loan data corresponding to the loan transactions in the first transaction state to obtain the target loan data, wherein the first transaction state indicates that the transaction state of the loan transaction is in a waiting state;
[0132] A first updating unit 52 is used to update the transaction status of the loan transaction corresponding to the target loan data to a second transaction status, wherein the second transaction status indicates that the transaction status of the loan transaction is in a pending state;
[0133] The sending unit 53 is used to perform message assembly on the target loan data in the second transaction state to obtain a request message, and call the service provider interface to send the request message to the service provider, and obtain a response result of the service provider;
[0134] The second updating unit 54 is used to update the transaction status of the loan transaction corresponding to the target loan data in the outgoing account table based on the response result to obtain an updated outgoing account table.
[0135] The above-mentioned loan transaction processing device traverses the loan transactions in the out-of-account table through the acquisition unit 51, determines the loan transactions in the first transaction state, and obtains the loan data corresponding to the loan transactions in the first transaction state to obtain the target loan data, wherein the first transaction state indicates that the transaction state of the loan transaction is in a pending state; updates the transaction state of the loan transaction corresponding to the target loan data to a second transaction state through the first update unit 52, wherein the second transaction state indicates that the transaction state of the loan transaction is in a pending state; assembles the target loan data in the second transaction state through the sending unit 53 to obtain a request message, calls the service party interface to send the request message to the service party, and obtains the response result of the service party; updates the transaction state of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result through the second update unit 54 to obtain an updated out-of-account table.
[0136] In this embodiment, when processing loan transactions, the actual situation of the loan transactions in the out-of-account table is distinguished through the status lock, and the loan transactions in the to-be-sent and to-be-processed states are distinguished based on the first transaction status and the second transaction status, so as to avoid the problem of repeated sending caused by the failure of idempotent control due to the failure of the database lock, thereby achieving the technical effect of reducing the dependence on database performance and accurately controlling the idempotence of funds, thereby solving the technical problem in the related technology that when processing loan transactions, the interaction process is controlled by the database lock, the dependence on the database is too strong, and it is difficult to accurately control the idempotent logic in a high concurrency scenario.
[0137] Optionally, the loan transaction processing device further includes: a first control module, configured to perform database lock control on the target loan data to obtain the locked target loan data.
[0138] Optionally, the transaction status also includes at least: a third transaction status, a fourth transaction status, a fifth transaction status, a sixth transaction status, and a seventh transaction status, wherein the third transaction status indicates that the transaction status of the loan transaction is in a funds processing state, the fourth transaction status indicates that the transaction status of the loan transaction is in a funds processing success state, the fifth transaction status indicates that the transaction status of the loan transaction is in a funds processing failure state, the sixth transaction status indicates that the transaction status of the loan transaction is in an unresponsive state, and the seventh transaction status indicates that the transaction status of the loan transaction is in an abnormal response state.
[0139] Optionally, the second updating unit 54 includes: a first updating module, configured to update the transaction status of the loan transaction in the outgoing table to a third transaction status when the response result indicates that the loan transaction is in funds processing.
[0140] Optionally, the second update unit 54 also includes: a second update module, which is used to update the transaction status of the loan transaction in the outgoing table to a fourth transaction status when the response result indicates that the loan transaction is in the process of successful fund processing; and a first accounting module, which is used to perform accounting processing on the loan transaction based on the response result and the fourth transaction status.
[0141] Optionally, the second update unit 54 also includes: a third update module, which is used to update the transaction status of the loan transaction in the outgoing table to the fifth transaction status when the response result indicates that the loan transaction is in a funds processing failure; and a second accounting module, which is used to perform accounting processing on the loan transaction based on the response result and the fifth transaction status.
[0142] Optionally, the second update unit 54 also includes: a fourth update module, which is used to update the transaction status of the loan transaction in the outgoing table to the sixth transaction status when no response result is received from the service party within a preset time period; and a first troubleshooting module, which is used to call the abnormality troubleshooting interface and perform abnormality troubleshooting on the loan transaction in the sixth transaction status through the abnormality troubleshooting interface.
[0143] Optionally, the second update unit 54 also includes: a fifth update module, which is used to update the transaction status of the loan transaction in the outgoing table to the seventh transaction status when the response result indicates that the service party responds abnormally; and a second troubleshooting module, which is used to call the abnormality troubleshooting interface to perform abnormality troubleshooting on the loan transaction in the seventh transaction status through the abnormality troubleshooting interface.
[0144] The above-mentioned loan transaction processing device may also include a processor and a memory. The above-mentioned acquisition unit 51, first update unit 52, sending unit 53, second update unit 54, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0145] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the loan transaction can be processed by adjusting kernel parameters.
[0146] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (fl ash RAM), and the memory includes at least one storage chip.
[0147] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned loan transaction processing methods.
[0148] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned loan transaction processing methods.
[0149] According to another aspect of an embodiment of the present invention, a computer program product is provided. The computer program product includes a computer program, wherein when the computer program is executed by a processor, any one of the above-mentioned loan transaction processing methods is implemented.
[0150] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: traversing the loan transactions in an out-of-pocket table, determining the loan transactions in a first transaction state, and obtaining loan data corresponding to the loan transactions in the first transaction state to obtain target loan data, wherein the first transaction state indicates that the transaction state of the loan transaction is in a pending state; updating the transaction state of the loan transaction corresponding to the target loan data to a second transaction state, wherein the second transaction state indicates that the transaction state of the loan transaction is in a pending state; assembling the target loan data in the second transaction state into a message to obtain a request message, and calling a service provider interface to send the request message to the service provider, and obtaining a response result from the service provider; updating the transaction state of the loan transaction corresponding to the target loan data in the out-of-pocket table based on the response result to obtain an updated out-of-pocket table.
[0151] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: after obtaining the target loan data, it also includes: performing database lock control on the target loan data to obtain the locked target loan data.
[0152] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program initialized with the following method steps: the transaction status also includes at least: a third transaction status, a fourth transaction status, a fifth transaction status, a sixth transaction status, and a seventh transaction status, wherein the third transaction status indicates that the transaction status of the loan transaction is in a funds processing state, the fourth transaction status indicates that the transaction status of the loan transaction is in a funds processing success state, the fifth transaction status indicates that the transaction status of the loan transaction is in a funds processing failure state, the sixth transaction status indicates that the transaction status of the loan transaction is in an unresponsive state, and the seventh transaction status indicates that the transaction status of the loan transaction is in an abnormal response state.
[0153] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-pocket table based on the response result includes: when the response result indicates that the loan transaction is in funds processing, updating the transaction status of the loan transaction in the out-of-pocket table to a third transaction status.
[0154] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result also includes: when the response result indicates that the loan transaction is in the process of successful fund processing, updating the transaction status of the loan transaction in the out-of-account table to a fourth transaction status; and accounting processing of the loan transaction based on the response result and the fourth transaction status.
[0155] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result also includes: when the response result indicates that the loan transaction is in a funds processing failure, updating the transaction status of the loan transaction in the out-of-account table to a fifth transaction status; and accounting processing of the loan transaction based on the response result and the fifth transaction status.
[0156] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result also includes: if no response result is received from the service party within a preset time period, updating the transaction status of the loan transaction in the out-of-account table to a sixth transaction status; calling an exception troubleshooting interface, and performing an exception troubleshooting on the loan transaction in the sixth transaction status through the exception troubleshooting interface.
[0157] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: the step of updating the transaction status of the loan transaction corresponding to the target loan data in the out-of-account table based on the response result also includes: when the response result indicates that the service party responds abnormally, updating the transaction status of the loan transaction in the out-of-account table to the seventh transaction status; calling the exception troubleshooting interface, and performing an exception troubleshooting on the loan transaction in the seventh transaction status through the exception troubleshooting interface.
[0158] Figure 6 1 is a hardware structure block diagram of an electronic device (or mobile device) for processing a loan transaction according to an embodiment of the present invention. Figure 6 As shown, the electronic device may include one or more ( Figure 6 602a, 602b, ..., 602n are used to illustrate) a processor (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 604 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 6 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 6 More or fewer components as shown, or with Figure 6 Different configurations are shown.
[0159] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0160] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0161] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0162] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0163] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0164] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0165] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing loan affairs, characterized in that: include: Traversing the loan transactions in the outgoing account table, determining the loan transactions in the first transaction state, and acquiring the loan data corresponding to the loan transactions in the first transaction state to obtain the target loan data, wherein the first transaction state indicates that the transaction state of the loan transaction is in a waiting-to-be-sent state; updating the transaction status of the loan transaction corresponding to the target loan data to a second transaction status, wherein the second transaction status indicates that the transaction status of the loan transaction is in a pending state; Perform message assembly on the target loan data in the second transaction state to obtain a request message, call the service provider interface to send the request message to the service provider, and obtain a response result from the service provider; Based on the response result, the transaction status of the loan transaction corresponding to the target loan data in the outgoing account table is updated to obtain the updated outgoing account table.
2. The processing method according to claim 1, characterized in that: After obtaining the target loan data, it also includes: The target loan data is subjected to database lock control to obtain the locked target loan data.
3. The processing method according to claim 1, characterized in that: The transaction status at least includes: a third transaction status, a fourth transaction status, a fifth transaction status, a sixth transaction status, and a seventh transaction status, wherein the third transaction status indicates that the transaction status of the loan transaction is in a funds processing state, the fourth transaction status indicates that the transaction status of the loan transaction is in a funds processing success state, the fifth transaction status indicates that the transaction status of the loan transaction is in a funds processing failure state, the sixth transaction status indicates that the transaction status of the loan transaction is in an unresponsive state, and the seventh transaction status indicates that the transaction status of the loan transaction is in an abnormal response state.
4. The processing method according to claim 3, characterized in that: The step of updating the transaction status of the loan transaction corresponding to the target loan data in the outgoing account table based on the response result includes: When the response result indicates that the loan transaction is in fund processing, the transaction status of the loan transaction in the outgoing table is updated to a third transaction status.
5. The processing method according to claim 3, characterized in that: The step of updating the transaction status of the loan transaction corresponding to the target loan data in the outgoing account table based on the response result also includes: When the response result indicates that the loan transaction is in the process of successful fund processing, updating the transaction status of the loan transaction in the outgoing account table to a fourth transaction status; The loan transaction is accounted for based on the response result and the fourth transaction status.
6. The processing method according to claim 3, characterized in that: The step of updating the transaction status of the loan transaction corresponding to the target loan data in the outgoing account table based on the response result also includes: When the response result indicates that the loan transaction is in a state of fund processing failure, updating the transaction status of the loan transaction in the outgoing account table to a fifth transaction status; The loan transaction is accounted for based on the response result and the fifth transaction status.
7. The processing method according to claim 3, characterized in that: The step of updating the transaction status of the loan transaction corresponding to the target loan data in the outgoing account table based on the response result also includes: If no response result is received from the service provider within a preset time period, updating the transaction status of the loan transaction in the outgoing account table to a sixth transaction status; An exception checking interface is called to perform an exception checking on the loan transaction in the sixth transaction state through the exception checking interface.
8. The processing method according to claim 3, characterized in that: The step of updating the transaction status of the loan transaction corresponding to the target loan data in the outgoing account table based on the response result also includes: When the response result indicates that the service provider responds abnormally, updating the transaction status of the loan transaction in the outgoing account table to the seventh transaction status; An exception checking interface is called to perform an exception checking on the loan transaction in the seventh transaction state through the exception checking interface.
9. A device for processing loan affairs, characterized in that: include: an acquisition unit, configured to traverse the loan transactions in the out-of-account table, determine the loan transactions in a first transaction state, and acquire loan data corresponding to the loan transactions in the first transaction state to obtain target loan data, wherein the first transaction state indicates that the transaction state of the loan transaction is in a waiting-to-be-sent state; A first updating unit, configured to update the transaction status of the loan transaction corresponding to the target loan data to a second transaction status, wherein the second transaction status indicates that the transaction status of the loan transaction is in a pending state; A sending unit, configured to perform message assembly on the target loan data in the second transaction state to obtain a request message, and call a service provider interface to send the request message to the service provider, and obtain a response result of the service provider; The second updating unit is used to update the transaction status of the loan transaction corresponding to the target loan data in the outgoing account table based on the response result to obtain the updated outgoing account table.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing loan transactions as described in any one of claims 1 to 8.