Electronic payment processing method and device, electronic equipment and storage medium

By querying the original and used quota of electronic vouchers in electronic payment, and using multiple parallel threads to perform quota locking and deduction operations, the transaction time-consuming problem caused by the superposition of multiple electronic vouchers is solved, and the user experience is improved.

CN120258805APending Publication Date: 2025-07-04TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410018538.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-02
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the prior art, when a user superimposes multiple electronic coupons in an electronic payment request, it leads to high transaction time and poor user experience.

Method used

By obtaining electronic payment requests, querying the original amount and used amount of the electronic voucher, determining the locking amount, and using multiple parallel threads to perform the quota locking and deduction operations in the database, improving processing efficiency.

Benefits of technology

It improves the processing efficiency of electronic coupons used in electronic payment, reduces the waiting time for users, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120258805A_ABST
    Figure CN120258805A_ABST
Patent Text Reader

Abstract

The invention provides an electronic payment processing method and device, electronic equipment, a computer program product and a computer readable storage medium. The method comprises the steps of obtaining an electronic payment request; querying a plurality of electronic coupons of participants of the electronic payment request from a database, and original quotas and used quotas respectively corresponding to the plurality of electronic coupons; according to the original quotas and used quotas corresponding to the plurality of electronic coupons, determining locked quotas corresponding to the plurality of electronic coupons; through a plurality of parallel threads and based on the locking quotas corresponding to the plurality of electronic coupons, executing quota locking operation for the plurality of electronic coupons in a database; and executing the quota deduction operation for the plurality of electronic coupons in the database through the plurality of parallel threads and based on the quota locked by the quota locking operation. According to the invention, the processing efficiency of the application electronic coupons in electronic payment can be improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to computer technology, and in particular to a method, apparatus, electronic device, and storage medium for processing electronic payment. Background Art

[0002] With the rapid development of computer technology and network technology, people's lives have become more convenient. Electronic payments can be completed through a payment platform, which can be docked with multiple service provider platforms. Users can select the service providers they need in the payment platform for transactions. To improve the user experience, the payment platform will issue electronic vouchers to waive certain fees.

[0003] In the prior art, for the situation where a user uses multiple electronic vouchers in an electronic payment request, a polling traversal method is used. If the number of electronic vouchers used by the user is large, it is easy to cause problems such as high transaction time consumption and poor user experience. Summary of the Invention

[0004] Embodiments of this application provide a method, apparatus, electronic device, computer-readable storage medium, and computer program product for processing electronic payment, which can improve the processing efficiency of applying electronic vouchers in electronic payment and enhance the user experience.

[0005] The technical solution of the embodiments of this application is implemented as follows:

[0006] Embodiments of this application provide a method for processing electronic payment, the method includes:

[0007] Obtain an electronic payment request;

[0008] Query from a database multiple electronic vouchers of the participant of the electronic payment request, and the original amount and the used amount corresponding to each of the multiple electronic vouchers;

[0009] Determine the locked amount corresponding to each of the multiple electronic vouchers according to the original amount and the used amount corresponding to each of the multiple electronic vouchers;

[0010] Through multiple parallel threads, and based on the locked amount corresponding to each of the multiple electronic vouchers, perform an amount locking operation on the multiple electronic vouchers in the database;

[0011] Through the multiple parallel threads, and based on the amount locked by the amount locking operation, perform an amount deduction operation on the multiple electronic vouchers in the database.

[0012] Embodiments of this application provide a device for processing electronic payment, the device includes:

[0013] An obtaining module, configured to obtain an electronic payment request;

[0014] A query module, configured to query multiple e-vouchers of the participants in the electronic payment request from a database, as well as the original amount and the used amount corresponding to each of the multiple e-vouchers;

[0015] A determination module, configured to determine the locked amount corresponding to each of the multiple e-vouchers according to the original amount and the used amount corresponding to each of the multiple e-vouchers;

[0016] A processing module, configured to execute an amount locking operation for the multiple e-vouchers in the database through multiple parallel threads and based on the locked amount corresponding to each of the multiple e-vouchers;

[0017] Execute an amount deduction operation for the multiple e-vouchers in the database through the multiple parallel threads and based on the amount locked by the amount locking operation.

[0018] In the above solution, the determination module is configured to traverse at least one of the multiple e-vouchers to perform the following processing: take the difference between the original amount and the used amount of the e-voucher as the remaining amount of the e-voucher; in response to the remaining amount of the e-voucher being greater than 0 and less than the target withholding fee of the electronic payment request, take the remaining amount of the e-voucher as the locked amount of the e-voucher and continue to traverse the next e-voucher, where the target withholding fee is the difference between the total withholding fee of the electronic payment request and the locked amount of the electronic payment request; in response to the remaining amount of the e-voucher being greater than 0 and equal to the target withholding fee, take the remaining amount of the e-voucher as the locked amount of the e-voucher and stop traversing.

[0019] In the above solution, the processing module is configured to divide the multiple e-vouchers into multiple rounds; traverse at least one of the e-vouchers in each round.

[0020] In the above solution, the processing module is configured to determine the upper limit of the concurrency number of the e-vouchers for executing the amount locking operation in each round according to real-time performance parameters, where the real-time performance parameters include the computing power and memory space of the processor, and the value of the performance parameter is positively correlated with the values of the computing power and memory space of the processor; divide the multiple e-vouchers into multiple rounds according to the upper limit of the concurrency number of the e-vouchers for the amount locking operation.

[0021] In the above solution, the processing module is configured to obtain context information, where the context information includes the performance parameter samples; call a machine learning prediction model based on the context information to determine the upper limit of the concurrent quantity of the e-vouchers for performing the quota locking operation in each round, where the training samples of the machine learning prediction model include the performance parameter samples and the number of parallel threads, and the concurrent quantity of the e-vouchers corresponds one-to-one with the number of parallel threads; divide the multiple e-vouchers into multiple rounds according to the upper limit of the concurrent quantity of the e-vouchers for the quota locking operation.

[0022] In the above solution, the processing module is configured to, in response to the remaining quota of the e-voucher being 0, delete the e-voucher and continue to traverse the next e-voucher.

[0023] In the above solution, when performing the quota locking operation on the multiple e-vouchers in the database through multiple parallel threads and based on the locking quotas respectively corresponding to the multiple e-vouchers, in response to at least one of the parallel threads failing, the processing module is configured to revoke the locking quota of the e-voucher corresponding to the failed parallel thread in the database, where the revoked locking quota of the e-voucher is used to process subsequent electronic payment requests.

[0024] In the above solution, the processing module is configured to perform the following processing through each of the multiple parallel threads: send a quota locking instruction of the e-voucher corresponding to the parallel thread to the database, where the multiple parallel threads correspond one-to-one with the multiple e-vouchers, so that the database performs the following processing: in response to the quota locking instruction, add a data lock to the locking quota of the e-voucher corresponding to the parallel thread in the database to shield other parallel threads from performing the quota locking operation on the e-voucher.

[0025] In the above solution, the processing module is configured to perform the following processing through each of the multiple parallel threads: send a quota deduction instruction of the e-voucher corresponding to the parallel thread to the database, where the multiple parallel threads correspond one-to-one with the multiple e-vouchers, so that the database performs the following processing: in response to the quota deduction instruction, add a data lock to the locking quota of the e-voucher corresponding to the parallel thread in the database to shield other parallel threads from performing the quota deduction operation on the e-voucher.

[0026] In the above solution, when the participant is the payee of the electronic payment request, the e-voucher is used to offset the handling fee of the electronic payment request.

[0027] In the above solution, when the participating party is the payer of the electronic payment request, the electronic voucher is used to deduct the transaction amount of the electronic payment request.

[0028] In the above solution, the processing module is configured to receive a redemption request for the electronic voucher from the participating party; in response to the redemption request, obtain the electronic voucher for the participating party, send the electronic voucher for the participating party to the terminal of the participating party, and record the information of the electronic voucher in the database, where the information of the electronic voucher includes the owner, the original amount, and the used amount of the electronic voucher.

[0029] In the above solution, the redemption request is sent by the terminal by presenting a redemption interface and in response to a trigger operation for redeeming the electronic voucher; the processing module is configured to query the virtual resources of the participating party from the database; determine the redemption amount corresponding to the virtual resources based on the redemption rules of the virtual resources; generate at least one electronic voucher for the participating party, where the sum of the original amounts of the at least one electronic voucher is the redemption amount.

[0030] An embodiment of the present application provides an electronic device, which includes:

[0031] A memory for storing computer-executable instructions;

[0032] A processor, when executing the computer-executable instructions stored in the memory, implements the processing method of electronic payment provided by the embodiment of the present application.

[0033] An embodiment of the present application provides a computer-readable storage medium, storing a computer program or computer-executable instructions, which are used to implement the processing method of electronic payment provided by the embodiment of the present application when being executed by a processor.

[0034] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions, which implement the processing method of electronic payment provided by the embodiment of the present application when being executed by a processor.

[0035] The embodiment of the present application has the following beneficial effects:

[0036] Before locking the quota of the e-voucher, by querying the original quota and the used quota of the e-voucher from the database, calculating the remaining quota of the e-voucher to determine the corresponding locked quota. Compared with directly locking based on a certain quota, it can ensure that part or all of the remaining quota can be successfully locked, avoid the situation of locking failure due to insufficient remaining quota, and improve the success rate of locking; after locking the locked quota in the database through multiple parallel threads, perform parallel quota deduction operations, so as to realize traversing multiple e-vouchers through multiple parallel threads at the same time, thereby performing quota locking or quota deduction operations on multiple e-vouchers. Compared with the time loss caused by traversing e-vouchers in a single thread, it can improve the processing efficiency of applying e-vouchers in electronic payment, reduce the waiting time of users, and enhance the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is the architecture diagram of the processing system 100 for the payee's electronic payment provided by the embodiment of the present application;

[0038] Figure 2A is the schematic diagram of the blockchain network provided by the embodiment of the present application;

[0039] Figure 2B is the schematic diagram of the data recording method of the blockchain provided by the embodiment of the present application;

[0040] Figure 3 is the schematic diagram of the structure of the server 200 provided by the embodiment of the present application;

