CN111831676A - Business rule design method of block chain - Google Patents
Business rule design method of block chain Download PDFInfo
- Publication number
- CN111831676A CN111831676A CN202010676852.8A CN202010676852A CN111831676A CN 111831676 A CN111831676 A CN 111831676A CN 202010676852 A CN202010676852 A CN 202010676852A CN 111831676 A CN111831676 A CN 111831676A
- Authority
- CN
- China
- Prior art keywords
- user
- trader
- traders
- node
- credit
- 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.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2365—Ensuring data consistency and integrity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- General Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Accounting & Taxation (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Health & Medical Sciences (AREA)
- Finance (AREA)
- Data Mining & Analysis (AREA)
- Bioethics (AREA)
- Computing Systems (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention relates to a method for designing a business rule of a block chain, which comprises a block chain system and a cloud service platform; the service platform provides cloud transaction service for the user, and transaction data and security verification information are stored in the block chain system through an API (application program interface); node information of users and traders is stored in a distributed mode in the blockchain system. The underlying technology of the invention ensures the privacy and safety of transactions, improves the storage and query efficiency by supplementing the storage capacity of a database expansion block chain, realizes the intelligent recommendation of the system by the comprehensive evaluation of traders, and improves the intelligent service of cloud transactions.
Description
Technical Field
The invention relates to the technical field of block chains, in particular to a method for designing a business rule of a block chain.
Background
In recent years, with the rise of the concept of 'cloud transaction', more and more traders begin to pay attention to the field of cloud transaction, and due to the fact that cloud transaction is simple to operate, an investment novice can select traders with abundant investment experience to make orders, risks are reduced, and benefits are improved. However, as an emerging concept, cloud transaction lacks effective supervision in China, and the operation safety of a cloud platform and the professional of a practitioner are difficult to judge. Therefore, the characteristics of decentralization, tamper resistance and traceability of the technology of the block chain can be combined, and the mass resource sharing of the cloud platform is combined, so that the safe, efficient and intelligent cloud transaction service is really realized.
Disclosure of Invention
The present invention provides a method for designing service rules of a block chain, which solves or partially solves the above-mentioned problems.
In order to achieve the effect of the technical scheme, the technical scheme of the invention is as follows: a method for designing business rules of a block chain comprises the following steps:
the system comprises a block chain system and a cloud service platform; the cloud service platform provides cloud transaction service for the user, and transaction data and security verification information are stored in the block chain system through an API (application program interface); node information of users and traders is stored in a distributed mode in the blockchain system.
Specifically, the blockchain system comprises an ether house blockchain and a database system. The ether house block chain consists of a user node, a trader node, a monitoring node, a server node and a storage node; the user node is a user registered in the system; the trader node is a trader registered in the system; the monitoring node is a node for monitoring the interactive data of the user node and the trader node; the server nodes are server clusters of the cloud and are used for providing distributed computation with high computation power; the storage node is an IPFS cluster and is used for storing mass data; the database system is IPFS and MongoDB; the IPFS is used for expanding the storage capacity of the block chain and storing encrypted user and trader identity information and trading data; MongoDB stores transaction data in the intelligent contract synchronously, and the query efficiency of the database is improved.
Specifically, the cloud service platform comprises a client, a server, a basic management module, an evaluation module, a distribution module, a storage module, a verification module, a transaction module and an inquiry module.
The client provides a web-side interface for the user and the trader, so that the cloud trading service can be conveniently registered and used; the user and the trader use the real identity information to register, a new trading account is obtained after the registration is successful, the user and the trader need to perfect the trading account information, the identity information and the trading account information are sent to the server side, the server side encrypts the information to generate a public and private key pair, an account address is obtained through a hash algorithm, and the account address is stored in the block chain system.
The server side comprises a server cluster at the cloud side and an API (application programming interface) interface of a block chain, the server cluster at the cloud side is responsible for responding to an operation request sent by a user, wherein the operation request comprises deposit, mode selection, transaction and withdrawal, when the user selects an autonomous transaction mode, a trader link is skipped, and the transaction operation is completed by the user; when the user selects an entrusted transaction mode, a trader system recommendation and negotiation verification process is carried out, the transaction operation of the user is finished by the selected trader, and the user needs to evaluate the trader after the transaction is finished; and the transaction data is sent to the storage node by the server node for storage.
The basic management module provides services such as registration, logout, authority management, information modification and the like for users and traders, and all registration information and authority information call the storage module for classified storage.
The evaluation module carries out comprehensive scoring on the traders based on historical trading data of the traders and user evaluation and controls through intelligent contracts, so that the evaluation module has high reliability; the comprehensive evaluation is the comprehensive evaluation of credit level, service level and user evaluation of traders, the comprehensive evaluation set is defined as F, F is { CL, PA, UC }, wherein CL represents the credit level evaluation of the traders, the credit level evaluation is carried out according to the ranking of credit coins of trader accounts from high to low, the traders of the top 20 percent are 5 scores, the traders of the ranking of 20 percent to 40 percent are 4 scores, the credit level evaluation is sequentially reduced, and the traders of the back 20 percent are 1 score; PA represents the service level score of traders, the earning rate is ranked from high to low, the traders in the top 20 percent of the ranking are ranked 5, the traders in the 20 percent to 40 percent of the ranking are ranked 4, the ranking is sequentially reduced, and the traders in the 20 percent of the ranking are ranked 1; UC represents the user rating of the trader, the average value of the user rating scores of all the trades of the trader is taken, and the rating range is [0,5 ]; the comprehensive score is applied to an allocation module for carrying out intelligent recommendation service according to user requirements, and is also applied to a storage module for classified storage management of trader accounts.
The distribution module is used for facilitating the user to more quickly and accurately find the traders which are rich in experience, good in credit and in line with the trading requirements of the user, and intelligent recommendation service is achieved through calculation of the comprehensive scoring of the traders and the matching degree of the user requirements by the evaluation module; the matching degree calculation and intelligent recommendation steps are as follows:
step one, defining a user requirement set as FU,FUA constrained range for each factor in the set of scoring factors is given, where All the values are continuous value ranges of more than or equal to 0 and less than or equal to 5, and are divided into high, medium and low three-level requirements according to the requirement grade selected by a user, namelyA high-level demand vector is represented,a vector of medium-level demand is represented,represents a low-level demand vector, whereinDefining the value range of the low level requirement as the high value respectivelyFUCustomizing a preset for a system;
step two, defining the mapping function of the scoring factor as a piecewise linear function, and then the credit level scoring mapping function of the ith trader is as follows:the service level score mapping function is:the user score mapping function is:wherein α (CL)i)、β(PAi)、γ(UCi) Respectively representing the matching values of the ith trader and the user demand in three aspects of credit level, service level and user evaluation, CLi、PAi、UCiScores representing the credit level, business level and user rating of the ith trader, respectively;
thirdly, in order to reduce system calculation amount, performing initial screening by using the score ranking of the credit level in the scoring factor set, selecting N traders before the ranking of the credit level, wherein N can be set by a system in a self-defined manner, calculating the matching values of the N traders and the user requirements in the credit level, the service level and the user evaluation, and obtaining a matching degree matrix M;
and step four, defining the weight vector of each factor in the scoring factor set as W, wherein the W can be set by a system in a self-defined mode, calculating the comprehensive matching degree MD of the first N traders, ranking, and recommending the top five traders to the user according to the ranking result, wherein the MD is W multiplied by M.
The storage module is used for establishing a double-layer classification storage model for improving the data query efficiency under the conditions of high access capacity and high throughput caused by mass data, and the double-layer classification storage model respectively comprises a user classification storage model and a trader classification storage model;
the user classification storage model construction steps are as follows:
step one, carrying out attribute classification on a user account, and defining a classification attribute set as follows: the transaction type, the transaction frequency and the transaction amount are C, Q, A, wherein C represents the type of the latest transaction operation of the user and is entrusted transaction or autonomous transaction; q represents the number of transactions of the user within a specified statistical period; a represents the total transaction amount of the user in a specified statistical period;
step two, performing cluster analysis on the classification attributes of all user accounts in the block chain, and defining the user set S in the block chain as S ═ S1,s2,…,snIn which s is1、s2、snRespectively representing the 1 st application registered on the block chainCategory attribute vectors of household, 2 nd user, n-th user, i.e.sjThe classification attribute vector representing the jth user is a three-dimensional vector and comprises the category of the latest transaction operation of the jth user, the transaction times in a specified statistical period and the total transaction amount in the specified statistical period, wherein j and n are natural numbers;
step three, selecting the most central user from the S as the initial class center point, namely selecting the secondIndividual user or secondTaking individual users as initialization central points, dividing the users into m categories, setting m in a self-defined way according to system requirements, and setting the value range to be [3,10 ]]In order to accelerate the cluster analysis speed, the second class center point selects a point farthest from the initial class, the point closest to the average value of the first two classes is used as the initial class center point, the point farthest from the initial class center point is used as the third class center point, iteration is carried out in sequence until the mth class center point is selected, and a classified data set SC of all users in the block chain is obtained, wherein SC is { SC ═ SC1,SC2,…,SCm},SCmRepresenting the nearest user in the mth class center point;
in order to encourage traders to provide better service for users, a consensus mechanism based on credit level is established, so that a trader classification storage model is divided into three classes of high credit, medium credit and low credit according to the number of credit coins of the traders, wherein 30% of traders with the highest credit ranking in the number of credit are high-credit traders, 20% of traders with the lowest credit ranking in the number of credit are low-credit traders, and the rest are medium-credit traders; the higher the credit, the easier the trader gets the opportunity to interact with the user, and the easier it becomes the manager node, thus getting the extra credit given by the system as reward;
as new accounts are continuously registered in the block chain system, and the account information of the users and the traders is continuously updated along with the increase of the trading, the storage module is dynamically classified and stored, a user classification storage model and a trader classification storage model are called every time x blocks are newly added in the system, the classification of the accounts of the users and the traders is recalculated, wherein x belongs to [10,20], and the system is customized and set according to the account information and the trading information; if the number of the newly added blocks does not reach x when the new account is registered, storing the newly registered account in the temporary classification, and recalculating the classification when the number of the newly added blocks reaches x; after the accounts of all users and traders are classified, storing the classification labels as suffixes of the account hash values;
the verification module is used for verifying the reliability of the negotiation process of the user in the process of selecting the trader; after the user submits the requirement, the allocation module calculates the trader recommendation with the matching degree of the first five ranks to the user, the server node firstly preprocesses the trader matching degree data and the identity information to generate a new node to be inserted into the Merkle tree, and if the new node is a leaf node, the tag value of the new node is the digital tag of the data block stored by the leaf node; if the new node is not a leaf node, calculating hash values of two child nodes of the new node as label values; storing the preprocessed label value into an IPFS; because each layer of nodes stores the hash value of the corresponding child node, and the label value stored by the root node is the hash value of the Merkle tree, whether the data is falsified can be judged by verifying the label values of the nodes and the adjacent nodes; when a user submits a storage task after selecting a trader, a server node automatically initiates a verification request, calls an intelligent contract to obtain a storage address of a new node, compares the storage address with a root node hash value of a Merkle tree, and if the data are consistent, passes the verification; if the data are not consistent, the verification is not passed, the verification result is returned to the user node, the user submits the requirement again, and the negotiation verification is initiated.
The transaction module is maintained by the administrator node and the monitoring node together; the monitoring node is responsible for negotiating and verifying data of the user and the recommended trader in the synchronous verification module, monitoring evaluation of the user on the trader, calculating credit coins rewarded additionally according to the negotiating and verifying data and the user evaluation, and then sending the credit coins rewarded additionally and the monitoring data to all trader nodes with high credit degrees; after receiving the information issued by the monitoring node, the trader node with high credit degree compares the information with the actual monitoring data, and if the comparison data is legal data, the trading data is written into the own account book; randomly selecting one trader from traders with high credit as an administrator, packaging trade data, monitoring data and credit coins with extra rewards into a block by the administrator, broadcasting the block to all trader nodes, submitting local data after all trader nodes receive notification, ensuring the consistency of all accounts, and obtaining the credit coins with extra rewards by the administrator.
The query module responds to query requests of users and traders, firstly queries the hash value of the corresponding account, acquires the classification information of the account according to the hash value suffix, then retrieves the account information of the corresponding classification in the MongoDB, and feeds query data back to the users.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the present invention more apparent, the present invention is described in detail below with reference to the embodiments. It should be noted that the specific embodiments described herein are only for illustrating the present invention and are not to be construed as limiting the present invention, and products that can achieve the same functions are included in the scope of the present invention. The specific method comprises the following steps:
example 1: the embodiment specifically describes the content of the design method of the cloud service logic simulator, and the method includes the following steps:
the design method of the cloud service logic simulator comprises a block chain system and a cloud service platform; the cloud service platform provides cloud transaction service for the user, and transaction data and security verification information are stored in the block chain system through an API (application program interface); node information of users and traders is stored in a distributed mode in the blockchain system.
Specifically, the blockchain system comprises an ether house blockchain and a database system. The ether house block chain consists of a user node, a trader node, a monitoring node, a server node and a storage node; the user node is a user registered in the system; the trader node is a trader registered in the system; the monitoring node is a node for monitoring the interactive data of the user node and the trader node; the server nodes are server clusters of the cloud and are used for providing distributed computation with high computation power; the storage node is an IPFS cluster and is used for storing mass data; the database system is IPFS and MongoDB; the IPFS is used for expanding the storage capacity of the block chain and storing encrypted user and trader identity information and trading data; MongoDB stores transaction data in the intelligent contract synchronously, and the query efficiency of the database is improved.
Specifically, the cloud service platform comprises a client, a server, a basic management module, an evaluation module, a distribution module, a storage module, a verification module, a transaction module and an inquiry module.
The client provides a web-side interface for the user and the trader, and is convenient for registering and using cloud trading service; the user and the trader use the real identity information to register, a new trading account is obtained after the registration is successful, the user and the trader need to perfect the trading account information, the identity information and the trading account information are sent to the server side, the server side encrypts the information to generate a public and private key pair, an account address is obtained through a hash algorithm, and the account address is stored in the block chain system.
The system comprises a server side, a client side and a server side, wherein the server side comprises a server cluster at the cloud side and an API (application programming interface) of a block chain, the server cluster at the cloud side is responsible for responding to an operation request sent by a user, and the operation request comprises deposit, mode selection, transaction and withdrawal; when the user selects an entrusted transaction mode, a trader system recommendation and negotiation verification process is carried out, the transaction operation of the user is finished by the selected trader, and the user needs to evaluate the trader after the transaction is finished; and the transaction data is sent to the storage node by the server node for storage.
The basic management module provides services such as registration, logout, authority management, information modification and the like for users and traders, and all registration information and authority information call the storage module for classified storage.
The evaluation module carries out comprehensive scoring on the traders based on historical trading data of the traders and user evaluation and controls through intelligent contracts, so that the evaluation module has high reliability; the comprehensive evaluation is the comprehensive evaluation of credit level, service level and user evaluation of traders, the comprehensive evaluation set is defined as F, F is { CL, PA, UC }, wherein CL represents the credit level evaluation of the traders, the credit level evaluation is carried out according to the ranking of credit coins of trader accounts from high to low, the traders of the top 20 percent are 5 scores, the traders of the ranking of 20 percent to 40 percent are 4 scores, the credit level evaluation is sequentially reduced, and the traders of the back 20 percent are 1 score; PA represents the service level score of traders, the earning rate is ranked from high to low, the traders in the top 20 percent of the ranking are ranked 5, the traders in the 20 percent to 40 percent of the ranking are ranked 4, the ranking is sequentially reduced, and the traders in the 20 percent of the ranking are ranked 1; UC represents the user rating of the trader, the average value of the user rating scores of all the trades of the trader is taken, and the rating range is [0,5 ]; the comprehensive score is applied to an allocation module for carrying out intelligent recommendation service according to user requirements, and is also applied to a storage module for classified storage management of trader accounts.
The distribution module is used for facilitating the user to quickly and accurately find the traders which are rich in experience, good in credit and capable of meeting trading requirements of the traders, and intelligent recommendation service is achieved through calculation of the comprehensive scoring of the traders and the matching degree of the user requirements through the evaluation module; the matching degree calculation and intelligent recommendation steps are as follows:
step one, defining a user requirement set as FU,FUA constrained range for each factor in the set of scoring factors is given, where Are all continuous values of more than or equal to 0 and less than or equal to 5The range is divided into three levels of high, medium and low according to the requirement grade selected by the user, namelyA high-level demand vector is represented,a vector of medium-level demand is represented,represents a low-level demand vector, whereinDefining the value range of the low level requirement as the high value respectivelyFUCustomizing a preset for a system;
step two, defining the mapping function of the scoring factor as a piecewise linear function, and then the credit level scoring mapping function of the ith trader is as follows:the service level score mapping function is:the user score mapping function is:wherein α (CL)i)、β(PAi)、γ(UCi) Respectively representing the matching values of the ith trader and the user demand in three aspects of credit level, service level and user evaluation, CLi、PAi、UCiScores representing the credit level, business level and user rating of the ith trader, respectively;
thirdly, in order to reduce system calculation amount, performing initial screening by using the score ranking of the credit level in the scoring factor set, selecting N traders before the ranking of the credit level, wherein N can be set by a system in a self-defined manner, calculating the matching values of the N traders and the user requirements in the credit level, the service level and the user evaluation, and obtaining a matching degree matrix M;
and step four, defining the weight vector of each factor in the scoring factor set as W, wherein the W can be set by a system in a self-defined mode, calculating the comprehensive matching degree MD of the first N traders, ranking, and recommending the top five traders to the user according to the ranking result, wherein the MD is W multiplied by M.
The storage module is used for establishing a double-layer classification storage model for improving data query efficiency under the conditions of high access capacity and high throughput caused by mass data, and the double-layer classification storage model comprises a user classification storage model and a trader classification storage model respectively;
the user classification storage model construction steps are as follows:
step one, carrying out attribute classification on a user account, and defining a classification attribute set as follows: the transaction type, the transaction frequency and the transaction amount are C, Q, A, wherein C represents the type of the latest transaction operation of the user and is entrusted transaction or autonomous transaction; q represents the number of transactions of the user within a specified statistical period; a represents the total transaction amount of the user in a specified statistical period;
step two, performing cluster analysis on the classification attributes of all user accounts in the block chain, and defining the user set S in the block chain as S ═ S1,s2,…,snIn which s is1、s2、snClass attribute vectors respectively representing the 1 st, 2 nd and nth users registered on the blockchain, i.e.siThe classification attribute vector representing the ith user is a three-dimensional vector and comprises the category of the latest transaction operation of the ith user, the transaction times in a specified statistical period and the total transaction amount in the specified statistical period, wherein i and n are natural numbers;
step three, selecting the most central user from the S as the initial class center point, namely selecting the secondIndividual user or secondTaking individual users as initialization central points, dividing the users into m categories, setting m in a self-defined way according to system requirements, and setting the value range to be [3,10 ]]In order to accelerate the cluster analysis speed, the second class center point selects a point farthest from the initial class, the point closest to the average value of the first two classes is used as the initial class center point, the point farthest from the initial class center point is used as the third class center point, iteration is carried out in sequence until the mth class center point is selected, and a classified data set SC of all users in the block chain is obtained, wherein SC is { SC ═ SC1,SC2,…,SCm},SCmRepresenting the nearest user in the mth class center point;
in order to encourage traders to provide better service for users, a consensus mechanism based on credit level is established, so that a trader classification storage model is divided into three classes of high credit, medium credit and low credit according to the number of credit coins of the traders, wherein 30% of traders with the highest credit ranking in the number of credit are high-credit traders, 20% of traders with the lowest credit ranking in the number of credit are low-credit traders, and the rest are medium-credit traders; the higher the credit, the easier the trader gets the opportunity to interact with the user, and the easier it becomes the manager node, thus getting the extra credit given by the system as reward;
as new accounts are continuously registered in the block chain system, and the account information of the users and the traders is continuously updated along with the increase of the trading, the storage module is dynamically classified and stored, a user classification storage model and a trader classification storage model are called every time x blocks are newly added in the system, the classification of the accounts of the users and the traders is recalculated, wherein x belongs to [10,20], and the system is customized and set according to the account information and the trading information; if the number of the newly added blocks does not reach x when the new account is registered, storing the newly registered account in the temporary classification, and recalculating the classification when the number of the newly added blocks reaches x; after the accounts of all users and traders are classified, storing the classification labels as suffixes of the account hash values;
the verification module is used for verifying the reliability of a negotiation process of a user in the process of selecting a trader; after the user submits the requirement, the allocation module calculates the trader recommendation with the matching degree of the first five ranks to the user, the server node firstly preprocesses the trader matching degree data and the identity information to generate a new node to be inserted into the Merkle tree, and if the new node is a leaf node, the tag value of the new node is the digital tag of the data block stored by the leaf node; if the new node is not a leaf node, calculating hash values of two child nodes of the new node as label values; storing the preprocessed label value into an IPFS; because each layer of nodes stores the hash value of the corresponding child node, and the label value stored by the root node is the hash value of the Merkle tree, whether the data is falsified can be judged by verifying the label values of the nodes and the adjacent nodes; when a user submits a storage task after selecting a trader, a server node automatically initiates a verification request, calls an intelligent contract to obtain a storage address of a new node, compares the storage address with a root node hash value of a Merkle tree, and if the data are consistent, passes the verification; if the data are not consistent, the verification is not passed, the verification result is returned to the user node, the user submits the requirement again, and the negotiation verification is initiated.
The transaction module is maintained by the administrator node and the monitoring node together; the monitoring node is responsible for negotiating and verifying data of the user and the recommended trader in the synchronous verification module, monitoring evaluation of the user on the trader, calculating credit coins rewarded additionally according to the negotiating and verifying data and the user evaluation, and then sending the credit coins rewarded additionally and the monitoring data to all trader nodes with high credit degrees; after receiving the information issued by the monitoring node, the trader node with high credit degree compares the information with the actual monitoring data, and if the comparison data is legal data, the trading data is written into the own account book; randomly selecting one trader from traders with high credit as an administrator, packaging trade data, monitoring data and credit coins with extra rewards into a block by the administrator, broadcasting the block to all trader nodes, submitting local data after all trader nodes receive notification, ensuring the consistency of all accounts, and obtaining the credit coins with extra rewards by the administrator.
The query module responds to query requests of users and traders, firstly queries the hash value of the corresponding account, acquires the classification information of the account according to the hash value suffix, then retrieves the account information of the corresponding classification in the MongoDB, and feeds query data back to the users.
The above description is only for the preferred embodiment of the present invention, and should not be used to limit the scope of the claims of the present invention. While the foregoing description will be understood and appreciated by those skilled in the relevant art, other equivalents may be made thereto without departing from the scope of the claims.
The beneficial results are as follows: the invention provides a block chain business rule design method, which ensures transaction privacy and safety by taking a block chain technology as a bottom technology, improves storage and query efficiency by supplementing the storage capacity of a database expansion block chain and dynamic classified storage, realizes system intelligent recommendation by comprehensive evaluation of traders, and improves intelligent service of cloud transaction.
Claims (1)
1. A method for designing service rules of a block chain is characterized in that:
the method comprises the following steps: the business rule design method of the block chain comprises a cloud service platform and a block chain system; the cloud service platform provides cloud transaction service for a user, and transaction data and security verification information are stored in the block chain system through an API (application programming interface); node information of users and traders is stored in the blockchain system in a distributed mode;
step two: the block chain system comprises an Ether house block chain and a database system; the ether house block chain consists of a user node, a trader node, a monitoring node, a server node and a storage node; the user node is a user registered in the system; the trader node is a trader registered in the system; the monitoring node is used for monitoring the interactive data of the user node and the trader node; the server nodes are server clusters of a cloud end and are used for providing distributed computation with high computation power; the storage node is an IPFS cluster and is used for storing mass data; the database system is IPFS and MongoDB; the IPFS is used for expanding the storage capacity of the block chain and storing encrypted user and trader identity information and trading data; the MongoDB synchronously stores the transaction data in the intelligent contract, so that the query efficiency of the database is improved;
step three: the cloud service platform comprises a client, a server, a basic management module, an evaluation module, a distribution module, a storage module, a verification module, a transaction module and an inquiry module;
step four: the client provides a web-side interface for the user and the trader, and is convenient for registering and using cloud trading service; the user and the trader register by using the real identity information, a new trading account is obtained after the registration is successful, the user and the trader need to perfect the trading account information, the identity information and the trading account information are sent to the server side, the server side encrypts the information to generate a public and private key pair, an account address is obtained through a hash algorithm, and the public and private key pair is stored in the blockchain system;
step five: the server side comprises a server cluster at the cloud side and an API (application programming interface) interface of the block chain, the server cluster at the cloud side is responsible for responding to an operation request sent by a user, wherein the operation request comprises deposit, mode selection, transaction and withdrawal, when the user selects an autonomous transaction mode, a trader link is skipped, and the transaction operation is completed by the user; when the user selects an entrusted transaction mode, a trader system recommendation and negotiation verification process is carried out, the transaction operation of the user is finished by the selected trader, and the user needs to evaluate the trader after the transaction is finished; the transaction data is sent to the storage node by the server node for storage;
step six: the basic management module provides services such as registration, logout, authority management, information modification and the like for users and traders, and all registration information and authority information call the storage module to be classified and stored;
step seven: the evaluation module carries out comprehensive scoring on the traders based on historical trading data of the traders and user evaluation and controls through intelligent contracts, so that the evaluation module has high reliability; the comprehensive evaluation is the comprehensive evaluation of credit level, service level and user evaluation of traders, the comprehensive evaluation set is defined as F, F is { CL, PA, UC }, wherein CL represents the credit level evaluation of the traders, the credit level evaluation is carried out according to the ranking of credit coins of trader accounts from high to low, the traders in the top 20% of the ranking are 5 scores, the traders in the 20% to 40% of the ranking are 4 scores, the ranking is sequentially decreased, and the traders in the 20% of the ranking are 1 score; PA represents the service level score of traders, the earning rate is ranked from high to low, the traders in the top 20 percent of the ranking are ranked 5, the traders in the 20 percent to 40 percent of the ranking are ranked 4, the ranking is sequentially reduced, and the traders in the 20 percent of the ranking are ranked 1; UC represents the user rating of the trader, the average value of the user rating values of all the trades of the trader is taken, and the rating range is [0,5 ]; the comprehensive score is applied to the distribution module, intelligent recommendation service is carried out according to user requirements, and the comprehensive score is also applied to the storage module and used for classified storage management of trader accounts;
step eight: the distribution module is used for facilitating the user to more quickly and accurately find the traders with rich experience and good reputation and meeting the trading requirements of the user, and intelligent recommendation service is realized through calculation of the comprehensive scores of the traders and the matching degree of the user requirements by the evaluation module; the matching degree calculation and intelligent recommendation are divided into the following steps:
step one, defining user requirement set as FU,FUThe constrained range of each factor in the scoring factor set is given, wherein Are all continuously taken with the total weight of more than or equal to 0 and less than or equal to 5The value range is divided into three levels of requirements, namely high, medium and low, according to the requirement level selected by the userA high-level demand vector is represented,a vector of medium-level demand is represented,represents a low-level demand vector, whereinDefining the value range of the low level requirement as the high value respectivelyFUCustomizing a preset for a system;
and step two, defining the mapping function of the scoring factor as a piecewise linear function, and then the credit level scoring mapping function of the ith trader is as follows:the service level score mapping function is:the user score mapping function is:wherein α (CL)i)、β(PAi)、γ(UCi) Respectively representing the matching values of the ith trader and the user demand in three aspects of credit level, service level and user evaluation, CLi、PAi、UCiScores representing the credit level, business level and user rating of the ith trader, respectively;
step three, in order to reduce system calculation amount, performing initial screening by using the score ranking of the credit level in the scoring factor set, selecting N traders before the ranking of the credit level, wherein N can be set by a system in a self-defined way, calculating the matching values of the N traders and the user requirements in the credit level, the service level and the user evaluation, and obtaining a matching degree matrix M;
step four, defining the weight vector of each factor in the scoring factor set as W, wherein W can be set by a system in a self-defined manner, calculating the comprehensive matching degree MD of the first N traders and ranking, wherein the MD is W multiplied by M, and recommending the first five traders to the user according to the ranking result;
step nine: the storage module establishes a double-layer classification storage model for improving data query efficiency under the conditions of high access and high throughput caused by mass data, wherein the double-layer classification storage model respectively comprises a user classification storage model and a trader classification storage model;
step ten: the user classification storage model is constructed by the following steps:
step one, carrying out attribute classification on a user account, and defining a classification attribute set as follows: the transaction type, the transaction frequency and the transaction amount are C, Q, A, wherein C represents the type of the latest transaction operation of the user and is entrusted transaction or autonomous transaction; q represents the number of transactions of the user within a specified statistical period; a represents the total transaction amount of the user in a specified statistical period;
and step two, performing cluster analysis on the classification attributes of all the user accounts in the block chain, and defining the user set S in the block chain as S ═ S1,s2,…,snIn which s is1、s2、snClass attribute vectors respectively representing the 1 st, 2 nd and nth users registered on the blockchain, i.e.sjThe classification attribute vector representing the jth user is a three-dimensional vector and comprises the category of the latest transaction operation of the jth user, the transaction times in a specified statistical period and the total transaction amount in the specified statistical period, wherein j and n are self-ownedCounting;
step three, selecting the most central user from the S as the initial class center point, namely selecting the secondIndividual user or secondTaking individual users as initialization central points, dividing the users into m categories, setting m in a self-defined way according to system requirements, and setting the value range to be [3,10 ]]In order to accelerate the cluster analysis speed, the second class center point selects a point farthest from the initial class, the point closest to the average value of the first two classes is used as the initial class center point, the point farthest from the initial class center point is used as the third class center point, iteration is carried out in sequence until the mth class center point is selected, and a classified data set SC of all users in the block chain is obtained, wherein SC is { SC ═ SC1,SC2,…,SCm},SCmRepresenting the nearest user in the mth class center point;
step eleven: in order to encourage traders to provide better service for users, a consensus mechanism based on credit level is established, so that the trader classification storage model is divided into three classes of high credit, medium credit and low credit according to the number of credits of the traders, wherein 30% of traders with the highest credit ranking in the number of credits are high-credit traders, 20% of traders with the lowest credit ranking in the number of credits are low-credit traders, and the rest are medium-credit traders; the higher the credit, the easier the trader gets the opportunity to interact with the user, and the easier it becomes the manager node, thus getting the extra credit given by the system as reward;
step twelve: because new accounts are continuously registered in the block chain system, and account information of users and traders is continuously updated with the increase of trading, the storage module is dynamically classified and stored, the user classified storage model and the trader classified storage model are called every time x blocks are newly added in the system, the classification of the accounts of the users and the traders is recalculated, wherein x belongs to [10,20], and the system is customized and set according to the account information and the trading information; if the number of the newly added blocks does not reach x when the new account is registered, storing the newly registered account in the temporary classification, and recalculating the classification when the number of the newly added blocks reaches x; after the accounts of all users and traders are classified, storing the classification labels as suffixes of the account hash values;
step thirteen: the verification module is used for verifying the reliability of the negotiation process of the user in the process of selecting the trader; after a user submits a demand, the allocation module calculates the trader recommendation with the matching degree of the first five ranks to the user, the server node firstly preprocesses the trader matching degree data and the identity information to generate a new node to be inserted into the Merkle tree, and if the new node is a leaf node, the tag value of the new node is the digital tag of the data block stored by the leaf node; if the new node is not a leaf node, calculating hash values of two child nodes of the new node as label values; storing the preprocessed label value into the IPFS; because each layer of nodes stores the hash value of the corresponding child node, and the label value stored by the root node is the hash value of the Merkle tree, whether the data is falsified can be judged by verifying the label values of the nodes and the adjacent nodes; when a user submits a storage task after selecting a trader, the server node automatically initiates a verification request, calls an intelligent contract to obtain a storage address of the new node, compares the storage address with a root node hash value of a Merkle tree, and if the data are consistent, the verification is passed; if the data are inconsistent, the verification is not passed, the verification result is returned to the user node, the user submits the requirement again, and the negotiation verification is initiated;
fourteen steps: the transaction module is maintained by the administrator node and the monitoring node together; the monitoring node is responsible for synchronizing negotiation authentication data of the user and the recommended trader in the authentication module, monitoring evaluation of the user on the trader, calculating credit coins rewarded additionally according to the negotiation authentication data and the user evaluation, and then sending the credit coins rewarded additionally and the monitoring data to all trader nodes with high credit degrees; after receiving the information issued by the monitoring node, the trader node with high credit degree compares the information with actual monitoring data, and if the compared data is legal data, the trading data is written into an account book of the trader node; randomly selecting one trader from the traders with high credit degree as an administrator, packaging the trading data, the monitoring data and the credit coins with extra rewards into a block by the administrator, broadcasting the block to all trader nodes, submitting local data after all trader nodes receive notification to ensure the consistency of all accounts, and obtaining the credit coins with extra rewards by the administrator;
step fifteen: the query module responds to query requests of users and traders, firstly queries the hash value of the corresponding account, acquires the classification information of the account according to the hash value suffix, then retrieves the account information of the corresponding classification in the MongoDB, and feeds query data back to the users.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010676852.8A CN111831676A (en) | 2020-07-15 | 2020-07-15 | Business rule design method of block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010676852.8A CN111831676A (en) | 2020-07-15 | 2020-07-15 | Business rule design method of block chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111831676A true CN111831676A (en) | 2020-10-27 |
Family
ID=72924194
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010676852.8A Withdrawn CN111831676A (en) | 2020-07-15 | 2020-07-15 | Business rule design method of block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111831676A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113568577A (en) * | 2021-07-27 | 2021-10-29 | 天津大学 | Distributed packet storage method based on alliance block chain |
CN118172029A (en) * | 2024-05-14 | 2024-06-11 | 南京笔戈智能科技有限公司 | Work information sharing platform based on block chain |
-
2020
- 2020-07-15 CN CN202010676852.8A patent/CN111831676A/en not_active Withdrawn
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113568577A (en) * | 2021-07-27 | 2021-10-29 | 天津大学 | Distributed packet storage method based on alliance block chain |
CN113568577B (en) * | 2021-07-27 | 2023-11-21 | 天津大学 | Distributed grouping storage method based on alliance block chain |
CN118172029A (en) * | 2024-05-14 | 2024-06-11 | 南京笔戈智能科技有限公司 | Work information sharing platform based on block chain |
CN118172029B (en) * | 2024-05-14 | 2024-08-02 | 南京笔戈智能科技有限公司 | Work information sharing platform based on block chain |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6993496B2 (en) | Method and system for determining market demand based on consumer contributions | |
Miller et al. | Eliciting honest feedback in electronic markets | |
CN109447648A (en) | The method of recorded data zone block, accounting nodes and medium in block chain network | |
CN108257027A (en) | Declaration form data checking method, device, computer equipment and storage medium | |
Cai et al. | Dynamic reputation–based consensus mechanism: Real-time transactions for energy blockchain | |
CN108985694A (en) | Method and apparatus for determining home-delivery center address | |
CN111753006B (en) | Prediction system and method based on federal learning | |
CN108122162A (en) | Based on intelligent manufacturing management service plateform system and its supply and demand information processing method | |
CN111831676A (en) | Business rule design method of block chain | |
CN114663091B (en) | Power transaction method based on multi-chain block chain architecture | |
CN107730386A (en) | Generation method, device, storage medium and the computer equipment of investment combination product | |
JP2022535636A (en) | Financial product recommendation method, device, electronic device and program | |
CN109615504A (en) | Products Show method, apparatus, electronic equipment and computer readable storage medium | |
CN109784851A (en) | A kind of trade and investment promotion system based on internet electronic business platform | |
CN115796952A (en) | Distributed energy transaction incentive method based on block chain intelligent contract | |
Aigner et al. | A simple model of information and lending behavior | |
CN117217710B (en) | Intelligent management method and system for virtual commodity and shortcut service | |
CN114997865B (en) | Platform transaction method and device based on blockchain system | |
CN116542696A (en) | User group classification method, device, equipment and storage medium | |
CN113781247A (en) | Protocol data recommendation method and device, computer equipment and storage medium | |
Cao et al. | Integration of the social welfare function and TOPSIS algorithm for 3PL selection | |
Bai et al. | A fair incentive mechanism in federated learning | |
CN112541732A (en) | Intelligent bidding contract generation method and device and readable storage medium | |
Popović et al. | Multiple-Criteria Approach for Serbian Tourism Products Assessment | |
CN111079992A (en) | Data processing method, device 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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20201027 |