A method and apparatus for a transaction of a digital currency

By storing digital currency hashes at different transaction levels, the problem of resource conflicts in digital currency systems under high concurrency scenarios is solved, improving transaction efficiency and system performance.

CN116187987BActive Publication Date: 2025-12-12THE PEOPLES BANK OF CHINA DIGITAL CURRENCY INST +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111421404.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2025-12-12
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

In the process of digital currency transactions, especially in high-concurrency scenarios, existing technologies suffer from performance degradation and transaction timeouts due to resource conflicts in digital currency systems, which reduce the transaction processing performance and stability of the system.

Method used

The user's digital currency is stored in hashes across different transaction tiers. Transaction tier information, including the number of tiers, tier limits, and the proportion of transactions, is generated based on the user's historical transaction information and digital currency balance, thereby enabling decentralized storage and block management of digital currency.

Benefits of technology

This effectively avoids resource conflicts in the digital currency system, improves transaction efficiency, enhances the performance and stability of the digital currency system, and ensures the system's transaction processing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116187987B_ABST
    Figure CN116187987B_ABST
Patent Text Reader

Abstract

The application discloses a kind of digital currency transaction method and device, it is related to computer technology field.The specific embodiment of the method includes: receiving user transaction request;According to user transaction request and transaction level information, determine the target digital currency corresponding to user transaction request;Wherein, transaction level information is generated according to the historical transaction information of user and digital currency balance, and transaction level information includes the level number of transaction level, and the level quota and transaction times proportion corresponding to each transaction level;According to target digital currency, response user transaction request.This embodiment effectively avoids the resource conflict of digital currency system when user carries out digital currency transaction, improves transaction efficiency, improves the performance and stability of digital currency system, improves the transaction processing performance of system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a digital currency transaction method and device. BACKGROUND

[0002] In the process of digital currency transaction, the digital currency under the user's digital currency wallet will be processed (generation and cancellation of digital currency), because the digital currency contains the user's account and key information and other related information, the performance loss caused by the generation and cancellation of the user's digital currency (especially the performance loss caused by resource conflict in high concurrency scenario) has become a transaction bottleneck, how to improve the transaction processing performance of the digital currency system in busy time is the current problem to be solved.

[0003] At least the following problems exist in the prior art:

[0004] In the existing digital currency transaction method, because the digital currency is basically stored together, when the digital currency transaction is performed, especially in the high concurrency transaction scenario, there is often a resource conflict of the digital currency system, which causes transaction timeout, reduces the performance and stability of the digital currency system, and reduces the transaction processing performance of the system. SUMMARY

[0005] Therefore, the embodiments of the present application provide a digital currency transaction method and device, which can store the user's digital currency in different transaction levels, especially in the high concurrency transaction scenario, effectively avoid the resource conflict of the digital currency system when the user performs the digital currency transaction, improve the transaction efficiency, improve the performance and stability of the digital currency system, and improve the transaction processing performance of the system.

[0006] To achieve the above-mentioned purpose, according to the first aspect of the embodiments of the present application, a digital currency transaction method is provided, comprising:

[0007] Receiving a user transaction request;

[0008] According to the user transaction request and the transaction level information, determining the target digital currency corresponding to the user transaction request; wherein the transaction level information is generated according to the user's historical transaction information and digital currency balance, and the transaction level information includes the level number of the transaction level, and the level quota and transaction number ratio corresponding to each transaction level;

[0009] According to the target digital currency, responding to the user transaction request.

[0010] Further, it further includes the storage step of the digital currency:

[0011] Obtaining user information, the user information including the user's historical transaction information and digital currency balance;

[0012] determine transaction level information corresponding to the user according to historical transaction information;

[0013] determine a storage limit of the digital currency corresponding to each transaction level according to the transaction level information and the digital currency balance, and store the digital currency balance into the corresponding transaction level according to the storage limit.

[0014] Further, the method further comprises:

[0015] generating a level queue corresponding to the transaction level information according to a transaction frequency ratio corresponding to each transaction level in the transaction level information and a level limit;

[0016] dividing each transaction level in the level queue according to the level limit to obtain a level queue comprising a plurality of division blocks; wherein a storage limit of the digital currency corresponding to each division block does not exceed the level limit of the corresponding transaction level;

[0017] determining a storage limit of the digital currency corresponding to each transaction level according to the digital currency balance and the level queue comprising the plurality of division blocks, and storing the digital currency balance into the corresponding transaction level according to the storage limit.

[0018] Further, the method further comprises:

[0019] sequentially numbering each division block in the level queue according to a level limit of a transaction level corresponding to each division block in the level queue and a position of each division block in the level queue to obtain a block number of each division block;

[0020] storing the digital currency balance into the plurality of division blocks in sequence according to the order of the block number until the digital currency balance is stored completely.

[0021] Further, the sequentially numbering each division block in the level queue comprises:

[0022] determining a current transaction level and a current division block in the current transaction level in the level queue in sequence according to the order of the level queue, and performing the following steps until each division block is numbered or the digital currency balance of the user is stored into the division block:

[0023] determining whether there is a target division block corresponding to the current division block in a next level of the transaction level corresponding to the current division block;

[0024] If yes, the number of the current split block is incremented, and the increment result is taken as the number of the target split block, and the target split block is taken as the current split block.

[0025] Further, the method further comprises:

[0026] receiving transaction level update information, updating the level queue according to the transaction level update information, and updating the storage limit of the digital currency corresponding to each transaction level in the updated level queue according to the digital currency balance and the level queue containing the plurality of split blocks; and / or,

[0027] receiving digital currency balance update information, and updating the storage limit of the digital currency corresponding to each transaction level in the level queue according to the digital currency balance update information.

[0028] Further, according to the user transaction request and the transaction level information, the target digital currency corresponding to the user transaction request is determined, comprising:

[0029] determining a candidate transaction level from the transaction level information according to the transaction limit or the transaction type indicated in the user transaction request;

[0030] determining whether the current storage limit in the candidate transaction level is greater than or equal to the transaction limit;

[0031] If yes, the candidate transaction level is determined as the target transaction level, and the digital currency corresponding to the current storage limit in the target transaction level is determined as the target digital currency.

[0032] If no, the target transaction level is determined according to the level limit corresponding to the transaction level, the current storage limit and the transaction limit, and the target digital currency is determined.

[0033] Further, the user information further comprises user feature information, wherein the user feature information comprises one or more of the following information: user type, user residence, and user consumption type; after the step of obtaining the user information, the method further comprises:

[0034] determining a database corresponding to the storage of the digital currency balance of the user according to one or more of the user type, the user residence and the user transaction type.

[0035] According to a second aspect of an embodiment of the present application, a digital currency transaction device is provided, comprising:

[0036] a transaction request obtaining module, configured to receive a user transaction request;

[0037] The target digital currency determination module is configured to determine a target digital currency corresponding to the user transaction request according to the user transaction request and transaction level information, wherein the transaction level information is generated according to historical transaction information and a digital currency balance of the user, and the transaction level information includes a level number of a transaction level, and a level quota and a transaction number ratio corresponding to each transaction level;

[0038] The transaction module is configured to respond to the user transaction request according to the target digital currency.

[0039] According to a third aspect of the embodiments of the present application, an electronic device is provided, including:

[0040] one or more processors;

[0041] a storage device configured to store one or more programs,

[0042] When the one or more programs are executed by the one or more processors, the one or more processors implement the digital currency transaction method as described above.

[0043] According to a fourth aspect of the embodiments of the present application, a computer readable medium is provided, which stores a computer program, and the program is executed by a processor to implement the digital currency transaction method as described above.

[0044] An embodiment of the above-mentioned application has the following advantages or beneficial effects: because the technical means of receiving a user transaction request, determining a target digital currency corresponding to the user transaction request according to the user transaction request and transaction level information, wherein the transaction level information is generated according to historical transaction information and a digital currency balance of the user, and the transaction level information includes a level number of a transaction level, and a level quota and a transaction number ratio corresponding to each transaction level, and responding to the user transaction request according to the target digital currency are adopted, the technical problem that in the prior art, because digital currencies are basically stored together, when digital currency transactions, especially in high-concurrency transaction scenarios, resource conflicts of the digital currency system often occur, leading to transaction timeouts, reducing the performance and stability of the digital currency system, and reducing the transaction processing performance of the system is overcome, and the technical effect that the digital currencies of the user can be stored in different transaction levels, especially in high-concurrency transaction scenarios, resource conflicts of the digital currency system during digital currency transactions of the user are effectively avoided, transaction efficiency is improved, the performance and stability of the digital currency system are improved, and the transaction processing performance of the system is improved is achieved.

[0045] The further effects of the above-mentioned non-conventional optional mode will be described in the following combined with the specific embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0046] The accompanying drawings are used to better understand the present application, and do not constitute undue limitations on the present application. Among them:

[0047] Figure 1 is a schematic diagram of the main process of the digital currency transaction method provided according to the first embodiment of the present application;

[0048] Figure 2a is a schematic diagram of the main process of the digital currency transaction method provided according to the second embodiment of the present application;

[0049] Figure 2b is Figure 2a The structure diagram of the method includes a plurality of numbered split block hierarchical queues;

[0050] Figure 3 is a schematic diagram of the main module of the digital currency transaction device provided according to the embodiment of the present application;

[0051] Figure 4 is an exemplary system architecture diagram to which the embodiments of the present application can be applied;

[0052] Figure 5 is a structure diagram of a computer system of a terminal device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION

[0053] The exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to help understanding, and should be considered only as exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Also, in order to be clear and concise, the description below omits the description of well-known functions and structures.

[0054] Figure 1 is a schematic diagram of the main process of the digital currency transaction method provided according to the first embodiment of the present application; as Figure 1 The digital currency transaction method provided by the embodiments of the present application mainly includes:

[0055] Step S101, receiving a user transaction request.

[0056] Specifically, before receiving the user transaction request, the embodiments of the present application further include the step of storing the user's digital currency, mainly including:

[0057] Obtaining user information, the user information including the user's historical transaction information and digital currency balance;

[0058] According to the historical transaction information, determining the transaction level information corresponding to the user;

[0059] According to the transaction level information and the digital currency balance, a storage quota of the digital currency corresponding to each transaction level is determined, and the digital currency balance is stored in the corresponding transaction level according to the storage quota.

[0060] Through the above setting, different transaction level information is determined according to the historical transaction information of the user, and the digital currency balance of the user is stored in different transaction levels by hashing, which avoids storing the digital currency together. When the digital currency transaction, especially the high-concurrency transaction scenario, is performed, the target digital currency can be determined in different transaction levels for transaction, which effectively avoids the resource conflict of the digital currency system, improves the transaction efficiency, improves the performance and stability of the digital currency system, and guarantees the transaction processing performance of the system.

[0061] Exemplarily, according to an embodiment of the present application, the user information further includes user feature information, wherein the user feature information includes one or more of the following information: user type, user residence, and user consumption type; after the step of obtaining the user information, the method further includes:

[0062] According to one or more of the user type, the user residence, and the user transaction type, a database corresponding to the storage of the digital currency balance of the user is determined.

[0063] Through the above setting, the hash storage of the digital currency of the user is realized, and the transaction processing performance of the digital currency system during busy time is effectively improved.

[0064] Further, according to an embodiment of the present application, according to the transaction level information and the digital currency balance, a storage quota of the digital currency corresponding to each transaction level is determined, and the digital currency balance is stored in the corresponding transaction level according to the storage quota, including:

[0065] According to the transaction number ratio and the level quota corresponding to each transaction level in the transaction level information, a level queue corresponding to the transaction level information is generated;

[0066] According to the level quota, each transaction level of the level queue is respectively divided to obtain a level queue containing a plurality of division blocks; wherein the storage quota of the digital currency corresponding to the division block does not exceed the level quota of the corresponding transaction level;

[0067] According to the digital currency balance and the level queue containing a plurality of division blocks, a storage quota of the digital currency corresponding to each transaction level is determined, and the digital currency balance is stored in the corresponding transaction level according to the storage quota.

[0068] Specifically, after determining different transaction levels and level quotas according to the historical transaction information of the user, the transaction level information corresponding to the level queue is generated according to the transaction frequency proportion corresponding to each transaction level and the level quota, and the above-mentioned step can be realized by machine learning, so that the transaction level with the highest transaction frequency proportion in the finally generated level queue is located at the upper part of the level queue; at the same time, each transaction level is cut respectively, so that each cut block can store no more than the level quota of the corresponding transaction level, and the above-mentioned setting helps to hash more storage quotas in the transaction level with the highest transaction frequency proportion, which is more conducive to the user's transaction habits, so that the transaction efficiency is improved during the transaction, especially during the high-concurrency transaction.

[0069] Preferably, according to an embodiment of the present application, the storage quota of the digital currency corresponding to each consumption level is determined according to the digital currency balance and the gradient level queue containing a plurality of cut blocks, and the digital currency balance is stored in the corresponding transaction level according to the storage quota, including:

[0070] According to the level quota of the transaction level corresponding to each cut block in the level queue and the position of each cut block in the level queue, each cut block in the level queue is numbered in turn to obtain the block number of each cut block;

[0071] According to the order of the block number, the digital currency balance is stored in the plurality of cut blocks in turn until the digital currency balance is stored.

[0072] Through the above-mentioned setting, after each transaction level in the level queue is cut and divided, each cut block in the level queue is numbered in turn according to the level quota of the transaction level corresponding to each cut block and the position of each cut block in the level queue to obtain the block number of each cut block; so as to store the digital currency balance of the user in the corresponding cut block according to the order of the block number.

[0073] Exemplarily, according to an embodiment of the present application, the above-mentioned numbering of each cut block in the level queue includes:

[0074] According to the order in the level queue, the current transaction level and the current cut block not numbered in the current transaction level are determined from the level queue, and the following steps are performed until each cut block is numbered or the digital currency balance of the user is stored in the cut block:

[0075] Determine whether there is a target cut block corresponding to the current cut block in the next level of the transaction level corresponding to the current cut block;

[0076] If yes, the number of the current split block is incremented, and the increment result is taken as the number of the target split block, and the target split block is taken as the current split block.

[0077] Specifically, since the number of the split block is related to the storage amount of each transaction level, when numbering the split blocks in the level queue, not only the position of the transaction level corresponding to the split block in the level queue (the transaction level with a high proportion of transaction times is located at the upper part of the level queue) needs to be considered, but also the correspondence between the split block of the current level and the split block of the next level needs to be considered, so that the digital currency balance of the user can be distributed to cover as many transaction levels as possible, and the stored digital currency in the commonly used transaction levels is guaranteed to be more, so as to effectively improve the transaction processing performance and improve the transaction efficiency.

[0078] Preferably, according to the embodiment of the present application, the method further comprises:

[0079] receiving transaction level update information, updating the level queue according to the transaction level update information, and updating the storage amount of the digital currency corresponding to each transaction level in the updated level queue according to the digital currency balance and the level queue containing a plurality of split blocks; and / or,

[0080] receiving digital currency balance update information, and updating the storage amount of the digital currency corresponding to each transaction level in the level queue according to the digital currency balance update information.

[0081] According to the embodiment of the present application, an update period can be set, the transaction level update information is determined according to the historical transaction information of the user in the last update period, and then the level queue and the storage amount corresponding to each transaction level in the level queue are updated. Through the above setting, the user experience is improved.

[0082] In step S102, the target digital currency corresponding to the user transaction request is determined according to the user transaction request and the transaction level information; wherein the transaction level information is generated according to the historical transaction information of the user and the digital currency balance, and the transaction level information includes the level number of the transaction level, and the level amount and the transaction times proportion corresponding to each transaction level.

[0083] Specifically, according to the embodiment of the present application, the determination of the target digital currency corresponding to the user transaction request according to the user transaction request and the transaction level information comprises:

[0084] determining the candidate transaction level from the transaction level information according to the transaction amount or the transaction type indicated in the user transaction request;

[0085] determining whether the current storage amount corresponding to the candidate transaction level is greater than or equal to the transaction amount;

[0086] If yes, the candidate transaction level is determined as the target transaction level, and the digital currency corresponding to the current stored amount in the target transaction level is determined as the target digital currency.

[0087] If no, the target transaction level is determined according to the level amount corresponding to the transaction level, the current stored amount and the transaction amount, and the target digital currency is determined.

[0088] Since the historical transaction information includes the transaction amount and / or transaction type of each historical transaction, the transaction level determined according to the historical transaction information also indicates different transaction amounts and / or transaction types. After receiving the transaction request of the user, the candidate transaction level can be determined from the multiple transaction levels according to the transaction amount or the transaction type indicated in the transaction request of the user, and then it is judged whether the current stored digital currency in the candidate transaction level can complete the transaction amount indicated in the transaction request of the user. If yes, the candidate transaction level is determined as the target transaction level, and the digital currency corresponding to the current stored amount in the target transaction level is determined as the target digital currency. If no, the next transaction level can be determined as the candidate transaction level, and then the above judgment is performed until the target transaction level is determined. It should be noted that the number of candidate transaction levels and target transaction levels can be one or more, that is, the target digital currency can be determined from the digital currency in the current stored amount of one or more transaction levels.

[0089] In step S103, the transaction request of the user is responded according to the target digital currency.

[0090] Further, according to the embodiment of the present application, the current stored amount corresponding to each transaction level also needs to be monitored to prevent the situation that the actual balance of the user is sufficient, but the stored amount of the digital currency of a certain level is insufficient, resulting in transaction failure. For example, a level queue stored amount intermediate table can be set to monitor the current stored amount corresponding to each transaction level.

[0091] According to the technical scheme of the embodiment of the present application, the user transaction request is received, the target digital currency corresponding to the user transaction request is determined according to the user transaction request and the transaction level information, wherein the transaction level information is generated according to the historical transaction information and the digital currency balance of the user, and the transaction level information includes the level number of the transaction level, and the level quota and the transaction number ratio corresponding to each transaction level, and the user transaction request is responded according to the target digital currency, so that the technical problem that in the prior art, the digital currencies are basically stored together, and when the digital currency transaction is performed, especially in a high-concurrency scenario, the resource conflict of the digital currency system often occurs, the transaction timeout is caused, the performance and stability of the digital currency system are reduced, and the transaction processing performance of the system is low is overcome, and the technical effect that the digital currencies of the user can be stored in different transaction levels in a hash manner, especially in a high-concurrency scenario, the resource conflict of the digital currency system is effectively avoided when the user performs the digital currency transaction, the transaction efficiency is improved, the performance and stability of the digital currency system are improved, and the transaction processing performance of the system is improved is achieved.

[0092] Figure 2a is a schematic diagram of the main process of the digital currency transaction method according to the second embodiment of the present application; as shown in Figure 2a the digital currency transaction method provided by the embodiment of the present application mainly includes:

[0093] In step S201, user information is obtained, the user information includes the historical transaction information and the digital currency balance of the user, and the transaction level information corresponding to the user is determined according to the historical transaction information.

[0094] Through the above setting, different transaction level information is determined according to the historical transaction information of the user, and then the digital currency balance of the user is stored in different transaction levels in a hash manner, so that the digital currencies are not stored together, and when the digital currency transaction is performed, especially in a high-concurrency transaction scenario, the target digital currency can be determined in different transaction levels for transaction, the resource conflict of the digital currency system is effectively avoided, the transaction efficiency is improved, the performance and stability of the digital currency system are improved, and the transaction processing performance of the system is ensured.

[0095] According to a specific embodiment of the embodiment of the present application, a plurality of levels are determined according to the transaction quota corresponding to each transaction in the historical transaction information of the user, for example, for a plurality of historical transactions in the 0-50 yuan interval, a 50 yuan transaction level can be determined, and 50 yuan is the level quota of the transaction level. Finally, 8 transaction levels (only as an example) of 50 yuan, 100 yuan, 150 yuan, 200 yuan, 500 yuan, 1000 yuan, 5000 yuan and more than 5000 yuan can be determined.

[0096] In another aspect, the transaction level can also be divided according to the transaction type. For example, the transaction amount of the payment type for daily diet, travel, etc. is often within 50 yuan, and therefore the transaction level corresponding to 50 yuan can be determined. The transaction amount of the decoration type is often above 5000 yuan, and therefore the transaction level corresponding to 5000 yuan or above can be determined, and so on. Finally, the multiple transaction level information corresponding to the user is determined.

[0097] Exemplarily, according to the embodiment of the present application, the user information further includes user characteristic information, wherein the user characteristic information includes one or more of the following information: user type, user residence, and user consumption type; after the step of obtaining the user information, the method further includes:

[0098] The database corresponding to the storage of the digital currency balance of the user is determined according to one or more of the user type, the user residence, and the user transaction type.

[0099] According to a specific embodiment of the present application, when the database corresponding to the storage of the digital currency balance of the user is determined according to the user type, the user residence, and the user consumption type: the user type can be determined first to determine whether the user is an individual user or a corporate user; if the user is a corporate user, the database corresponding to the storage of the digital currency of the corporate user is determined according to the user residence; that is, the digital currency of users in different residences is stored in different databases corresponding to different cities, thereby improving the transaction efficiency. If the user is an individual user, the digital currency of different transaction types can be stored in different databases according to the user transaction type, so that when the user performs a digital currency transaction, the target digital currency can be determined from different databases according to the type of the transaction to be transacted. According to another specific embodiment of the present application, the database corresponding to the storage of the digital currency balance of the user can also be determined directly according to any one or any two of the user type, the user residence, and the user transaction type. Through the above setting, the hash storage of the digital currency of the user is realized, and the transaction processing performance of the digital currency system during busy time is effectively improved.

[0100] In step S202, the level queue corresponding to the transaction level information is generated according to the transaction frequency proportion and the level quota corresponding to each transaction level in the transaction level information.

[0101] Specifically, the level queue corresponding to the transaction level information is generated according to the transaction frequency proportion and the level quota corresponding to each transaction level. The above step can be realized by machine learning, so that the transaction level with the highest transaction frequency proportion in the finally generated level queue is located at the upper part of the level queue, which is more conducive to the transaction habits of the user, so as to facilitate the subsequent hash storage of the digital currency with the corresponding storage quota according to the position of each transaction level in the level queue.

[0102] According to a specific embodiment of the embodiment of the present application, for example, the consumption behavior (corresponding to the transaction level of 50 yuan) of less than 50 yuan of a user in a period of time accounts for 40%, the consumption behavior (corresponding to the transaction level of 100 yuan) of less than 50-100 yuan accounts for 10%, and the consumption behavior of 100-200 accounts for 10% (corresponding to the transaction level of 200 yuan). There are three transaction levels in total in the transaction level, the 50 yuan level is located at the top, the 100 yuan level is located in the middle, and the 200 yuan level is located at the bottom. This is because the transaction frequency ratio of the 50 yuan level is the highest, and although the transaction frequency ratios of the 100 yuan level and the 200 yuan level are consistent, the level amount (100 yuan) of the 100 yuan level is less than the level amount (200 yuan) of the 200 yuan level, so the 100 yuan level is placed above the 200 yuan level to facilitate subsequent hash storage.

[0103] In step S203, each transaction level of the level queue is respectively divided according to the level amount, and a level queue containing a plurality of division blocks is obtained; wherein the storage amount of the digital currency corresponding to the division block does not exceed the level amount of the corresponding transaction level.

[0104] Through the above setting, each transaction level is respectively divided, so that each division block can store digital currency not exceeding the level amount of the corresponding transaction level. The above setting helps to store more storage amount in the transaction level with the highest transaction frequency ratio, which is more conducive to the transaction habits of users, so as to improve the transaction efficiency in the transaction process, especially in the high-concurrency transaction process.

[0105] In step S204, each division block in the level queue is sequentially numbered according to the level amount of the transaction level corresponding to each division block in the level queue and the position of each division block in the level queue, and the block number of each division block is obtained.

[0106] In step S205, the digital currency balance is sequentially stored in the plurality of division blocks according to the order of the block number until the digital currency balance is stored.

[0107] Through the above setting, after the division of each transaction level in the level queue, each division block in the level queue is sequentially numbered according to the level amount of the transaction level corresponding to each division block and the position of each division block in the level queue, and the block number of each division block is obtained; so as to store the digital currency balance of the user in the corresponding division block according to the order of the block number.

[0108] Exemplarily, according to the embodiment of the present application, the above sequential numbering of each division block in the level queue comprises:

[0109] determining, from the hierarchical queue in the order, a current transaction level in the hierarchical queue, and a current split block in the current transaction level which is not numbered, and performing the following steps until each split block is numbered or the user's digital currency balance is stored into the split block:

[0110] determining whether there is a target split block corresponding to the current split block in a next level of the transaction level corresponding to the current split block;

[0111] if yes, incrementing the number of the current split block, taking the increment result as the number of the target split block, and taking the target split block as the current split block.

[0112] Specifically, the split blocks are numbered vertically according to the order from top to bottom of the multiple transaction levels in the hierarchical queue. The purpose is that when the user's digital currency balance is small, the hierarchical distribution range of the digital currency is narrow, and the available digital currency cannot be quickly located. According to the embodiment of the present application, Figure 2b a structural schematic diagram of the hierarchical queue containing multiple numbered split blocks is shown, as Figure 2b shown (only part of the numbers are shown), the split blocks are numbered vertically according to the order from top to bottom of the multiple transaction levels in the hierarchical queue.

[0113] First, the topmost transaction level of the hierarchical queue is determined as the current transaction level, and then the first split block in the current transaction level is numbered as 1. Then, according to the correspondence between the split block numbered 1 in the first level and the split blocks in the next level (which is the second level), it can be known that the straight line corresponding to the right side of the split block 1 is located on the left side of the straight line corresponding to the right side of the split blocks in the next level, so the split blocks in the first level are still numbered, which is numbered as 2. Then, it can be known that the straight line corresponding to the right side of the split block 2 coincides with the straight line corresponding to the right side of the split blocks in the next level, so the split blocks in the second level are numbered, which is numbered as 3. For the split block 3 in the second level, it can be known that the straight line corresponding to the right side of the split block 3 is located on the left side of the straight line corresponding to the right side of the split blocks in the next level. At this time, the unnumbered split blocks in the first level are numbered again, which is numbered as 4. That is, when the straight line corresponding to the right side of the split block in the current level does not coincide with the straight line corresponding to the right side of the unnumbered split block in the next level, or the former corresponding straight line is located on the right side of the latter corresponding straight line, the arrangement according to the order from top to bottom of the multiple transaction levels in the hierarchical queue in the current round is ended, and the first level of the hierarchical queue is returned to start the second round of numbering.

[0114] A preferred embodiment can also directly determine the consumption frequency according to the historical transaction information and the actual digital currency balance of the user, and split the hierarchical queue, that is, after determining the actual digital currency balance of the user, the split blocks are divided from the hierarchical queue. For example, according to the historical transaction information of the user, 10 consumption frequencies of 15 transactions are below 100 yuan, 4 consumption frequencies of 15 transactions are below 1000 yuan, and 1 consumption frequency of 15 transactions is below 5000 yuan. Based on this, three transaction levels can be determined, 100 yuan transaction level, 1000 yuan transaction level and 5000 yuan transaction level. If the actual digital currency balance of the user is 10,000 yuan. According to the consumption frequency ratio, 10 split blocks can be divided from the 100 yuan transaction level, each of which stores 100 yuan of digital currency; 4 split blocks can be divided from the 1000 yuan transaction level, each of which stores 1000 yuan of digital currency; and 1 split block can be divided from the 5000 yuan transaction level, each of which stores 5000 yuan of digital currency.

[0115] According to another embodiment of the embodiment of the application, if the transaction type is deposit, the deposit amount can be determined at this time, the corresponding transaction level is determined according to the deposit amount, and the digital currency corresponding to the deposit amount is stored in the split block in the corresponding transaction level. Further, if there is an unfull split block in the corresponding transaction level, but the remaining amount of the split block is less than the deposit amount, the deposit amount will be hashed again and stored in different split blocks of the corresponding transaction level. Preferably, if the split block of the corresponding transaction level is full of digital currency, the digital currency corresponding to the deposit amount can be stored in a transaction level with a larger hierarchical amount.

[0116] Specifically, since the number of split blocks involves the storage amount corresponding to each transaction level, when numbering the split blocks in the hierarchical queue, not only the position of the split block corresponding to the transaction level in the hierarchical queue (the transaction level with high transaction frequency ratio is above in the hierarchical queue) needs to be considered, but also the corresponding relationship between the split block of the current level and the split block of the next level needs to be considered, so that the digital currency balance of the user can be as dispersed as possible to cover more transaction levels, and the stored digital currency in the commonly used transaction level is guaranteed to be more, so as to effectively improve the transaction processing performance and improve the transaction efficiency.

[0117] Preferably, according to the embodiment of the application, the above method further comprises:

[0118] receiving transaction level update information, updating the hierarchical queue according to the transaction level update information, and updating the storage amount of the digital currency corresponding to each transaction level in the updated hierarchical queue according to the digital currency balance and the hierarchical queue containing a plurality of split blocks; and / or,

[0119] receive the digital currency balance update information, and update the storage amount of the digital currency corresponding to each transaction level in the hierarchical queue according to the digital currency balance update information.

[0120] According to the embodiment of the present application, an update period can be set, each satisfying one update period, and the transaction level update information is determined according to the historical transaction information of the user in the last update period, and then the hierarchical queue and the storage amount corresponding to each transaction level in the hierarchical queue are updated. Through the above setting, the user experience is improved.

[0121] Step S206, receiving the user transaction request.

[0122] Step S207, determining the candidate transaction level from the transaction level information according to the transaction amount or the transaction type indicated in the user transaction request.

[0123] Since the historical transaction information includes the transaction amount and / or the transaction type of each historical transaction, the transaction level determined according to the historical transaction information also indicates different transaction amounts and / or transaction types. After receiving the user's transaction request, the candidate transaction level can be determined from the plurality of transaction levels according to the transaction amount or the transaction type indicated in the user transaction request, wherein the number of candidate transaction levels is generally one, and when the storage amount is small, it can also be multiple.

[0124] Step S208, determining whether the current storage amount corresponding to the candidate transaction level is greater than or equal to the transaction amount. If not, step S209 is executed; if yes, step S210 is executed.

[0125] Step S209, updating the candidate transaction level according to the hierarchical amount and the current storage amount corresponding to the transaction level. Then go to step S208.

[0126] Step S210, determining that the candidate transaction level is the target transaction level, and determining that the digital currency corresponding to the current storage amount in the target transaction level is the target digital currency.

[0127] Through the above setting, it is determined whether the current storage amount in the candidate transaction level can complete the transaction amount indicated in the user transaction request. If yes, the candidate transaction level is determined as the target transaction level, and the digital currency corresponding to the current storage amount in the target transaction level is determined as the target digital currency. If not, the next transaction level can be determined as the candidate transaction level (i.e. updating the candidate transaction level), and then the above determination is performed until the target transaction level is determined. It should be noted that the number of target transaction levels can be one or more, i.e. the target digital currency can be determined from the digital currency in the current storage amount of one or more transaction levels.

[0128] Step S211, according to the target digital currency, responding to the user transaction request.

[0129] Further, according to the embodiment of the present application, the hierarchical queue storage quota intermediate table can also be set up to monitor the current storage quota corresponding to each transaction level, so as to prevent the situation that the actual balance of the user is sufficient, but the digital currency storage amount of a certain level is insufficient, resulting in transaction failure.

[0130] According to the technical scheme of the embodiment of the present application, because the technical means of receiving a user transaction request, determining the target digital currency corresponding to the user transaction request according to the user transaction request and transaction level information, wherein the transaction level information is generated according to the historical transaction information and digital currency balance of the user, and the transaction level information includes the level number of the transaction level, and the level quota and transaction number ratio corresponding to each transaction level, and responding to the user transaction request according to the target digital currency, the technical problem that in the existing digital currency transaction method, because the digital currency is basically stored together, when the digital currency transaction is carried out, especially in a high concurrency scenario, the resource conflict of the digital currency system often exists, resulting in transaction timeout, reducing the performance and stability of the digital currency system, and reducing the transaction processing performance of the system is overcome, and the technical effect that the digital currency of the user can be hash stored to different transaction levels, especially in a high concurrency scenario, the resource conflict of the digital currency system when the user carries out digital currency transaction is effectively avoided, the transaction efficiency is improved, the performance and stability of the digital currency system are improved, and the transaction processing performance of the system is improved.

[0131] Figure 3 is the schematic diagram of the main module of the digital currency transaction device provided by the embodiment of the present application; as Figure 3 shown, the digital currency transaction device 300 provided by the embodiment of the present application mainly includes:

[0132] The transaction request acquisition module 301 is used for receiving a user transaction request.

[0133] Specifically, the digital currency transaction device 300 provided by the embodiment of the present application further includes a storage module, before receiving the user transaction request, the storage module is used for:

[0134] Obtaining user information, the user information including the historical transaction information and the digital currency balance of the user;

[0135] According to the historical transaction information, determining the transaction level information corresponding to the user; wherein;

[0136] According to the transaction level information and the digital currency balance, determining the storage quota of the digital currency corresponding to each transaction level, and storing the digital currency balance to the corresponding transaction level according to the storage quota.

[0137] Through the above setting, different transaction level information is determined according to the historical transaction information of the user, and then the digital currency balance of the user is stored in different transaction levels by hashing, so that the digital currencies are not stored together. When the digital currency transaction, especially in a high concurrency scenario, the target digital currency can be determined in different transaction levels for transaction, which effectively avoids the resource conflict of the digital currency system, improves the transaction efficiency, improves the performance and stability of the digital currency system, and guarantees the transaction processing performance of the system.

[0138] Exemplarily, according to the embodiment of the application, the user information further includes user feature information, wherein the user feature information includes one or more of the following information: user type, user residence, and user consumption type; the transaction device 300 of the digital currency further includes a database determination module, configured to:

[0139] determine the database corresponding to the storage of the digital currency balance of the user according to one or more of the user type, the user residence, and the user transaction type.

[0140] Through the above setting, the hash storage of the digital currency of the user is realized, and the transaction processing performance of the digital currency system during busy time is effectively improved.

[0141] Further, according to the embodiment of the application, the storage module is further configured to:

[0142] generate a level queue corresponding to the transaction level information according to the transaction number ratio and the level quota of each transaction level in the transaction level information;

[0143] According to the level quota, each transaction level of the level queue is respectively divided to obtain a level queue containing a plurality of division blocks; wherein the storage quota of the digital currency corresponding to the division block does not exceed the level quota of the corresponding transaction level;

[0144] According to the digital currency balance and the level queue containing a plurality of division blocks, the storage quota of the digital currency corresponding to each transaction level is determined, and the digital currency balance is respectively stored in the corresponding transaction level according to the storage quota.

[0145] Specifically, after determining different transaction levels and level quotas according to the historical transaction information of the user, the transaction level information corresponding to the level queue is generated according to the transaction frequency proportion corresponding to each transaction level and the level quota, and the above-mentioned setting can be realized by machine learning, so that the transaction level with the highest transaction frequency proportion in the finally generated level queue is located at the upper part of the level queue; at the same time, each transaction level is cut respectively, so that each cut block can store no more than the level quota of the corresponding transaction level, and the above-mentioned setting helps to hash more storage quotas in the transaction level with the highest transaction frequency proportion, which is more conducive to the user's transaction habits, so that the transaction efficiency is improved during the transaction, especially during the high-concurrency transaction.

[0146] Preferably, according to an embodiment of the present application, the storage module is further configured to:

[0147] According to the level quota of the transaction level corresponding to each cut block in the level queue and the position of each cut block in the level queue, each cut block in the level queue is sequentially numbered to obtain the block number of each cut block.

[0148] According to the order of the block number, the digital currency balance is sequentially stored in the plurality of cut blocks until the digital currency balance is stored.

[0149] According to the above-mentioned setting, after each transaction level in the level queue is cut and divided, each cut block in the level queue is sequentially numbered according to the level quota of the transaction level corresponding to each cut block and the position of each cut block in the level queue, to obtain the block number of each cut block; so as to store the digital currency balance of the user in the corresponding cut block according to the order of the block number.

[0150] Exemplarily, according to an embodiment of the present application, the storage module is further configured to:

[0151] According to the order of the level queue, the current transaction level and the current cut block in the current transaction level which has not been numbered are determined from the level queue, and the following steps are performed until each cut block is numbered or the digital currency balance of the user is stored in the cut block:

[0152] Determine whether there is a target cut block corresponding to the current cut block in the next level of the transaction level corresponding to the current cut block;

[0153] If yes, the number of the current cut block is incremented, and the increment result is used as the number of the target cut block, and the target cut block is used as the current cut block.

[0154] Specifically, since the number of the split block is related to the storage amount of each transaction level, when numbering the split blocks in the level queue, not only the position of the transaction level corresponding to the split block in the level queue (the transaction level with high transaction frequency ratio is above in the level queue) needs to be considered, but also the corresponding relationship between the split block of the current level and the split block of the next level needs to be considered, so that the digital currency balance of the user can be as evenly distributed as possible to cover a wide range of transaction levels, and the storage of digital currency in the commonly used transaction levels is guaranteed to be more, so as to effectively improve the transaction processing performance and improve the transaction efficiency.

[0155] Preferably, according to the embodiment of the present application, the transaction device 300 of the digital currency further comprises an updating module, configured to:

[0156] receive transaction level update information, update the level queue according to the transaction level update information, and update the storage amount of the digital currency corresponding to each transaction level in the updated level queue according to the digital currency balance and the level queue comprising a plurality of split blocks; and / or,

[0157] receive digital currency balance update information, and update the storage amount of the digital currency corresponding to each transaction level in the level queue according to the digital currency balance update information.

[0158] According to the embodiment of the present application, an update period can be set, each satisfying an update period, the transaction level update information is determined according to the historical transaction information of the user in the last update period, and then the level queue and the storage amount corresponding to each transaction level in the level queue are updated. Through the above setting, the user experience is improved.

[0159] The target digital currency determination module 302 is configured to determine the target digital currency corresponding to the user transaction request according to the user transaction request and the transaction level information, wherein the transaction level information is generated according to the historical transaction information of the user and the digital currency balance, and the transaction level information comprises the level number of the transaction level, and the level amount and the transaction frequency ratio corresponding to each transaction level.

[0160] Specifically, according to the embodiment of the present application, the target digital currency determination module 302 is further configured to:

[0161] determine the candidate transaction level from the transaction level information according to the transaction amount or the transaction type indicated in the user transaction request;

[0162] determine whether the current storage amount corresponding to the candidate transaction level is greater than or equal to the transaction amount;

[0163] If yes, the candidate transaction level is determined as the target transaction level, and the digital currency corresponding to the current stored amount in the target transaction level is determined as the target digital currency.

[0164] If no, the target transaction level is determined according to the level amount corresponding to the transaction level, the current stored amount and the transaction amount, and the target digital currency is determined.

[0165] Since the historical transaction information includes the transaction amount and / or transaction type of each historical transaction, the transaction level determined according to the historical transaction information also indicates different transaction amounts and / or transaction types. After receiving the transaction request of the user, the candidate transaction level can be determined from the plurality of transaction levels according to the transaction amount or the transaction type indicated in the transaction request of the user, and then it is judged whether the current stored digital currency in the candidate transaction level can complete the transaction amount indicated in the transaction request of the user. If yes, the candidate transaction level is determined as the target transaction level, and the digital currency corresponding to the current stored amount in the target transaction level is determined as the target digital currency. If no, the next transaction level can be determined as the candidate transaction level, and then the above judgment is performed until the target transaction level is determined. It should be noted that the number of candidate transaction levels and target transaction levels can be one or more, that is, the target digital currency can be determined from the digital currency in the current stored amount of one or more transaction levels.

[0166] The transaction module 303 is configured to respond to the transaction request of the user according to the target digital currency.

[0167] Further, according to the embodiment of the present application, the transaction device 300 of the digital currency further comprises an intermediate table setting module, configured to set a level queue stored amount intermediate table to monitor the current stored amount corresponding to each transaction level. This prevents the situation that the actual balance of the user is sufficient, but the digital currency storage amount of a certain level is insufficient, resulting in transaction failure.

[0168] According to the technical scheme of the embodiment of the present application, the user transaction request is received, the target digital currency corresponding to the user transaction request is determined according to the user transaction request and the transaction level information, wherein the transaction level information is generated according to the historical transaction information and the digital currency balance of the user, and the transaction level information includes the level number of the transaction level, and the level quota and the transaction number ratio corresponding to each transaction level, and the user transaction request is responded according to the target digital currency, so that the technical problem of the prior art that the digital currency is basically stored together, and when the digital currency transaction is performed, especially in a high concurrency scenario, the resource conflict of the digital currency system often occurs, the transaction timeout is caused, the performance and stability of the digital currency system are reduced, and the transaction processing performance of the system is low is overcome, and the technical effect that the digital currency of the user can be stored in different transaction levels, especially in a high concurrency scenario, the resource conflict of the digital currency system when the user performs the digital currency transaction is effectively avoided, the transaction efficiency is improved, the performance and stability of the digital currency system are improved, and the transaction processing performance of the system is improved is achieved.

[0169] Figure 4 An exemplary system architecture 400 to which the digital currency transaction method or the digital currency transaction device of the embodiments of the present application can be applied is shown.

[0170] As shown in Figure 4 The system architecture 400 can include terminal devices 401, 402, 403, a network 404, and a server 405 (this architecture is only an example, and the components included in the specific architecture can be adjusted according to the specific application). The network 404 is used to provide a communication link medium between the terminal devices 401, 402, 403 and the server 405. The network 404 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0171] The user can use the terminal devices 401, 402, 403 to interact with the server 405 through the network 404 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 401, 402, 403, such as data processing applications, digital currency payment applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as an example).

[0172] The terminal devices 401, 402, 403 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0173] The server 405 can be a server that provides various services, such as a server that processes transactions and processes data for users using the terminal devices 401, 402, and 403 (only as an example). The server can analyze and process received data such as a user transaction request, and feed back the processing result (for example, target digital currency - only as an example) to the terminal device.

[0174] It should be noted that the transaction method of the digital currency provided by the embodiment of the present application is generally executed by the server 405, and accordingly, the transaction device of the digital currency is generally provided in the server 405.

[0175] It should be understood that Figure 4 The number of terminal devices, networks, and servers in the above-mentioned system is only illustrative. Any number of terminal devices, networks, and servers can be provided according to the needs of implementation.

[0176] Reference will be made to Figure 5 which shows a structural schematic diagram of a computer system 500 suitable for implementing the terminal device or server of the embodiment of the present application. Figure 5 The terminal device or server shown is only an example, and should not impose any limitation on the function and use range of the embodiment of the present application.

[0177] As shown in Figure 5 , the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 502 or programs loaded from a storage portion 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0178] The following components are connected to the I / O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage portion 508 including a hard disk, and the like; and a communication portion 509 including a network interface card such as a LAN card, a modem, and the like. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 510 as needed, so that a computer program read therefrom is installed in the storage portion 508 as needed.

[0179] In particular, the processes described above with reference to the flow charts can be implemented as a computer software program in accordance with the embodiments disclosed herein. For example, embodiments disclosed herein include a computer program product which includes a computer program tangibly embodied on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flow charts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 509 and / or installed from the removable media 511. When the computer program is executed by the central processing unit (CPU) 501, the above-described functions defined in the system of the present application are executed.

[0180] It should be noted that the computer readable medium shown in the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present application, the computer readable signal medium can include a data signal carried in a baseband or as a carrier wave in a propagated data signal, in which the computer readable program code is carried. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium that can send, propagate or transfer a program for use by or in connection with an instruction execution system, device or apparatus. The program code contained on the computer readable medium can be transmitted using any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0181] The computer program product of the present application can include a computer readable medium, which can be a built-in medium installed in a device or an external medium such as a USB flash drive, a Blu-ray disk or an SD memory card, or a separate computer program product. The computer readable medium has a program stored thereon, and the program can make the device include: receiving a user transaction request; determining a target digital currency corresponding to the user transaction request according to the user transaction request and transaction level information, wherein the transaction level information is generated according to historical transaction information and a digital currency balance of the user, and the transaction level information includes a level number of a transaction level, and a level quota and a transaction number ratio corresponding to each transaction level; and responding to the user transaction request according to the target digital currency.

[0182] The modules described in the embodiments of the present application can be implemented in the form of software, or can be implemented in the form of hardware. The described modules can also be arranged in a processor, for example, a processor can be described as: a processor includes a transaction request obtaining module, a target digital currency determining module and a transaction module. Among them, the names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the transaction request obtaining module can also be described as "a module for receiving a user transaction request".

[0183] As another aspect, the present application also provides a computer readable medium, which can be included in the device described in the above embodiments, or can exist separately without being assembled into the device. The computer readable medium described above carries one or more programs, which, when executed by the device, cause the device to include: receiving a user transaction request; determining a target digital currency corresponding to the user transaction request according to the user transaction request and transaction level information, wherein the transaction level information is generated according to historical transaction information and a digital currency balance of the user, and the transaction level information includes a level number of a transaction level, and a level quota and a transaction number ratio corresponding to each transaction level; and responding to the user transaction request according to the target digital currency.

[0184] According to the technical scheme of the embodiment of the present application, the user transaction request is received, the target digital currency corresponding to the user transaction request is determined according to the user transaction request and the transaction level information, the transaction level information is generated according to the historical transaction information and the digital currency balance of the user, the transaction level information includes the level number of the transaction level, and the level quota and the transaction number ratio corresponding to each transaction level, the user transaction request is responded according to the target digital currency, so the technical scheme overcomes the technical problem in the prior art that, due to the fact that the digital currencies are basically stored together, when the digital currency transaction is performed, especially in a high concurrency scenario, the resource conflict of the digital currency system often occurs, which leads to transaction timeout, reduces the performance and stability of the digital currency system, and reduces the transaction processing performance of the system, and further achieves the technical effect that the digital currencies of the user can be stored in different transaction levels in a hash manner, especially in a high concurrency scenario, the resource conflict of the digital currency system is effectively avoided when the user performs the digital currency transaction, the transaction efficiency is improved, the performance and stability of the digital currency system are improved, and the transaction processing performance of the system is improved.

[0185] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made depending on design requirements and other factors. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method of transaction of a digital currency, characterized by, Comprising: receiving a user transaction request; determining a target digital currency corresponding to the user transaction request according to the user transaction request and transaction level information, wherein the transaction level information is generated according to historical transaction information and digital currency balance of a user, and the transaction level information includes a level number of a transaction level and a level quota and a transaction number ratio corresponding to each transaction level; responding to the user transaction request according to the target digital currency; Further comprising a storage step of digital currency: obtaining user information, wherein the user information includes historical transaction information and digital currency balance of a user; determining transaction level information corresponding to the user according to the historical transaction information; generating a level queue corresponding to the transaction level information according to the transaction number ratio and the level quota corresponding to each transaction level in the transaction level information; dividing each transaction level of the level queue according to the level quota to obtain a level queue containing multiple division blocks, wherein a storage quota of the digital currency corresponding to the division block does not exceed the level quota of the corresponding transaction level; determining a storage quota of the digital currency corresponding to each transaction level according to the digital currency balance and the level queue containing multiple division blocks, and storing the digital currency balance to the corresponding transaction level according to the storage quota.

2. The method of claim 1, wherein, The step of determining a storage quota of the digital currency corresponding to each transaction level according to the digital currency balance and the level queue containing multiple division blocks, and storing the digital currency balance to the corresponding transaction level, comprises: sequentially numbering each division block in the level queue according to the level quota of the transaction level corresponding to each division block in the level queue and the position of each division block in the level queue to obtain a block number of each division block; storing the digital currency balance in the multiple division blocks in sequence according to the order of the block number until the digital currency balance is stored completely.

3. The method of claim 2, wherein, The step of sequentially numbering each division block in the level queue, comprises: determining a current transaction level and a current division block in the current transaction level that has not been numbered in the level queue according to the order in the level queue, and performing the following steps until each division block is numbered or the digital currency balance of the user is stored in the division block: determining whether there is a target division block corresponding to the current division block in the next level of the transaction level corresponding to the current division block; if yes, incrementing the number of the current division block and taking the increment result as the number of the target division block, and taking the target division block as the current division block.

4. The method of claim 1, wherein, Further comprising: receiving transaction level update information, updating the level queue according to the transaction level update information, and updating the storage quota of the digital currency corresponding to each transaction level in the updated level queue according to the digital currency balance and the level queue containing multiple division blocks; and / or, receive digital currency balance update information, and update a storage amount of a digital currency corresponding to each transaction level in the hierarchical queue according to the digital currency balance update information.

5. The method of claim 1, wherein, According to the user transaction request and the transaction level information, determine a target digital currency corresponding to the user transaction request, including: According to the transaction amount or the transaction type indicated in the user transaction request, determine a candidate transaction level from the transaction level information; Determine whether the current storage amount in the candidate transaction level is greater than or equal to the transaction amount; If yes, determine the candidate transaction level as the target transaction level, and determine the digital currency corresponding to the current storage amount in the target transaction level as the target digital currency; If no, determine the target transaction level and the target digital currency according to the level amount, the current storage amount, and the transaction amount corresponding to the transaction level.

6. The method of claim 1, wherein, The user information further includes user feature information, wherein the user feature information includes one or more of the following information: user type, user residence, and user consumption type; after the step of obtaining user information, further including: Determine a database corresponding to the storage of the digital currency balance of the user according to one or more of the user type, the user residence, and the user transaction type.

7. A transaction device for a digital currency, characterized by Including: A transaction request acquisition module for receiving a user transaction request; A target digital currency determination module for determining a target digital currency corresponding to the user transaction request according to the user transaction request and transaction level information; wherein the transaction level information is generated according to the historical transaction information and the digital currency balance of the user, and the transaction level information includes the level number of the transaction level, and the level amount and the transaction frequency ratio corresponding to each transaction level; A transaction module for responding to the user transaction request according to the target digital currency; A storage module for: Obtain user information, including the historical transaction information and the digital currency balance of the user; Determine the transaction level information corresponding to the user according to the historical transaction information; Generate a hierarchical queue corresponding to the transaction level information according to the transaction frequency ratio and the level amount corresponding to each transaction level in the transaction level information; According to the level amount, divide each transaction level of the hierarchical queue to obtain a hierarchical queue containing multiple cut blocks; wherein the storage amount of the digital currency corresponding to the cut block does not exceed the level amount of the corresponding transaction level; According to the digital currency balance and the hierarchical queue containing multiple cut blocks, determine the storage amount of the digital currency corresponding to each transaction level, and store the digital currency balance to the corresponding transaction level according to the storage amount.

8. An electronic device, comprising: Including: One or more processors; Storage devices for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-6.

9. A computer readable medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-6. The program is executed by the processor to implement the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Method and device for determining the validity of transactions based on chain blocks

    CN107103471A

  • Digital currency performance expansion method based on districts

    CN110570187A

  • Transaction processing method and device based on digital currency and electronic equipment

    CN110852730A

  • Method and system for managing digital assets

    US20050028104A1