[0041] Figure 4A is the schematic diagram of the process of the electronic payment processing method provided by the embodiment of the present application;

[0042] Figure 4B is the schematic diagram of the e-voucher redemption process provided by the embodiment of the present application;

[0043] Figure 4C is the schematic diagram of the process of determining the redemption quota of the e-voucher provided by the embodiment of the present application;

[0044] Figure 4D is the schematic diagram of the process of determining the locked quota of the e-voucher provided by the embodiment of the present application;

[0045] Figure 4E is the schematic diagram of the process of e-voucher round division provided by the embodiment of the present application;

[0046] Figure 4F is the schematic diagram of the process of dividing e-voucher rounds based on performance parameters provided by the embodiment of the present application;

[0047] Figure 4G is the schematic diagram of the process of dividing e-voucher rounds based on the machine learning prediction model provided by the embodiment of the present application;

[0048] Figure 4H It is an interaction flowchart for the operation of locking the amount of e-vouchers provided by the embodiments of the present application;

[0049] Figure 4I It is an interaction flowchart for the operation of deducting the amount of e-vouchers provided by the embodiments of the present application;

[0050] Figure 5 It is a schematic structural diagram of the prediction model provided by the embodiments of the present application;

[0051] Figure 6 It is a conversion logic flowchart provided by the embodiments of the present application;

[0052] Figure 7A It is the first conversion interface provided by the embodiments of the present application;

[0053] Figure 7B It is the second conversion interface provided by the embodiments of the present application;

[0054] Figure 7C It is the e-voucher usage interface provided by the embodiments of the present application;

[0055] Figure 7D It is the remaining amount interface of the e-voucher provided by the embodiments of the present application;

[0056] Figure 7E It is the detailed amount interface of the e-voucher provided by the embodiments of the present application;

[0057] Figure 8A It is the e-voucher usage interaction flowchart provided by the embodiments of the present application;

[0058] Figure 8B It is the e-voucher usage algorithm flowchart provided by the embodiments of the present application;

[0059] Figure 9 It is the schematic diagram of concurrent voucher locking in electronic payment provided by the embodiments of the present application;

[0060] Figure 10A It is the first usage logic schematic diagram provided by the embodiments of the present application;

[0061] Figure 10B It is the second usage logic schematic diagram provided by the embodiments of the present application;

[0062] Figure 11A It is the schematic diagram of concurrent voucher locking in electronic payment provided by the embodiments of the present application;

[0063] Figure 11B It is the schematic diagram of concurrent actual deduction in electronic payment provided by the embodiments of the present application. Detailed implementation manner

[0064] In order to make the objectives, technical solutions, and advantages of this application clearer, the following will further describe this application in detail in conjunction with the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.

[0065] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.

[0066] In the following description, the terms "first / second / third" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when permitted, so that the embodiments of this application described here can be implemented in an order other than that illustrated or described here.

[0067] In the embodiments of this application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of that module or unit.

[0068] In the actual application of the relevant data collection and processing in the embodiments of this application, the informed consent or separate consent of the personal information subject should be obtained in strict accordance with the requirements of relevant national laws and regulations, and subsequent data use and processing behaviors should be carried out within the scope authorized by laws and regulations and the personal information subject.

[0069] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by those skilled in the technical field to which this application belongs. The terms used in the embodiments of this application are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0070] Before further elaborating on the embodiments of this application, the nouns and terms involved in the embodiments of this application are explained. The nouns and terms involved in the embodiments of this application are subject to the following explanations.

[0071] 1) Quota component: A component that can create nodes, allocate, increase, or deduct quotas for nodes, and can ensure the efficiency and accuracy of quota deduction in concurrent scenarios.

[0072] 2) Concurrent lock of vouchers: In one round of processing, perform the quota locking operation on multiple e-vouchers through multiple parallel threads, where the concurrent quantity of multiple e-vouchers corresponds one-to-one with multiple parallel threads.

[0073] 3) Concurrent actual deduction: In one round of processing, perform the quota deduction operation on multiple e-vouchers through multiple parallel threads, where the concurrent quantity of multiple e-vouchers corresponds one-to-one with multiple parallel threads.

[0074] 4) E-voucher: An electronic voucher, which can be obtained by redeeming based on virtual resources (such as points), and carries a free quota that can be used in the electronic payment scenario. For example, it can be used to deduct the payment amount of the payer, or to deduct the handling fee that the payee needs to pay to the electronic payment platform.

[0075] 5) Original quota: The initial quota carried by the e-voucher when it is not used.

[0076] 6) Used quota: The quota of the e-voucher consumed by the user during electronic payment. The maximum value of the used quota is the original quota of the e-voucher.

[0077] 7) Locked quota: The quota locked for the e-voucher during the processing of the electronic payment request. The locked quota is a pre-operation for the deduction quota, and the maximum value of the locked quota is the original quota of the e-voucher.

[0078] 8) Parallel thread: Refers to multiple threads used for parallel processing in the processor. For example, each thread is used to perform the quota locking or quota deduction operation of an e-voucher.

[0079] 9) Blockchain, is an encrypted, chain-like storage structure formed by blocks (Block).

[0080] For example, the header of each block can include both the hash value of all transactions in the block and the hash value of all transactions in the previous block, so as to achieve the anti-tampering and anti-counterfeiting of transactions in the block based on the hash value; after the newly generated transaction is filled into the block and consensus is reached by the nodes in the blockchain network, it will be appended to the end of the blockchain to form a chain-like growth.

[0081] 10) Blockchain Network, a set of a series of nodes that incorporate new blocks into the blockchain through consensus.

[0082] 11) Consensus is a process in a blockchain network used to reach an agreement on the transactions in a block among multiple involved nodes. The block that reaches an agreement will be appended to the tail of the blockchain. The mechanisms to achieve consensus include Proof of Work (PoW), Proof of Stake (PoS), Delegated Proof-of-Stake (DPoS), Proof of Elapsed Time (PoET), etc.

[0083] 12) Smart Contracts, also known as Chaincode or application code, are programs deployed in the nodes of a blockchain network. Nodes execute the smart contracts invoked in the received transactions to perform operations such as updating or querying the key-value pair data in the state database.

[0084] The embodiments of the present application provide a method, apparatus, electronic device, computer-readable storage medium, and computer program product for processing electronic payments, which can improve the processing efficiency of applying electronic vouchers in electronic payments and enhance the user experience. The following describes the exemplary applications of the electronic devices provided by the embodiments of the present application. The electronic devices provided by the embodiments of the present application can be implemented as various types of user terminals such as laptop computers, tablet computers, desktop computers, set-top boxes, mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable game devices), smartphones, smart speakers, smart watches, smart TVs, in-vehicle terminals, etc., or can also be implemented as servers.

[0085] See Figure 1 , Figure 1 is the architecture diagram of the processing system 100 for the payee's electronic payment provided by the embodiments of the present application. To support the processing application of the electronic payment of a payee (e.g., a merchant), for example, Figure 1 the processing system 100 for electronic payment involves a server 200, a network 300, a terminal 400, and a database 500. A settlement service 200-1 and a voucher service 200-2 can run in the server 200. Among them, the settlement service 200-1 is responsible for performing data updates related to settlement on the database 500, and the voucher service 200-2 is responsible for processing related to electronic vouchers (e.g., querying, modifying the used amount, and deleting, etc.). The terminal 400 is connected to the server 200 through the network 300. The database 500 stores the data processed by the server 200. The network 300 can be a wide area network, a local area network, or a combination of the two.

[0086] As an example of a payee (merchant) using an electronic coupon to offset the handling fee paid to a payment platform, the payee retrieves an electronic coupon from the coupon service 200-2 in the server 200 via the network 300 through the terminal 400 for offsetting the handling fee generated in the electronic payment request. When the payer (customer) submits an electronic payment request to the server 200 through the terminal 400, the electronic payment request may carry the identity identification information of the payee and the identity identification information of the payer; in response to the payer's electronic payment request, the server 200 queries the payee's electronic coupon from the database 500 through the payee's identity identification information, calculates the remaining amount of the payee's electronic coupon by the coupon service 200-2 in the server 200 according to the original amount and the used amount of the queried electronic coupon, and sends it to the settlement service 200-1 in the server 200 for offsetting the handling fee generated by the payee in this electronic payment request, and at the same time deducts the transaction amount of the payer; then, records such as the identity identification information of the payee and the payer, the transaction time, the transaction amount of the payer, and the handling fee of the payee in this electronic payment request are written into the database 500.

[0087] As an example of a payer (customer) using an electronic coupon to offset the transaction amount that should be paid to a merchant during an electronic payment process, the payer (customer) retrieves an electronic coupon from the coupon service 200-2 in the server 200 via the network 300 through the terminal 400 for offsetting the transaction amount in the electronic payment request. When the payer submits an electronic payment request to the server 200 through the terminal 400, the electronic payment request will carry the transaction amount, the identity identification information of the payee, and the identity identification information of the payer; in response to the payer's electronic payment request, the server 200 queries the payer's electronic coupon from the database 500 through the payer's identity identification information, calculates the remaining amount of the payer's electronic coupon by the coupon service 200-2 in the server 200 according to the original amount and the used amount of the queried electronic coupon, and sends it to the settlement service 200-1 in the server 200 for offsetting the transaction amount of the payer in this electronic payment request; then, records such as the identity identification information of the payee and the payer, the transaction time, and the transaction amount of the payer in this electronic payment request are written into the database 500.

[0088] In some embodiments, the database 500 may be implemented through a blockchain network, and the types of blockchain networks are flexible and diverse. For example, it may be any one of a public chain, a private chain, or a consortium chain. Taking the public chain as an example, the electronic devices of any business entity, such as user terminals and servers, can access the blockchain network without authorization; taking the consortium chain as an example, after obtaining authorization, the electronic devices (such as terminals / servers) under the business entity can access the blockchain network, and at this time, they become a special type of node in the blockchain network, namely client nodes.

[0089] See Figure 2A , Figure 2A which is a schematic diagram of implementing a database as a blockchain network provided by an embodiment of the present application. The blockchain network is formed by linking nodes that implement different functions. Figure 2A Examples show nodes 500-1 and 500-2. Among them, the blockchain, application, and routing functions are deployed in node 500-1; the blockchain, consensus, and routing functions are deployed in node 500-2.

[0090] As Figure 2A shown, when the server 200 sends an instruction related to an electronic payment request to the database 500, by invoking the smart contract of the nodes in the blockchain network, operations are performed on the data nodes in the database 500, including query operations (i.e., querying key-value pairs in the database to implement querying of the original amount and used amount of e-vouchers), locking operations (i.e., locking key-value pairs in the database to implement amount locking operations), and deletion operations (i.e., deleting key-value pair data to implement amount deduction operations). And each operation on the data nodes in the database 500 needs to be consensus-approved before it can take effect. The consensus mechanism in the blockchain network can ensure that only when the transaction instruction is consensus-approved will it be recorded in each node of the database 500, thus ensuring the reliability of the electronic payment request operation.

[0091] In some embodiments, see Figure 2B , Figure 2B which is a schematic diagram of the data recording method of the blockchain provided by an embodiment of the present application. As Figure 2B shown, the data in the database can be recorded in different blocks of the blockchain. Different blocks are linked through hashes, and the hash of the previous block points to the hash of this block, thus realizing the continuity of data recording.

[0092] In some embodiments, the terminal 400 is used to respond to the trigger operation of the payer's electronic payment, send an electronic payment request to the server 200 through the network 300, and display the trigger interface of the electronic payment on the graphical interface 410 (exemplarily showing the graphical interface 410-1). The server 200 is used to obtain the electronic payment request sent by the payer through the terminal 400 via the network 300; query multiple e-vouchers of the participant (payee or payer) of the electronic payment request from the database 500, as well as the original amount and used amount corresponding to the multiple e-vouchers respectively; determine the locked amount corresponding to each of the multiple e-vouchers according to the original amount and used amount corresponding to the multiple e-vouchers respectively; execute the amount locking operation for the multiple e-vouchers in the database 500 through multiple parallel threads and based on the locked amount corresponding to the multiple e-vouchers respectively; execute the amount deduction operation for the multiple e-vouchers in the database 500 through multiple parallel threads and based on the amount locked by the amount locking operation.

[0093] In some embodiments, the e-voucher used by the payee (merchant) mentioned above to offset the handling fees generated by the electronic payment request is obtained in the following manner: The terminal 400 is configured to send an e-voucher exchange request to the server 200 via the network 300 in response to the triggering operation of the e-voucher exchange by the payee. The server 200, in response to the e-voucher exchange request sent by the terminal 400 via the network 300, sends the exchanged e-voucher to the payee through the terminal 400 via the voucher service 200-2.

[0094] In some embodiments, the e-voucher used by the payer (customer) mentioned above to offset the transaction amount in the electronic payment request is obtained in the following manner: The terminal 400 is configured to send an e-voucher exchange request to the server 200 via the network 300 in response to the triggering operation of the e-voucher exchange by the payer. The server 200, in response to the e-voucher exchange request sent by the terminal 400 via the network 300, sends the exchanged e-voucher to the payer through the terminal 400 via the voucher service 200-2.

[0095] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.

[0096] The embodiments of the present application can also be implemented with the aid of Artificial Intelligence (AI) technology, which is to use a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results in theory, method, technology, and application systems. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines to enable the machines to have the functions of perception, reasoning, and decision-making.

[0097] See Figure 3 , Figure 3 is a schematic structural diagram of the server 200 provided by the embodiments of the present application. Figure 3The server 200 shown includes: at least one processor 210, a memory 250 and at least one network interface 220. The various components in the terminal 400 are coupled together via a bus system 240. It is understood that the bus system 240 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 240 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 240 is not described in detail. Figure 3 Various buses are labeled as bus system 240 .

[0098] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0099] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices that are physically remote from the processor 210.

[0100] The memory 250 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 250 described in the embodiments of the present application is intended to include any suitable type of memory.

[0101] In some embodiments, memory 250 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0102] Operating system 251, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0103] The network communication module 252 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220. Exemplary network interfaces 220 include: Bluetooth, Wireless LAN (WiFi), and Universal Serial Bus (USB).

[0104] In some embodiments, the apparatus provided by the embodiments of the present application may be implemented in software. Figure 3 FIG. Figure 3 shows a processing apparatus 253 for electronic payment stored in a memory 250, which may be software in the form of a program and a plug-in, etc., including the following software modules: an obtaining module 2531, a querying module 2532, a determining module 2533, and a processing module 2534. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.

[0105] An exemplary application and implementation of the electronic device provided by the embodiments of the present application will be combined to illustrate the processing method for electronic payment provided by the embodiments of the present application.

[0106] Next, the processing method for electronic payment provided by the embodiments of the present application will be described. As described above, the electronic device for implementing the processing method for electronic payment in the embodiments of the present application may be the above-mentioned server 200, and the execution subject of each step will not be repeated below.

[0107] See Figure 4A , Figure 4A FIG. Figure 4A is a schematic flowchart of the processing method for electronic payment provided by the embodiments of the present application. Taking the server as the main body, it will be described in combination with the steps shown in Figure 4A FIG. Figure 4A .

[0108] In step 101, an electronic payment request is obtained.

[0109] In some embodiments, the terminal responds to the code-scanning payment operation of the payer to obtain an electronic payment request. The electronic payment request carries the identity identification information of the participating parties, including the identity identification information of the payee and the payer.

[0110] Exemplarily, when customer A makes an electronic payment request by scanning the business code of merchant A, the terminal responds to the electronic payment operation of customer A and sends an electronic payment request to the Figure 1 server 200 in FIG. Figure 1 . The electronic payment request carries the identity identification information of customer A and merchant A.

[0111] In step 102, multiple electronic coupons of the participating parties of the electronic payment request are queried from the database, as well as the original amount and the used amount corresponding to each of the multiple electronic coupons.

[0112] In some embodiments, querying multiple electronic coupons of the participating parties of the electronic payment request from the database based on the identity identification information of the participating parties may be all electronic coupons, as well as the original amount and the used amount corresponding to each electronic coupon, where the participating party is the payee or the payer of the electronic payment request.

[0113] Exemplarily, when the participating party is Figure 1When the payee involved in the electronic payment request, such as merchant A in the above example, based on the identity identification information of merchant A, first from Figure 1 In the database 500, query multiple electronic vouchers of merchant A. For example, three electronic vouchers of merchant A are queried, namely electronic voucher 1, electronic voucher 2, and electronic voucher 3, and the original amount and used amount corresponding to each of the three electronic vouchers. Among them, the original amount of electronic voucher 1 is 1000, and the used amount is 200; the original amount of electronic voucher 2 is 900, and the used amount is 300; the original amount of electronic voucher 3 is 800, and the used amount is 400.

[0114] Exemplarily, when the participant is Figure 1 The payer involved in the electronic payment request, such as customer A in the above example, based on the identity identification information of customer A, first from Figure 1 In the database 500, query multiple electronic vouchers of customer A. For example, three electronic vouchers of customer A are queried, namely electronic voucher 4, electronic voucher 5, and electronic voucher 6, and the original amount and used amount corresponding to each of the three electronic vouchers. Among them, the original amount of electronic voucher 4 is 500, and the used amount is 50; the original amount of electronic voucher 5 is 400, and the used amount is 100; the original amount of electronic voucher 6 is 300, and the used amount is 200.

[0115] In some embodiments, the participant is the payee of the electronic payment request, and the electronic voucher is used to offset the handling fee of the electronic payment request.

[0116] Exemplarily, when the payee is merchant A in the above example, merchant A can use the remaining amount of at least one of electronic voucher 1, electronic voucher 2, and electronic voucher 3 to offset the handling fee of the electronic payment request. The electronic voucher can be exchanged based on the virtual resources of merchant A (such as points, props, etc.).

[0117] In some embodiments, the participant is the payer of the electronic payment request, and the electronic voucher is used to offset the transaction amount of the electronic payment request.

[0118] Exemplarily, when the payee is customer A in the above example, customer A can use the remaining amount of at least one of electronic voucher 4, electronic voucher 5, and electronic voucher 6 to offset the transaction amount of the electronic payment request. The electronic voucher is exchanged based on the virtual resources of customer A (such as points, props, etc.).

[0119] In step 103, according to the original amount and used amount corresponding to each of the multiple electronic vouchers, determine the locked amount corresponding to each of the multiple electronic vouchers.

[0120] In some embodiments, the amount that each electronic voucher can lock is greater than or equal to 0 and not greater than the remaining amount.

[0121] Exemplarily, in the e-vouchers of merchant A in the above example, the maximum locked amount of e-voucher 1 is 800, the maximum locked amount of e-voucher 2 is 600, and the maximum locked amount of e-voucher 3 is 400; in the e-vouchers of customer A in the above example, the maximum locked amount of e-voucher 4 is 450, the maximum locked amount of e-voucher 5 is 300, and the maximum locked amount of e-voucher 6 is 100.

[0122] In some embodiments, referring to Figure 4D , Figure 4D is a schematic flowchart of the process for determining the locked amount of an e-voucher provided by an embodiment of the present application. Figure 4A Step 103 of Figure 4D can be implemented by traversing at least one e-voucher among multiple e-vouchers to perform the processing from step 1031 to step 1033 of

[0123] In step 1031, the difference between the original amount and the used amount of the e-voucher is used as the remaining amount of the e-voucher.

[0124] In some embodiments, the difference between the original amount of each e-voucher and the used amount in the payment is used as the remaining amount of each e-voucher.

[0125] Exemplarily, in the e-vouchers of merchant A in the above example, the original amount of e-voucher 1 is 1000 and the used amount is 200; the original amount of e-voucher 2 is 900 and the used amount is 300; the original amount of e-voucher 3 is 800 and the used amount is 400; the remaining amounts of the three e-vouchers are calculated respectively by the voucher service 200-2 in the server 200, and the remaining amount of e-voucher 1 is 800, the remaining amount of e-voucher 2 is 600, and the remaining amount of e-voucher 3 is 400.

