CN116187987A - Digital currency transaction method and device - Google Patents

Digital currency transaction method and device Download PDF

Info

Publication number
CN116187987A
CN116187987A CN202111421404.4A CN202111421404A CN116187987A CN 116187987 A CN116187987 A CN 116187987A CN 202111421404 A CN202111421404 A CN 202111421404A CN 116187987 A CN116187987 A CN 116187987A
Authority
CN
China
Prior art keywords
transaction
level
digital currency
user
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111421404.4A
Other languages
Chinese (zh)
Inventor
戈星晨
赖锋健
王晓旭
穆长春
狄刚
吕远
赵新宇
张红波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Digital Currency Institute of the Peoples Bank of China
Original Assignee
Bank of China Ltd
Digital Currency Institute of the Peoples Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd, Digital Currency Institute of the Peoples Bank of China filed Critical Bank of China Ltd
Priority to CN202111421404.4A priority Critical patent/CN116187987A/en
Publication of CN116187987A publication Critical patent/CN116187987A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The invention discloses a method and a device for trading digital currency, and relates to the technical field of computers. One embodiment of the method comprises the following steps: receiving a user transaction request; determining a target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information; the transaction hierarchy information is generated according to historical transaction information and digital currency balance of a user, and comprises hierarchy numbers of transaction hierarchies, hierarchy amount corresponding to each transaction hierarchy and transaction frequency proportion; responding to the user transaction request according to the target digital currency. According to the embodiment, the resource conflict of the digital currency system when the user carries out the digital currency transaction is effectively avoided, the transaction efficiency is improved, the performance and the stability of the digital currency system are improved, and the transaction processing performance of the system is improved.

Description

