CN114116888A - Transaction processing method, device, equipment and storage medium - Google Patents

Transaction processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN114116888A
CN114116888A CN202111266167.9A CN202111266167A CN114116888A CN 114116888 A CN114116888 A CN 114116888A CN 202111266167 A CN202111266167 A CN 202111266167A CN 114116888 A CN114116888 A CN 114116888A
Authority
CN
China
Prior art keywords
block
value
node
target value
difficulty
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
CN202111266167.9A
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.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202111266167.9A priority Critical patent/CN114116888A/en
Publication of CN114116888A publication Critical patent/CN114116888A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0207Discounts or incentives, e.g. coupons or rebates
    • G06Q30/0239Online discounts or incentives
    • 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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0633Lists, e.g. purchase orders, compilation or processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Databases & Information Systems (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Computing Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present disclosure relates to a transaction processing method, apparatus, device and storage medium, wherein the method comprises: the client node responds to a central node of the transaction system to establish a creating block, generates a first block and acquires commodity information carried by the block body of the creating block; determining a corresponding difficulty target value according to the rights and interests value of the client node; carrying out Hash operation on the random parameters to obtain target values of the random parameters by resolving; under the condition that the target value of the random parameter is obtained through resolving, generating first order information according to the commodity information and storing the first order information to a first block; and mounting the first block to a block chain where the creation block is located. In the method, the central node only needs to be responsible for the access of new customer nodes, establishment of creation blocks and synchronization of main chain information, and does not need to process ordering requests of users, so that the requests of the customer nodes to the central node can be reduced, the concurrency is reduced, and the pressure on the central node during the commodity shopping is relieved or relieved.

Description

Transaction processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a transaction processing method, apparatus, device, and storage medium.
Background
With the rapid development of social economy, electronic commerce is rapidly developed and matured. At present, the competition of electronic commerce is fierce, various marketing activities are developed in a large number in order to attract and retain customers, for example, an online shopping activity is an effective marketing activity, and can attract a large number of customers to participate in the activity. However, the online shopping activities may cause great concurrent pressure on the online shopping system, and in order to cope with the highly concurrent online shopping activities, the system may adopt means such as server capacity expansion, load balancing, Redis caching, and the like.
However, the above solutions all rely on the background server, and when the non-robbery activity is not performed, high concurrency pressure is not applied to the system, that is, the concurrency of the system is not large, and in this case, the server resources set up for solving the high-concurrency robbery activity will be wasted; during some hot emergency activities, the upper limit of the system load may be exceeded, resulting in system crash.
Therefore, how to alleviate the high concurrent pressure of the shopping activities on the service end is very important.
Disclosure of Invention
The present disclosure provides a transaction processing method, apparatus, device and storage medium to solve at least one of the technical problems in the related art to some extent. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a transaction processing method applied to a client node in a transaction system, including:
establishing a creating block in response to a central node of the transaction system, generating a first block, and acquiring commodity information carried by a block body of the creating block;
determining a corresponding difficulty target value according to the rights and interests value of the client node; wherein the equity value is in an inverse relationship to the difficulty target value;
performing hash operation on the random parameter to obtain a target value of the random parameter by resolving, wherein under the condition that the target value is measured by the random parameter, a hash value obtained by the hash operation is smaller than the difficulty target value;
under the condition that the target value of the random parameter is obtained through calculation, first order information is generated according to the commodity information and stored in the first block;
and mounting the first block to a block chain where the created block is located.
In a possible implementation manner of the embodiment of the present disclosure, the mounting the first block to the block chain where the created block is located includes:
broadcasting the first block to an adjacent node in the transaction system such that the adjacent node receiving the broadcast authenticates the first block;
and if the first block passes the verification, mounting the first block to a block chain where the created block is located.
In a possible implementation manner of the embodiment of the present disclosure, before generating order information according to the commodity information and storing the order information to the first block in the case of resolving the target value of the random parameter, the method further includes:
under the condition that the target value of the random parameter is not obtained through resolving, if a second block broadcasted by the adjacent node is received, resolving is suspended;
verifying the second block;
and continuing to solve under the condition that the second block passes the verification and the inventory of the commodities in the second order information stored in the second block is not zero.
In a possible implementation manner of the embodiment of the present disclosure, the verifying the second block includes:
reading a block head of the second block to obtain a value to be checked obtained by resolving the random parameter by the adjacent node and a difficulty target value of the second block;
and carrying out Hash operation on the value to be checked of the random parameter so as to determine that the Hash value obtained by Hash operation is smaller than the target difficulty value of the second block.
In a possible implementation manner of the embodiment of the present disclosure, the verifying the second block includes:
and if the number of the second blocks is at least two, selecting the block with the longest chain of the block chain to be verified.
In one possible implementation of the embodiment of the disclosure, the equity value of the customer node is determined according to the customer level of the customer node, the activity of the customer node, and the number of times of participation in the transaction of the customer node.
In a possible implementation manner of the embodiment of the present disclosure, the determining, according to the equity value of the client node, a corresponding difficulty target value includes:
adjusting the basic difficulty value adopted by the latest round of the first-time purchasing process according to the total duration of the latest round of the first-time purchasing process and the block chain length established by the latest round of the first-time purchasing process so as to determine the basic difficulty value adopted by the current round of the first-time purchasing process;
and for any client node, determining a corresponding difficulty target value of the client node in the current round of the preempting process according to the right value of the client node and the basic difficulty value adopted in the current round of the preempting process.
In one possible implementation manner of the embodiment of the present disclosure, the first block includes a block head and a block body;
wherein the block header of the first block comprises a plurality of combinations of: the hash value of the parent block, the hash value of the local block, a timestamp for indicating the block generation time, the difficulty target value, the target value of the random parameter, the rights value and the hash value of the block body of the first block;
the block body of the first block comprises the first order information.
In a possible implementation manner of the embodiment of the present disclosure, the first order information includes: commodity information further including at least one of a node address of the customer node, a digital signature of the customer node, and a public key of the customer node;
wherein the commodity information includes: at least one of a product number, a placing time stamp, a product total, and a product inventory.
According to a second aspect of the embodiments of the present disclosure, there is provided a transaction processing apparatus applied to a client node in a transaction system, including:
the generation unit is configured to respond to a central node of the transaction system to establish a created block, generate a first block and acquire commodity information carried by the block body of the created block;
a determining unit configured to determine a corresponding difficulty target value according to the interest value of the client node; wherein the equity value is in an inverse relationship to the difficulty target value;
the operation unit is configured to perform hash operation on the random parameter to obtain a target value of the random parameter through calculation, wherein under the condition that the target value is obtained by the random parameter, a hash value obtained through the hash operation is smaller than the difficulty target value;
the storage unit is configured to generate first order information according to the commodity information and store the first order information to the first block under the condition that a target value of the random parameter is obtained through calculation;
and the mounting unit is configured to mount the first block to the block chain where the created block is located.
In a possible implementation manner of the embodiment of the present disclosure, the mount unit is configured to:
broadcasting the first block to an adjacent node in the transaction system such that the adjacent node receiving the broadcast authenticates the first block;
and if the first block passes the verification, mounting the first block to a block chain where the created block is located.
In a possible implementation manner of the embodiment of the present disclosure, the apparatus further includes:
a suspending unit configured to suspend resolving if a second block broadcasted by the adjacent node is received under the condition that the target value of the random parameter is not resolved;
a verification unit configured to verify the second block;
and the calculating unit is configured to continue calculating under the condition that the second block passes verification and the inventory of the goods in the second order information stored in the second block is not zero.
In a possible implementation manner of the embodiment of the present disclosure, the verification unit is configured to:
reading a block head of the second block to obtain a value to be checked obtained by resolving the random parameter by the adjacent node and a difficulty target value of the second block;
and carrying out Hash operation on the value to be checked of the random parameter so as to determine that the Hash value obtained by Hash operation is smaller than the target difficulty value of the second block.
In a possible implementation manner of the embodiment of the present disclosure, the verification unit is configured to:
and if the number of the second blocks is at least two, selecting the block with the longest chain of the block chain to be verified.
In one possible implementation of the embodiment of the disclosure, the equity value of the customer node is determined according to the customer level of the customer node, the activity of the customer node, and the number of times of participation in the transaction of the customer node.
In a possible implementation manner of the embodiment of the present disclosure, the determining unit is configured to:
adjusting the basic difficulty value adopted by the latest round of the first-time purchasing process according to the total duration of the latest round of the first-time purchasing process and the block chain length established by the latest round of the first-time purchasing process so as to determine the basic difficulty value adopted by the current round of the first-time purchasing process;
and for any client node, determining a corresponding difficulty target value of the client node in the current round of the preempting process according to the right value of the client node and the basic difficulty value adopted in the current round of the preempting process.
In one possible implementation manner of the embodiment of the present disclosure, the first block includes a block head and a block body;
wherein the block header of the first block comprises a plurality of combinations of: the hash value of the parent block, the hash value of the local block, a timestamp for indicating the block generation time, the difficulty target value, the target value of the random parameter, the rights value and the hash value of the block body of the first block;
the block body of the first block comprises the first order information.
In a possible implementation manner of the embodiment of the present disclosure, the first order information includes: commodity information further including at least one of a node address of the customer node, a digital signature of the customer node, and a public key of the customer node;
wherein the commodity information includes: at least one of a product number, a placing time stamp, a product total, and a product inventory.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the transaction processing method according to the above embodiment of the present disclosure.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform a transaction processing method according to the above-described embodiments of the present disclosure.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising: a computer program which, when executed by a processor, implements a transaction processing method as described in the above-described embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
establishing a creating block in response to a central node of a transaction system through a client node, generating a first block, and acquiring commodity information carried by the block body of the creating block; determining a corresponding difficulty target value according to the rights and interests value of the client node; performing hash operation on the random parameter to obtain a target value of the random parameter by resolving, wherein the hash value obtained by the hash operation is smaller than the difficulty target value under the condition that the target value is measured by the random parameter; under the condition that the target value of the random parameter is obtained through resolving, generating first order information according to the commodity information and storing the first order information to a first block; and mounting the first block to a block chain where the creation block is located. In the method, the central node only needs to be responsible for accessing the new customer node, establishing the creation block and synchronizing the main chain information without processing the order placing request of the user, the commodity shopping process is decentralized, the requests of the customer node to the central node can be reduced, the concurrency is reduced, and the pressure on the central node during commodity shopping is reduced or relieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a schematic flow chart of a refined current limiting processing method of a preemptive action in a high-concurrency scenario in the related art.
Fig. 2 is a flow chart of a method for optimizing reservation and first-aid purchase of a commodity in the related art.
Fig. 3 is a flowchart illustrating a transaction processing method according to a first embodiment of the disclosure.
Fig. 4 is a schematic structural diagram of a block body in a first embodiment of the present disclosure.
Fig. 5 is a flowchart illustrating a transaction processing method according to a second embodiment of the disclosure.
Fig. 6 is a schematic structural diagram of a blockchain in a second embodiment of the present disclosure.
Fig. 7 is a flowchart illustrating a transaction processing method according to a third embodiment of the disclosure.
Fig. 8 is a schematic diagram of network discovery and synchronization of a new node in a fourth embodiment of the present disclosure.
Fig. 9 is a schematic structural diagram of a transaction processing device according to a fifth embodiment of the present disclosure.
Fig. 10 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The online shopping campaign is a very common marketing campaign, and the current online shopping system has a large requirement on a server side because the traditional online shopping system needs to have a central system to verify the authenticity of the shopping operation transaction and manage the commodity inventory. During the emergency purchase activity, the high concurrency amount has high requirement on the performance of the central system, and in order to cope with the impact of the high concurrency amount, the central system needs to be provided with a large amount of server resources. However, the above-mentioned server resources are wasted during non-preemptive activities.
Therefore, how to realize the online shopping activity is very important to reduce the requests of the client to the server as much as possible, reduce the concurrency and ensure that the client can normally participate in the shopping activity.
Compared with the traditional centralized system, the decentralized function of the block chain can effectively relieve the high concurrent pressure of the current shopping mode of the centralized system on the server.
In the related art, the high concurrent pressure of the emergency mode on the service end is relieved mainly through the following schemes:
the first method is that emotion information of a user watching a video on a first terminal or a second terminal is sensed, if the emotion information indicates that the user likes a commodity in the video, purchase information of the commodity is displayed on the second terminal based on a bottom-layer block chain service, and a purchase operation is executed after the user selects to purchase the commodity.
However, the first scheme only uses the blockchain to store the purchase information of the commodity, does not fully utilize the decentralized function of the blockchain, and does not solve the high concurrency problem in the online shopping scene.
Secondly, a consumer enters a physical store to select a pre-purchased commodity, a shopping guide in the merchant introduces commodity characteristics to the consumer, a plurality of merchant alliances produce a member card public key chain through a third party platform, the consumer can obtain the member card public key chain sent by the third party platform after consuming a certain amount (namely, the consumer information can be input into a block chain network, the block chain network verifies the consumer information, and after verification is completed, the consumer can obtain the member card public key chain), and the consumer accumulates points in the member card public key chain to enjoy discount activities of different merchants.
However, in the second scheme, the public key chain of the membership card is obtained by consuming the block chain to store the consumer information, which is essentially a membership system, and the public key chain is made by relying on a third-party platform, so that a concurrent bottleneck problem exists during large-scale membership activities.
Thirdly, as shown in fig. 1, a software load balancing node may be provided; respectively setting a certain number of tokens for different shopping activities and storing the tokens in a redis; after starting a certain shopping activity, executing the following steps:
1) acquiring the number of people participating in the first-aid shopping activity;
2) probability current limiting, namely releasing user requests which can access redis;
3) carrying out token bucket current limiting on a user request for accessing the redis to obtain a token;
4) carrying out two-second click current limiting on users who have acquired the token, and entering step 5), carrying out two-second click current limiting on users who do not acquire the token, and executing the steps 1) to 4);
5) the leaky bucket flow limitation is used for forwarding the user request to a back-end real address;
6) and (4) successfully purchasing, reducing the inventory of the commodities, and repeating the steps 1) to 6) until the inventory of the commodities is zero.
However, in the third scheme, the used current limiting measures (such as probability current limiting, token bucket current limiting, two-second click current limiting and leaky bucket current limiting) depend on the server side to perform logic judgment, corresponding server resources are needed, and the server resources are idle when the user does not perform the robbery activity, so that the resource waste is caused; in the process of the emergency purchase activity, even if the user submits the request with sufficient inventory, the server side always rejects the request of the user due to the current limiting measure, so that the user experience is poor. Moreover, after the request is rejected by the server, the user often re-initiates the request, which increases the pressure of the server.
Fourthly, in order to improve the successful rate of the first-time purchase of the users who participate in the first-time purchase activities for a plurality of times but have unsuccessful first-time purchase, the next-order first-time purchase requests of the users can be preferentially processed, specifically, as shown in fig. 2, a table a can be added in the database, an opportunity value field Y is added in the table a, and user data which participate in the first-time purchase activities for 1 time or more but have unsuccessful first-time purchase is stored in the table a; synchronizing the table A in the database into a redis cache library, matching a shopping page with user information in the redis cache library, if the matching is successful, calculating an opportunity value of a user with unsuccessful shopping through a formula Y (aX + D), wherein a is a fixed percentage and is a positive value, and the opportunity value is set by a system, X is the participation frequency of the user, and D is the holding frequency of the activity; and sequencing from high to low according to the opportunity value of the successfully matched user, and sequentially submitting ordering and purchasing requests triggered by the successfully matched user according to a sequencing result.
However, in the fourth scheme, the order placing and first-aid purchasing requests of users who participate in the first-aid purchasing activities for multiple times but have unsuccessful first-aid purchasing are preferentially processed, and during the first-time activities, there is a problem that data of the users having unsuccessful first-aid purchasing is missing, that is, during the first-time first-aid purchasing activities, there is no case that the users have unsuccessful first-aid purchasing, and opportunity values of all users are consistent. Secondly, during the shopping activities, the server needs to perform matching of a large amount of user information and calculation and sequencing of opportunity values, and under the condition of too large concurrency, the server still has the possibility of no response.
Therefore, in order to solve the existing problems, the present disclosure provides a transaction processing method, device, equipment and storage medium.
A transaction processing method, apparatus, device, and storage medium of the embodiments of the present disclosure are described below with reference to the accompanying drawings.
Fig. 3 is a flowchart illustrating a transaction processing method according to a first embodiment of the disclosure.
The transaction processing method of the embodiment of the disclosure can be applied to a client node in a transaction system, and the client node can be a node or a client where a client who buys commodities is located.
As shown in fig. 3, the transaction processing method may include the following steps S11-S15.
In step S11, a creating block is created in response to the central node of the trading system, a first tile is generated, and commodity information carried by a tile body of the creating block is acquired.
In the embodiment of the present disclosure, the central node may be a server in the transaction system. The central node only needs to be responsible for the access of new customer nodes, establishment of creation blocks and synchronization of main chain information, and does not need to process ordering requests of users, the commodity shopping process is 'decentralized', the requests of the customer nodes to the central node can be reduced, the concurrency is reduced, and therefore pressure on the central node during commodity shopping is relieved or relieved.
In the disclosed embodiment, a created block refers to the earliest (i.e., first) constructed block in a block chain.
In this disclosure, when a shopping campaign of a commodity starts, an ancestry block may be established by a central node, and a block body of the ancestry block may carry commodity information, where the commodity information may include information such as a commodity number, a total number of commodities, and a commodity inventory.
In the embodiment of the disclosure, after the creation block is established at the central node of the transaction system, the customer node may make a first purchase of the commodity to generate the first block.
In step S12, determining a corresponding difficulty target value according to the interest value of the client node; wherein the rights value is inversely related to the difficulty target value.
In the embodiment of the present disclosure, the equity value of the customer node may be determined according to at least one of a customer level corresponding to the customer node, an activity corresponding to the customer node, or a number of times of participating in a transaction (or a number of times of participating in a shopping purchase) corresponding to the customer node.
In a possible implementation manner of the embodiment of the present disclosure, the client level of the client node, the activity of the client node, and the number of times of participation in the transaction of the client node may be weighted to obtain a weighted value, and the weighted value is used as the equity value of the client node.
For example, the equity value for a customer node may be determined according to the following formula:
the right value of the customer node is a multiplied by the customer grade + b multiplied by the activity + c multiplied by the number of times of participating in the transaction (or the number of times of participating in the shopping);
the values a, b, and c are weighted values, and may be fixed values, or may be dynamically adjusted according to an actual application scenario, which is not limited by the present disclosure.
In the embodiment of the present disclosure, after determining the equity value of a client node, a difficulty target value corresponding to the client node may be determined according to the equity value of the client node; wherein the rights value is inversely related to the difficulty target value.
It can be understood that, in the case that the higher the customer grade corresponding to the customer node, and/or the higher the activity of the customer node, and/or the more the number of times the customer node participates in the transaction, the node corresponding to the customer who is a frequent commodity purchasing customer is indicated as the customer node, and in order to stimulate the purchasing desire of such customers, the difficulty value corresponding to the commodity purchasing of such customers can be reduced. Thus, in the present disclosure, the equity value of the client node may have an inverse relationship with the difficulty target value, i.e., the greater the equity value, the smaller the difficulty target value, and vice versa, the smaller the equity value, the larger the difficulty target value.
In step S13, a hash operation is performed on the random parameter to obtain a target value of the random parameter, where the hash value obtained by the hash operation is smaller than the difficulty target value when the target value of the random parameter is obtained.
In this disclosure, the random parameter is an unknown quantity, and the random parameter may be randomly subjected to hash operation, and whether the hash value obtained by the hash operation is smaller than the difficulty target value determined in step S12 is determined.
In step S14, when the target value of the random parameter is calculated, first order information is generated from the product information, and the first order information is stored in the first block.
In the embodiment of the present disclosure, when the target value of the random parameter is obtained by calculation, it indicates that the client node obtains the commodity purchase right, and may generate the order information according to the commodity information, which is denoted as the first order information in the present disclosure, and may further store the first order information in the first block.
The first order information may include commodity information, and may further include at least one of a node address of the client node, a digital signature of the client node, and a public key of the client node, where the commodity information in the first order information may include at least one of a commodity number, an order placing timestamp, a total number of commodities, and a commodity inventory.
As an example, the first order information may be stored in a block of the first block, and the structure of the block of the first block may be as shown in fig. 4, wherein the node address of the client node, the private key of the client node, and the public key of the client node may be allocated by the trading system when the client node logs in the trading system; a digital signature algorithm (such as an elliptic curve digital signature algorithm) can be adopted to generate a digital signature of the client node; the node address of the client node can be generated by a public key of the client node through a series of one-way Hash encryption algorithms and is used as the identity of the client node in the block chain; the digital signature of the client node can be used for verifying the correctness of the first order information transaction of the client node.
In step S15, the first tile is mounted on the tile chain where the created tile is located.
In the embodiment of the present disclosure, the client node may further mount the first block on a block chain where the created block is located, so as to store the block information and the order information by the block chain.
The transaction processing method of the embodiment of the disclosure comprises the steps of establishing a creating block by responding to a central node of a transaction system through a client node, generating a first block, and acquiring commodity information carried by the block body of the creating block; determining a corresponding difficulty target value according to the rights and interests value of the client node; performing hash operation on the random parameter to obtain a target value of the random parameter by resolving, wherein the hash value obtained by the hash operation is smaller than the difficulty target value under the condition that the target value is measured by the random parameter; under the condition that the target value of the random parameter is obtained through resolving, generating first order information according to the commodity information and storing the first order information to a first block; and mounting the first block to a block chain where the creation block is located. In the method, the central node only needs to be responsible for accessing the new customer node, establishing the creation block and synchronizing the main chain information without processing the order placing request of the user, the commodity shopping process is decentralized, the requests of the customer node to the central node can be reduced, the concurrency is reduced, and the pressure on the central node during commodity shopping is reduced or relieved.
In order to clearly illustrate how the first block is mounted on the blockchain of the created block in the above embodiments of the present disclosure, the present disclosure further provides a transaction processing method.
Fig. 5 is a flowchart illustrating a transaction processing method according to a second embodiment of the disclosure.
As shown in fig. 5, the transaction processing method may include the following steps S201 to S215.
In step S201, a creating block is created in response to the central node of the trading system, a first block is generated, and commodity information carried by a block body of the creating block is acquired.
In step S202, determining a corresponding difficulty target value according to the equity value of the client node; wherein the rights value is inversely related to the difficulty target value.
In step S203, a hash operation is performed on the random parameter to obtain a target value of the random parameter by calculation, where the hash value obtained by the hash operation is smaller than the difficulty target value under the condition that the target value of the random parameter is obtained.
In step S204, it is determined whether or not the target value of the random parameter is obtained by calculation, and if yes, step S205 is executed, and if not, step S209 is executed.
In step S205, first order information is generated according to the commodity information, and the first order information is stored in the first block.
The execution process of steps S201 to S205 may refer to the execution process of any embodiment of the present disclosure, and is not described herein again.
In any embodiment of the present disclosure, the first block may include a block header and a block body, wherein the first order information may be stored in the block body of the first block, and the block header of the first block may include a plurality of combinations of the following: the hash value of the parent block, the hash value of the local block, the timestamp indicating the block generation time, the difficulty target value, the target value of the random parameter, the rights value, and the hash value of the block body of the first block.
As an example, the structure of the first block may be as shown in fig. 6, and the block header may include a hash value of a parent block, a hash value of the block, a sequence number of the block, a timestamp indicating a block generation time, a difficulty target value, a target value of a random parameter (i.e., a random number Nonce in fig. 6), a rights value, and a hash value of the block body of the first block. The meaning of each parameter in the block header can be as shown in table 1.
Table 1 data structure of block header
Field(s) Byte(s) Description of the invention
Hash value of parent block 32 Hash value referencing a block of a previous block
Hash value of this block 32 Hash value of current block
Serial number 4 The sequence number, or height, of the block indicates the position of the current block in the blockchain
Time stamp 4 Time of block generation
Difficulty target value 4 Difficulty target value of Proof of block workload (POW)
Target value of random parameter 4 Random number for block achievement workload certification
Equity value 4 Entitlement value of Proof of block of entitlement (POS)
Hash value of a block of blocks 32 Hash value of a block of a current block
In step S206, the first block is broadcast to the neighboring nodes in the transaction system, so that the neighboring nodes receiving the broadcast verify the first block.
In the disclosed embodiment, the client node may broadcast the first block to the neighboring nodes in the transaction system, and accordingly, the neighboring nodes may verify the first block after receiving the broadcast information.
As a possible implementation manner, the neighboring node may read a block header of the first block to obtain a target value and a difficulty target value of the random parameter, perform hash operation on the target value of the random parameter in the block header of the first block, determine whether a hash value obtained by the hash operation is smaller than the difficulty target value in the block header of the first block, determine that the first block passes verification if the hash value is smaller than the difficulty target value, and determine that the first block fails verification if the hash value is not smaller than the difficulty target value.
In step S207, it is determined whether the first block passes the verification, if so, step S208 is performed, and if not, step S203 and the following steps are re-performed.
In step S208, the first block is mounted on the block chain where the created block is located.
In the embodiment of the present disclosure, in the case that the first block verification passes, the client node may mount the first block on the block chain where the created block is located. In the case that the first block verification fails, the client node needs to re-execute step S203 and subsequent steps.
In step S209, if the second block broadcasted by the neighboring node is received, the calculation is suspended.
In the embodiment of the present disclosure, in the process of performing the hash operation on the random parameter by the client node, and under the condition that the target value of the random parameter is not obtained by resolving, if the client node receives the second block broadcasted by the adjacent node, the client node may suspend resolving, so as to verify the second area.
In step S210, the second block is verified.
In a first possible implementation manner of the embodiment of the present disclosure, when the number of the second blocks is one, the client node may read a block header of the second block, obtain a to-be-checked value obtained by resolving the random parameter and a difficulty target value of the second block by the adjacent node, and perform hash operation on the to-be-checked value of the random parameter to determine whether the hash value obtained by the hash operation is smaller than the difficulty target value of the second block, if so, determine that the second block passes verification, and if not, determine that the second block does not pass verification.
In a second possible implementation manner of the embodiment of the present disclosure, when the number of the second blocks is at least two, the client node may select the block with the longest chain of the block chain where the client node is located to perform verification, and the verification manner is the same as that of the first possible implementation manner, which is not described herein again.
In step S211, it is determined whether the second block passes the verification, if so, step S212 is performed, and if not, step S215 is performed.
In step S212, it is determined whether the product stock in the second order information stored in the second block is zero, if not, step S213 is executed, and if so, step S214 is executed.
In step S213, the calculation is continued.
In the embodiment of the present disclosure, in the case that the second block is verified, if the inventory of the goods in the second order information stored in the second block is not zero, the client node may continue to perform the calculation until the target value of the random parameter is obtained by the calculation, and step S204 and subsequent steps may be performed.
In step S214, the calculation is stopped.
In the embodiment of the present disclosure, in the case that the second block is verified, if the inventory of the goods in the second order information stored in the second block is zero, the robbery activity is ended, and the customer node may stop resolving.
In step S215, the neighboring node is notified to perform the hash operation on the random parameter again to obtain the target value of the random parameter.
In the embodiment of the present disclosure, when the second block verification fails, the processing procedure of the adjacent node is similar to the processing procedure of the client node in step S203, and the hash operation needs to be performed on the random parameter again to obtain the target value of the random parameter through calculation, and when the target value of the random parameter is obtained through calculation, the second order information is generated according to the commodity information and is stored in the second block, so that the client node performs recheck on the second block.
It should be noted that, these possible implementations described above may be executed alone or in combination, and the embodiments of the present disclosure are not limited thereto.
According to the transaction processing method, the first block and/or the second block are verified, and only when the first block and/or the second block are verified, the blocks are mounted on the block chain where the creation blocks are located, so that the effectiveness and the validity of the commodity shopping are guaranteed.
In one possible implementation of the embodiment of the disclosure, when the rights value is inversely proportional to the difficulty target value, the difficulty target value may be determined in the manner shown in fig. 7.
Fig. 7 is a flowchart illustrating a transaction processing method according to a third embodiment of the disclosure.
As shown in fig. 7, the transaction processing method may include the following steps S31-S36.
In step S31, a creating block is created in response to the central node of the trading system, a first tile is generated, and commodity information carried by a tile body of the creating block is acquired.
The execution process of step S31 can refer to the above embodiments, which are not described herein.
In step S32, the basic difficulty value adopted in the latest round of the shopping procedure is adjusted according to the total duration of the latest round of the shopping procedure and the length of the blockchain created in the latest round of the shopping procedure, so as to determine the basic difficulty value adopted in the current round of the shopping procedure.
For example, marking the basic difficulty value adopted in the current round of the first-time purchase process as the basic difficulty valueiThe basic difficulty value adopted in the latest round of emergency purchase process is the basic difficulty valuei-1Then the base difficulty value can be determined according to the following formulai
Basic difficulty valueiBasic value of difficultyi-1X total duration of the latest round of the preemption process/the blockchain length (i.e. number of blocks) created by the latest round of the preemption process;
in step S33, for any one client node, a difficulty target value corresponding to the client node in the current round of the first-time purchase process is determined according to the right value of the client node and the basic difficulty value adopted in the current round of the first-time purchase process.
In the embodiment of the present disclosure, for each client node, a difficulty target value corresponding to the client node in the current round of the preemptive purchasing process may be determined according to the right value of the client node and the basic difficulty value adopted in the current round of the preemptive purchasing process. Wherein the difficulty target value is inversely proportional to the equity value.
For example, for each customer node, the corresponding difficulty target value of the customer node in the current round of the shopping process may be determined according to the following formula:
target difficulty value being the basic difficulty valueiA/equity value;
in step S34, a hash operation is performed on the random parameter to obtain a target value of the random parameter, where the hash value obtained by the hash operation is smaller than the difficulty target value when the target value of the random parameter is obtained.
In step S35, when the target value of the random parameter is obtained by calculation, first order information is generated from the product information and stored in the first block.
In step S36, the first tile is mounted on the tile chain where the created tile is located.
The execution process of steps S34 to S36 can refer to any of the above embodiments, and will not be described herein.
Corresponding to the transaction processing methods provided in the embodiments of fig. 3 to 7, the present disclosure also provides a transaction processing device, and since the transaction processing device provided in the embodiments of the present disclosure corresponds to the transaction processing methods provided in the embodiments of fig. 3 to 7, the embodiments of the transaction processing methods are also applicable to the transaction processing device provided in the embodiments of the present disclosure, and will not be described in detail in the embodiments of the present disclosure.
Fig. 9 is a schematic structural diagram of a transaction processing device according to a fifth embodiment of the present disclosure.
Referring to fig. 9, the transaction processing apparatus 900 may be applied to a client node in a transaction system, and includes: generation section 901, determination section 902, calculation section 903, storage section 904, and mounting section 905.
The generating unit 901 is configured to create a created block in response to a central node of the trading system, generate a first block, and acquire commodity information carried by a block body of the created block.
A determining unit 902 configured to determine a corresponding difficulty target value according to the interest value of the client node; wherein the rights value is inversely related to the difficulty target value.
And the operation unit 903 is configured to perform hash operation on the random parameter to obtain a target value of the random parameter by calculation, where in the case of obtaining the target value of the random parameter, the hash value obtained by the hash operation is smaller than the difficulty target value.
The storage unit 904 is configured to generate first order information according to the commodity information and store the first order information to the first block when the target value of the random parameter is obtained by calculation.
A mounting unit 905 is configured to mount the first block on the block chain where the created block is located.
In a possible implementation manner of the embodiment of the present disclosure, the mounting unit 905 is configured to: broadcasting the first block to an adjacent node in the transaction system such that the adjacent node receiving the broadcast authenticates the first block; and if the first block passes the verification, mounting the first block on a block chain where the creation block is located.
In a possible implementation manner of the embodiment of the present disclosure, the transaction processing apparatus 900 may further include:
and a suspending unit configured to suspend the resolving if the second block broadcasted by the adjacent node is received, in a case where the target value of the random parameter is not resolved.
A verification unit configured to verify the second block.
And the resolving unit is configured to continue resolving under the condition that the second block passes verification and the commodity stock in the second order information stored in the second block is not zero.
In one possible implementation manner of the embodiment of the present disclosure, the verification unit is configured to: reading a block head of the second block to obtain a value to be checked obtained by resolving the random parameter by the adjacent node and a difficulty target value of the second block; and carrying out Hash operation on the value to be checked of the random parameter to determine that the Hash value obtained by the Hash operation is smaller than the difficulty target value of the second block.
In one possible implementation manner of the embodiment of the present disclosure, the verification unit is configured to: and selecting the block with the longest chain of the block chain to be verified if the number of the second blocks is at least two.
In one possible implementation of the embodiment of the disclosure, the equity value of the customer node is determined based on the customer level of the customer node, the activity of the customer node, and the number of times the customer node participates in the transaction.
In a possible implementation manner of the embodiment of the present disclosure, the determining unit 902 is configured to: adjusting the basic difficulty value adopted by the latest round of the first-time purchasing process according to the total duration of the latest round of the first-time purchasing process and the block chain length established by the latest round of the first-time purchasing process so as to determine the basic difficulty value adopted by the current round of the first-time purchasing process; and for any client node, determining a corresponding difficulty target value of the client node in the current round of the robbery process according to the right value of the client node and the basic difficulty value adopted in the current round of the robbery process.
In one possible implementation manner of the embodiment of the present disclosure, the first block includes a block head and a block body; wherein the block header of the first block comprises a plurality of combinations of: the hash value of the parent block, the hash value of the block, a timestamp for indicating the block generation time, a difficulty target value, a target value of a random parameter, a rights and interests value and the hash value of the block of the first block; the block body of the first block comprises first order information.
In a possible implementation manner of the embodiment of the present disclosure, the first order information includes: the commodity information further comprises at least one of a node address of the client node, a digital signature of the client node and a public key of the client node; wherein the commodity information includes: at least one of a product number, a placing time stamp, a product total, and a product inventory.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The transaction processing device of the embodiment of the disclosure establishes a creating block in response to a central node of a transaction system through a client node, generates a first block, and acquires commodity information carried by the block body of the creating block; determining a corresponding difficulty target value according to the rights and interests value of the client node; performing hash operation on the random parameter to obtain a target value of the random parameter by resolving, wherein the hash value obtained by the hash operation is smaller than the difficulty target value under the condition that the target value is measured by the random parameter; under the condition that the target value of the random parameter is obtained through resolving, generating first order information according to the commodity information and storing the first order information to a first block; and mounting the first block to a block chain where the creation block is located. In the method, the central node only needs to be responsible for accessing the new customer node, establishing the creation block and synchronizing the main chain information without processing the order placing request of the user, the commodity shopping process is decentralized, the requests of the customer node to the central node can be reduced, the concurrency is reduced, and the pressure on the central node during commodity shopping is reduced or relieved.
In an exemplary embodiment, an electronic device is also presented.
Wherein, electronic equipment includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the transaction processing method as set forth in any of the preceding embodiments.
As an example, fig. 10 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the disclosure, and as shown in fig. 10, the electronic device 200 may further include:
a memory 210 and a processor 220, a bus 230 connecting different components (including the memory 210 and the processor 220), wherein the memory 210 stores a computer program, and when the processor 220 executes the program, the transaction processing method according to the embodiment of the disclosure is implemented.
Bus 230 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 200 typically includes a variety of electronic device readable media. Such media may be any available media that is accessible by electronic device 200 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 210 may also include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)240 and/or cache memory 250. The server 200 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 260 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 10, and commonly referred to as a "hard drive"). Although not shown in FIG. 10, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 230 by one or more data media interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.
A program/utility 280 having a set (at least one) of program modules 270, including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment, may be stored in, for example, the memory 210. The program modules 270 generally perform the functions and/or methodologies of the embodiments described in this disclosure.
Electronic device 200 may also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), with one or more devices that enable a user to interact with electronic device 200, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 200 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 292. Also, the electronic device 200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 293. As shown, the network adapter 293 communicates with the other modules of the electronic device 200 via the bus 230. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 220 executes various functional applications and data processing by executing programs stored in the memory 210.
It should be noted that, for the implementation process and the technical principle of the electronic device of the embodiment, reference is made to the foregoing explanation of the transaction processing method of the embodiment of the present disclosure, and details are not described here again.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an electronic device to perform a method set forth in any one of the embodiments described above is also provided. Alternatively, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, comprising a computer program, characterized in that the computer program, when executed by a processor, implements the method set forth in any of the above embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (21)

1. A transaction processing method applied to a client node in a transaction system, the method comprising:
establishing a creating block in response to a central node of the transaction system, generating a first block, and acquiring commodity information carried by a block body of the creating block;
determining a corresponding difficulty target value according to the rights and interests value of the client node; wherein the equity value is in an inverse relationship to the difficulty target value;
performing hash operation on the random parameter to obtain a target value of the random parameter by resolving, wherein under the condition that the target value is measured by the random parameter, a hash value obtained by the hash operation is smaller than the difficulty target value;
under the condition that the target value of the random parameter is obtained through calculation, first order information is generated according to the commodity information and stored in the first block;
and mounting the first block to a block chain where the created block is located.
2. The method of claim 1, wherein the mounting the first block to a block chain in which the created block is located comprises:
broadcasting the first block to an adjacent node in the transaction system such that the adjacent node receiving the broadcast authenticates the first block;
and if the first block passes the verification, mounting the first block to a block chain where the created block is located.
3. The method according to claim 2, wherein before generating order information from the commodity information and storing the order information in the first block in a case where the target value of the random parameter is obtained by calculation, the method further comprises:
under the condition that the target value of the random parameter is not obtained through resolving, if a second block broadcasted by the adjacent node is received, resolving is suspended;
verifying the second block;
and continuing to solve under the condition that the second block passes the verification and the inventory of the commodities in the second order information stored in the second block is not zero.
4. The method of claim 3, wherein the verifying the second block comprises:
reading a block head of the second block to obtain a value to be checked obtained by resolving the random parameter by the adjacent node and a difficulty target value of the second block;
and carrying out Hash operation on the value to be checked of the random parameter so as to determine that the Hash value obtained by Hash operation is smaller than the target difficulty value of the second block.
5. The method of claim 3, wherein the verifying the second block comprises:
and if the number of the second blocks is at least two, selecting the block with the longest chain of the block chain to be verified.
6. The method of any one of claims 1-5, wherein the equity value of the customer node is determined based on a customer level of the customer node, an activity of the customer node, and a number of times the customer node has engaged in the transaction.
7. The method according to any one of claims 1-5, wherein determining a corresponding difficulty target value based on the equity value of the customer node comprises:
adjusting the basic difficulty value adopted by the latest round of the first-time purchasing process according to the total duration of the latest round of the first-time purchasing process and the block chain length established by the latest round of the first-time purchasing process so as to determine the basic difficulty value adopted by the current round of the first-time purchasing process;
and for any client node, determining a corresponding difficulty target value of the client node in the current round of the preempting process according to the right value of the client node and the basic difficulty value adopted in the current round of the preempting process.
8. The method of any of claims 1-5, wherein the first tile comprises a tile header and a tile body;
wherein the block header of the first block comprises a plurality of combinations of: the hash value of the parent block, the hash value of the local block, a timestamp for indicating the block generation time, the difficulty target value, the target value of the random parameter, the rights value and the hash value of the block body of the first block;
the block body of the first block comprises the first order information.
9. The method of any of claims 1-5, wherein the first order information comprises: commodity information further including at least one of a node address of the customer node, a digital signature of the customer node, and a public key of the customer node;
wherein the commodity information includes: at least one of a product number, a placing time stamp, a product total, and a product inventory.
10. A transaction processing apparatus applied to a client node in a transaction system, comprising:
the generation unit is configured to respond to a central node of the transaction system to establish a created block, generate a first block and acquire commodity information carried by the block body of the created block;
a determining unit configured to determine a corresponding difficulty target value according to the interest value of the client node; wherein the equity value is in an inverse relationship to the difficulty target value;
the operation unit is configured to perform hash operation on the random parameter to obtain a target value of the random parameter through calculation, wherein under the condition that the target value is obtained by the random parameter, a hash value obtained through the hash operation is smaller than the difficulty target value;
the storage unit is configured to generate first order information according to the commodity information and store the first order information to the first block under the condition that a target value of the random parameter is obtained through calculation;
and the mounting unit is configured to mount the first block to the block chain where the created block is located.
11. The apparatus of claim 10, wherein the mounting unit is configured to:
broadcasting the first block to an adjacent node in the transaction system such that the adjacent node receiving the broadcast authenticates the first block;
and if the first block passes the verification, mounting the first block to a block chain where the created block is located.
12. The apparatus of claim 11, further comprising:
a suspending unit configured to suspend resolving if a second block broadcasted by the adjacent node is received under the condition that the target value of the random parameter is not resolved;
a verification unit configured to verify the second block;
and the calculating unit is configured to continue calculating under the condition that the second block passes verification and the inventory of the goods in the second order information stored in the second block is not zero.
13. The apparatus of claim 12, wherein the verification unit is configured to:
reading a block head of the second block to obtain a value to be checked obtained by resolving the random parameter by the adjacent node and a difficulty target value of the second block;
and carrying out Hash operation on the value to be checked of the random parameter so as to determine that the Hash value obtained by Hash operation is smaller than the target difficulty value of the second block.
14. The apparatus of claim 12, wherein the verification unit is configured to:
and if the number of the second blocks is at least two, selecting the block with the longest chain of the block chain to be verified.
15. The apparatus of any one of claims 10-14, wherein the equity value of the customer node is determined based on a customer level of the customer node, an activity of the customer node, and a number of times the customer node has engaged in transactions.
16. The apparatus according to any of claims 10-14, wherein the determining unit is configured to:
adjusting the basic difficulty value adopted by the latest round of the first-time purchasing process according to the total duration of the latest round of the first-time purchasing process and the block chain length established by the latest round of the first-time purchasing process so as to determine the basic difficulty value adopted by the current round of the first-time purchasing process;
and for any client node, determining a corresponding difficulty target value of the client node in the current round of the preempting process according to the right value of the client node and the basic difficulty value adopted in the current round of the preempting process.
17. The apparatus of any of claims 10-14, wherein the first block comprises a block header and a block body;
wherein the block header of the first block comprises a plurality of combinations of: the hash value of the parent block, the hash value of the local block, a timestamp for indicating the block generation time, the difficulty target value, the target value of the random parameter, the rights value and the hash value of the block body of the first block;
the block body of the first block comprises the first order information.
18. The apparatus of any of claims 10-14, wherein the first order information comprises: commodity information further including at least one of a node address of the customer node, a digital signature of the customer node, and a public key of the customer node;
wherein the commodity information includes: at least one of a product number, a placing time stamp, a product total, and a product inventory.
19. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the transaction processing method of any of claims 1 to 9.
20. A computer-readable storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the transaction processing method of any of claims 1 to 9.
21. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the transaction processing method of any of claims 1-9.
CN202111266167.9A 2021-10-28 2021-10-28 Transaction processing method, device, equipment and storage medium Pending CN114116888A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111266167.9A CN114116888A (en) 2021-10-28 2021-10-28 Transaction processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111266167.9A CN114116888A (en) 2021-10-28 2021-10-28 Transaction processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114116888A true CN114116888A (en) 2022-03-01

Family

ID=80377429

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111266167.9A Pending CN114116888A (en) 2021-10-28 2021-10-28 Transaction processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114116888A (en)

Similar Documents

Publication Publication Date Title
US11899809B2 (en) Proof-of-approval distributed ledger
US20190333058A1 (en) Method for providing payment gateway service using utxo-based protocol and server using same
US20180247304A1 (en) Electronic certificate processing method and electronic certificate processing apparatus
CN109727038B (en) Block chain consensus mechanism based on credit proof PoC and implementation method
US20210248604A1 (en) Electronic-certificate-based interaction methods and apparatuses, and electronic devices
CN104052731A (en) Alias-Based Social Media Identity Verification method and system
CN110557403B (en) Resource allocation method and device based on block chain, storage medium and node equipment
WO2017084245A1 (en) Method and apparatus for processing purchase request
CN109447791B (en) Block chain-based fund transaction method and device
CN112101994A (en) Member rights management method, member rights management device, computer equipment and readable storage medium
US9124570B1 (en) Providing an assessment of authentication requests
CN112915548A (en) Data processing method, device and equipment of multimedia playing platform and storage medium
CN110135850A (en) A kind of information processing method and relevant apparatus
AU2020204469A1 (en) Ad hoc neural network for proof of wallet
US11533163B2 (en) Mining method and device based on blockchain, and computer readable storage medium
EP4358000A1 (en) Digital currency-based payment method, platform, terminal, and payment system
CN112118138A (en) System and method for implementing block chain consensus mechanism
CN108961034A (en) System and method, storage medium based on user behavior certification
CN109271415A (en) A kind of data processing method and device in collage-credit data library
US11682016B2 (en) System to perform identity verification
CN114116888A (en) Transaction processing method, device, equipment and storage medium
CN109785107B (en) Method for flexibly configuring fund duty ratio and related products
CN109919767B (en) Transaction risk management method, device and equipment
CN116433249A (en) Method for proving content using behavior and method for verifying content using behavior
CN113553203A (en) Request processing method, device, server and storage medium

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