[0126] Exemplarily, in the e-vouchers of customer A in the above example, the original amount of e-voucher 4 is 500 and the used amount is 50; the original amount of e-voucher 5 is 400 and the used amount is 100; the original amount of e-voucher 6 is 300 and the used amount is 200; the remaining amounts of the three e-vouchers are calculated respectively by the voucher service 200-2 in the server 200, and the remaining amount of e-voucher 4 is 450, the remaining amount of e-voucher 5 is 300, and the remaining amount of e-voucher 6 is 100.

[0127] In step 1032, in response to the remaining amount of the e-voucher being greater than 0 and less than the target withholding fee of the electronic payment request, the remaining amount of the e-voucher is used as the locked amount of the e-voucher, and the next e-voucher is continued to be traversed, where the target withholding fee is the difference between the total withholding fee of the electronic payment request and the locked amount of the electronic payment request.

[0128] Exemplarily, when merchant A in the above example uses at least one of e-voucher 1, e-voucher 2, and e-voucher 3 to offset the handling fee generated in e-payment request A, if the target withholding fee is 1000, since the remaining amount of e-voucher 1 is 800, which is less than the target withholding fee, the remaining amount of 800 of e-voucher 1 is used as the locked amount of e-voucher A, and e-voucher 2 is continued to be traversed. The remaining amount of e-voucher 2 is 600. At this time, the target withholding fee is updated to 200, that is, the locked amount for e-voucher 2 is 200.

[0129] In step 1033, in response to the remaining amount of the e-voucher being greater than 0 and equal to the target withholding fee, the remaining amount of the e-voucher is used as the locked amount of the e-voucher, and the traversal is stopped.

[0130] In some embodiments, when the remaining amount of the e-voucher is greater than 0 and equal to the target withholding fee, the remaining amount of the e-voucher is used as the locked amount of the e-voucher, and there is no need to continue traversing the next e-voucher.

[0131] Exemplarily, when merchant A in the above example uses the e-voucher to offset the handling fee generated in e-payment request B, if the target withholding fee is 800, since the remaining amount of e-voucher 1 is 800, which is equal to the target withholding fee, the remaining amount of 800 of e-voucher 1 is used as the locked amount of e-voucher 1, and there is no need to continue traversing the next e-voucher.

[0132] In some embodiments, in response to the remaining amount of the e-voucher being 0, the e-voucher is deleted, and the next e-voucher is continued to be traversed.

[0133] Exemplarily, after merchant A in the above example uses e-voucher 1 to offset the 800 handling fee generated in e-payment request B, the remaining amount of e-voucher 1 is updated to 0. At this time, if merchant A continues with the next e-payment request C, the server will, in response to merchant A's e-payment request, perform a deletion operation on e-voucher 1 and continue to traverse e-voucher 2.

[0134] In some embodiments, traversing multiple e-vouchers can be divided into multiple rounds. Refer to Figure 4E , Figure 4E which is the schematic flowchart of the e-voucher round division provided by the embodiments of the present application, and will be described in combination with Figure 4E the steps shown.

[0135] In step 301, multiple e-vouchers are divided into multiple rounds.

[0136] In some embodiments, the e-vouchers can be divided into rounds according to the performance parameters of the server, or the e-vouchers can be divided into rounds through a machine learning prediction model.

[0137] In some embodiments, referring to Figure 4F , Figure 4F is a schematic flowchart of dividing e-voucher rounds based on performance parameters provided by an embodiment of the present application. Figure 4E Step 301 of Figure 4F can be implemented by steps 3011A to 3012A of

[0138] In step 3011A, according to the real-time performance parameters, determine the upper limit of the concurrent quantity of e-vouchers for which the quota locking operation is performed in each round. Among them, the real-time performance parameters include the computing power and memory space of the processor, and the value of the performance parameter is positively correlated with the values of the computing power and memory space of the processor.

[0139] In some embodiments, according to the real-time performance parameters of the server processor, determine the upper limit of the concurrent quantity of e-vouchers for which the quota locking operation is performed in each round. Among them, the real-time performance parameters include the computing power and memory space of the processor, and the value of the performance parameter is positively correlated with the values of the computing power and memory space of the processor. The computing power of the processor is an index describing the ability of the processor to perform operations and manipulate data, that is, the speed and efficiency of the computing tasks that the device can complete. High computing power means that the processor can quickly execute more computing tasks, which is very important for tasks that require a large amount of computing, such as encryption algorithms, simulations, data analysis, etc. Therefore, computing power is also one of the common indicators for evaluating computer performance. The unit of computing power is TOPS (Tera Operations Per Second), and 1 TOPS represents that the processor can perform one trillion operations per second. Corresponding to this are also GOPS (Giga Operations Per Second) and MOPS (Million Operation PerSecond). 1 GOPS represents that the processor can perform one billion operations per second, and 1 MOPS represents that the processor can perform one million operations per second.

[0140] In some embodiments, the value of the performance parameter may be linearly correlated or non-linearly correlated with the values of the computing power and memory space of the processor. That is to say, when the values of the computing power and memory space of the processor change, the value of the performance parameter may change equally or unequally accordingly.

[0141] In step 3012A, divide multiple e-vouchers into multiple rounds according to the upper limit of the concurrent quantity of e-vouchers for which the quota locking operation is performed.

[0142] In some embodiments, round up the ratio of the number of multiple e-vouchers to the upper limit of the concurrent quantity as the rounds for dividing the e-vouchers.

[0143] For example, if the user has 8 e-vouchers and the upper limit of the concurrency count of the processor is 3, the ratio of the total number of e-vouchers to the upper limit of the concurrency count is 2 at this time, and the remainder is 2; that is to say, according to the operation of locking the quota for 3 e-vouchers each time, 3 e-vouchers are processed in the first round and 3 e-vouchers are processed in the second round. Then, the remaining 2 unprocessed e-vouchers need to be processed in the third round. Therefore, the ratio of multiple e-vouchers to the upper limit of the concurrency count is rounded up to be used as the number of rounds for dividing the e-vouchers.

[0144] In some embodiments, referring to Figure 4G , Figure 4G is a schematic flowchart of a process for dividing e-voucher rounds based on a machine learning prediction model provided in an embodiment of the present application. Figure 4E Step 301 of Figure 4G can be implemented by steps 3011B to 3013B of

[0145] In step 3011B, context information is obtained, and the context information includes performance parameter samples.

[0146] In some embodiments, the context information includes sample data and label data sampled from a sample server; wherein, the sample data includes performance parameter samples, and the label data is the e-voucher concurrency processing quantity. By sampling the performance parameter samples and the e-voucher concurrency processing quantity in the sample server, the machine learning prediction model learns the potential association between the performance parameters of different machines in the sample server and the concurrency quantity of e-vouchers that the server can process during the training process.

[0147] For example, the performance parameter samples taken from the server include processor computing power and memory space, such as the average processor usage rate of the APP, average memory, peak memory, etc. Since each e-voucher processing corresponds to a server thread when the server performs concurrent processing of e-vouchers, the label data is the e-voucher concurrency processing quantity manually marked according to the number of threads processed in parallel by the server.

[0148] In step 3012B, based on the context information, a machine learning prediction model is called to determine the upper limit of the concurrency quantity of e-vouchers for which the quota locking operation is performed in each round; wherein, the training samples of the machine learning prediction model include performance parameter samples and the number of parallel threads, and the e-voucher concurrency quantity corresponds one-to-one with the number of parallel threads.

[0149] Exemplarily, when Merchant A in the above example uses at least one of E-voucher 1, E-voucher 2, and E-voucher 3 to offset the handling fee generated in the electronic payment request, the processing process of each E-voucher corresponds to a parallel processing thread. If the quota locking operation is performed on E-voucher 1, E-voucher 2, and E-voucher 3 simultaneously in the same round, at this time, the corresponding parallel thread for performing the quota locking operation on E-voucher 1 is Thread 1, the corresponding parallel thread for performing the quota locking operation on E-voucher 2 is Thread 2, and the corresponding parallel thread for performing the quota locking operation on E-voucher 3 is Thread 3. Then the concurrency number of E-vouchers is 3, and the number of parallel threads is also 3.

[0150] In some embodiments, the upper limit of the concurrency number of E-vouchers determined by calling the machine learning prediction model for performing the quota locking operation can be valid for a long time and applicable to any payment scenario; or during the model training process, by regularly updating the sample data, the upper limit of the concurrency number of E-vouchers can be updated regularly.

[0151] In some embodiments, the machine learning prediction model can be a convolutional neural network model. Refer to Figure 5 , Figure 5 which is the structural schematic diagram of the prediction model provided by the embodiments of the present application. In Figure 5 , the convolutional neural network is used to extract the sample data of the performance parameters of the processor and the label data of the corresponding number of parallel threads. The convolutional neural network generally includes the following layers: input layer, convolutional layer, pooling layer, and output layer (fully connected layer + activation function layer (softmax layer)).

[0152] Exemplarily, other machine learning regression models can also be used to determine the concurrency number of E-vouchers for performing the quota locking operation, such as: linear regression model, decision tree regression model, random forest regression model, neural network regression model, gradient boosting based on decision tree (LightGBM, Light Gradient Boosting Machine) regression model.

[0153] In some embodiments, the loss between the actual concurrency number of E-vouchers and the predicted concurrency number of E-vouchers can be determined through a loss function, such as: Quadratic Loss Function, Logarithmic Loss Function, Absolute Loss Function, Hinge Loss Function, etc.

[0154] In step 3013B, according to the upper limit of the concurrent quantity of the e-vouchers for the quota locking operation, multiple e-vouchers are divided into multiple rounds.

[0155] In some embodiments, the result obtained by dividing the e-vouchers into rounds according to the performance parameters of the server can be weighted-averaged with the result obtained by dividing the e-vouchers into rounds through a machine learning prediction model, so as to be used as the concurrent quantity of the e-vouchers for the quota locking operation; alternatively, the maximum value between the two can be taken as the concurrent quantity of the e-vouchers for the quota locking operation.

[0156] Continue to refer to Figure 4E , and continue to describe based on step 301 above.

[0157] In step 302, at least one e-voucher in each round is traversed.

[0158] In some embodiments, at least one e-voucher in each round is traversed, where the concurrent quantity of the e-vouchers for the quota locking operation in each round in each transaction can be fixed.

[0159] Continue to refer to Figure 4A , and continue to describe based on step 103 above.

[0160] In step 104, through multiple parallel threads, and based on the locking quotas respectively corresponding to multiple e-vouchers, a quota locking operation for multiple e-vouchers is performed in the database.

[0161] In some embodiments, refer to Figure 4H , Figure 4H is an interaction flowchart for performing a quota locking operation on e-vouchers provided by an embodiment of the present application. Figure 4A Step 104 of Figure 4H can be implemented by performing the processing from step 1041 to step 1042 of

[0162] In step 1041, a quota locking instruction is sent.

[0163] In some embodiments, the server sends a quota locking instruction for the e-voucher corresponding to the parallel thread to the database, where multiple parallel threads correspond to multiple e-vouchers one by one. Each parallel thread corresponds to a quota locking operation for one e-voucher.

[0164] Exemplarily, when merchant A in the above example uses an e-voucher to offset the handling fee generated in the e-payment request, if the quota locking operation is performed on e-voucher 1, e-voucher 2, and e-voucher 3 simultaneously in the same round, the parallel thread corresponding to e-voucher 1 is thread 1, the parallel thread corresponding to e-voucher 2 is thread 2, and the parallel thread corresponding to e-voucher 3 is thread 3.

[0165] In step 1042, a locked amount operation is performed.

[0166] In some embodiments, in response to an amount locking instruction, the database adds a data lock to the locked amount of the e-voucher corresponding to the parallel thread in the database to shield other parallel threads from performing the amount locking operation on the e-voucher.

[0167] Exemplarily, when thread 1 in the above example performs an amount locking operation on e-voucher 1 of merchant A, the database, in response to the amount locking instruction, adds a data lock to the locked amount of e-voucher 1 corresponding to parallel thread 1 in the database to shield other parallel threads (such as thread 2 or thread 3) from performing the amount locking operation on e-voucher 1.

[0168] In some embodiments, when performing an amount locking operation on multiple e-vouchers in the database through multiple parallel threads and based on the locked amounts corresponding to the multiple e-vouchers respectively, in response to at least one parallel thread failing, the database cancels the locked amount of the e-voucher corresponding to the failed parallel thread, where the cancelled locked amount of the e-voucher is used to process subsequent electronic payment requests.

[0169] In step 105, through multiple parallel threads and based on the amounts locked by the amount locking operation, an amount deduction operation on multiple e-vouchers is performed in the database.

[0170] In some embodiments, referring to Figure 4I , Figure 4I is an interaction flowchart for performing an amount deduction operation on an e-voucher provided by an embodiment of the present application. Figure 4A Step 105 of Figure 4I can be implemented by performing the processing of steps 1051 to 1052 of

[0171] In step 1051, an amount deduction instruction is sent.

[0172] In some embodiments, the server sends an amount deduction instruction for the e-voucher corresponding to the parallel thread to the database, where the multiple parallel threads correspond to multiple e-vouchers one by one. Each parallel thread corresponds to an amount deduction operation for one e-voucher.

[0173] Exemplarily, when merchant A in the above example uses an e-voucher to offset the handling fee generated in an electronic payment request, if an amount deduction operation is performed on the locked amounts of e-voucher 1, e-voucher 2, and e-voucher 3 in the same round, the parallel thread corresponding to e-voucher 1 is thread 4, the parallel thread corresponding to e-voucher 2 is thread 5, and the parallel thread corresponding to e-voucher 3 is thread 6.

[0174] In step 1052, an amount deduction operation is performed.

[0175] In some embodiments, in response to an amount locking instruction, the database adds a data lock to the locked amount of the electronic voucher corresponding to the parallel thread in the database to shield other parallel threads from performing an amount deduction operation on the electronic voucher.

[0176] For example, when thread 4 performs an amount deduction operation on electronic voucher 1 of merchant A in the above example, in response to the amount deduction instruction, the database adds a data lock to the locked amount of electronic voucher 1 corresponding to parallel thread 1 in the database to shield other parallel threads (such as thread 5 or thread 6) from performing an amount deduction operation on electronic voucher 1.

[0177] In some embodiments, the locking / submission / release function of the electronic voucher amount can be implemented with the help of a quota component. For example, when querying the remaining amount of the electronic voucher during the process of an electronic payment request, in order to ensure that the remaining amount of the queried electronic voucher can be used normally in this transaction, the quota component can be used to lock the queried remaining amount to ensure the normal progress of the transaction.

[0178] In some embodiments, refer to Figure 4B , Figure 4B is a schematic diagram of the electronic voucher redemption process provided by an embodiment of the present application. Before performing Figure 4A step 102 of Figure 4B , the redemption of the electronic voucher can be realized through steps 201 to 202 of

[0179] In step 201, a redemption request for the electronic voucher from the participating party is received.

[0180] In some embodiments, in response to a trigger operation by the participating party to convert virtual resources in the account into an electronic voucher with a corresponding amount, the terminal sends a redemption request to the server, and the server receives the redemption request sent by the terminal and performs subsequent processing.

[0181] For example, when the participating party is Figure 1 the payee involved in the electronic payment request described in

[0182] For example, when the participating party is Figure 1 the payer involved in the electronic payment request described in

[0183] In step 202, in response to a redemption request, determine the e-voucher for the participant, send the e-voucher for the participant to the terminal of the participant, and record the information of the e-voucher in the database, where the information of the e-voucher includes the owner of the e-voucher, the original amount, and the used amount.

[0184] In some embodiments, the redemption request is sent by the terminal by presenting a redemption interface and in response to a trigger operation for redeeming the e-voucher.

[0185] Exemplarily, when the participant is Figure 1 the payee of the electronic payment request involved in, for example, merchant A in the above example, in response to the trigger operation of merchant A presenting the redemption interface 410-1 on the terminal 400 to redeem the virtual resources in the account into e-vouchers of corresponding amounts, the voucher service 200-2 of the server 200 sends e-voucher 1, e-voucher 2, and e-voucher 3 to merchant A through the terminal 400, and at the same time stores the relevant information of e-voucher 1, e-voucher 2, and e-voucher 3 in the database 500, where the owners of e-voucher 1, e-voucher 2, and e-voucher 3 are all merchant A; the original amount of e-voucher 1 is 1000 and the used amount is 0; the original amount of e-voucher 2 is 900 and the used amount is 0; the original amount of e-voucher 3 is 800 and the used amount is 0.

[0186] Exemplarily, when the participant is Figure 1 the payer of the electronic payment request involved in, for example, customer A in the above example, in response to the trigger operation of customer A presenting the redemption interface 410-1 on the terminal 400 to redeem the virtual resources in the account into e-vouchers of corresponding amounts, the voucher service 200-2 of the server 200 sends e-voucher 4, e-voucher 5, and e-voucher 6 to customer A through the terminal 400, and at the same time stores the relevant information of e-voucher 4, e-voucher 5, and e-voucher 6 in the database 500, where the owners of e-voucher 4, e-voucher 5, and e-voucher 6 are all customer A; the original amount of e-voucher 4 is 500 and the used amount is 0; the original amount of e-voucher 5 is 400 and the used amount is 0; the original amount of e-voucher 6 is 300 and the used amount is 0.

[0187] In some embodiments, referring to Figure 4C , Figure 4C is a schematic diagram of the process for determining the redemption amount of the e-voucher provided by the embodiment of the present application, Figure 4B "Determine the e-voucher for the participant" in step 202 of, Figure 4C can be implemented through steps 2021 to 2023 of, and the following is a specific description.

[0188] In step 2021, query the virtual resources of the participant from the database.

[0189] In some embodiments, the virtual resources of the participating party queried from the database can be the remaining points obtained from payment, or the quantity of a specific type of item.

[0190] In step 2022, based on the redemption rule of the virtual resources, determine the redemption quota corresponding to the virtual resources.

[0191] In some embodiments, based on the redemption rule of the virtual resources, determine the redemption quota corresponding to the virtual resources, where the redemption rule includes a preset conversion relationship between the virtual resources and the redemption quota. For example, 100 payment points can be redeemed for 100 free quotas.

[0192] In step 2023, generate at least one e-voucher for the participating party, where the sum of the original quotas of the at least one e-voucher is the redemption quota.

[0193] In some embodiments, generate at least one e-voucher corresponding to the corresponding quota based on the redemption quota of the virtual resources, and the redemption quota is the sum of the original quotas of the at least one e-voucher.

[0194] Exemplarily, when the participating party is Figure 1 the payee involved in the e-payment request described above, such as merchant A in the above example, the redemption quota of merchant A is the sum of e-voucher 1, e-voucher 2, and e-voucher 3. Among them, the original quota of e-voucher 1 is 1000, the original quota of e-voucher 2 is 900, and the original quota of e-voucher 3 is 800. Then, the redemption quota of merchant A is 2700.

[0195] Exemplarily, when the participating party is Figure 1 the payer involved in the e-payment request described above, such as customer A in the above example, the redemption quota of customer A is the sum of e-voucher 4, e-voucher 5, and e-voucher 6. Among them, the original quota of e-voucher 4 is 500, the original quota of e-voucher 5 is 400, and the original quota of e-voucher 6 is 300. Then, the redemption quota of customer A is 1200.

[0196] By querying the original quota and the used quota of the e-voucher from the database to determine the corresponding locked quota, it is possible to avoid the situation of locking failure due to insufficient remaining quota, and improve the success rate of locking; by using multiple parallel threads to lock the locked quota in the database and then performing parallel quota deduction operations, compared with the time consumption caused by single-thread traversing the e-voucher, it can improve the processing efficiency of applying e-vouchers in e-payment, reduce the user waiting time, and enhance the user experience.

[0197] Next, an exemplary application of the embodiments of the present application in an actual application scenario will be described.

[0198] Exemplarily, the application scenario of the electronic payment processing method provided in the embodiments of the present application can be that a merchant (payee) uses the redeemed electronic vouchers to offset the service fees (i.e., handling fees) generated in the transaction. In an electronic payment request, multiple electronic vouchers can be used simultaneously. When a merchant receives multiple customers' electronic payment requests at the same time, there is a competitive relationship among the uses of multiple electronic vouchers. Before successfully locking the amount of an electronic voucher, it is unknown how much the actual locked amount will be. The common logic for using electronic vouchers in the prior art is as follows: traverse all the electronic vouchers of the merchant; take the minimum value between the remaining amount of the electronic voucher and the remaining required handling fee; attempt to lock the amount of the electronic voucher with this value; if the locking is successful, then traverse the next voucher of the user until all the electronic vouchers are used up or the locked amount meets the handling fee; if the locking is unsuccessful, repeat the amount locking step.