Digital currency transaction method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for trading digital money.
Background
In the process of the transaction of the digital currency, the digital currency under the digital currency wallet of the user is processed (the generation and the cancellation of the digital currency), and as the digital currency contains the related information such as the account and the secret key of the user, the performance loss caused by the generation and the cancellation of the digital currency of the user (particularly the performance loss caused by the resource conflict in a high concurrency scene) becomes a transaction bottleneck, and how to improve the transaction processing performance of the digital currency system when busy is a problem to be solved at present.
The prior art has at least the following problems:
in the existing digital currency transaction method, because the digital currencies are basically stored together, when digital currency transaction, especially in a high concurrency transaction scene, resource conflict of the digital currency system often exists, so that the transaction overtime is caused, the performance and the stability of the digital currency system are reduced, and the transaction processing performance of the system is reduced.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method and an apparatus for trading digital money, which can store the hash of the digital money of a user to different trading levels, especially in a high concurrency trading scenario, so as to effectively avoid resource conflict of a digital money system when the user performs the digital money trade, improve the trading efficiency, and improve the performance and stability of the digital money system, and the trading processing performance of the system.
To achieve the above object, according to a first aspect of an embodiment of the present invention, there is provided a transaction method of digital money, including:
receiving a user transaction request;
determining a target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information; the transaction hierarchy information is generated according to historical transaction information and digital currency balance of a user, and comprises hierarchy numbers of transaction hierarchies, hierarchy amount corresponding to each transaction hierarchy and transaction frequency proportion;
Responding to the user transaction request according to the target digital currency.
Further, the method also comprises the step of storing the digital currency:
acquiring user information, wherein the user information comprises historical transaction information and digital currency balance of a user;
determining transaction level information corresponding to a user according to historical transaction information;
according to the transaction level information and the digital currency balance, determining the storage limit of the digital currency corresponding to each transaction level, and respectively storing the digital currency balance to the corresponding transaction level according to the storage limit.
Further, according to the transaction level information and the digital currency balance, determining a storage limit of the digital currency corresponding to each transaction level, and respectively storing the digital currency balance to the corresponding transaction level according to the storage limit, including:
generating a hierarchy queue corresponding to the transaction hierarchy information according to the transaction number proportion and the hierarchy limit corresponding to each transaction hierarchy in the transaction hierarchy information;
dividing each transaction level of the level queue according to the level limit to obtain a level queue containing a plurality of dividing blocks; wherein, the storage limit of the digital currency corresponding to the segmentation block does not exceed the level limit of the corresponding transaction level;
According to the balance of the digital currency and the level queues containing a plurality of cut blocks, the storage limit of the digital currency corresponding to each transaction level is determined, and the balance of the digital currency is respectively stored to the corresponding transaction level according to the storage limit.
Further, determining a storage limit of the digital currency corresponding to each consumption level according to the digital currency balance and a gradient level queue including a plurality of cut blocks, and respectively storing the digital currency balance to the corresponding transaction level according to the storage limit, including:
sequentially numbering each segmentation block in the hierarchy queue according to the hierarchy limit of the transaction hierarchy corresponding to each segmentation block in the hierarchy queue and the position of each segmentation block in the hierarchy queue to obtain the block number of each segmentation block;
and sequentially storing the digital currency balances in the plurality of cutting blocks according to the sequence of the block numbers until the digital currency balances are stored.
Further, each segmentation block in the hierarchical queue is numbered in turn, including:
determining a current transaction level and unnumbered current cut segments in the current transaction level from the level queue according to the sequence in the level queue, and executing the following steps until each cut segment is numbered or the digital currency balance of the user is stored in the cut segment:
Determining whether a target segmentation block corresponding to the current segmentation block exists in the next level of the transaction level corresponding to the current segmentation block;
if yes, the number of the current cutting block is increased, the increasing result is used as the number of the target cutting block, and the target cutting block is used as the current cutting block.
Further, the method further comprises the following steps:
receiving transaction level updating information, updating a level queue according to the transaction level updating information, and updating a storage limit of digital currency corresponding to each transaction level in the updated level queue according to the balance of the digital currency and the level queue comprising a plurality of cut blocks; and/or the number of the groups of groups,
and receiving digital currency balance updating 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 updating information.
Further, determining a target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information, including:
determining candidate transaction levels from the transaction level information according to the transaction amount or the transaction type indicated in the user transaction request;
judging whether the corresponding current memory line in the candidate transaction hierarchy is greater than or equal to the transaction line;
If yes, determining the candidate transaction level as a target transaction level, and determining the digital currency corresponding to the current storage line in the target transaction level as target digital currency;
if not, determining a target transaction level according to the level limit, the current storage limit and the transaction limit corresponding to the transaction level, and determining target digital currency.
Further, the user information further comprises user characteristic information, wherein the user characteristic information comprises one or more of the following information: user type, user attribution, user consumption type; after the step of acquiring the user information, further comprising:
and determining a database stored correspondingly with the digital currency balance of the user according to one or more of the user type, the user attribution and the user transaction type.
According to a second aspect of an embodiment of the present invention, there is provided a transaction apparatus for digital money, comprising:
the transaction request acquisition module is used for receiving a user transaction request;
the target digital currency determining module is used for determining target digital currency corresponding to the user transaction request according to the user transaction request and the transaction level information; the transaction hierarchy information is generated according to historical transaction information and digital currency balance of a user, and comprises hierarchy numbers of transaction hierarchies, hierarchy amount corresponding to each transaction hierarchy and transaction frequency proportion;
And the transaction module is used for responding to the user transaction request according to the target digital currency.
According to a third aspect of an embodiment of the present invention, there is provided an electronic apparatus including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of transaction for digital currency as any one of the above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which when executed by a processor implements a method of transaction of digital currency as any one of the above.
One embodiment of the above invention has the following advantages or benefits: because of the adoption of receiving user transaction requests; determining a target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information; the transaction hierarchy information is generated according to historical transaction information and digital currency balance of a user, and comprises hierarchy numbers of transaction hierarchies, hierarchy amount corresponding to each transaction hierarchy and transaction frequency proportion; according to the target digital currency, the technical means of responding to the user transaction request is overcome, and the technical effects that in the existing digital currency transaction method, as the digital currencies are basically stored together, when digital currency transaction, especially in a high concurrency transaction scene, the resource conflict of a digital currency system is frequently caused, so that the transaction overtime is caused, the performance and stability of the digital currency system are reduced, the technical problem that the transaction processing performance of the system is lower is solved, and further, the digital currency hash of a user can be stored to different transaction levels, especially in the high concurrency transaction scene, the resource conflict of the digital currency system when the user carries out 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 are achieved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main flow of a method for trading digital money according to a first embodiment of the present invention;
FIG. 2a is a schematic diagram of the main flow of a method for trading digital money according to a second embodiment of the present invention;
FIG. 2b is a schematic diagram of a hierarchical queue comprising a plurality of numbered sliced chunks in the method of FIG. 2 a;
FIG. 3 is a schematic diagram of the main modules of a digital money transaction device provided according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 5 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
FIG. 1 is a schematic diagram of the main flow of a method for trading digital money according to a first embodiment of the present invention; as shown in fig. 1, the method for trading digital currency according to the embodiment of the present invention mainly includes:
step S101, a user transaction request is received.
Specifically, before receiving the user transaction request, the embodiment of the invention further comprises the step of storing the digital currency of the user, which mainly comprises the following steps:
acquiring user information, wherein the user information comprises historical transaction information and digital currency balance of a user;
determining transaction level information corresponding to a user according to historical transaction information;
according to the transaction level information and the digital currency balance, determining the storage limit of the digital currency corresponding to each transaction level, and respectively storing the digital currency balance to the corresponding transaction level according to the storage limit.
Through the arrangement, different transaction level information is determined according to the historical transaction information of the user, and then the balance of the digital currency of the user is hashed and stored to different transaction levels, so that the storage of the digital currency together is avoided, and when digital currency transaction, especially high concurrency transaction scenes, target digital currency can be determined in different transaction levels to conduct transaction, so that resource conflict of a digital currency system is effectively avoided, transaction efficiency is improved, performance and stability of the digital currency system are improved, and transaction processing performance of the system is guaranteed.
Illustratively, according to an embodiment of the present invention, the user information further includes user feature information, where the user feature information includes one or more of the following information: user type, user attribution, user consumption type; after the step of acquiring the user information, further comprising:
and determining a database stored correspondingly with the digital currency balance of the user according to one or more of the user type, the user attribution and the user transaction type.
By the arrangement, the hash storage of the digital currency of the user is realized, and the transaction processing performance of the digital currency system in busy hours is effectively improved.
Further, according to an embodiment of the present invention, according to transaction level information and digital currency balances, a storage line of digital currency corresponding to each transaction level is determined, and according to the storage line, the digital currency balances are respectively stored to the corresponding transaction levels, including:
generating a hierarchy queue corresponding to the transaction hierarchy information according to the transaction number proportion and the hierarchy limit corresponding to each transaction hierarchy in the transaction hierarchy information;
dividing each transaction level of the level queue according to the level limit to obtain a level queue containing a plurality of dividing blocks; wherein, the storage limit of the digital currency corresponding to the segmentation block does not exceed the level limit of the corresponding transaction level;
According to the balance of the digital currency and the level queues containing a plurality of cut blocks, the storage limit of the digital currency corresponding to each transaction level is determined, and the balance of the digital currency is respectively stored to the corresponding transaction level according to the storage limit.
Specifically, after different transaction levels and level amounts are determined according to historical transaction information of a user, through the setting, a level queue corresponding to the transaction level information is generated according to the transaction number proportion and the level amounts corresponding to each transaction level, and the steps can be realized through machine learning, so that the transaction level with the highest transaction number proportion ratio is positioned above the level queue in the finally generated level queue; and meanwhile, each transaction level is respectively segmented, so that each segmented block can store digital currency which does not exceed the level line of the corresponding transaction level, and the arrangement is beneficial to hashing more storage lines in the transaction level with the highest transaction frequency proportion ratio, so that the transaction habit of a user is facilitated, and the transaction efficiency is improved in the transaction process, particularly in the high-concurrency transaction process.
Preferably, according to an embodiment of the present invention, according to a digital currency balance and a gradient hierarchy queue including a plurality of cut segments, a storage unit of digital currency corresponding to each consumption hierarchy is determined, and according to the storage unit, the digital currency balance is stored to a corresponding transaction hierarchy, respectively, including:
Sequentially numbering each segmentation block in the hierarchy queue according to the hierarchy limit of the transaction hierarchy corresponding to each segmentation block in the hierarchy queue and the position of each segmentation block in the hierarchy queue to obtain the block number of each segmentation block;
and sequentially storing the digital currency balances in the plurality of cutting blocks according to the sequence of the block numbers until the digital currency balances are stored.
Through the arrangement, after each transaction level in the level queue is diced and divided, each diced block in the level queue can be numbered in sequence according to the level limit of the transaction level corresponding to each diced block and the position of each diced block in the level queue, so as to obtain the block number of each diced block; so that the user's digital money balance is stored in the corresponding cut block according to the order of the block numbers.
Illustratively, according to an embodiment of the present invention, the numbering each segment in the hierarchical queue sequentially includes:
determining a current transaction level and unnumbered current cut segments in the current transaction level from the level queue according to the sequence in the level queue, and executing the following steps until each cut segment is numbered or the digital currency balance of the user is stored in the cut segment:
Determining whether a target segmentation block corresponding to the current segmentation block exists in the next level of the transaction level corresponding to the current segmentation block;
if yes, the number of the current cutting block is increased, the increasing result is used as the number of the target cutting block, and the target cutting block is used as the current cutting block.
Specifically, because the number of the cut blocks relates to the corresponding storage limit of each transaction level, when the cut blocks in the level queue are numbered, the positions of the transaction levels corresponding to the cut blocks in the level queue (the transaction level with high proportion of transaction times is positioned above the level queue) are considered, and the corresponding relation between the cut blocks of the current level and the cut blocks of the next level is combined, so that the balance of digital currency of a user can be scattered to cover more transaction levels as much as possible, more stored digital currency in the common transaction levels is ensured, the transaction processing performance is effectively improved, and the transaction efficiency is improved.
Preferably, according to an embodiment of the present invention, the method further includes:
receiving transaction level updating information, updating a level queue according to the transaction level updating information, and updating a storage limit of digital currency corresponding to each transaction level in the updated level queue according to the balance of the digital currency and the level queue comprising a plurality of cut blocks; and/or the number of the groups of groups,
And receiving digital currency balance updating 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 updating information.
According to the embodiment of the invention, the updating period can be set, the transaction level updating information is determined according to the historical transaction information of the user in the latest updating period, and then the level queue and the storage limit corresponding to each transaction level in the level queue are updated, so that the user experience is improved.
Step S102, determining target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information; the transaction hierarchy information is generated according to historical transaction information and digital currency balances of users, and comprises hierarchy numbers of transaction hierarchies, hierarchy amounts corresponding to each transaction hierarchy and transaction times proportions.
Specifically, according to an embodiment of the present invention, determining, according to the user transaction request and the transaction hierarchy information, the target digital currency corresponding to the user transaction request includes:
determining candidate transaction levels from the transaction level information according to the transaction amount or the transaction type indicated in the user transaction request;
Judging whether the corresponding current memory line in the candidate transaction hierarchy is greater than or equal to the transaction line;
if yes, determining the candidate transaction level as a target transaction level, and determining the digital currency corresponding to the current storage line in the target transaction level as target digital currency;
if not, determining a target transaction level according to the level limit, the current storage limit and the transaction limit corresponding to the transaction level, and determining target digital currency.
Since the historical transaction information includes transaction amounts and/or transaction types for each historical transaction, the transaction level determined from the historical transaction information also indicates different transaction amounts and/or transaction types. After receiving the transaction request of the user, a candidate transaction hierarchy can be determined from a plurality of transaction hierarchies according to the transaction amount or the transaction type indicated in the transaction request of the user, then whether the currently stored digital currency in the candidate transaction hierarchy can complete the transaction amount indicated by the transaction request of the user is judged, if so, the candidate transaction hierarchy is determined to be a target transaction hierarchy, and the digital currency corresponding to the currently stored amount in the target transaction hierarchy is determined to be the target digital currency. If not, the next transaction level can be determined as the candidate transaction level, and then the judgment is carried out until the target transaction level is determined. It should be noted that the number of the candidate transaction levels and the target transaction level may be one or more, that is, the target transaction currency may be determined by using digital currencies in the current memory line of the one or more transaction levels.
Step S103, responding to the user transaction request according to the target digital currency.
Further, according to the embodiment of the present invention, the current memory value unit corresponding to each transaction level is also monitored to prevent the situation that the actual balance of the user is insufficient, but the memory value of the digital currency of a certain level is insufficient, resulting in transaction failure. For example, a hierarchy queue storage amount middle table may be provided for monitoring the current storage amount corresponding to each transaction hierarchy.
According to the technical scheme of the embodiment of the invention, the method and the device adopt the steps of receiving the user transaction request; determining a target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information; the transaction hierarchy information is generated according to historical transaction information and digital currency balance of a user, and comprises hierarchy numbers of transaction hierarchies, hierarchy amount corresponding to each transaction hierarchy and transaction frequency proportion; according to the target digital currency, the technical means of responding to the user transaction request is overcome, and the technical effects that in the existing digital currency transaction method, as the digital currencies are basically stored together, when digital currency transaction is carried out, especially in a high concurrency scene, the resource conflict of a digital currency system is frequently existed, so that the transaction overtime is caused, the performance and stability of the digital currency system are reduced, the technical problem that the transaction processing performance of the system is lower is solved, further, the digital currency hash of the user can be stored to different transaction levels, especially in the high concurrency scene, the resource conflict of the digital currency system when the user carries out 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 are achieved.
FIG. 2a is a schematic diagram of the main flow of a method for trading digital money according to a second embodiment of the present invention; as shown in fig. 2a, the method for trading digital currency according to the embodiment of the present invention mainly includes:
step S201, obtaining user information, wherein the user information comprises historical transaction information and digital currency balance of a user; and determining transaction level information corresponding to the user according to the historical transaction information.
Through the arrangement, different transaction level information is determined according to the historical transaction information of the user, and then the balance of the digital currency of the user is hashed and stored to different transaction levels, so that the storage of the digital currency together is avoided, and when digital currency transaction, especially high concurrency transaction scenes, target digital currency can be determined in different transaction levels to conduct transaction, so that resource conflict of a digital currency system is effectively avoided, transaction efficiency is improved, performance and stability of the digital currency system are improved, and transaction processing performance of the system is guaranteed.
According to an embodiment of the present invention, a plurality of levels are determined according to a transaction amount corresponding to each transaction in the historical transaction information of the user, for example, for a plurality of historical transactions between 0 and 50 yuan, a 50 yuan transaction level may be determined, where 50 yuan is the level amount of the transaction level. Finally, 8 transaction levels above 50, 100, 150, 200, 500, 1000, 5000, and 5000 can be determined (by way of example only).
On the other hand, transaction levels can be further divided according to transaction types, for example, transaction amounts for payment types such as daily diet, travel and the like are often within 50 yuan, so that transaction levels corresponding to 50 yuan can be determined, for example, transaction amounts for decoration types are often above 5000, transaction levels above 5000 can be determined, and the like, and finally a plurality of transaction level information corresponding to users are determined.
Illustratively, according to an embodiment of the present invention, the user information further includes user feature information, where the user feature information includes one or more of the following information: user type, user attribution, user consumption type; after the step of acquiring the user information, further comprising:
and determining a database stored correspondingly with the digital currency balance of the user according to one or more of the user type, the user attribution and the user transaction type.
According to a specific implementation of the embodiment of the invention, when determining a database stored corresponding to the digital currency balance of the user according to the user type, the user attribution and the user consumption type: whether the user is an individual user or an enterprise user can be judged according to the user type; if the user is an enterprise user, determining a database corresponding to and storing digital currency of the enterprise user according to the attribution of the user; namely, the digital currencies of users in different attribution areas are stored in databases corresponding to different cities, so that the transaction efficiency is improved. If the user is a personal user, the digital currency of different transaction types can be stored in different databases according to the transaction types of the user, so that when the user performs the digital currency transaction, the target digital currency can be determined from the different databases according to the type to be transacted for the transaction. According to another specific implementation of the embodiment of the invention, the database stored corresponding to the digital currency balance of the user can be determined directly according to any one or any two of the user type, the user attribution and the user transaction type. By the arrangement, the hash storage of the digital currency of the user is realized, and the transaction processing performance of the digital currency system in busy hours is effectively improved.
Step S202, generating a hierarchy queue corresponding to the transaction hierarchy information according to the transaction number proportion and the hierarchy amount corresponding to each transaction hierarchy in the transaction hierarchy information.
Specifically, according to the transaction number proportion and the hierarchy limit corresponding to each transaction hierarchy, a hierarchy queue corresponding to transaction hierarchy information is generated, and the steps can be realized through machine learning, so that in the finally generated hierarchy queue, the transaction hierarchy with the highest transaction number proportion is located above the hierarchy queue, and transaction habits of users are facilitated, and digital currency of the corresponding storage limit is hashed according to the position of each transaction hierarchy in the hierarchy queue.
According to an embodiment of the present invention, for example, the consumption behavior of the user under 50 yuan (corresponding to the transaction level of 50 yuan) accounts for 40% and the consumption behavior under 50 to 100 yuan (corresponding to the transaction level of 100 yuan) accounts for 10% and 100 to 200 accounts for 10% (corresponding to the transaction level of 200 yuan) in a period of time, then three transaction levels are total in the transaction levels, the 50 yuan level is located at the top, the 100 yuan level is located at the middle, and the 200 yuan level is located at the bottom. This is because the proportion of the number of transactions at the 50-ary level is highest, and the proportion of the number of transactions at the 100-ary level and the 200-ary level is consistent, but the level amount (100-ary) at the 100-ary level is smaller than the level amount (200-ary) at the 200-ary level, so that the 100-ary level is placed above the 200-ary level for subsequent hash storage.
Step S203, dividing each transaction level of the level queue according to the level amount to obtain a level queue containing a plurality of divided blocks; the storage limit of the digital currency corresponding to the segmentation block does not exceed the level limit of the corresponding transaction level.
Through the arrangement, each transaction level is respectively segmented, so that each segmented block can store digital currency which does not exceed the level line of the corresponding transaction level, and the arrangement is beneficial to hashing more storage lines in the transaction level with the highest transaction frequency proportion, so that the transaction habit of a user is facilitated, and the transaction efficiency is improved in the transaction process, particularly in the high-concurrency transaction process.
Step S204, according to the level limit of the transaction level corresponding to each segmentation block in the level queue and the position of each segmentation block in the level queue, numbering each segmentation block in the level queue in turn to obtain the block number of each segmentation block.
Step S205, according to the sequence of the block numbers, the digital currency balances are sequentially stored in a plurality of cutting blocks until the digital currency balances are stored.
Through the arrangement, after each transaction level in the level queue is diced and divided, each diced block in the level queue can be numbered in sequence according to the level limit of the transaction level corresponding to each diced block and the position of each diced block in the level queue, so as to obtain the block number of each diced block; so that the user's digital money balance is stored in the corresponding cut block according to the order of the block numbers.
Illustratively, according to an embodiment of the present invention, the numbering each segment in the hierarchical queue sequentially includes:
determining a current transaction level and unnumbered current cut segments in the current transaction level from the level queue according to the sequence in the level queue, and executing the following steps until each cut segment is numbered or the digital currency balance of the user is stored in the cut segment:
determining whether a target segmentation block corresponding to the current segmentation block exists in the next level of the transaction level corresponding to the current segmentation block;
if yes, the number of the current cutting block is increased, the increasing result is used as the number of the target cutting block, and the target cutting block is used as the current cutting block.
Specifically, the cut blocks are numbered longitudinally in the order of the plurality of transaction levels in the level queue from top to bottom. The purpose of this is to provide a narrow hierarchical distribution of digital currency when the balance of the user's digital currency is small, and to prevent the user from being able to quickly locate the available digital currency. Fig. 2b shows a schematic structure of a hierarchical queue containing a plurality of numbered sliced chunks, according to an embodiment of the present invention, as shown in fig. 2b (only part of the numbering is shown), the sliced chunks are numbered longitudinally in the order of the transaction levels in the hierarchical queue from top to bottom.
Firstly, determining the uppermost transaction level of a level queue as the current transaction level, then marking a first segmentation block in the current transaction level as a number 1, then according to the corresponding relation between the segmentation block with the number 1 of the first level and the segmentation block with the next level (the second level at this time), knowing that a straight line corresponding to the right side of the segmentation block 1 is positioned at the left side of a straight line corresponding to the right side of the segmentation block with the next level, numbering the segmentation block with the first level, marking the number 2, then knowing that a straight line corresponding to the right side of the segmentation block 2 is overlapped with the straight line corresponding to the right side of the segmentation block with the next level, marking the segmentation block with the second level as a number 3, and regarding the segmentation block 3 with the right side of the segmentation block with the second level, knowing that the straight line corresponding to the right side of the segmentation block with the next level is positioned at the left side of the corresponding straight line of the segmentation block with the next level, and returning to the unnumbered segmentation block with the first level at this time, marking the segmentation block with the number 4. That is, when the straight line corresponding to the right side of the current level dividing block does not coincide with the straight line corresponding to the right side of the unnumbered dividing block of the next level, or the former corresponding straight line is positioned on the right side of the latter corresponding straight line, the arrangement of the transaction levels in the level queue from top to bottom in the current round is ended, the first level of the level queue is returned again, and the numbering of the second round is started.
In a preferred embodiment, the hierarchical queue may be further partitioned directly according to the consumption frequency determined by the historical transaction information and the actual digital currency balance of the user, that is, the hierarchical queue may be partitioned into blocks after the actual digital currency balance of the user is determined. For example, according to the historical transaction information of the user, transactions with a 10-by-15 consumption frequency are all under 100 yuan, transactions with a 4-by-15 consumption frequency are all under 1000 yuan, and transactions with a 1-by-15 consumption frequency are all under 5000 yuan. Based on this, 3 transaction levels, a 100-ary transaction level, a 1000-ary transaction level, and a 5000-ary transaction level may be determined. If the actual digital currency balance of the user is ten thousand yuan. According to the consumption frequency proportion, 10 segmentation blocks can be divided from a 100-element transaction hierarchy, and 100-element digital currency is stored in each segmentation block; dividing 4 segmentation blocks in a 1000-element transaction hierarchy, and storing 1000-element digital currency in each segmentation block; the 5000-element transaction hierarchy is divided into 1 segmentation block, and 5000-element digital currency is stored in each segmentation block.
According to another embodiment of the present invention, if the transaction type is billing, at this time, a billing amount may be determined, a corresponding transaction level is determined according to the billing amount, and digital currency corresponding to the billing amount is stored in a cut block in the corresponding transaction level. Further, if there are partial blocks in the corresponding transaction level, but the empty amount of the partial block is smaller than the account amount, the account amount is hashed again and stored in different partial blocks of the corresponding transaction level. Preferably, if the segmentation block of the corresponding transaction hierarchy is full of digital currency, the digital currency corresponding to the account entry amount may be stored in the transaction hierarchy with larger hierarchy amount.
Specifically, because the number of the cut blocks relates to the corresponding storage limit of each transaction level, when the cut blocks in the level queue are numbered, the positions of the transaction levels corresponding to the cut blocks in the level queue (the transaction level with high proportion of transaction times is positioned above the level queue) are considered, and the corresponding relation between the cut blocks of the current level and the cut blocks of the next level is combined, so that the balance of digital currency of a user can be scattered to cover more transaction levels as much as possible, more stored digital currency in the common transaction levels is ensured, the transaction processing performance is effectively improved, and the transaction efficiency is improved.
Preferably, according to an embodiment of the present invention, the method further includes:
receiving transaction level updating information, updating a level queue according to the transaction level updating information, and updating a storage limit of digital currency corresponding to each transaction level in the updated level queue according to the balance of the digital currency and the level queue comprising a plurality of cut blocks; and/or the number of the groups of groups,
and receiving digital currency balance updating 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 updating information.
According to the embodiment of the invention, the updating periods can be set, each updating period is satisfied, the transaction level updating information is determined according to the historical transaction information of the user in the last updating period, and then the level queue and the storage limit corresponding to each transaction level in the level queue are updated, so that the user experience is improved.
Step S206, receiving a user transaction request.
Step S207, determining candidate transaction levels from the transaction level information according to the transaction amount or the transaction type indicated in the user transaction request.
Since the historical transaction information includes transaction amounts and/or transaction types for each historical transaction, the transaction level determined from the historical transaction information also indicates different transaction amounts and/or transaction types. After receiving the transaction request of the user, the candidate transaction levels can be determined from a plurality of transaction levels according to the transaction amount or the transaction type indicated in the transaction request of the user, wherein the number of the candidate transaction levels is generally one, and when the memory amount is less, the candidate transaction levels can also be a plurality of candidate transaction levels.
Step S208, judging whether the corresponding current memory line in the candidate transaction hierarchy is greater than or equal to the transaction line. If not, executing step S209; if yes, go to step S210; .
Step S209, updating the candidate transaction level according to the corresponding level limit and the current memory limit. And then goes to step S208.
Step S210, determining the candidate transaction level as a target transaction level, and determining the digital currency corresponding to the current memory line in the target transaction level as the target digital currency.
Through the setting, whether the currently stored digital currency in the candidate transaction hierarchy can complete the transaction amount indicated by the user transaction request is judged, if so, the candidate transaction hierarchy is determined to be the target transaction hierarchy, and the digital currency corresponding to the currently stored amount in the target transaction hierarchy is determined to be the target digital currency. If not, the next transaction level may be determined to be the candidate transaction level (i.e., the candidate transaction level is updated), and then the determination is performed until the target transaction level is determined. It should be noted that the number of target transaction levels may be one or more, i.e. the target transaction currency may be determined from the digital currency in the current memory line of the one or more transaction levels.
Step S211, responding to the user transaction request according to the target digital currency.
Further, according to the embodiment of the present invention, a middle table of the level queue storage line may be further configured to monitor the current storage line corresponding to each transaction level, so as to prevent the situation that the actual balance of the user is insufficient, but the storage amount of the digital currency of a certain level is insufficient, so that the transaction fails.
According to the technical scheme of the embodiment of the invention, the method and the device adopt the steps of receiving the user transaction request; determining a target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information; the transaction hierarchy information is generated according to historical transaction information and digital currency balance of a user, and comprises hierarchy numbers of transaction hierarchies, hierarchy amount corresponding to each transaction hierarchy and transaction frequency proportion; according to the target digital currency, the technical means of responding to the user transaction request is overcome, and the technical effects that in the existing digital currency transaction method, as the digital currencies are basically stored together, when digital currency transaction is carried out, especially in a high concurrency scene, the resource conflict of a digital currency system is frequently existed, so that the transaction overtime is caused, the performance and stability of the digital currency system are reduced, the technical problem that the transaction processing performance of the system is lower is solved, further, the digital currency hash of the user can be stored to different transaction levels, especially in the high concurrency scene, the resource conflict of the digital currency system when the user carries out 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 are achieved.
FIG. 3 is a schematic diagram of the main modules of a digital money transaction device provided according to an embodiment of the present invention; as shown in fig. 3, a transaction device 300 for digital currency according to an embodiment of the present invention mainly includes:
the transaction request acquisition module 301 is configured to receive a user transaction request.
Specifically, the transaction device 300 for digital currency provided in the embodiment of the present invention further includes a storage module, where the storage module is configured to, before receiving a user transaction request:
acquiring user information, wherein the user information comprises historical transaction information and digital currency balance of a user;
determining transaction level information corresponding to a user according to historical transaction information; wherein;
according to the transaction level information and the digital currency balance, determining the storage limit of the digital currency corresponding to each transaction level, and respectively storing the digital currency balance to the corresponding transaction level according to the storage limit.
Through the arrangement, different transaction level information is determined according to the historical transaction information of the user, and then the balance of the digital currency of the user is hashed and stored to different transaction levels, so that the storage of the digital currency together is avoided, and when the digital currency transaction is carried out, especially in a high concurrency scene, the target digital currency can be determined in different transaction levels to carry out the transaction, so that the resource conflict of the digital currency system is effectively avoided, the transaction efficiency is improved, the performance and the stability of the digital currency system are improved, and the transaction processing performance of the system is ensured.
Illustratively, according to an embodiment of the present invention, the user information further includes user feature information, where the user feature information includes one or more of the following information: user type, user attribution, user consumption type; the above-mentioned transaction device 300 for digital money further comprises a database determining module for:
and determining a database stored correspondingly with the digital currency balance of the user according to one or more of the user type, the user attribution and the user transaction type.
By the arrangement, the hash storage of the digital currency of the user is realized, and the transaction processing performance of the digital currency system in busy hours is effectively improved.
Further, according to an embodiment of the present invention, the memory module is further configured to:
generating a hierarchy queue corresponding to the transaction hierarchy information according to the transaction number proportion and the hierarchy limit corresponding to each transaction hierarchy in the transaction hierarchy information;
dividing each transaction level of the level queue according to the level limit to obtain a level queue containing a plurality of dividing blocks; wherein, the storage limit of the digital currency corresponding to the segmentation block does not exceed the level limit of the corresponding transaction level;
according to the balance of the digital currency and the level queues containing a plurality of cut blocks, the storage limit of the digital currency corresponding to each transaction level is determined, and the balance of the digital currency is respectively stored to the corresponding transaction level according to the storage limit.
Specifically, after different transaction levels and level amounts are determined according to historical transaction information of a user, through the setting, a level queue corresponding to the transaction level information is generated according to the transaction number proportion and the level amounts corresponding to each transaction level, and the steps can be realized through machine learning, so that the transaction level with the highest transaction number proportion ratio is positioned above the level queue in the finally generated level queue; and meanwhile, each transaction level is respectively segmented, so that each segmented block can store digital currency which does not exceed the level line of the corresponding transaction level, and the arrangement is beneficial to hashing more storage lines in the transaction level with the highest transaction frequency proportion ratio, so that the transaction habit of a user is facilitated, and the transaction efficiency is improved in the transaction process, particularly in the high-concurrency transaction process.
Preferably, according to an embodiment of the present invention, the memory module is further configured to:
sequentially numbering each segmentation block in the hierarchy queue according to the hierarchy limit of the transaction hierarchy corresponding to each segmentation block in the hierarchy queue and the position of each segmentation block in the hierarchy queue to obtain the block number of each segmentation block;
And sequentially storing the digital currency balances in the plurality of cutting blocks according to the sequence of the block numbers until the digital currency balances are stored.
Through the arrangement, after each transaction level in the level queue is diced and divided, each diced block in the level queue can be numbered in sequence according to the level limit of the transaction level corresponding to each diced block and the position of each diced block in the level queue, so as to obtain the block number of each diced block; so that the user's digital money balance is stored in the corresponding cut block according to the order of the block numbers.
Illustratively, according to an embodiment of the present invention, the above-described memory module is further configured to:
determining a current transaction level and unnumbered current cut segments in the current transaction level from the level queue according to the sequence in the level queue, and executing the following steps until each cut segment is numbered or the digital currency balance of the user is stored in the cut segment:
determining whether a target segmentation block corresponding to the current segmentation block exists in the next level of the transaction level corresponding to the current segmentation block;
if yes, the number of the current cutting block is increased, the increasing result is used as the number of the target cutting block, and the target cutting block is used as the current cutting block.
Specifically, since the number of the cut blocks relates to the corresponding storage limit of each transaction level, when the cut blocks in the level queue are numbered, the positions of the transaction levels corresponding to the cut blocks in the level queue (the transaction level with high proportion of transaction times is positioned above the level queue) need to be considered, and the corresponding relation between the cut blocks of the current level and the cut blocks of the next level needs to be combined, so that the digital currency balance of a user can be dispersed to cover a large range of transaction levels as far as possible, and more stored digital currencies in the common transaction levels are ensured, so that the transaction processing performance is effectively improved, and the transaction efficiency is improved.
Preferably, according to an embodiment of the present invention, the above-mentioned transaction device 300 for digital currency further includes an update module for:
receiving transaction level updating information, updating a level queue according to the transaction level updating information, and updating a storage limit of digital currency corresponding to each transaction level in the updated level queue according to the balance of the digital currency and the level queue comprising a plurality of cut blocks; and/or the number of the groups of groups,
and receiving digital currency balance updating 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 updating information.
According to the embodiment of the invention, the updating periods can be set, each updating period is satisfied, the transaction level updating information is determined according to the historical transaction information of the user in the last updating period, and then the level queue and the storage limit corresponding to each transaction level in the level queue are updated, so that the user experience is improved.
A target digital currency determining module 302, configured to determine a target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information; the transaction hierarchy information is generated according to historical transaction information and digital currency balances of users, and comprises hierarchy numbers of transaction hierarchies, hierarchy amounts corresponding to each transaction hierarchy and transaction times proportions.
Specifically, according to an embodiment of the present invention, the target digital currency determining module 302 is further configured to:
determining candidate transaction levels from the transaction level information according to the transaction amount or the transaction type indicated in the user transaction request;
judging whether the corresponding current memory line in the candidate transaction hierarchy is greater than or equal to the transaction line;
if yes, determining the candidate transaction level as a target transaction level, and determining the digital currency corresponding to the current storage line in the target transaction level as target digital currency;
If not, determining a target transaction level according to the level limit, the current storage limit and the transaction limit corresponding to the transaction level, and determining target digital currency.
Since the historical transaction information includes transaction amounts and/or transaction types for each historical transaction, the transaction level determined from the historical transaction information also indicates different transaction amounts and/or transaction types. After receiving the transaction request of the user, a candidate transaction hierarchy can be determined from a plurality of transaction hierarchies according to the transaction amount or the transaction type indicated in the transaction request of the user, then whether the currently stored digital currency in the candidate transaction hierarchy can complete the transaction amount indicated by the transaction request of the user is judged, if so, the candidate transaction hierarchy is determined to be a target transaction hierarchy, and the digital currency corresponding to the currently stored amount in the target transaction hierarchy is determined to be the target digital currency. If not, the next transaction level can be determined as the candidate transaction level, and then the judgment is carried out until the target transaction level is determined. It should be noted that the number of the candidate transaction levels and the target transaction level may be one or more, that is, the target transaction currency may be determined by using digital currencies in the current memory line of the one or more transaction levels.
The transaction module 303 is configured to respond to a user transaction request according to the target digital currency.
Further, according to an embodiment of the present invention, the above-mentioned transaction device 300 for digital money further includes an intermediate table setting module for: and setting a hierarchy queue storage limit middle table to monitor the current storage limit corresponding to each transaction hierarchy. The situation that the actual balance of the user is sufficient, but the storage amount of the digital currency of a certain level is insufficient, so that the transaction is failed is prevented.
According to the technical scheme of the embodiment of the invention, the method and the device adopt the steps of receiving the user transaction request; determining a target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information; the transaction hierarchy information is generated according to historical transaction information and digital currency balance of a user, and comprises hierarchy numbers of transaction hierarchies, hierarchy amount corresponding to each transaction hierarchy and transaction frequency proportion; according to the target digital currency, the technical means of responding to the user transaction request is overcome, and the technical effects that in the existing digital currency transaction method, as the digital currencies are basically stored together, when digital currency transaction is carried out, especially in a high concurrency scene, the resource conflict of a digital currency system is frequently existed, so that the transaction overtime is caused, the performance and stability of the digital currency system are reduced, the technical problem that the transaction processing performance of the system is lower is solved, further, the digital currency hash of the user can be stored to different transaction levels, especially in the high concurrency scene, the resource conflict of the digital currency system when the user carries out 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 are achieved.
Fig. 4 illustrates an exemplary system architecture 400 of a digital currency transaction method or digital currency transaction device to which embodiments of the present invention may be applied.
As shown in fig. 4, a system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405 (this architecture is merely an example, and the components contained in a particular architecture may be tailored to the application specific case). The network 404 is used as a medium to provide communication links between the terminal devices 401, 402, 403 and the server 405. The network 404 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 405 via the network 404 using the terminal devices 401, 402, 403 to receive or send messages or the like. Various communication client applications, such as a data processing class application, a payment class application for digital money, a search class application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 401, 402, 403, as just examples.
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 405 may be a server providing various services, such as a server (by way of example only) that utilizes terminal devices 401, 402, 403 (performs transaction processing/performs data processing) for a user. The server may analyze and/or the like the received data of the user transaction request and feed back the processing result (e.g., the target digital currency—only by way of example) to the terminal device.
It should be noted that, the method for trading digital currency according to the embodiment of the present invention is generally executed by the server 405, and accordingly, the trading device for digital currency is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, there is illustrated a schematic diagram of a computer system 500 suitable for use in implementing a terminal device or server in accordance with an embodiment of the present invention. The terminal device or server shown in fig. 5 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 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, ROM 502, and RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input section 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 section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The 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, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 501.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a transaction request acquisition module, a target digital currency determination module, and a transaction module. The names of these modules do not constitute a limitation on the module itself in some cases, and for example, the transaction request acquisition module may also be described as "a module for receiving a user transaction request".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a 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 the transaction hierarchy information; the transaction hierarchy information is generated according to historical transaction information and digital currency balance of a user, and comprises hierarchy numbers of transaction hierarchies, hierarchy amount corresponding to each transaction hierarchy and transaction frequency proportion; responding to the user transaction request according to the target digital currency.
According to the technical scheme of the embodiment of the invention, the method and the device adopt the steps of receiving the user transaction request; determining a target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information; the transaction hierarchy information is generated according to historical transaction information and digital currency balance of a user, and comprises hierarchy numbers of transaction hierarchies, hierarchy amount corresponding to each transaction hierarchy and transaction frequency proportion; according to the target digital currency, the technical means of responding to the user transaction request is overcome, and the technical effects that in the existing digital currency transaction method, as the digital currencies are basically stored together, when digital currency transaction is carried out, especially in a high concurrency scene, the resource conflict of a digital currency system is frequently existed, so that the transaction overtime is caused, the performance and stability of the digital currency system are reduced, the technical problem that the transaction processing performance of the system is lower is solved, further, the digital currency hash of the user can be stored to different transaction levels, especially in the high concurrency scene, the resource conflict of the digital currency system when the user carries out 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 are achieved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (11)

