Accounting idempotent anti-duplication method, device and equipment, medium and product

By determining the processing plan based on the business key value and technical key value of payment request in financial technology scenarios, the payment process or idempotent anti-duty process is initiated, the problem of repeated payment in online consumption is solved, and payment security and user experience are improved.

CN119809636AActive Publication Date: 2025-04-11INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Application Number
CN202411858817.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

The problem of repeated payments may occur in online consumption in the financial technology scenario, resulting in additional logistics costs, transaction negotiations and return operation costs, affecting merchant reputation and user experience.

Method used

When receiving a payment request for the service to be paid, the processing plan is determined based on the service key value and technical key value in the payment request, and the payment process or idempotent anti-duplication process is initiated to avoid repeated payments.

Benefits of technology

It effectively avoids the repeated payment problems caused by the payment system responding to multiple payment requests, ensures the security of payment work, and visualizes the payment results, improving the payment experience of the payment requester.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119809636A_ABST
    Figure CN119809636A_ABST
Patent Text Reader

Abstract

The invention discloses an idempotent anti-duplication method, device and equipment for accounting, a medium and a product, and relates to a data processing technology in the financial science and technology field, and the method comprises the steps: determining a processing scheme corresponding to a payment request based on a service key value and a technology key value in the payment request when the payment request of a to-be-paid service is received, the processing scheme is a first processing scheme or a second processing scheme, the first processing scheme is used for starting a payment process, and the second processing scheme is used for starting an idempotent anti-duplication process; based on the first processing scheme or the second processing scheme, starting a payment process or an idempotent anti-duplication process, and processing a service key value and a technical key value of the payment request to obtain a payment result of the to-be-paid service; and controlling the information interaction interface to display the payment result. The problem of repeated payment due to the fact that the payment system responds to multiple payment requests can be avoided, the safety of payment work is ensured, and the payment experience of a payment requester is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to data processing technology in the field of financial technology, and in particular to an idempotent anti-duplication method, device, equipment, medium and product for accounting. Background Art

[0002] With the popularization of electronic transactions and economic development, more and more users are shopping online through mobile terminals, and online shopping has become an important form of shopping.

[0003] Online consumption in the financial technology scenario generally includes two processes: ordering and payment. In the payment process, the problem of duplicate payment may occur, which will bring additional logistics costs, purchase and sale negotiations, and return operation costs, which will greatly affect the reputation of merchants and user experience. The causes of duplicate payment include: 1) Customer misoperation, for example, after clicking the order button, before receiving the payment information returned by the backend, the order button is not disabled and the order status cannot be checked, causing the user to click the order button repeatedly. 2) The payment channel returns a timeout. For example, the user clicks a payment method on the cashier page and completes the payment on the corresponding payment channel, but the channel returns an asynchronous notification timeout, the payment status of the payment system has not been updated, and the user is unclear whether the order has been paid successfully, which leads to multiple payments. Users may make duplicate payments due to network fluctuations or information delays, and some lawless elements may make duplicate payments through some means, thereby causing losses to merchants or users. Therefore, how to accurately prevent duplicate payments and ensure the security of payment work is an urgent problem to be solved. Summary of the invention

[0004] The present invention provides an idempotent anti-duplicate method, device, equipment, medium and product for accounts, which can avoid the problem of repeated payment caused by the payment system responding to multiple payment requests, ensure the security of payment work, and also visualize the payment results, so that the payment requester can timely understand the payment status of the business to be paid, thereby improving the payment experience of the payment requester.

[0005] According to one aspect of the present invention, an idempotent anti-duplicate method for accounts is provided, the method comprising:

[0006] When receiving a payment request for a service to be paid, determining a processing scheme corresponding to the payment request based on the service key value and the technical key value included in the payment request, wherein the processing scheme is a first processing scheme or a second processing scheme, the first processing scheme is used to start the payment process, and the second processing scheme is used to start the idempotent anti-duplicate process;

[0007] Based on the first processing scheme or the second processing scheme, a payment process or an idempotent anti-duplicate process is started, the business key value and the technical key value of the payment request are processed, and a payment result of the to-be-paid business is obtained;

[0008] Control the information interaction interface and display the payment results.

[0009] According to another aspect of the present invention, an idempotent anti-duplication device for accounts is provided. The idempotent anti-duplication device for accounts is used to implement the idempotent anti-duplication method for accounts in any embodiment of the present invention. The device includes:

[0010] An information acquisition module, configured to determine, upon receiving a payment request for a service to be paid, a processing scheme corresponding to the payment request based on a service key value and a technical key value included in the payment request, wherein the processing scheme is a first processing scheme or a second processing scheme, the first processing scheme is used to start a payment process, and the second processing scheme is used to start an idempotent anti-duplicate process;

[0011] The interface scoring module is used to start the payment process or the idempotent anti-duplicate process based on the first processing scheme or the second processing scheme, process the business key value and the technical key value of the payment request, and obtain the payment result of the business to be paid;

[0012] The conclusion determination module is used to control the information interaction interface and display the payment results.

[0013] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0014] at least one processor; and a memory communicatively coupled to the at least one processor;

[0015] The memory stores a computer program executable by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the idempotent anti-duplication method for accounts in any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a processor to implement the idempotent anti-duplication method for accounts in any embodiment of the present invention when executed.

[0017] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the idempotent anti-duplication method for accounts according to any embodiment of the present invention is implemented.

[0018] The idempotent anti-duplicate method of the account of the present invention comprises: when receiving a payment request of a business to be paid, determining a processing scheme corresponding to the payment request based on the business key value and the technical key value included in the payment request, wherein the processing scheme is a first processing scheme or a second processing scheme, the first processing scheme is used to start the payment process, and the second processing scheme is used to start the idempotent anti-duplicate process; based on the first processing scheme or the second processing scheme, starting the payment process or the idempotent anti-duplicate process, processing the business key value and the technical key value of the payment request, and obtaining the payment result of the business to be paid; controlling the information interaction interface, and displaying the payment result. The present invention determines whether the payment request is the first trigger through the business key value and the technical key value of the payment request of the business to be paid, if it is the first trigger, the payment process is started, and if it is the second trigger, the idempotent anti-duplicate process is started, avoiding the problem of repeated payment caused by the payment system responding to multiple payment requests, ensuring the security of the payment work, and visually displaying the payment result, so that the payment requester can timely understand the payment situation of the business to be paid, and improve the payment experience of the payment requester.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0021] Figure 1 It is a flow chart of an idempotent anti-duplicate method for accounts provided by the present invention;

[0022] Figure 2 It is a schematic diagram of a payment process provided by the present invention;

[0023] Figure 3 It is a structural schematic diagram of an idempotent anti-duplicate device for accounts provided by the present invention;

[0024] Figure 4 It is a structural schematic diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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.

[0026] It should be noted that the terms "first", "second", "initial", "intermediate", "candidate", "target", 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 interchangeable 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.

[0027] Figure 1 This is a flowchart of an idempotent anti-duplicate method for accounts provided by the present invention. This embodiment can be applied to avoid duplicate payment problems, improve the security of payment systems, etc. The method can be executed by the idempotent anti-duplicate device for accounts provided by the present invention. The device can be implemented in the form of hardware and / or software. In a specific embodiment, the device can be integrated in an electronic device. The following embodiments will be described by taking the device integrated in an electronic device as an example. Figure 1 , the method specifically comprises the following steps:

[0028] S101: When a payment request for a service to be paid is received, a processing scheme corresponding to the payment request is determined based on the service key value and the technical key value included in the payment request.

[0029] Among them, the pending payment business can be understood as an order that needs to be paid, for example, a payment order generated after a purchase instruction is issued, a payment order generated after a payment instruction is issued, etc. The payment request can be understood as a payment instruction for the pending payment business, which is used to indicate that the user is currently inclined to pay to complete the order. The business key and the technical key can be understood as two key information contained in the order. The business key is the business information of the order, including but not limited to the order number and order generation time of the order. The technical key can be understood as the technical information of the order, including but not limited to the order type and order amount of the order. The two types of information work together to determine the processing plan for the payment request.

[0030] In order to prevent the problem of duplicate payment for the same order, the present invention will parse the payment request to determine whether the payment request is the first payment instruction for the business to be paid. Different order payment processes are formulated for different types of payment requests. For example, for the first payment instruction, the normal payment process can be directly triggered. For the second payment instruction, it is necessary to determine whether the corresponding business has been successfully paid, that is, to trigger the payment anti-duplicate process. The purpose of this setting is to reduce the probability of duplicate payments on the basis of ensuring the smooth execution of payment work.

[0031] The processing scheme of the present invention is a first processing scheme or a second processing scheme. The first processing scheme is used to start the payment process, and the second processing scheme is used to start the idempotent anti-duplicate process.

[0032] In one embodiment, S101 may specifically include: upon receiving a payment request for a business to be paid, determining a historical payment business set, wherein the historical payment business set includes at least one historical payment business, and the historical payment business includes a historical business key value and a historical technical key value; determining whether there is a matching payment business for the business to be paid in the historical payment business set, wherein the matching payment business is a payment business in the historical payment business set whose historical business key value is the same as the business key value of the business to be paid and / or whose historical technical key value is the same as the technical key value of the business to be paid; if there is no matching payment business for the business to be paid in the historical payment business set, determining that the processing solution is the first processing solution; if there is a matching payment business for the business to be paid in the historical payment business set, determining that the processing solution is the second processing solution.

[0033] Among them, the historical payment business set can be understood as all payment logs within the data processing period, including each payment business and detailed payment information of each payment business (payment success, payment in progress, payment failure, etc.), which is used to determine whether the payment request of the current business to be paid is the first payment instruction and quickly determine the payment result of the business corresponding to the second payment instruction. The matching payment business and its historical business key value and the historical business key value are used to indicate the historical payment information of the business to be paid. Once the business key value or technical key value of the business to be paid is the same as a business in the historical payment business set, that is, the business to be paid has found a matching payment business in the historical payment business set, it proves that the business to be paid has a payment record, and idempotent anti-duplicate is required to avoid repeated payment, and the processing solution is determined to be the second processing solution. If the business key value or technical key value of the business to be paid is not recorded in the historical payment business set, that is, the business to be paid has not found a matching payment business in the historical payment business set, it proves that the business to be paid has no payment record, and the payment process can be directly triggered, and there will be no problem of repeated payment, and the processing solution is determined to be the first processing solution.

[0034] For example, assuming that the historical payment business set includes 3 businesses, the historical business key value of historical payment business 1 is A1, the historical technical key value is B1, the historical business key value of historical payment business 2 is A2, the historical technical key value is B2, the historical business key value of historical payment business 3 is A3, and the historical technical key value is B3. If the business key value of the business to be paid is A4, A5, etc., which are different from A1, A2, and A3, and the technical key value is B4, B5, etc., which are different from B1, B2, and B3, then it is considered that there is no matching payment business for the business to be paid in the historical payment business set, and the payment request for the business to be paid is triggered for the first time, and the processing scheme is the first processing scheme. If the business key value of the business to be paid is any one of A1, A2, and A3 and / or the technical key value is any one of B1, B2, and B3, then it is considered that there is a matching payment business for the business to be paid in the historical payment business set, and idempotent anti-duplicate processing is required. The processing scheme is the second processing scheme, and the historical payment business with the same technical key value and / or the same business key value as the business to be paid is determined to be the matching payment business.

[0035] The advantage of this setting is that it can quickly, efficiently and specifically determine the processing flow of the business to be paid, ensuring the security and real-time nature of the account payment results.

[0036] Furthermore, the same key values ​​include the same technical key values, the same business key values, and the same technical key values ​​and business key values. The three situations can be divided into two situations according to the same business key values ​​and different business key values. In order to improve the efficiency of idempotent anti-duplicate work, the present invention sets different idempotent anti-duplicate schemes for different situations. Specifically, the second processing scheme includes a business idempotent processing scheme and a technical idempotent processing scheme. Determining the second processing scheme includes: determining whether the historical business key value of the matching payment business is the same as the business key value of the business to be paid; if the historical business key value of the matching payment business is the same as the business key value of the business to be paid, then determining that the second processing scheme is a business idempotent processing scheme; if the historical business key value of the matching payment business is not the same as the business key value of the business to be paid, then determining that the second processing scheme is a technical idempotent processing scheme.

[0037] Among them, the business idempotent processing scheme is used to indicate that the current payment request of the pending payment service is a request with a repeated business key value, and business idempotent processing is required, and the technical idempotent processing scheme is used to indicate that the current payment request of the pending payment service is a request with a repeated technical key value, and technical idempotent processing is required. The advantage of this setting is that the processing method of the re-payment request is refined and classified according to the type of the re-payment request, which can better and more targetedly determine the payment results of each payment request of the pending payment service.

[0038] S102: Based on the first processing scheme or the second processing scheme, start the payment process or the idempotent anti-duplicate process, process the business key value and the technical key value of the payment request, and obtain the payment result of the business to be paid.

[0039] Among them, the first processing scheme and the second processing scheme are different processing procedures set for different types of payment requests, which are used to perform global anti-duplicate and global idempotency of accounts under a distributed architecture. The first processing scheme corresponds to the payment process, and the second processing scheme corresponds to the idempotent anti-duplicate process. Specifically, the payment process is used to indicate that the business to be paid is the first payment work, and the payment result obtained by executing the process is the first payment result; the idempotent anti-duplicate process is used to indicate that the business to be paid is the second payment work, and the payment result obtained by executing the process is the second payment result.

[0040] Exemplarily, when the processing scheme is the first processing scheme, the payment process is started, the payment process of the business to be paid is executed according to the business key value and the technical key value of the payment request, and the first payment result is determined according to the payment situation. For example, if the payment process is successfully executed, the first payment result is determined to be a successful payment, and if the payment process fails, the first payment result is determined to be a payment failure. When the processing scheme is the second processing scheme, the idempotent anti-duplicate process is started, and the anti-duplicate payment process of the business to be paid is executed according to the historical payment situation (which can be understood as at least one first payment result of the business to be paid), the business key value and the technical key value of the payment request, and the second payment result is determined according to the payment situation. It is worth noting that the same business can only be successfully paid once, and the process of determining the second payment result is to determine whether the first payment result is successful. If the first payment result is a successful payment, it is determined that the payment of the business to be paid has been completed, and the second payment result is a failure. If the first payment result is a payment failure, the payment process is continued to be executed using the business key value and the technical key value, and the second payment result is determined according to the payment situation. Similarly, when the payment process is successfully executed, the second payment result is determined to be a successful payment, and when the payment process fails, the second payment result is determined to be a payment failure. The advantage of this setting is that it can effectively avoid the problem of duplicate payment.

[0041] In one embodiment, based on a first processing scheme, a payment process is initiated, the business key value and the technical key value of the payment request are processed, and the payment result of the business to be paid is obtained, including: generating a first payment instruction based on the business key value and the technical key value of the payment request, sending the first payment instruction to an accounting processing device, and receiving first payment feedback information from the accounting processing device; based on the first payment feedback information, determining a first payment result of the business to be paid.

[0042] The first payment instruction can be understood as an instruction carrying payment request information of the business to be paid, the account processing device can be understood as an account accounting or payment server, the first payment feedback information can be understood as the account processing device responding to the first payment instruction, and obtaining a payment conclusion of the business to be paid after processing the payment request information carried in the first payment instruction, and the payment result application indicates the payment result of the business to be paid. For example, the payment conclusion can be the execution status of the business key value, the execution status of the technical key value, and the execution status of the business key value and the execution status of the technical key value are used to determine the payment result of the business to be paid.

[0043] Specifically, when the first payment feedback information indicates that the business key and technical key of the payment request are executed successfully, the first payment result is determined to be a successful payment; when the first payment feedback information indicates that the business key and technical key of the payment request are executed unsuccessfully, the first payment result is determined to be a failed payment; when the first payment feedback information indicates that the execution status of the business key and technical key of the payment request is in an unknown state, the first payment result is determined to be a payment in progress state. The advantage of such a setting is that the payment result of the business to be paid can be obtained accurately and specifically.

[0044] Furthermore, before generating the first payment instruction based on the business key value and technical key value of the payment request, the key value information of the technical key value of the payment request is written into the database, and the key value information of the business key value of the payment request is written into the distributed cache device and the database; after obtaining the first payment result of the business to be paid, the key value information of the distributed cache device and the database is adjusted based on the first payment result; wherein the key value information is used to determine the payment result of the re-payment work, and when the first payment result is a successful payment, the key value information in the distributed cache device and the database is updated based on the first payment result, that is, the key value information of the business key value in the distributed cache device is updated to success, and the key value information of the business key value and the technical key value in the database is updated to success, and the key value information in the database can be understood as anti-duplicate details; when the first payment result is a payment failure, the key value information in the distributed cache device is deleted and the key value information in the database is updated, that is, the information of the business key value in the distributed cache device and the database is deleted, and the technical key value is updated to failure. Such a setting will not affect subsequent payment work and will also leave a complete payment record, thereby ensuring the traceability of transaction data.

[0045] In another embodiment, based on the second processing scheme, an idempotent anti-duplicate process is started, and the business key value and technical key value of the payment request are processed to obtain the payment result of the business to be paid, including: when the second processing scheme is a technical idempotent processing scheme, determining that the second payment result is a business rejection; when the second processing scheme is a business idempotent processing scheme, determining whether the historical technical key value of the matching payment business is the same as the technical key value of the business to be paid; if the historical technical key value of the matching payment business is the same as the technical key value of the business to be paid, then determining that the second payment result is the payment result of the matching payment business, that is, the payment result of the idempotent first payment; if the historical technical key value of the matching payment business is different from the technical key value of the business to be paid, then determining whether the payment result of the matching payment business is a payment failure; when the payment result of the matching payment business is not a payment failure, determining that the second payment result is a payment failure, and returning the transaction identification information of the business to be paid, when the payment result of the matching payment business is a payment failure, generating a second payment instruction based on the business key value and technical key value of the payment request, sending the second payment instruction to the account processing device, and determining the second payment result based on the second payment feedback information of the account processing device.

