A computer measurement method for a blockchain platform
By introducing decentralized application modules, blockchain modules and key modules on the blockchain platform, and adopting user name competition mode and smart contract management, the fuel measurement and payment problems during user registration and transactions on the blockchain platform are solved, and the secure competition of user information and efficient measurement of transactions are achieved.
Patent Information
- Application Number
- CN202111279277.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-01
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-11-01
AI Technical Summary
How to design an effective payment mechanism to support the basic services of the blockchain platform, especially fuel measurement and payment during user registration and transactions.
By designing decentralized application modules, blockchain modules and key modules, using user name competition mode and smart contract management, combining fuel account and VIP level rules, the measurement and payment of user registration and transactions are realized.
It realizes the secure competition of user information on the blockchain platform and efficient measurement of transactions, ensuring the security of user information and transaction transparency, while reducing the complexity of the system and improving the fault tolerance of the network.
Smart Images

Figure QLYQS_1
Abstract
Description
Technical Field
[0001] The present invention relates to the application field of blockchain, and relates to a computer measurement method for a blockchain platform. Background Art
[0002] On the blockchain platform, it is necessary to pay for the services and work provided. Blockchain and decentralized applications built on blockchain technology are considered the cornerstone of the value Internet. With the continuous development of blockchain technology, especially the emergence and application of smart contract technology, blockchain technology has the ability to process more complex business logics, and thus has gradually been applied to financial fields such as cross-border payments, asset transactions, and supply chain finance, and has continuously extended to various fields of people's digital lives, with broad application prospects. How to design a payment mechanism is a problem worthy of research. Summary of the Invention
[0003] In view of this, the present invention provides a measurement and payment device for a blockchain platform that solves or partially solves the above problems.
[0004] To achieve the effects of the above technical solutions, the technical solution of the present invention is: The device includes a decentralized application module, a key module, and a blockchain module; the blockchain module includes a simulation chain and a record chain. The simulation chain is used for the chain of competing for usernames when users register usernames, and the record chain is used for the chain that actually records the transactions after users register; the key module contains a contract management component, and the contract management component is used to manage the smart contract services of the device; an administrator is set in the device, and the administrator sets the user vip level rules. The user vip level rules are used to describe the user's vip level and the amount of fuel owned in the user's account corresponding to the vip level; the fuel is used to pay for the services in the device;
[0005] Among them, the decentralized application module is used to assemble the transactions on the blockchain module. Users can write business functions on the decentralized application module and then interact with the blockchain module to complete the implementation of the written business functions; the key module is responsible for packaging the transactions assembled by the decentralized application module and then sending them to the blockchain module;
[0006] The working process of the device is as follows:
[0007] First, the user registers on the decentralized application module. After registration, a username and a tuple are established. The usernames of different users must be different during registration; the username competition mode is adopted during registration, and the username competition mode is used for the workflow of users competing for usernames; the user bids to purchase fuel and places the fuel in the user's fuel account;
[0008] The working process of the username competition mode is divided into two stages during registration. In the first stage, the administrator determines the starting block number and the ending block number that can be used in the simulation chain. Users start competing for usernames. First, the administrator queries whether the usernames are repeated. If there are no repeated usernames, the user packs the hash value of the username to be registered and the user's public key together as a bid package and places it on the simulation chain. The administrator sets a username counter and clears it. The username counter is used to count the newly generated usernames in the first stage. The administrator sets the alarm value of the username counter as the highest value that the username counter can reach in the first stage. There are two modes for the bid package: the valid mode and the invalid mode. The valid mode indicates a bid package with a valid bid, that is, the bid package with the highest bid for the same username in the first stage. When the bid package becomes the valid mode, the username counter is incremented by one. When it reaches the alarm value of the username counter, it broadcasts to all users, and all users stop competing for usernames. The frozen fuel is deducted from the fuel account of the user with the valid bid package. The invalid mode indicates a bid package with an invalid bid, that is, a bid package that is not the highest bid for the same username in the first stage. When the bid package is in the valid mode, the same amount of fuel as the user's bid is frozen in the user's fuel account. Otherwise, the same amount of fuel as the user's bid is unfrozen in the user's fuel account. When the first stage ends, the data recorded on the simulation chain has exceeded the ending block number or reaches the alarm value of the username counter, the users stop competing for usernames, and the frozen fuel is deducted from the users' fuel accounts.
[0009] In the second stage, the decentralized application module summarizes all the bid packages in the valid mode, extracts the usernames and the users' public keys on the simulation chain, and searches for the users who set the usernames through the users' public keys. The users start setting passwords, record the passwords and usernames on the record chain. After recording, the users select the vip level and can choose to purchase fuel immediately or defer the purchase of fuel. The quantity of fuel purchased is determined by the vip level selected by the user, which is clearly specified in the user vip level rules. The quantity of fuel purchased is reserved by the user: If the user purchases fuel immediately, the user purchases fuel and stores it in the user's fuel account. If the user defers the purchase of fuel, the user sets an expiration smart contract. The expiration smart contract is used to take a snapshot of the user's fuel account at the time preset by the user to check if there is more fuel than the reserved quantity. If there is less than or equal to the reserved quantity of fuel, the user's level is set to the lowest level of vip. Otherwise, the user's level is set to the vip level corresponding to the reserved quantity of fuel in the user vip level rules. The total time length of the two stages of the username competition mode is named the activity period, which is the time period for the administrator to operate on the device.
[0010] The tuple includes a tuple front group and a tuple back group. The tuple front group is user information stored on the decentralized application module, and the tuple back group is user information stored on the key module. The tuple includes all transaction information of the user on the device, and then a mapping pair of the user account is constructed. The mapping pair includes two groups of mapping pairs. The user name and the tuple front group constitute a mapping pair and are placed on the decentralized application module. The owner of the mapping pair formed by the user name and the tuple front group is the user. The user has the right to unlock the mapping pair, but does not have the right to modify the mapping pair, that is, the user can unlock the mapping relationship between the user name and the tuple front group. The mapping pair is unlocked after resetting the password; the user name and the tuple back group constitute a mapping pair and are placed on the key module, and the owner is the administrator; the tuple front group includes the user's password, and the tuple back group includes the block number of the bid package where the user name is located on the simulation chain, the user's VIP level, and the key of the user's fuel account; the key of the user's fuel account is not allowed to be changed. When the user's VIP level changes, the time of change, the VIP level before and after the change, and the user's user name are recorded on the record chain;
[0011] When a user needs to conduct a transaction, he initiates the transaction through the decentralized application module, annotates the user's signature in the transaction, and packages it to the key module. The key module verifies the user's signature in the transaction, evaluates the amount of fuel required for the transaction, and deducts it from the user's account in advance, and then encapsulates the packaged transaction. After encapsulation, the internal transactions are invisible except for the administrator; the administrator records the average block time of the record chain on the blockchain module during each activity cycle, and increases the value of the average block time by P as the difficulty value; P is a real number, and the value of P is determined by the administrator; all block nodes perform hash calculations , calculate the random number, and formulate the conditions that the last N digits of the number obtained by splicing the calculated random number with the hash value of the previous block on the record chain appear alternately 1 and 0, and the value of N is equal to the random number. The first block node that meets the conditions and calculates in less than W seconds obtains the packaging right, places the packaged transaction in the internal transaction, and then adds the private key of the block node to the internal transaction to form a nested transaction; W is a real number determined by the administrator; all block nodes place the nested transaction on the record chain and obtain the fuel paid by the user; the internal transaction is used to place the packaged transaction, and the nested transaction is the transaction packaged by the administrator;
[0012] In each activity cycle, every N block-producing nodes participating in the competition for random numbers are assembled into a block-producing node group, and the remaining block-producing nodes are assembled into a block-producing node group. Each block-producing node group corresponds to three consensus nodes, and the consensus nodes are used as nodes for determining whether to change the user's VIP level. Every other transaction cycle, the VIP level of users who trade within the transaction cycle is recalculated, and the calculation formula is: Let M be the number of all consensus nodes, M1 be the number of consensus nodes participating in voting in the previous trading cycle, L be the number of user transactions within the trading cycle, T be the level value, which is used to recalculate the vip value. The sum obtained by dividing the remainder of the level value T divided by U and adding the vip level when the user obtained the username is used as the user's vip level in the next trading cycle. U is a real number, and the value of U is determined by the administrator; the time value of the trading cycle is determined by the administrator;
[0013] The key system contains a fuel pool. The administrator uniformly purchases fuel and stores it in the fuel pool, and the fuel pool is used to store the fuel required for user transactions; all users purchase fuel through the administrator; Detailed implementation mode
[0014] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention clearer and more understandable, the present invention will be described in detail below in conjunction with embodiments. It should be noted that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Products that can achieve the same function belong to equivalent replacement and improvement and are all included in the protection scope of the present invention.
[0015] Embodiment 1: Regarding blockchain technology, it mainly has the following three attributes:
[0016] (a) Distributed: The blockchain uses a peer-to-peer network model to network each participating node, and distributes tasks and shares resources among peer nodes. Information sharing and exchange can be achieved among network nodes without relying on a central node.
[0017] Peer nodes can be both providers and acquirers of resources, services, and content, thereby reducing the networking complexity and improving the fault tolerance of the network system.
[0018] (b) Robustness: Narrowly defined, robustness, that is, the degree of consistency between the computing power of subjects and the voting weight, depends on the consensus mechanism. Broadly defined, robustness extends to the entire blockchain method. The blockchain system adopts a specific economic incentive mechanism to promote more nodes to participate in the process of generating and verifying data blocks, and relies on the distributed system structure for mathematical calculations. Through the consensus algorithm, specific nodes are determined to add new blocks to the blockchain, rather than relying on a third-party trusted institution.
[0019] (c) Security: Blockchain technology uses asymmetric encryption technology to encrypt data. Transaction requests for writing data to the blockchain are attached with the signature of the private key of the initiator. This signature is broadcast and verified among the participating nodes in the network along with the transaction request. Therefore, transaction requests are forgery-proof and tamper-proof. At the same time, the block-chain data structure further ensures the immutability of data. Even if a certain or some nodes are tampered with, forged, or even destroyed, it will not affect the normal operation of the entire blockchain system.
[0020] (2) Current Development Status of Blockchain
[0021] In recent years, blockchain technology has received extensive attention. Ethereum accounts are divided into two types. One is the externally owned account (EOA) controlled by users, and the other is the contract account (Contract Account) controlled by executable code. An Ethereum account consists of four parts: Nonce, Balance, StorageRoot, and CodeHash. Nonce is a random number that determines that each transaction can only be processed once, used to prevent replay attacks on the blockchain. The difference is that the Nonce of an externally owned account represents the transaction sequence number sent from this account address, and the Nonce of a contract account represents the contract sequence number created by this account; Balance represents the integral balance of the account; StorageRoot is the hash value of the root node of the Merkle tree, which is empty by default; CodeHash represents the hash value of the EVM code of the account. The difference is that the CodeHash of an externally owned account is the hash value of an empty string, and the CodeHash of a contract account is the hash value of the contract code. Blockchains can be divided into public blockchains, private blockchains, and consortium blockchains according to the network scope and openness. For public blockchains, any node worldwide can send transactions, view blocks, or directly participate in the consensus mechanism to generate new blocks and obtain corresponding incentives. Private blockchains are not open to the public, and their operation is limited within an individual or organizational unit. External network access to data or sending transactions will be restricted. Consortium blockchains are usually applied among different units or enterprises. Several institutions jointly participate in maintaining the blockchain. Each unit runs a node. The reading operation of block data is only open to members, ensuring the privacy among units in the distributed network.
[0022] Objects of trustworthy deposit include, but are not limited to, the following electronic data:
[0023] (1) Information published on web pages such as Weibo, Moments, Tieba, and network disks;
[0024] (2) Communication data of network application services, such as text messages, emails, instant messaging, communication records, etc.;
[0025]
[0026] (3) Information such as user registration information, identity authentication information, electronic transaction records, and login logs;
[0027] (4) Electronic documents, such as documents, pictures, audio, video, digital certificates, computer programs, etc.
[0028] According to the different applicable scenarios of blockchain technology, the current blockchain technology can be divided into public blockchain (Public Blockchain), private blockchain (Private Blockchain), and consortium blockchain (Consortium Blockchain).
[0029] 1. A comparison of these three types of blockchain technologies is made, and a brief summary is given below:
[0030] (1) The public blockchain is also known as the permissionless blockchain or public chain, which represents a blockchain network where any individual or group can freely participate and fairly compete for the system's bookkeeping right. The public blockchain is suitable for public applications and business scenarios that require public governance, and mostly adopts non-deterministic consensus algorithms such as proof of work (PoW), proof of stake (PoS), and delegated proof of stake (DPoS) as the consensus mechanism. Its technical feature is that the system is open and does not require an identity approval mechanism. Anyone can participate in the maintenance of the network and data, and the network is not controlled by any institution.
[0031] (2) The consortium blockchain is also known as the permissioned blockchain with an access mechanism, which refers to a blockchain network jointly participated in by a consortium composed of multiple institutions and organizations, where the members within the consortium negotiate the bookkeeping right. The consortium blockchain is suitable for business alliances and mostly adopts deterministic consensus algorithms such as practical Byzantine fault tolerance (PBFT). Its technical feature is that the openness of the system is controllable. Only the nodes authenticated by the consortium can access the blockchain network, and the nodes designated by the consortium are responsible for bookkeeping, while other nodes use the blockchain but do not participate in bookkeeping.
[0032] (3) The private blockchain is also known as the proprietary chain, which is controlled and managed by an individual or organization. The private blockchain is suitable for business scenarios within a company or organization and can adopt a flexible consensus scheme. Its technical feature is that the system is closed to the outside world and is usually used for internal information interaction within an organization. Only the characteristics of difficult tampering and traceability of the blockchain are used for bookkeeping and auditing. The private blockchain can be used by deploying a public blockchain or consortium blockchain within an enterprise, or other private blockchain solutions can also be used.
[0033] The beneficial effects of the present invention are as follows: The present invention proposes a computer measurement method for a blockchain platform. In the present invention, the competition of user names is first carried out, the information of users is used by mapping pairs, a user VIP level adjustment mechanism and a block packaging competition mechanism are established, the measurement of fuel and paid services are carried out to support the basic services of the blockchain.
[0034] The above are only the preferred embodiments of the present invention and are not intended to limit the scope of protection of the claims of the present invention. At the same time, the above description should be understandable and implementable by those skilled in the relevant technical fields. Therefore, all equivalent changes completed based on the content disclosed in the present invention should be included within the scope covered by this claims book.
Claims
1. A computer measurement method for a blockchain platform, characterized in that, It includes the following steps: Step 1, the computer metering device includes a decentralized application module, a key module, and a blockchain module; the blockchain module includes a simulation chain and a record chain, and the blockchain module is used to record the data required for the operation of the computer metering device. The simulation chain is used to record the chain for competing for usernames when users register usernames, and the record chain is used to record the chain of transactions after users register; the key module contains a contract management component, and the contract management component is used to manage the smart contract services involved in the computer metering device; an administrator is set in the computer metering device, and the administrator sets the user vip level rule, and the user vip level rule is used to describe the user's vip level and the minimum amount of fuel that the user account corresponding to the vip level should have at least; Step 2, the fuel is used for users to pay for the services in the device; among them, the decentralized application module is used to assemble the transactions on the blockchain module, and users can write business functions on the decentralized application module, and then the decentralized application module interacts with the blockchain module to complete the realization of the written business functions; the key module is responsible for packaging the transactions assembled by the decentralized application module and then sending them to the blockchain module, and then recording them on the blockchain module; Step 3, the working process of the computer metering device is as follows: First, the user registers on the decentralized application module. After registration, the decentralized application module establishes a username and a tuple. The usernames of different users must be different during registration; the username competition mode is adopted during registration, and the username competition mode is used to describe the working process of users competing for usernames; the user bids to purchase fuel and places the fuel in the user's fuel account, and the user's fuel account is used to place the user's fuel; Step 4, the working process of the username competition mode is divided into two stages during registration. In the first stage, the administrator determines the starting block number and the ending block number that can be used by the simulation chain in the first stage, and the user starts to compete for usernames. First, the administrator queries whether the username is repeated. If there is no repeated username, the user packs the hash value of the username to be registered and the user's public key together as a bid package and records it on the simulation chain, and the block number of the block where the bid package is recorded on the simulation chain is between the starting area number and the ending area number. When the record exceeds the ending area number on the simulation chain, the first stage of the username competition mode ends; the administrator sets a username counter and clears it. The username counter is used to count the newly generated usernames in the first stage. The administrator sets the alarm value of the username counter as the highest value that the username counter can reach in the first stage; the bid package has two modes: valid mode and invalid mode;The valid mode represents a bid package with a valid bid, that is, the bid package with the highest bid for the same username in the first stage. When the bid package becomes the valid mode, the username counter is incremented by one. When it reaches the alarm value of the username counter, it is broadcast to all users, and all users stop competing for the username. The frozen fuel is deducted from the fuel account of the user with the valid bid package. The invalid mode represents a bid package with an invalid bid, that is, the bid package that is not the highest bid for the same username in the first stage. When the bid package is in the valid mode, the same amount of fuel as the user's bid is frozen in the user's fuel account. When the bid package changes from the valid mode to the invalid mode, the same amount of fuel as the user's bid is unfrozen in the user's fuel account. When the first stage ends, that is, the data recorded on the simulated chain has exceeded the end block number or the number in the username counter has exceeded the alarm value, the users stop competing for the username, and the frozen fuel is deducted from the fuel account of the user. Step Five: In the second stage, the decentralized application module summarizes all the bid packages in the valid mode, extracts the hash value of the username on the simulated chain and the user's public key, and searches for the user who sets the username through the user's public key. The user starts to set a password, records the password and the username on the record chain. After recording, the user selects a VIP level and can choose to purchase fuel immediately or purchase fuel later. The amount of fuel purchased is determined by the VIP level selected by the user, which is clearly specified in the user VIP level rule. The VIP level selected by the user and the minimum amount of fuel owned are determined. The amount of fuel purchased is reserved by the user: If the user purchases fuel immediately, the user purchases fuel and stores it in the user's fuel account. If the user purchases fuel later, the user sets up a smart contract. The smart contract is used to take a snapshot of the user's fuel account at the time preset by the user to check whether the user's fuel account contains more fuel than the reserved amount. If the fuel is less than the reserved amount, the administrator sets the user's VIP level to the lowest VIP level. Otherwise, the user's VIP level is set to the VIP level corresponding to the reserved amount of fuel in the user VIP level rule. The total time length of the two stages of the username competition mode is named the activity period, and the activity period is the time period for the administrator to operate on the computer metering device. Step Six: The multi-tuple includes a multi-previous group and a multi-later group. The multi-previous group is used to store user information on the decentralized application module, and the multi-later group is user information stored on the key module.The multi - tuple is used to represent all the transaction information of the user on the computer metering device. Then, the administrator constructs a mapping pair for the user account. The mapping pair contains two sets of mapping pairs. One set of mapping pairs consists of the user name and the multi - tuple before, which is placed on the decentralized application module. The owner of the mapping pair consisting of the user name and the multi - tuple before is the user. The user has the right to unlock the mapping pair but does not have the right to modify it. That is, the user can unlock the mapping relationship between the user name and the multi - tuple before. After resetting the password, the mapping pair is unlocked. Another set of mapping pairs consists of the user name and the multi - tuple after, which is placed on the key module and the owner is the administrator. The multi - tuple before contains the user's password. The multi - tuple after contains the block number of the user name's bid package on the simulation chain, the user's vip level, and the key of the user's fuel account. The key of the user's fuel account is not allowed to be changed. When the user's vip level changes, the administrator records the change time, the vip levels before and after the change, and the user's user name on the record chain. Step 7: When the user needs to conduct a transaction, the transaction is initiated through the decentralized application module. The user's signature is attached to the transaction and sent to the key module. The key module verifies the user's signature in the transaction, evaluates the amount of fuel required for the transaction, and deducts it from the user's fuel account in advance. Then, the packaged transaction is encapsulated. The internal transaction after encapsulation is invisible to everyone except the administrator. The administrator records the average block - generation time of the record chain on the blockchain module in each activity period and increases it by P% as the difficulty value. P is a real number determined by the administrator. All block - producing nodes perform hash calculations, calculate random numbers, and set the condition to be satisfied as the last N bits of the number obtained by concatenating the calculated random number and the hash value of the previous block - producing block on the record chain to alternate between 1 and 0, and the value of N is equal to the random number. The first block - producing node that meets the condition and whose hash - calculation time is less than W seconds obtains the packaging right, places the packaged transaction in the internal transaction, and then adds the private key of the block - producing node to the internal transaction to form a nested transaction. W is a real number determined by the administrator. All block - producing nodes place the nested transaction on the record chain and obtain the fuel paid by the user. The internal transaction is used to place the packaged transaction, and the nested transaction is the transaction packaged by the administrator. N is a natural number determined by the administrator. The block - producing node is the node responsible for transaction packaging. Step 8: Every N block - producing nodes participating in the random - number competition in each activity period are grouped into a block - producing node group, and the remaining block - producing nodes are grouped into another block - producing node group. Each block - producing node group corresponds to three consensus nodes, and the consensus nodes are used as the nodes for determining the change of the user's vip level. Every other transaction period, the vip level of the users who have conducted transactions during the transaction period is recalculated. The calculation formula is: Let M be the number of all consensus nodes, M1 be the number of consensus nodes participating in voting in the previous trading cycle, L be the number of user transactions within the trading cycle, T be the rank value, which is used to recalculate the vip value. The sum obtained by adding the remainder of dividing the rank value T by U to the vip level value when the user obtained the username is used as the user's vip level in the next trading cycle. U is a real number, and the value of U is determined by the administrator. The time value of the trading cycle is determined by the administrator, and the trading cycle is used to describe the time period of the transaction; Step Nine: The key system contains a fuel pool. The key system uniformly purchases fuel and stores it in the fuel pool, and the fuel pool is used to store the fuel required for user transactions. All users need to purchase fuel through the administrator.
Citation Information
Patent Citations
Block chain-based shared electricity transaction method
CN108364180A
Biomass fuel tracing management method, device and system based on block chain
CN112132492A