1. A method of trading digital money, comprising:
receiving a user transaction request;
determining a target digital currency corresponding to the user transaction request according to the user transaction request and the transaction hierarchy information; the transaction level information is generated according to historical transaction information and digital currency balance of a user, and comprises a level number of transaction levels, and a level amount and a transaction number proportion corresponding to each transaction level;
responding to the user transaction request according to the target digital currency.
2. The method of claim 1, further comprising the step of storing the digital currency:
acquiring user information, wherein the user information comprises historical transaction information and digital currency balance of a user;
Determining transaction level information corresponding to the user according to the historical transaction information;
and determining the storage limit of the digital currency corresponding to each transaction level according to the transaction level information and the digital currency balance, and respectively storing the digital currency balance to the corresponding transaction level according to the storage limit.
3. The method according to claim 2, wherein determining a storage unit of digital currency corresponding to each transaction level according to the transaction level information and the digital currency balance, and storing the digital currency balance to the corresponding transaction level according to the storage unit, respectively, comprises:
generating a hierarchy queue corresponding to the transaction hierarchy information according to the transaction number proportion and the hierarchy limit corresponding to each transaction hierarchy in the transaction hierarchy information;
dividing each transaction level of the level queue according to the level limit to obtain a level queue containing a plurality of dividing blocks; wherein, the storage limit of the digital currency corresponding to the segmentation block does not exceed the level limit of the corresponding transaction level;
and determining the storage limit of the digital currency corresponding to each transaction level according to the digital currency balance and the level queue containing the plurality of cut blocks, and respectively storing the digital currency balance to the corresponding transaction level according to the storage limit.
4. A method of trading digital currency according to claim 3, wherein determining a storage limit of the digital currency corresponding to each consumption level according to the balance of the digital currency and the gradient level queue including a plurality of segments, and storing the balance of the digital currency to the corresponding trading level according to the storage limit respectively comprises:
sequentially numbering each segmentation block in the hierarchy queue according to the hierarchy limit of the transaction hierarchy corresponding to each segmentation block in the hierarchy queue and the position of each segmentation block in the hierarchy queue to obtain the block number of each segmentation block;
and sequentially storing the digital currency balances in a plurality of cutting blocks according to the sequence of the block numbers until the digital currency balances are stored.
5. The method of claim 4, wherein said sequentially numbering each segment in said hierarchical queue comprises:
determining a current transaction level and unnumbered current cut blocks in the current transaction level from the level queue according to the sequence in the level queue, and executing the following steps until each cut block is numbered or the digital currency balance of the user is stored in the cut block:
Determining whether a target cut block corresponding to the current cut block exists in a next level of a transaction level corresponding to the current cut block;
if yes, the number of the current cutting block is increased, the increasing result is used as the number of the target cutting block, and the target cutting block is used as the current cutting block.
6. A method of trading digital currency in accordance with claim 3, further comprising:
receiving transaction level updating information, updating the level queue according to the transaction level updating information, and updating the storage limit of 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 cut blocks; and/or the number of the groups of groups,
and receiving digital currency balance updating 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 updating information.
7. The method of claim 1, wherein determining a target digital currency corresponding to the user transaction request based on the user transaction request and transaction level information, comprises:
Determining candidate transaction levels from the transaction level information according to the transaction amount or the transaction type indicated in the user transaction request;
judging whether the corresponding current memory line in the candidate transaction hierarchy is greater than or equal to the transaction line or not;
if yes, determining the candidate transaction level as a target transaction level, and determining digital currency corresponding to the current storage line in the target transaction level as target digital currency;
if not, determining a target transaction level according to the level limit corresponding to the transaction level, the current storage limit and the transaction limit, and determining target digital currency.
8. The method of claim 2, wherein the user information further includes user characteristic information, wherein the user characteristic information includes one or more of the following information: user type, user attribution, user consumption type; after the step of acquiring the user information, the method further comprises:
and determining a database stored corresponding to the digital currency balance of the user according to one or more of the user type, the user attribution and the user transaction type.
9. A digital money transaction device, comprising:
the transaction request acquisition module is used for receiving a user transaction request;
the target digital currency determining module is used for determining target digital currency corresponding to the user transaction request according to the user transaction request and the transaction level information; the transaction level information is generated according to historical transaction information and digital currency balance of a user, and comprises a level number of transaction levels, and a level amount and a transaction number proportion corresponding to each transaction level;
and the transaction module is used for responding to the user transaction request according to the target digital currency.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-8.
11. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-8.
CN202111421404.4A 2021-11-26 2021-11-26 Digital currency transaction method and device Pending CN116187987A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111421404.4A CN116187987A (en) 2021-11-26 2021-11-26 Digital currency transaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111421404.4A CN116187987A (en) 2021-11-26 2021-11-26 Digital currency transaction method and device