[0199] In the prior art, by attempting to lock each electronic voucher one by one to obtain the locked amount, assuming that the locking time for each voucher is 10 ms, then if a transaction uses more than 2000 electronic vouchers, it will cause the calculation time for using vouchers in this transaction to reach 2000 ms, thus greatly reducing the user experience.

[0200] The electronic payment processing method provided in the embodiments of the present application calculates the locked amount of each electronic voucher before performing the amount locking, and then executes the amount locking logic through multiple parallel threads. After multiple parallel threads finish execution, collect the execution results of the concurrent locked amounts of the electronic vouchers in this round, determine the actual amount of locked vouchers, and then confirm whether to perform the next round of concurrency until all the electronic vouchers are used up or the locked amount reaches the amount required for the handling fee, which can improve the processing efficiency of applying electronic vouchers in electronic payment and enhance the user experience.

[0201] On the one hand, the payment platform needs to promote the compliance of merchants' transactions and collection behaviors. On the other hand, it hopes that merchants can use the business code for collection more and manage the transaction funds using the business account. Therefore, at the business operation level, the payment platform needs to continuously provide subsidies and benefits to merchants. By setting up a merchant welfare mall to attract merchants to use the business code for collection, while ensuring that merchants can continuously receive business subsidies. Among them, the free collection amount (redemption amount) is the core gift in the merchant welfare mall of the business code. Merchants can obtain it by redeeming with payment points (virtual resources). At the value level, the payment platform gives the greatest business subsidies to merchants in the simplest and most direct way; at the user experience level, after merchants redeem the corresponding electronic vouchers for the free collection amount with payment points and make an electronic payment request with the electronic vouchers within the validity period of the electronic vouchers, they can exempt the service fees generated by this transaction within the amount of the electronic vouchers, attracting more merchants to use the business code for transactions.

[0202] See Figure 6 , Figure 6It is the exchange logic flow chart provided by the embodiments of the present application, with the terminal as the execution subject. For example, Figure 6 As shown, first, it is determined whether the merchant has opened an integral mall.

[0203] In step 601, the free collection amount and relevant information are displayed.

[0204] When it is determined that the merchant has opened an integral mall, in response to the merchant's exchange payment request, the terminal displays a browsable interface of the free collection amount on the payment platform interface, showing the free collection amount and relevant information.

[0205] In step 602, the merchant is prompted to open it.

[0206] When it is determined that the merchant has not opened an integral mall, the terminal will prompt the merchant to open it through the payment platform interface to continue the subsequent steps.

[0207] Then, in response to the merchant's operation of browsing and clicking on the free collection amount, the payment platform interface will prompt the merchant whether to exchange the free collection amount.

[0208] In step 603, a pop-up window and exchange information are displayed.

[0209] In response to the merchant's operation of selecting to exchange the free collection amount, the terminal displays a pop-up window through the payment platform interface, prompting that the exchange is successful. At the same time, the displayed exchange information includes that the free collection amount takes effect immediately, the validity period of the free collection amount, and the viewing path, so as to enable the merchant to exchange the corresponding free collection amount by paying points.

[0210] In step 604, return to the upper-level page.

[0211] In response to the merchant's triggering operation of not exchanging the free collection amount temporarily, the upper-level page is displayed.

[0212] Finally, for whether the merchant views the free collection amount, the following processing is performed.

[0213] In step 605, the amount and detailed information are displayed.

[0214] In response to the merchant's triggering operation of viewing the amount, the payment platform jumps to the free collection amount management page, and the merchant can view the existing available amount through the free collection amount management page. At the same time, in response to the merchant's triggering operation of the amount details on the free collection amount management page, the terminal will display the amount acquisition and expiration details on the free collection amount management page.

[0215] In step 606, return to the upper-level page.

[0216] In response to the merchant's triggering operation of not viewing the free collection amount temporarily, the upper-level page is displayed.

[0217] For example, refer to Figure 7A , Figure 7A which is the first redemption interface provided by an embodiment of the present application. As Figure 7A shown, in response to the merchant's redemption request, the terminal displays relevant information on the collection free quota in the redemption interface of the points mall, including the collection free quota 701A, usage instructions 702A, validity period 703A, applicable scenarios 704A, and the "Redeem with 200 points" function key 705A.

[0218] In response to the merchant browsing and selecting the collection free quota 701A and then clicking the "Redeem with 200 points" function key 705A, at this time, the terminal jumps from the current Figure 7A redemption page to the next redemption interface. Refer to Figure 7B , Figure 7B which is the second redemption interface provided by an embodiment of the present application. As Figure 7B shown, the redemption interface displays the collection free quota 701B, usage instructions 702B, redemption result 703B, the "Back to Home Page" function key 704B, and the "Go and See" function key 705B. Among them, the redemption result 703 shows that the redemption is successful, and it prompts that "the gift has taken effect and will expire in 30 days. Using the business code for collection can automatically deduct the service fee", that is, in response to the merchant's trigger operation of redeeming the quota with 200 payment points, the corresponding 200 collection free quota is obtained. At the same time, in response to the merchant clicking the "Back to Home Page" function key 704B, the merchant returns to the previous-level interface, or in response to the merchant clicking the "Go and View" function key 705B, it jumps to the collection free quota management page.

[0219] When the merchant uses the business code for collection, the payment platform will automatically deduct the corresponding collection free quota. Refer to Figure 7C , Figure 7C which is the e-voucher usage interface provided by an embodiment of the present application. As Figure 7C shown, the interface displays the used collection free quota 701C, collection service fee 702C, and collection information 703C. The used collection free quota 701C shows 10 yuan, that is to say, when the merchant uses the business code for collection in a transaction, the payment platform deducts 10 yuan of service fee from the 200 collection free quota redeemed by the merchant.

[0220] In response to the merchant's viewing operation, the remaining quota of the collection free quota is displayed. Refer to Figure 7D , Figure 7D which is the e-voucher remaining quota interface provided by an embodiment of the present application. As Figure 7DAs shown, the total free collection amount limit 701D, relevant information 702D, and the "limit details" function key 703D are displayed in the interface. Among them, the remaining total free collection amount limit of 190 yuan is displayed in the total free collection amount limit 701D; the relevant information 702D shows the relevant information of the limit, including the validity period and the acquisition method of the free collection amount limit; meanwhile, the "limit details" function key is set. In response to the triggering operation of the merchant on the "limit details" function key 703D, the acquisition and expiration details of the free collection amount limit can be viewed. Refer to Figure 7E , Figure 7E is the electronic coupon limit details interface provided by the embodiment of the present application. As Figure 7E shown, the relevant information 701E on using the free limit and the relevant information 702E on obtaining the free limit are displayed in the interface. Among them, the relevant information of the free limit includes the time of use or acquisition and the transaction amount involved.

[0221] The merchant can use the free collection amount limit of the electronic coupon obtained by redemption to offset the service fee through Figure 1 the interaction process between the settlement service 200-1 and the coupon service 200-2 of the server 200 in Figure 8A , Figure 8A is the electronic coupon usage interaction flow chart provided by the embodiment of the present application. When receiving the electronic payment request from the payer, first, the settlement service 200-1 sends a query for the remaining limit to the coupon service 200-2; upon receiving the query for the remaining limit instruction, the coupon service 200-2 queries the electronic coupon of the payee from the database 500 through the identity identification information of the payee, calculates the remaining limit based on the original limit and the used limit of the queried electronic coupon, and sends it to the settlement service 200-1; then, the settlement service 200-1 sends a consumption limit instruction to the coupon service 200-2 according to the handling fee generated by the transaction. The coupon service 200-2 deducts the limit from the remaining limit to offset the handling fee generated by the payee in this electronic payment request.

[0222] Exemplarily, refer to Figure 8B , Figure 8B is the electronic coupon usage algorithm flow chart provided by the embodiment of the present application. As Figure 8B shown, when the customer (payer) sends the electronic payment request to the settlement platform (settlement service 200-1) through code scanning payment, upon receiving the electronic payment request from the customer, the settlement platform sends a query for the remaining limit to the free coupon service (coupon service 200-2); the free limit service calculates the remaining limit by querying the original limit and the used limit of the customer's electronic coupon, and sends the remaining limit to the settlement platform; after receiving the remaining limit, the settlement platform offsets the service fee generated by the transaction amount and sends the consumption limit to the free limit service, notifying the free coupon service to perform the operation of deducting the limit.

[0223] When the service fee amount of a transaction is relatively large and the merchant has numerous small-amount exemption vouchers (electronic vouchers), there will be a situation where hundreds or even more exemption vouchers are used in a single electronic payment request. When multiple electronic vouchers are used in a single electronic payment request, the quota locking operation of the electronic vouchers can be executed through multiple parallel threads. Refer to Figure 9 , Figure 9 which is the schematic diagram of concurrent voucher locking in electronic payment provided by an embodiment of the present application. As Figure 9 shown, the transactions involved in the total transaction amount of the merchant include transaction x, transaction y and transaction z. The merchant used three exemption vouchers, namely exemption voucher A, exemption voucher B, and exemption voucher C, to offset the service fee generated by transaction x. Among them, the quota locked by transaction x in exemption voucher A is quota a, the quota locked by transaction x in exemption voucher B is quota b, and the quota locked by transaction x in exemption voucher C is quota c .

[0224] Exemplarily, when the merchant has a large-amount exemption voucher, it can be used for multiple transactions. Refer to Figure 10A , FIG. 10 is the schematic diagram of the first usage logic provided by an embodiment of the present application; as Figure 10A shown, when the merchant uses the business code to collect payment, the quota of electronic voucher A with an amount of 1000 becomes effective. The merchant uses a quota of 300 for collection order 1, 100 for collection order 2, and 345 for collection order 3. Then, the consumed quota in the quota of 1000 of electronic voucher A is 745, and the remaining quota is 255. The remaining quota can still be used for other transactions within the validity period.

[0225] When the merchant conducts subsequent transactions, it can redeem or use other quota electronic vouchers that have been redeemed. Refer to Figure 10B , Figure 10B which is the schematic diagram of the second usage logic provided by an embodiment of the present application; as Figure 10BAs shown, when the merchant uses the business code to receive payments again, the quota of e-voucher B of 1000 becomes effective. The quota used for the merchant's payment order 4 is 400, and the quota used for payment order 5 is 475.5. At this time, the remaining quota of the e-voucher of e-voucher B is 124.5. If the total amount of order 6 is 900, the e-voucher of e-voucher B can be used to waive the handling fee for 124.5 yuan, and the handling fee for 775.5 yuan is still required. At this time, the merchant can exchange e-vouchers again or use the remaining quota of the exchanged e-vouchers to deduct the handling fee of 775.5 yuan generated by payment order 6. When the e-voucher of e-voucher C becomes effective, it can be used to deduct the handling fee of 775.5 yuan generated by payment order 6. If the quota of e-voucher C is greater than 775.5, it can also be used for payment order 7 to deduct the handling fee of payment order 7. The handling fee of payment order 7 can also be deducted by exchanging e-voucher D again and using the quota d of e-voucher D.

[0226] In the method for processing electronic payment provided in the embodiment of the present application, the concurrent number of e-vouchers for which quota locking is performed in each round can be adjusted according to the performance parameters of the processor and memory in the server. In the actual application scenario, the concurrent number can be adjusted to 50. Then, in the case of using 200 vouchers, as long as 4 rounds of concurrency are executed, all the logic of locking vouchers can be completed, and the time-consuming of 200 vouchers can be shortened to 40 ms, improving the efficiency by 50 times.

[0227] For example, a merchant's transaction requires a service fee of 2000, that is, the total e-voucher quota required is 2000. The information of the merchant's multiple e-vouchers is as follows:

[0228] Electronic coupon Total amount Used amount Remaining amount A 1000 500 500 B 600 300 300 C 500 300 200 D 500 300 200 F 2000 1000 1000

[0229] As shown in the above table, the remaining quota of e-voucher A is 500, the remaining quota of e-voucher B is 300, the remaining quota of e-voucher C is 200, the remaining quota of e-voucher D is 200, and the remaining quota of e-voucher F is 1000.

[0230] Set the concurrent number of e-vouchers for which quota locking is performed in each round to 3. Refer to Figure 11A , Figure 11A is a schematic diagram of concurrent voucher locking in the electronic payment provided in the embodiment of the present application. As Figure 11A shown, in the first round of concurrent processing, an attempt is made to lock a quota of 500 for e-voucher A, an attempt is made to lock a quota of 300 for e-voucher B, and an attempt is made to lock a quota of 200 for e-voucher C. After determining the attempted locking quota for each e-voucher, the quota locking operation is performed through multiple parallel threads. If during the process of attempting to lock the quota, the merchant receives an electronic payment request for other transactions at the same time, it will cause some of the vouchers for which the attempt to lock is made to be occupied. For example Figure 11AIf the 100 quota in the e-voucher A is occupied by other transactions, the final successfully locked quota in the first round of concurrency is 900. Since the locked quota in the first round of concurrent processing is less than the total required quota of 2000, the second round of concurrent e-voucher locking is entered.

[0231] Since 900 has been successfully locked in the first round of concurrency and the total required quota for the transaction is 2000, the e-voucher locking quota for the second round of concurrent processing is 1100. As Figure 11A shown, in the second round of concurrent processing, the attempt to lock the quota for e-voucher D is 200, so e-voucher F only needs to lock 900 quota. If all the e-voucher locking quotas in the second round are successful, the concurrent e-voucher locking process ends completely. As Figure 11A shown, in the first round of concurrency, the attempt to lock the quota is 1000, and the actual locked quota is 900; in the second round of concurrency, the attempt to lock the quota is 1100, and the actual locked quota is 1100, resulting in a total locked quota of 2000, that is, the concurrent e-voucher locking process ends. If the second round of concurrent e-voucher locking is not successfully locked, continue to execute the next round of concurrent processing until all e-vouchers are used up or the locked quota reaches the total required quota of the service fee.

[0232] When the concurrent e-voucher locking encounters a system failure, it is necessary to record all the e-vouchers with successful locking and roll back the locked quotas of these e-vouchers. For example, if in the process of a round of concurrent e-voucher locking, the concurrent locking of e-voucher A, e-voucher B, and e-voucher C is performed. Among them, the locking of e-voucher A and e-voucher B is successful, and the system fails to lock e-voucher C. Then there is no available free quota in the result of this round of concurrent e-voucher locking process, and the free quotas of e-voucher A, e-voucher B, and e-voucher C can still be used in the next transaction.

[0233] After the quota of the e-voucher is locked, when using the e-voucher to process the electronic payment request, a real deduction operation will be performed on the locked quota. The real deduction operation also uses concurrent real deduction. The difference is that when performing the real deduction, it is already known clearly the quota to be actually deducted, so there is no need to attempt and can directly perform the concurrent real deduction. See Figure 11B , Figure 11B is a schematic diagram of concurrent real deduction in electronic payment provided by an embodiment of the present application. As Figure 11B shown, in the first round of concurrent processing, the real deduction quota for e-voucher A is 400, the real deduction quota for e-voucher B is 300, and the real deduction quota for e-voucher C is 200, that is, the real deduction in the first round of concurrent processing is 900; in the second round of concurrent processing, the real deduction quota for e-voucher D is 200, and the real deduction quota for e-voucher F is 900, that is, the real deduction in the second round of concurrent processing is 1100, resulting in a total real deduction quota of 2000, that is, the concurrent real deduction process ends.

[0234] The processing method for electronic payment provided by the embodiments of the present application calculates the locked amount of each electronic coupon before performing the amount lock, and then executes the logic of amount locking through multiple parallel threads. After multiple parallel threads are executed, the execution results of the concurrent locked amounts of the electronic coupons in this round are collected to determine the actual amount of coupon locking, and then it is confirmed whether to perform the next round of concurrency until all electronic coupons are used up or the locked amount reaches the amount required for the handling fee, which can improve the processing efficiency of applying electronic coupons in electronic payment and enhance the user experience.

[0235] Next, the exemplary structure of the software module for the implementation of the electronic payment processing device 253 provided by the embodiments of the present application will be further described. In some embodiments, as Figure 3 shown, the software module in the electronic payment processing device 253 stored in the memory 250 may include:

[0236] An obtaining module 2531, configured to obtain an electronic payment request.

[0237] A query module 2532, configured to query multiple electronic coupons of the participants of the electronic payment request and the original amounts and used amounts corresponding to the multiple electronic coupons respectively from the database.

[0238] A determining module 2533, configured to determine the locked amounts corresponding to the multiple electronic coupons respectively according to the original amounts and used amounts corresponding to the multiple electronic coupons.

[0239] A processing module 2534, configured to execute an amount locking operation for the multiple electronic coupons in the database through multiple parallel threads and based on the locked amounts corresponding to the multiple electronic coupons. Through multiple parallel threads and based on the amounts locked by the amount locking operation, execute an amount deduction operation for the multiple electronic coupons in the database.

[0240] In some embodiments, the determining module 2533 is further configured to traverse at least one of the multiple electronic coupons to perform the following processing: taking the difference between the original amount and the used amount of the electronic coupon as the remaining amount of the electronic coupon; in response to the remaining amount of the electronic coupon being greater than 0 and less than the target withholding fee of the electronic payment request, taking the remaining amount of the electronic coupon as the locked amount of the electronic coupon and continuing to traverse the next electronic coupon, where the target withholding fee is the difference between the total withholding fee of the electronic payment request and the locked amount of the electronic payment request; in response to the remaining amount of the electronic coupon being greater than 0 and equal to the target withholding fee, taking the remaining amount of the electronic coupon as the locked amount of the electronic coupon and stopping the traversal.

[0241] In some embodiments, the processing module 2534 is further configured to divide the multiple electronic coupons into multiple rounds; traverse at least one of the electronic coupons in each round.

[0242] In some embodiments, the processing module 2534 is further configured to determine an upper limit on the concurrent number of e-vouchers for which the quota locking operation is performed in each round based on real-time performance parameters, where the real-time performance parameters include the computing power and memory space of the processor, and the value of the performance parameter is positively correlated with the values of the computing power and memory space of the processor; divide a plurality of e-vouchers into multiple rounds according to the upper limit on the concurrent number of e-vouchers for which the quota locking operation is performed.

[0243] In some embodiments, the processing module 2534 is further configured to obtain context information, where the context information includes performance parameter samples; call a machine learning prediction model based on the context information to determine an upper limit on the concurrent number of e-vouchers for which the quota locking operation is performed in each round, where the training samples of the machine learning prediction model include performance parameter samples and the number of parallel threads, and the concurrent number of e-vouchers corresponds one-to-one with the number of parallel threads; divide a plurality of e-vouchers into multiple rounds according to the upper limit on the concurrent number of e-vouchers for which the quota locking operation is performed.

[0244] In some embodiments, the processing module 2534 is further configured to, in response to the remaining quota of the e-voucher being 0, delete the e-voucher and continue to traverse the next e-voucher.

[0245] In some embodiments, when performing a quota locking operation on multiple e-vouchers in the database through multiple parallel threads and based on the locking quotas respectively corresponding to the multiple e-vouchers, the processing module 2534 is further configured to, in response to at least one parallel thread failing, revoke the locking quota of the e-voucher corresponding to the failed parallel thread in the database, where the revoked locking quota of the e-voucher is used to process subsequent electronic payment requests.

[0246] In some embodiments, the processing module 2534 is further configured to perform the following processing through each of the multiple parallel threads: send a quota locking instruction for the e-voucher corresponding to the parallel thread to the database, where the multiple parallel threads correspond one-to-one with the multiple e-vouchers, so that the database performs the following processing: in response to the quota locking instruction, add a data lock to the locking quota of the e-voucher corresponding to the parallel thread in the database to block other parallel threads from performing a quota locking operation on the e-voucher.

[0247] In some embodiments, the processing module 2534 is further configured to perform the following processing through each of the multiple parallel threads: send a quota deduction instruction for the e-voucher corresponding to the parallel thread to the database, where the multiple parallel threads correspond one-to-one with the multiple e-vouchers, so that the database performs the following processing: in response to the quota deduction instruction, add a data lock to the locking quota of the e-voucher corresponding to the parallel thread in the database to block other parallel threads from performing a quota deduction operation on the e-voucher.

[0248] In some embodiments, the participant is the payee of an electronic payment request, and the electronic coupon is used to offset the handling fee of the electronic payment request.

[0249] In some embodiments, the participant is the payer of an electronic payment request, and the electronic coupon is used to offset the transaction amount of the electronic payment request.

[0250] In some embodiments, the processing module 2534 is further configured to receive a redemption request for an electronic coupon from a participant; in response to the redemption request, obtain the electronic coupon for the participant, send the electronic coupon for the participant to the terminal of the participant, and record the information of the electronic coupon in the database, where the information of the electronic coupon includes the owner, the original amount, and the used amount of the electronic coupon.

[0251] In some embodiments, the redemption request is sent by the terminal by presenting a redemption interface and in response to a trigger operation for redeeming the electronic coupon; the processing module 2534 is further configured to query the virtual resources of the participant from the database; determine the redemption amount corresponding to the virtual resources based on the redemption rules of the virtual resources; generate at least one electronic coupon for the participant, where the sum of the original amounts of the at least one electronic coupon is the redemption amount.

[0252] An embodiment of the present application provides a computer program product, which includes a computer program or computer-executable instructions, and the computer program or computer-executable instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, so that the electronic device executes the processing method of electronic payment in the above embodiments of the present application.

[0253] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, where computer-executable instructions or a computer program are stored, and when the computer-executable instructions or the computer program are executed by a processor, the processor will be caused to execute the processing method of electronic payment provided by the embodiments of the present application, for example, Figure 4A the processing method of electronic payment shown.

[0254] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0255] In some embodiments, the computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as a stand-alone program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0256] As an example, the computer-executable instructions may or may not correspond to a file in the file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program in question, or, stored in multiple cooperating files (such as files that store one or more modules, subroutines, or portions of code).

[0257] As an example, the computer-executable instructions may be deployed to execute on one electronic device, or on multiple electronic devices located at one location, or, on multiple electronic devices distributed across multiple locations and interconnected by a communication network.

[0258] In summary, the method for processing electronic payment provided by the embodiments of the present application calculates the locked amount of each electronic coupon before executing the amount lock, then executes the logic of the amount lock through multiple parallel threads. After multiple parallel threads have finished executing, collects the execution results of the concurrent locked amount of the electronic coupons in this round, determines the actual amount of coupon locking, and then confirms whether to perform the next round of concurrency until all electronic coupons are used up or the locked amount reaches the amount required for the handling fee, which can improve the processing efficiency of applying electronic coupons in electronic payment and enhance the user experience.

[0259] The above is only the embodiments of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are all included in the protection scope of the present application.

Claims

1. A processing method for electronic payment, characterized in that, The method includes: Obtaining an electronic payment request; Querying multiple electronic vouchers of the parties involved in the electronic payment request from a database, as well as the original amounts and used amounts corresponding to the multiple electronic vouchers respectively; Determining the locked amounts corresponding to the multiple electronic vouchers according to the original amounts and used amounts corresponding to the multiple electronic vouchers respectively; Executing an amount locking operation for the multiple electronic vouchers in the database through multiple parallel threads and based on the locked amounts corresponding to the multiple electronic vouchers respectively; Executing an amount deduction operation for the multiple electronic vouchers in the database through the multiple parallel threads and based on the amounts locked by the amount locking operation; 2. The method according to claim 1, wherein The determining the locked amounts corresponding to the multiple electronic vouchers according to the original amounts and used amounts corresponding to the multiple electronic vouchers respectively includes: Traversing at least one of the multiple electronic vouchers to perform the following processing: Taking the difference between the original amount and the used amount of the electronic voucher as the remaining amount of the electronic voucher; In response to the remaining amount of the electronic voucher being greater than 0 and less than the target withholding fee of the electronic payment request, taking the remaining amount of the electronic voucher as the locked amount of the electronic voucher and continuing to traverse the next electronic voucher, where the target withholding fee is the difference between the total withholding fee of the electronic payment request and the locked amount of the electronic payment request; In response to the remaining amount of the electronic voucher being greater than 0 and equal to the target withholding fee, taking the remaining amount of the electronic voucher as the locked amount of the electronic voucher and stopping the traversal.

3. The method according to claim 2, wherein The traversing at least one of the multiple electronic vouchers includes: Dividing the multiple electronic vouchers into multiple rounds; Traversing at least one of the electronic vouchers in each round.

4. The method according to claim 3, characterized in that, The dividing the multiple electronic vouchers into multiple rounds includes: Determining an upper limit on the concurrent number of the electronic vouchers for performing the amount locking operation in each round according to real-time performance parameters, where the real-time performance parameters include the computing power and memory space of a processor, and the value of the performance parameter is positively correlated with the values of the computing power and memory space of the processor; Dividing the multiple electronic vouchers into multiple rounds according to the upper limit on the concurrent number of the electronic vouchers for performing the amount locking operation.

5. The method according to claim 3, characterized in that The dividing the multiple electronic vouchers into multiple rounds includes: Obtaining context information, where the context information includes the performance parameter samples; Invoking a machine learning prediction model based on the context information to determine an upper limit on the concurrent number of the electronic vouchers for performing the amount locking operation in each round, where the training samples of the machine learning prediction model include the performance parameter samples and the number of parallel threads, and the concurrent number of the electronic vouchers corresponds one-to-one with the number of parallel threads; Dividing the multiple electronic vouchers into multiple rounds according to the upper limit on the concurrent number of the electronic vouchers for performing the amount locking operation.

6. The method according to any one of claims 2 to 5, characterized in that, The method further includes: In response to the remaining amount of the electronic voucher being 0, deleting the electronic voucher and continuing to traverse the next electronic voucher.

7. The method according to any one of claims 1 to 5, characterized in that, When performing the quota locking operation on the multiple e-vouchers in the database through multiple parallel threads and based on the locking quotas respectively corresponding to the multiple e-vouchers, the method further includes: In response to at least one of the parallel threads failing, cancel the locking quota of the e-voucher corresponding to the failed parallel thread in the database, where the cancelled locking quota of the e-voucher is used to process subsequent electronic payment requests.

8. The method according to any one of claims 1 to 5, characterized in that The performing the quota locking operation on the multiple e-vouchers in the database through multiple parallel threads and based on the locking quotas respectively corresponding to the multiple e-vouchers includes: Each of the multiple parallel threads performs the following processing: Send a quota locking instruction of the e-voucher corresponding to the parallel thread to the database, where the multiple parallel threads correspond to the multiple e-vouchers one by one, so that the database performs the following processing: In response to the quota locking instruction, add a data lock to the locking quota of the e-voucher corresponding to the parallel thread in the database to block other parallel threads from performing the quota locking operation on the e-voucher.

9. The method according to any one of claims 1 to 5, characterized in that, The performing the quota deduction operation on the multiple e-vouchers in the database through the multiple parallel threads and based on the quotas locked by the quota locking operation includes: Each of the multiple parallel threads performs the following processing: Send a quota deduction instruction of the e-voucher corresponding to the parallel thread to the database, where the multiple parallel threads correspond to the multiple e-vouchers one by one, so that the database performs the following processing: In response to the quota deduction instruction, add a data lock to the locking quota of the e-voucher corresponding to the parallel thread in the database to block other parallel threads from performing the quota deduction operation on the e-voucher.

10. The method according to any one of claims 1 to 5, wherein The participating party is the payee of the electronic payment request, and the e-voucher is used to offset the handling fee of the electronic payment request.

11. The method according to any one of claims 1 to 5, wherein The participating party is the payer of the electronic payment request, and the e-voucher is used to offset the transaction amount of the electronic payment request.

12. The method according to any one of claims 1 to 5, characterized in that Before querying the multiple e-vouchers of the participating party of the electronic payment request from the database, the method further includes: Receive a redemption request for the e-voucher from the participating party; In response to the redemption request, obtain the e-voucher for the participating party, send the e-voucher for the participating party to the terminal of the participating party, and record the information of the e-voucher in the database, where the information of the e-voucher includes the owner, the original quota, and the used quota of the e-voucher.

13. The method according to claim 12, wherein The redemption request is sent by the terminal by presenting a redemption interface and in response to a trigger operation for redeeming the e-voucher; The obtaining the e-voucher for the participating party includes: Query the virtual resources of the participating party from the database; Determine the redemption amount corresponding to the virtual resource based on the redemption rule of the virtual resource; Generate at least one electronic coupon for the participant, wherein the sum of the original amounts of the at least one electronic coupon is the redemption amount.

14. A processing device for electronic payment, characterized in that, The device includes: An acquisition module, configured to acquire an electronic payment request; A query module, configured to query, from a database, multiple electronic coupons of the participant of the electronic payment request, and the original amounts and used amounts respectively corresponding to the multiple electronic coupons; A determination module, configured to determine the locked amounts respectively corresponding to the multiple electronic coupons according to the original amounts and used amounts respectively corresponding to the multiple electronic coupons; A processing module, configured to perform, through multiple parallel threads and based on the locked amounts respectively corresponding to the multiple electronic coupons, an amount locking operation on the multiple electronic coupons in the database; Perform, through the multiple parallel threads and based on the amounts locked by the amount locking operation, an amount deduction operation on the multiple electronic coupons in the database.

15. An electronic device, characterized in that, The electronic device includes: A memory, configured to store computer-executable instructions; A processor, configured to implement the processing method of electronic payment according to any one of claims 1 to 13 when executing the computer-executable instructions stored in the memory.

16. A computer-readable storage medium stores computer-executable instructions or a computer program, characterized in that, The computer-executable instructions or computer program, when executed by the processor, implement the processing method of electronic payment according to any one of claims 1 to 13.

17. A computer program product, comprising computer-executable instructions or a computer program, characterized in that The computer-executable instructions or computer program, when executed by the processor, implement the processing method of electronic payment according to any one of claims 1 to 13.