[0046] Similarly, the second payment instruction is an instruction that carries the payment request information of the business to be paid, the second payment feedback information is the payment conclusion of the business to be paid obtained by the account processing device in response to the second payment instruction and after processing the payment request information carried in the second payment instruction, and the payment result application indicates the payment result of the business to be paid. Specifically, when the first payment result is successful, in order to avoid the problem of repeated payment, the second payment result fails. When the first payment result fails, the technical key value and business key value in the second payment request are used to continue the payment work, and the second payment result is determined according to the information fed back by the account processing device.

[0047] Table 1 shows the payment status relationship, indicating the corresponding relationship between payment results and payment request and other information. The transaction scenario is used to indicate whether the payment request is submitted for the first time. The business key indicates the business key value, the technical key indicates the technical key value, the execution status is the execution status of the business key value and the technical key value, the execution result is the payment result, the database indicates the conclusion stored in the database, the slash indicates that the execution result is not written to the database, the written information can be understood as anti-duplicate details, and the serial number can be understood as key value information. Table 1 distinguishes between resubmission and secondary submission. In fact, the secondary submission can also follow the resubmission process, and the present invention does not limit this.

[0048] Table 1 Payment status relationship

[0049]

[0050]

[0051] The main contents of Table 1 are as follows: when making the first payment, the payment result is determined according to the execution status of A1 and B1. When making the second payment, the payment result of the second payment is determined in combination with the key value information and the first payment result. If the key value information is A1 and B1, the first payment result is directly fed back. If the key value information is A2 and B1, the payment is rejected. If the key value information is A1 and B2, it is first determined whether A1 and B1 fail. When A1 and B1 succeed, it is directly determined that A1 and B2 fail. Only when A1 and B1 fail will A1 and B2 be used to continue the payment process, and the payment result is determined according to the execution status of A1 and B2.

[0052] The distributed cache device of the present invention can be a REDIS (an in-memory data structure storage database) cache, connecting multiple distributed systems to achieve the purpose of data transfer and caching, and realize the global idempotence and anti-duplicate of accounts under distributed systems. The advantages of adopting this design are: 1) Solving the anti-duplicate protection problem under distributed architecture. When the REDIS cache fails, the local anti-duplicate of the database can be used to ensure the availability of anti-duplicate. 2) Solving the global anti-duplicate problem under distributed architecture, anti-duplicate filtering of payment services based on the REDIS distributed cache can improve the performance of business processing and reduce database pressure.

[0053] S103, control the information interaction interface to display the payment result.

[0054] Specifically, the information interaction interface can be understood as an information display screen. The purpose of controlling the information interaction interface to display the payment results is to visualize the payment results, so that the payer can understand the payment status of the business to be paid and take corresponding processing measures in a timely manner.

[0055] It is worth noting that if the payment result is payment failure, the information interaction interface can also be controlled to display the reason for payment failure, so that the payer can adjust the payment request or the business parameters of the business to be paid. For example, if the displayed amount is too large, it can be paid in batches. If the balance is insufficient, the payer can be prompted to start the payment process after resolving the balance problem.

[0056] The technical solution of this embodiment determines whether the payment request is triggered for the first time through the payment request business key value and technical key value of the business to be paid. If it is triggered for the first time, the payment process is started. If it is triggered for the second time, the idempotent anti-duplicate process is started to avoid the problem of repeated payments caused by the payment system responding to multiple payment requests, ensure the security of the payment work, and visualize the payment results, so that the payment requester can understand the payment status of the business to be paid in time, thereby improving the payment experience of the payment requester.

[0057] Figure 2 is a schematic diagram of a payment process provided by the present invention, Figure 2 Is a complete business payment process, such as Figure 2As shown in the figure, the payment process mainly includes:

[0058] 1. The product server sends a payment instruction to the payment server.

[0059] The essence of this step is to send the payer's payment demand to the payment service. The payment instruction is essentially the business key and technical key of the business to be paid.

[0060] 2. The payment service writes the business key value into the distributed cache.

[0061] 3. The distributed cache feeds back the writing status of the business key value to the payment business.

[0062] Figure 2 The writing status of the business key value is successful.

[0063] 4. The payment service writes the business key and technical key into the database.

[0064] 5. The database feeds back the writing status of technical key values ​​and business key values ​​to the payment service.

[0065] Similarly, Figure 2 The writing status of the technical key value and business key value is successful.

[0066] 6. The payment service sends payment instructions to the core accounting service.

[0067] 7. The core accounting service sends the payment conclusion to the payment service.

[0068] The payment conclusion refers to whether the payment is successful.

[0069] 8. The payment service updates / deletes the key value information of the distributed cache based on the payment conclusion.

[0070] Specifically, when the payment is successful, the key value information of the distributed cache is updated, and when the payment fails, the key value information of the distributed cache is deleted.

[0071] 9. The distributed cache sends the key-value information to the payment service.

[0072] 10. The payment service updates / deletes the key value information in the database based on the payment conclusion.

[0073] Specifically, when the payment is successful, the key value information of the distributed cache is updated, and when the payment fails, the key value information of the distributed cache is deleted. It is worth noting that the transaction details status in the database will be updated regardless of success or failure.

[0074] 11. The database sends the key-value information to the payment service.

[0075] 12. Payment service product and service feedback payment results.

[0076] Specifically, the feedback of payment results can be understood as a visual display of the payment results, which is convenient for the payer to understand the payment status of the pending payment business.

[0077] The beneficial effects of the present invention include: 1) Supporting service idempotence. Specifically, for payment data submitted repeatedly, the original data processing result is returned by default, and the response data is displayed to indicate that the data has been processed. In addition, when it is judged that it is an idempotent request, the consistency of the business elements will be checked. If the business elements are inconsistent, the transaction will be rejected, and the user will be reminded to check the business elements to prevent accounting risks. 2) Global anti-duplicate is performed based on REDIS cache. Specifically, if the insertion of the global anti-duplicate key value fails, the abnormal return message is encapsulated. If the payment fails, the global business anti-duplicate key value is deleted for subsequent retry. If successful or unknown, the global business anti-duplicate is not deleted, and the original transaction processing result is returned idempotently. 3) Database anti-duplicate is implemented based on the business anti-duplicate table. Ensure that the system can route the same transaction to the same database shard according to the business flow. In the same shard, it can be determined whether it is the same business according to the primary key of the business anti-duplicate table. If it is the same business and the payment status is unknown or successful, the idempotent returns the original processing result. 4) Support service failure redo. Specifically, for failed payment services, the business flow remains unchanged, and it supports replacing the technical flow and re-initiating. When the system determines that the original transaction has failed, the payment process can be continued to avoid duplicate payments while ensuring the payment quality of the business.

[0078] Figure 3 Schematic diagram of the structure of an idempotent anti-duplicate device for accounts provided by the present invention. Figure 3 As shown, the device includes: a solution determination module 201, a result determination module 202 and a result display module 203.

[0079] The solution determination module 201 is used to determine the processing solution corresponding to the payment request based on the business key value and technical key value included in the payment request when receiving the payment request for the service to be paid, wherein the processing solution is the first processing solution or the second processing solution, the first processing solution is used to start the payment process, and the second processing solution is used to start the idempotent anti-duplicate process.

[0080] The result determination module 202 is used to start the payment process or the idempotent anti-duplicate process based on the first processing scheme or the second processing scheme, process the business key value and the technical key value of the payment request, and obtain the payment result of the to-be-paid business.

[0081] The result display module 203 is used to control the information interaction interface and display the payment results.

[0082] Optionally, the solution determination module 201 is specifically used to determine a historical payment business set, wherein the historical payment business set includes at least one historical payment business, and the historical payment business includes a historical business key value and a historical technical key value; determine whether there is a matching payment business for the business to be paid in the historical payment business set, wherein the matching payment business is a payment business in which the historical business key value in the historical payment business set is the same as the business key value of the business to be paid and / or the historical technical key value is the same as the technical key value of the business to be paid; if there is no matching payment business for the business to be paid in the historical payment business set, determine that the processing solution is the first processing solution; if there is a matching payment business for the business to be paid in the historical payment business set, determine that the processing solution is the second processing solution.

[0083] Optionally, the second processing scheme includes a business idempotent processing scheme and a technical idempotent processing scheme. The scheme determination module 201 is specifically used to determine whether the historical business key value of the matching payment business is the same as the business key value of the business to be paid; if the historical business key value of the matching payment business is the same as the business key value of the business to be paid, the second processing scheme is determined to be a business idempotent processing scheme; if the historical business key value of the matching payment business is not the same as the business key value of the business to be paid, the second processing scheme is determined to be a technical idempotent processing scheme.

[0084] Optionally, the payment process is used to indicate that the business to be paid is a first payment operation, and the payment result is a first payment result. The result determination module 202 is specifically used to generate a first payment instruction based on the business key value and the technical key value of the payment request, send the first payment instruction to the account processing device, and receive first payment feedback information from the account processing device; based on the first payment feedback information, determine the first payment result of the business to be paid; wherein, when the first payment feedback information indicates that the business key value and the technical key value of the payment request are executed successfully, the first payment result is determined to be a successful payment; when the first payment feedback information indicates that the business key value and the technical key value of the payment request fail to execute, the first payment result is determined to be a failed payment; when the first payment feedback information indicates that the execution status of the business key value and the technical key value of the payment request is in an unknown state, the first payment result is determined to be a payment in progress state.

[0085] Optionally, the result determination module 202 is also used to write the key value information of the technical key value of the payment request into the database, and write the key value information of the business key value of the payment request into the distributed cache device and the database before generating the first payment instruction based on the business key value and the technical key value of the payment request; after obtaining the first payment result of the business to be paid, adjust the key value information of the distributed cache device and the database based on the first payment result; wherein the key value information is used to determine the payment result of the re-payment work, and when the first payment result is a successful payment, the key value information in the distributed cache device and the database is updated based on the first payment result; when the first payment result is a failed payment, the key value information in the distributed cache device is deleted and the key value information in the database is updated.

[0086] Optionally, the idempotent anti-duplicate process is used to indicate that the business to be paid is a re-payment job, and the payment result is a second payment result. The result determination module 202 is specifically used to determine that the second payment result is a business rejection when the second processing scheme is a technical idempotent processing scheme; when the second processing scheme is a business idempotent processing scheme, determine whether the historical technical key value of the matching payment business is the same as the technical key value of the business to be paid; if the historical technical key value of the matching payment business is the same as the technical key value of the business to be paid, determine that the second payment result is the payment result of the matching payment business; if the historical technical key value of the matching payment business is not the same as the technical key value of the business to be paid, determine whether the payment result of the matching payment business is a payment failure; when the payment result of the matching payment business is not a payment failure, determine that the second payment result is a payment failure, and return the transaction identification information of the business to be paid. When the payment result of the matching payment business is a payment failure, generate a second payment instruction based on the business key value and the technical key value of the payment request, send the second payment instruction to the account processing device, and determine the second payment result based on the second payment feedback information of the account processing device.

[0087] The idempotent anti-duplication device for accounts provided in this embodiment can execute the idempotent anti-duplication method for accounts provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0088] Figure 4 : is a schematic diagram of the structure of an electronic device provided by the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0089] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (also called random access memory, RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0090] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0091] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the idempotent anti-duplicate method of the account.

[0092] In some embodiments, the idempotent anti-duplicate method for accounts can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the idempotent anti-duplicate method for accounts described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the idempotent anti-duplicate method for accounts in any other appropriate manner (for example, by means of firmware).

[0093] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0094] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0095] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0096] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0097] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server) or a computing system that includes middleware components (e.g., an application server) or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein) or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0098] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0099] In one embodiment, the present invention further includes a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the idempotent anti-duplication method for accounts of any embodiment of the present invention is implemented.

[0100] The computer program product may be implemented in a computer program code for performing the operation of the present invention written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​and conventional procedural programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0101] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0102] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An idempotent anti-duplicate method for accounts, characterized in that: include: When receiving a payment request for a service to be paid, determining a processing scheme corresponding to the payment request based on a service key value and a technical key value included in the payment request, wherein the processing scheme is a first processing scheme or a second processing scheme, the first processing scheme is used to start a payment process, and the second processing scheme is used to start an idempotent anti-duplicate process; Based on the first processing scheme or the second processing scheme, the payment process or the idempotent anti-duplicate process is started, the business key value and the technical key value of the payment request are processed, and the payment result of the to-be-paid business is obtained; The control information interaction interface displays the payment result.

2. The method according to claim 1, characterized in that Determining a processing scheme corresponding to the payment request based on the business key value and the technical key value included in the payment request includes: Determine a historical payment service set, wherein the historical payment service set includes at least one historical payment service, and the historical payment service includes a historical service key value and a historical technology key value; Determine whether there is a matching payment service for the service to be paid in the historical payment service set, wherein the matching payment service is a payment service in the historical payment service set whose historical service key value is the same as the service key value of the service to be paid and / or whose historical technical key value is the same as the technical key value of the service to be paid; If there is no matching payment service for the service to be paid in the historical payment service set, determining the processing scheme to be the first processing scheme; If the historical payment service set contains a matching payment service of the service to be paid, the processing scheme is determined to be the second processing scheme.

3. The method according to claim 2, characterized in that The second processing scheme includes a business idempotent processing scheme and a technical idempotent processing scheme. Determining the second processing scheme includes: Determine whether the historical service key value of the matching payment service is the same as the service key value of the service to be paid; If the historical business key value of the matched payment business is the same as the business key value of the to-be-paid business, determining that the second processing scheme is the business idempotent processing scheme; If the historical business key value of the matched payment business is different from the business key value of the to-be-paid business, the second processing scheme is determined to be the technical idempotent processing scheme.

4. The method according to claim 3, characterized in that The payment process is used to indicate that the business to be paid is a first payment operation, and the payment result is a first payment result; based on the first processing scheme, starting the payment process, processing the business key value and the technical key value of the payment request, and obtaining the payment result of the business to be paid, includes: Generate a first payment instruction based on the business key value and the technical key value of the payment request, send the first payment instruction to the account processing device, and receive first payment feedback information from the account processing device; Based on the first payment feedback information, determine the first payment result of the to-be-paid business; wherein, when the first payment feedback information indicates that the business key value and the technical key value of the payment request are executed successfully, determine that the first payment result is a successful payment; when the first payment feedback information indicates that the business key value and the technical key value of the payment request are executed unsuccessfully, determine that the first payment result is a failed payment; and when the first payment feedback information indicates that the execution status of the business key value and the technical key value of the payment request is in an unknown state, determine that the first payment result is a payment in progress state.

5. The method according to claim 4, characterized in that Also includes: Before generating the first payment instruction based on the business key value and the technical key value of the payment request, writing the key value information of the technical key value of the payment request into a database, and writing the key value information of the business key value of the payment request into a distributed cache device and the database; After obtaining the first payment result of the business to be paid, the key value information of the distributed cache device and the database is adjusted based on the first payment result; wherein the key value information is used to determine the payment result of the re-payment work, and when the first payment result is a successful payment, the key value information in the distributed cache device and the database is updated based on the first payment result; when the first payment result is a failed payment, the key value information in the distributed cache device is deleted and the key value information in the database is updated.

6. The method according to claim 4, characterized in that The idempotent anti-duplicate process is used to indicate that the business to be paid is a re-payment work, and the payment result is a second payment result; based on the second processing scheme, starting the idempotent anti-duplicate process, processing the business key value and the technical key value of the payment request, and obtaining the payment result of the business to be paid, including: When the second processing scheme is the technical idempotent processing scheme, determining that the second payment result is business rejection; When the second processing scheme is the service idempotent processing scheme, determining whether the historical technical key value of the matched payment service is the same as the technical key value of the service to be paid; If the historical technical key value of the matched payment service is the same as the technical key value of the service to be paid, determining the second payment result as the payment result of the matched payment service; If the historical technical key value of the matched payment service is different from the technical key value of the service to be paid, determining whether the payment result of the matched payment service is a payment failure; When the payment result of the matched payment service is not a payment failure, the second payment result is determined to be a payment failure, and the transaction identification information of the service to be paid is returned; when the payment result of the matched payment service is a payment failure, a second payment instruction is generated based on the service key value and technical key value of the payment request, the second payment instruction is sent to the accounting processing device, and the second payment result is determined based on the second payment feedback information of the accounting processing device.

7. An idempotent anti-duplicate device for accounts, characterized in that: The idempotent anti-duplicate method for an account described in any one of claims 1 to 6, wherein the idempotent anti-duplicate device for an account comprises: A scheme determination module, configured to, upon receiving a payment request for a service to be paid, determine a processing scheme corresponding to the payment request based on a business key value and a technical key value included in the payment request, wherein the processing scheme is a first processing scheme or a second processing scheme, the first processing scheme is used to start a payment process, and the second processing scheme is used to start an idempotent anti-duplicate process; A result determination module, configured to start the payment process or the idempotent anti-duplicate process based on the first processing scheme or the second processing scheme, process the business key value and the technical key value of the payment request, and obtain the payment result of the to-be-paid business; The result display module is used to control the information interaction interface and display the payment result.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the idempotent anti-duplication method for accounts described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the idempotent anti-duplication method for accounts described in any one of claims 1 to 6 when executed.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the idempotent anti-duplication method for accounts according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • High-concurrency payment order anti-duplication method, device, system and equipment, medium and program product

    CN115374098A

  • Repeated payment prevention method and device based on order state idempotent control

    CN115730938A

  • Idempotent control method and device and electronic equipment

    CN117407388A

  • Payment anti-repetition method and device, terminal equipment and readable storage medium

    CN117952614A

Cited By

  • Incoming account processing method and system and storage medium

    CN120952773A