Publications (1)

Publication Number Publication Date
CN116187987A true CN116187987A (en) 2023-05-30

Family

ID=86436932

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111421404.4A Pending CN116187987A (en) 2021-11-26 2021-11-26 Digital currency transaction method and device

Country Status (1)

Country Link
CN (1) CN116187987A (en)

Similar Documents

Publication Publication Date Title
CN108629029B (en) Data processing method and device applied to data warehouse
CN109614402B (en) Multidimensional data query method and device
CN110706093A (en) Accounting processing method and device
CN112527649A (en) Test case generation method and device
CN112132674A (en) Transaction processing method and device
CN110648216A (en) Wind control method and device
CN112597126A (en) Data migration method and device
CN111062572B (en) Task allocation method and device
CN111401684A (en) Task processing method and device
CN111753019A (en) Data partitioning method and device applied to data warehouse
CN108985805B (en) Method and device for selectively executing push task
CN110928594A (en) Service development method and platform
CN113761856A (en) Data processing method and device
CN113760982A (en) Data processing method and device
CN112433757A (en) Method and device for determining interface calling relationship
CN112685481A (en) Data processing method and device
CN115421922A (en) Current limiting method, device, equipment, medium and product of distributed system
CN116187987A (en) Digital currency transaction method and device
CN114090247A (en) Method, device, equipment and storage medium for processing data
CN112862554A (en) Order data processing method and device
CN108683608B (en) Method and device for distributing flow
CN113704222A (en) Method and device for processing service request
CN109213815B (en) Method, device, server terminal and readable medium for controlling execution times
CN113762819A (en) Channel scheduling method and device
CN112183799A (en) Task allocation method and device for synthesizing task list

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination