CN114549198A - Method and device for modifying intelligent contract rules of block chain - Google Patents

Method and device for modifying intelligent contract rules of block chain Download PDF

Info

Publication number
CN114549198A
CN114549198A CN202210119185.2A CN202210119185A CN114549198A CN 114549198 A CN114549198 A CN 114549198A CN 202210119185 A CN202210119185 A CN 202210119185A CN 114549198 A CN114549198 A CN 114549198A
Authority
CN
China
Prior art keywords
contract
weight
transaction
voting
proposal
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
CN202210119185.2A
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.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai 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 Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202210119185.2A priority Critical patent/CN114549198A/en
Publication of CN114549198A publication Critical patent/CN114549198A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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/23Updating
    • 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
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06311Scheduling, planning or task assignment for a person or group

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Accounting & Taxation (AREA)
  • Operations Research (AREA)
  • Educational Administration (AREA)
  • Technology Law (AREA)
  • Computing Systems (AREA)
  • Game Theory and Decision Science (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the specification provides a method for modifying a block chain intelligent contract rule, which is applied to a block chain node for deploying an intelligent contract, wherein the intelligent contract rule is expressed by configurable parameters, and the method comprises the following steps: receiving a proposal transaction of a contract union member, wherein the proposal transaction carries a configurable parameter target value; generating an initial value of a ticket obtaining statistical item of the configurable parameter target value; receiving the voting transaction of other contract alliance members to the configurable parameter target value, and updating the vote counting item of the configurable parameter target value according to a preset vote counting rule and based on the initial value; and when the ticket obtaining statistic item of the configurable parameter target value meets a preset passing condition, updating the intelligent contract rule running on the block chain according to the configurable parameter target value.

Description

Method and device for modifying intelligent contract rules of block chain
Technical Field
The present disclosure relates to the field of network communication technologies, and in particular, to a method and an apparatus for modifying a rule of a block chain intelligent contract.
Background
The distributed accounting and consensus mechanism technology of the block chain can provide a trusted data sharing mechanism for eliminating a third party, so that a trust relationship is established in an untrusted environment, and value transfer is realized. The intelligent contract technology greatly expands the application prospect of the block chain in social life.
An intelligent contract is a piece of code running on a block link point for engaging in entitlement obligations between one or more participants of the intelligent contract. Intelligent contracts contain a number of rules that determine how the participants interact with each other. Contracts are automatically executed as long as the predefined rules are met. As a computer transaction protocol which does not need an intermediary, is self-verified and automatically executes contract rules, the intelligent contract provides a safer, more efficient and more credible mode for realizing functions of transaction execution, asset management and the like in a block chain.
Intelligent contracts are usually negotiated by the participants of the contract to determine contract rules, and then developers write corresponding codes and deploy the codes on a blockchain to run. Once deployment is complete, the intelligent contracts will run exactly as the code. And the contract participants face the constant change of the real environment, so that the rules of the intelligent contract are not applicable any more. Rewriting and deploying new intelligent contracts can be very labor and resource intensive and time consuming.
Disclosure of Invention
In view of this, the present specification provides a method for modifying a blockchain intelligent contract rule, which is applied to a blockchain node deploying the intelligent contract, where the intelligent contract rule is expressed by configurable parameters, and the method includes:
receiving proposal transaction of contract alliance members, wherein the proposal transaction carries configurable parameter target values; generating an initial value of a ticket obtaining statistical item of the configurable parameter target value;
receiving the voting transaction of other contract alliance members to the configurable parameter target value, and updating the vote counting item of the configurable parameter target value according to a preset vote counting rule and based on the initial value;
and when the ticket obtaining statistic item of the configurable parameter target value meets a preset passing condition, updating the intelligent contract rule running on the block chain according to the configurable parameter target value.
The embodiment of the present specification further provides an apparatus for modifying a blockchain intelligent contract rule, which is applied to a blockchain node where the intelligent contract is deployed, where the intelligent contract rule is expressed by using configurable parameters, and the apparatus includes:
a proposal transaction processing unit, configured to receive a proposal transaction of a contract alliance member, where the proposal transaction carries a configurable parameter target value; generating an initial value of a ticket obtaining statistic item of the configurable parameter target value;
the voting transaction processing unit is used for receiving the voting transaction of other contract alliance members to the configurable parameter target value, and updating the voting statistical item of the configurable parameter target value according to a preset voting rule and based on the initial value;
and the rule updating unit is used for updating the intelligent contract rule running on the block chain according to the configurable parameter target value when the ticket obtaining statistic item of the configurable parameter target value meets a preset passing condition.
An embodiment of the present specification provides a computer device, including: a memory and a processor; the memory having stored thereon a computer program executable by the processor; when the processor runs the computer program, the method for modifying the intelligent contract rule of the block chain is executed.
Embodiments of the present specification provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs the method described in the above method for modifying a blockchain intelligent contract rule.
According to the technical scheme, in the embodiment of the specification, after receiving a proposal transaction of a contract union member carrying a configurable parameter target value, a block link point operating an intelligent contract assigns an initial value to a vote statistical item of the configurable parameter target value, updates the vote statistical item according to a subsequently received voting transaction of other contract union members on the configurable parameter target value, and updates an intelligent contract rule operating on the block link according to the configurable parameter target value when the vote statistical item meets a preset passing condition, so that the contract union member can modify contract terms after proposal and voting at any time according to actual needs without rewriting and deploying the intelligent contract on the block link, and labor, resource and time costs required for modifying the contract rule are greatly reduced.
Drawings
FIG. 1 is a diagram of a network architecture for an application scenario of an embodiment of the present disclosure;
FIG. 2 is a flowchart of a method applied to a blockchain node for modifying blockchain intelligent contract rules in an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a data storage model on a blockchain running a smart contract for trading commodities in an embodiment of the present description;
FIG. 4 is a schematic flow chart of a proposal in an application example of the present specification;
FIG. 5 is a schematic flow chart of a failed proposal in an application example of the specification;
FIG. 6 is a hardware block diagram of an apparatus for performing embodiments of the present description;
fig. 7 is a logical block diagram of an apparatus for modifying a blockchain intelligent contract rule in an embodiment of the present specification.
Detailed Description
The embodiment of the specification provides a new method for modifying a block chain intelligent contract rule, wherein contract coalition members can initiate proposal transaction carrying configurable parameter target values when wishing to modify specific clauses of an intelligent contract, block link points generate initial values of vote statistical terms of the configurable parameter target values and achieve consensus on the proposal transaction, other contract coalition members can initiate voting transaction on the configurable parameter target values, the block link points update the vote statistical terms and achieve consensus on the voting transaction, and after the vote statistical terms meet predetermined passing conditions, the intelligent contract rules running on each block chain node are updated according to the configurable parameter target values, so that the rules are modified in the running process of the intelligent contract without rewriting intelligent contract codes or redeploying the intelligent contract, and the required labor and computing resource cost is reduced, the efficiency of modifying the rules is improved.
Fig. 1 shows an example of a network structure according to an embodiment of the present disclosure, where an intelligent contract runs on each blockchain node of a blockchain 10, a user has an account with the blockchain 10, and a device 20 that the user logs in with the blockchain account may communicate with at least one node of the blockchain. The device in which the log-in device 20 of the blockchain account and the blockchain link point of the blockchain 10 are located may be a mobile phone, a tablet Computer, a PC (Personal Computer), a notebook, a server, or the like, and may also be a logical device running on one or more physical devices without limitation.
In the embodiment of the present specification, the blockchain may be any point-to-point network system that can deploy and run an intelligent contract and has a consensus mechanism and a distributed accounting function, and may be any type of public chain, private chain, alliance chain, and the like, and may adopt any consensus algorithm and any accounting mode, which are not limited.
As mentioned above, an intelligent contract is a piece of code running on a block link point to contract the right obligation between two or more parties participating in the intelligent contract. The intelligent contracts contain rules that may be used to contract various matters related to the intelligent contracts. In general, rules determine how the participants of an intelligent contract interact with each other, or determine what rights each participant has, what obligations it undertakes, and in what manner it exercises respective rights, fulfilling respective obligations. In addition, rules may determine issues related to the intelligent contract itself, such as what conditions a blockchain account is to satisfy in order to become a participant in the intelligent contract, in what circumstances the intelligent contract fails, and so forth.
In an embodiment of the present description, the rules of the intelligent contract are expressed by configurable parameters. When a configurable parameter is assigned different values, the rules expressed by the configurable parameter have different contents. After the intelligent contract is deployed on the block chain, the value of the configurable parameter is adjusted and consensus is achieved among the block chain nodes, so that the rule expressed by the configurable parameter in the intelligent contract is changed, the subsequent operation of the intelligent contract is performed according to the changed rule, and the rule corresponding to the configurable parameter before adjustment is not applicable any more.
Basically, any appointment item in the rule may adopt configurable parameters to implement different appointment contents, and is not limited. By the example of completing intelligent contract of a certain service, different values of a configurable parameter can be made to correspond to different service flows, and the interactive process between the participants when the service is executed can be modified by changing the value of the configurable parameter; a configurable parameter may be used to set the conditions for starting a certain service operation; a configurable parameter can also be used to represent a target object of a business operation, and the value of the configurable parameter can be changed, so that the business operation can be performed by whom. As another example, rules associated with the intelligent contracts themselves may also be agreed upon using configurable parameters, such as failure conditions for the intelligent contracts.
When a developer writes code for an intelligent contract, several configurable parameters may be used to reserve various possibilities to provide the intelligent contract with the ability to modify its own rules in the future on the fly as needed. The method can determine which rule contents are used as adjustable contents based on the consideration of the characteristics of the intelligent contract to complete the service, the factors which may change when being applied to the real scene, the service expansion space which is expected to be reserved and the like, and support how the contents can be adjusted in the future, thereby determining all configurable parameters in the intelligent contract. In addition, the developer can add an interface provided for adjusting the configurable parameters in the code of the intelligent contract, and the interface is called by a user of the block chain so as to modify the values of the configurable parameters during the operation of the intelligent contract.
In the usual case, the rules of an intelligent contract are negotiated by the parties to the contract. Modifications to intelligent contract rules should also embody the volition of the various parties. In the embodiment of the specification, a proposal and voting mechanism is adopted to realize the negotiation process of each participant during the rule modification, each participant adopts the block chain account to carry out proposal or voting on the rule modification, and when the proposal and voting result meet the preset passing condition, the proposal can be put into practice.
However, the blockchain for deploying the intelligent contracts is mostly an open platform, and users who open accounts on the blockchain may be completely unrelated to the intelligent contracts. The proposal and voting rights granted to these users for the intelligent contracts independent of them are not necessary, and may also result in unfair results to the contract interest stakeholders. In the embodiment of the specification, the contract federation members are adopted to limit the blockchain accounts capable of proposing or voting on the rule modification of a certain intelligent contract, and only the blockchain accounts belonging to the contract federation members can be used for proposing or voting. The contract federation members may be all or part of a blockchain account.
The block chain accounts can be determined to be used as contract alliance members according to factors such as the type of the block chain, the range of block chain users participating in the intelligent contract, the service to be completed by the intelligent contract and the like, and the method is not limited. For example, for a large commodity trader alliance chain that deploys intelligent contracts that are universally applicable to large commodity traders, all blockchain accounts may be considered contract alliance members. As another example, on a blockchain where multiple intelligent contracts are deployed, contract federation members for an intelligent contract may be restricted to blockchain accounts that have participated in the intelligent contract, i.e., that have performed an action associated with the intelligent contract. For another example, a user group may be established for a certain intelligent contract, and the blockchain account joining the user group is a contract federation member of the intelligent contract.
In the embodiment of the present specification, the flow of the method for modifying the rule of the blockchain intelligent contract is shown in fig. 2, and the method is applied to the blockchain node where the intelligent contract is deployed.
Step 210, receiving a proposal transaction of a contract union member, wherein the proposal transaction carries a configurable parameter target value; and generating an initial value of the ticket obtaining statistic item of the configurable parameter target value.
When a certain contract alliance member wants to modify the rules of the intelligent contract, the value (called as a configurable parameter target value) of a configurable parameter corresponding to a modification target is determined, proposal transaction is initiated to a block link point, and the configurable parameter target value is carried in the proposal transaction.
And the block chain link points receive the proposal transaction, extract a configurable parameter target value from the proposal transaction, set a ticket-obtaining statistic item for the configurable parameter target value and generate an initial value of the ticket-obtaining statistic item. After the plurality of blockchain nodes agree on the proposed transaction, information of the proposed transaction (including the target value of the configurable parameter and the current value of the ticketing statistic item of the configurable parameter) is recorded into the blockchain account.
Step 220, receiving the voting transaction of other contract alliance members to the configurable parameter target value, and updating the vote counting item of the configurable parameter target value according to a preset vote counting rule and based on the initial value.
After the blockchain agrees on the proposal transaction, other contract federation members may obtain proposal information from the blockchain ledger, knowing the configurable parameters that the proposal wishes to alter and their target values. After determining the attitude of the contract union member to the proposal, other contract union members can initiate voting transaction to the block chain node, and indicate whether the members support the attitude of the proposal in the voting transaction.
The block chain node receives the voting transaction, determines the configurable parameter target value aimed at by the voting transaction and the table state of the voting transaction, updates the vote counting item of the configurable parameter target value according to a preset vote counting rule, and updates the vote counting item based on the initial value generated when the proposal transaction aiming at the configurable parameter target value is processed. After the plurality of blockchain nodes agree on the voting transaction, the information of the voting transaction (including the influence of the voting transaction on the vote statistic item) is recorded into the blockchain account.
The formal type of voting and the corresponding predetermined vote counting rule can be selected according to the specific situation of the actual application scenario, without limitation. For example, the tabular types of votes may include up, down, and discard, and the predetermined tally rules include accumulating the number of votes for up, down, and discard (the initial value of the tally statistic is up to 1, and down and discard are 0). As another example, the types of votes may include positive and negative (members of a contractual union who are abstaining from initiating a voting transaction), and the predetermined voting rules include positive votes plus 1 on the votes-up statistics and negative votes do not change the votes-down statistics.
In some application scenarios, the influence degree of the intelligent contract rules on the benefits of each contract union member is greatly different. For example, for a large number of transactions processed using intelligent contracts, involving highly profitable contract federation members, small changes to contract rules may have a substantial impact, and it may be more fair to have such contract federation members have a larger floor for rule modification. In these application scenarios, member weights may be maintained by the block link points for each contract federation member, and each contract federation member may be asked or voted for within the scope of its member weight. Two exemplary implementations are given below.
In a first implementation manner, when a certain contract union member initiates a proposal transaction, the initial value of the ticketing statistic item of the configurable parameter target value in the proposal is determined according to the member weight of the contract union member. When receiving a voting transaction initiated by a certain contract alliance member, calculating a vote value of the current voting according to the member weight of the contract alliance member initiating the current voting, and updating a vote statistical item of the configurable parameter target value according to the obtained vote value.
In a second implementation, the contract federation members may choose to use all or part of the member's weight for proposal or voting. When a certain contract alliance member initiates proposal transaction, a designated use weight (not exceeding the member weight of the contract alliance member initiating the proposal transaction) is carried in the proposal transaction, and the initial value of the ticket obtaining statistical item of the parameter target value can be configured in the proposal and is determined according to the designated use weight in the proposal. The method comprises the following steps that a predetermined vote counting rule adopted by a blockchain node in the process of voting transaction also reflects the influence of designated use weight, and when a certain contract alliance member initiates voting transaction, the designated use weight is carried in the voting transaction (the weight of the member of the contract alliance member initiating the voting transaction is not more than the weight of the member of the contract alliance member initiating the voting transaction); after receiving the voting transaction, the block chain node calculates the vote value of the current voting according to the appointed use weight in the voting transaction, and updates the vote statistic item of the configurable parameter target value according to the obtained vote value.
In the two implementation modes, for a certain intelligent contract, the calculation method of the member weight of a contract union member can be determined according to the requirement of an actual application scene. In one example, the member weights of the contract federation members may be determined based on the intended behavior of the contract federation members to participate in the intelligent contract. Which behaviors are related to the intelligent contract and used as the established behaviors influencing the member weight can be set according to actual needs. In the above example, the maintenance of the member weight may be implemented in an intelligent contract running on the blockchain, the blockchain link point records the member weight of each contract federation member in the blockchain ledger, when a contract federation member initiates a transaction belonging to a predetermined behavior with the blockchain link point, the member weight of each contract federation member participating in the predetermined behavior in the blockchain ledger is updated according to the predetermined behavior, and when the blockchain link point agrees with the predetermined behavior, the block link point agrees with the update of all the member weights. It should be noted that the predetermined behavior includes several processing operations related to the intelligent contract, each processing operation may involve one to many contract federation members, and the block link point will update the member weight of the one to many contract federation members.
One specific way of determining the membership weights in the above example is given below. The member weight of each contract alliance member is determined according to one or more of the member quota weight, the member frequency weight, the member association degree weight and the member voting win-lose weight of the contract alliance member. The method comprises the following steps that the member quota weight of one contract union member is determined according to the quota of the contract union member for completing the service by adopting the intelligent contract in a first time period and the total quota of all services completed by adopting the intelligent contract in the first time period; the member frequency weight of a contract alliance member is determined according to the times that the contract alliance member adopts the intelligent contract to complete the service in the second time period and the total times that all the intelligent contract adopted to complete the service in the second time period; the member association degree weight of one contract alliance member is determined according to the number of other contract alliance members involved when the contract alliance member adopts the intelligent contract to complete the service; the membership voting win-lose weight of a contract union member is determined according to whether the historical proposal initiated by the contract union member passes and whether the voting historical proposal passes.
Assuming that the intelligent contract running on the blockchain is used for conducting commodity transaction, the blockchain account which once called the intelligent contract to complete the commodity transaction is a contract alliance member. The member weight of a contract union member can be determined according to the four items of member limit weight, member frequency weight, member association degree weight and member voting win-win weight of the contract union member. Specifically, the sum of the weight of the member limit of all contract alliance members is 10, the weight of the member limit of the member alpha is equal to the proportion of GMV (Gross Merchandis Volume) completed by calling the intelligent contract by the member alpha in the last three months and GMV completed by calling the intelligent contract by all contract alliance members in the last three months, and the weight of the member limit of the member alpha is obtained after multiplying the weight by 10; setting the member frequency weight of all contract union members as 9, and then obtaining the member frequency weight of the member alpha by multiplying the member frequency weight of the member alpha by the ratio of the number of times that the member alpha calls the intelligent contract to complete the transaction in the last three months to the number of times that all the contract union members call the intelligent contract to complete the transaction in the last three months; setting the member association degree weight of all contract union members as 8, and obtaining the member association degree weight of the member alpha after the member alpha is multiplied by 8, wherein the member association degree weight of the member alpha is equal to the number of other contract union members involved when the member alpha calls the intelligent contract to complete the transaction and accounts for the proportion of the total number of the other contract union members involved when all contract union members call the intelligent contract to complete the transaction; the initial value of the member voting win-lose weight of the member alpha is 0, the member voting win-lose weight is reduced by 1 when the initiated proposal passes, the proposal for voting passes or the proposal for voting up or the proposal for voting down fails, and the member voting win-lose weight is increased by 1 when the initiated proposal fails, the proposal for voting up or the proposal for voting down passes. The sum of the above four terms is the member weight of the member α.
The member voting win-lose weight can enable a contract union member with unapproved opinion to have advantages in subsequent proposal or voting, and the phenomenon that the voice of some contract union members is ignored is prevented to a certain extent.
On a blockchain where the above commodity transaction contracts are deployed, a data model structure as shown in fig. 3 may be employed to record information related to the transaction and contract federation members. The chain fund model comprises data items such as fund identification, anchor currency (the price currency of the chain fund), balance, profit (the balance of the chain fund in the using process caused by the requirement of price number, such as rounding below the RMB score) and the like; the weight rule model comprises GMV weight (member quota weight of the affiliated contract union member), transaction frequency weight (member frequency weight of the affiliated contract union member), transaction breadth weight (member association weight of the affiliated contract union member) and voting win/lose weight (member voting win/lose weight of the affiliated contract union member); the on-chain order model includes buyer identification (as blockchain account identification of buyer for commodity transaction), seller identification (as blockchain account identification of seller for commodity transaction), target identification (identification of commodity to be traded), order amount (price of transaction), anchor currency (invoicing currency of transaction). The block link points may employ the data model described above to maintain member weights for individual contract federation members.
And step 230, updating the intelligent contract rules running on the block chain according to the configurable parameter target value when the ticket obtaining statistic item of the configurable parameter target value meets the preset passing condition.
After the block chain node agrees with the voting transaction, if the voting statistical item of the target value of the configurable parameter in the block chain account book meets the preset passing condition in a certain voting transaction, the block chain node updates the configurable parameter of the intelligent contract rule to the target value, and starts the agreement process of the updating operation of the configurable parameter. After agreement is reached on the configurable parameter update, the contents of the intelligent contract rules on the blockchain are updated to match the contents of the configurable parameter target values.
The corresponding predetermined passing condition may be set by using a formal type of voting in an actual application scenario and a predetermined vote counting rule, which is not limited. For example, in the aforementioned example of accumulating the numbers of votes for the vote, the vote opposed to the vote, and the ticket for which the right of passage reaches or exceeds the sum of the numbers of votes 2/3 may be used as the predetermined passing condition. As another example, in the aforementioned example that the vote is approved to add 1 to the vote statistic and the vote is rejected not to change the vote statistic, the vote statistic may be not less than a threshold as the predetermined passing condition.
In steps 310 and 320, contract federation members initiate proposal transactions and voting transactions by invoking intelligent contracts to adjust the interface provided by the configurable parameters. The specific implementation of the interface can be determined by the developer according to the adopted block chain technology, and is not limited.
In one implementation, a developer may provide two interfaces, a proposal interface and a voting interface, for each configurable parameter. The contract alliance member wants to adjust which configurable parameter, can call the proposal interface of the configurable parameter, and carry the target value of the configurable parameter in the call instruction. For proposal transactions known from the blockchain ledger, other contract federation members (other than the contract federation member initiating the proposal) may invoke a voting interface with configurable parameters in the proposal to initiate a voting transaction to the blockchain nodes, indicating the attitude of whether the proposal is approved.
It can be seen that, in the embodiment of the present specification, a contract federation member initiates a proposal transaction carrying a configurable parameter target value, a block link point generates an initial value of a vote-obtaining statistic item of the configurable parameter target value, and updates the vote-obtaining statistic item according to a subsequently received vote transaction of other contract federation members on the configurable parameter target value, and updates an intelligent contract rule running on each block link node according to the configurable parameter target value after the vote-obtaining statistic item meets a predetermined passing condition, so as to modify the rule in the running process of an intelligent contract, and the contract federation member can modify contract terms after proposal and voting according to actual needs at any time without rewriting and deploying the intelligent contract on the block link, thereby reducing the cost of required labor and operation resources, and improving the efficiency of rule modification.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
In an application example of the present specification, a blockchain is deployed with an intelligent contract for commodity transaction, the intelligent contract uses configurable parameters to describe its rules, and the intelligent contract exposes two interfaces to the outside for each configurable parameter, one is a proposal interface, and the other is a voting interface, which is used for a negotiation process for modifying the value of the configurable parameter. Each user has a respective account on the blockchain, the blockchain account which calls the intelligent contract to complete the commodity transaction is a contract alliance member, and the user of the blockchain account is a participant of the commodity transaction contract.
The blockchain maintains a member weight for each contract federation member, the member weight determined according to the trading behavior of the contract federation member in participating in a commodity trading contract. When the block chain link points process the transaction of the contract participating in the commodity transaction, the member weight of the contract union member related to the transaction is updated according to the transaction information and is recorded in the block chain account book. The initial value of the ticket-obtaining statistic item is the member weight of the contract union member who initiates the proposal, the member weight of each contract union member who agrees to the ticket is added into the ticket-obtaining statistic item, and the ticket-obtaining statistic item is not influenced by the rejection of the ticket. When the ticket statistical item reaches or exceeds 80, the proposal is passed.
The rules of the intelligent contract include an agreement on a commodity transaction rate, where the commodity transaction rate is a configurable parameter.
Assuming that the intelligent contract currently running on the blockchain adopts 4% of commodity transaction rate, the user A considers that the rate is too low, and invokes a commodity transaction rate proposal interface of the commodity transaction contract, wherein the invocation instruction comprises a target value of the commodity transaction rate of 5%, and the commodity transaction rate is recommended to be increased to 5%. And the block chain node generates a ticket obtaining statistical item for the commodity transaction rate of 5%, and sets the initial value of the ticket obtaining statistical item to be 20 according to the member weight (set to be 20) of the user A. The blockchain node agrees with the proposed transaction, and the initial values of the proposed transaction and the ticket-obtaining statistic item are written into a blockchain ledger.
After knowing from the blockchain ledger that user a initiated a proposal transaction at a commodity transaction rate of 5%, other users may invoke the commodity transaction rate voting interface of the commodity transaction contract, indicating in the invocation instruction whether they agree or disagree to increase the commodity transaction rate to 5%. And the blockchain node receives the call of the commodity transaction rate voting interface, calculates the voting value of the voting according to the member weight and the voting type of the user who initiates the call, and updates the value of the vote counting item. And the blockchain nodes reach consensus on each voting transaction, and the values of the vote counting items after each updating are written into a blockchain account book. When the value of the statistical items of the obtained tickets recorded in the blockchain account book reaches or exceeds 80%, the blockchain nodes update the commodity transaction rate of the commodity transaction contract to 5% to start a consensus mechanism, and the commodity transaction rate of the commodity transaction contract is modified to 5% after the consensus is achieved. And if the value of the statistic item of obtaining the ticket recorded in the blockchain account book is less than 80, the commodity transaction rate of the commodity transaction contract on the blockchain is unchanged.
Referring to fig. 4, assume that the voting process for a commodity transaction rate of 5% is: the user C of the member weight 20 throws an agreement ticket, the user B of the member weight 30 throws an objection ticket, the user E of the member weight 40 throws an agreement ticket, the statistical item of obtaining the ticket of 5% of the commodity transaction rate in the block chain account book is 80, the threshold value 80 is reached, the proposal is passed, the block chain node triggers the automatic update of the commodity transaction contract, and the commodity transaction rate is modified to be 5%. Because the user D and the user F are not participators of the commodity transaction contract and do not belong to contract alliance members of the commodity transaction contract, the users are not entitled to vote on proposals with commodity transaction rates of 5%.
Referring to fig. 5, assume that the voting process for a commodity transaction rate of 5% is: and if the user C with the member weight of 20 throws an objection ticket, the user B with the member weight of 30 throws an assent ticket, and the user E with the member weight of 40 throws an objection ticket, the 5% of the commodity transaction rate in the block chain account is 50, which is smaller than the threshold value of 80, the proposal cannot be passed, and the block chain node does not change the commodity transaction rate in the commodity transaction contract, which is still 4%.
Therefore, in the application example, the participants of the intelligent contract can selectively participate in the modification activities of different rules according to specific needs, so as to help the perfection and evolution of the rules. The modification of the rules is not the volition of one party, but the result of a multi-party negotiation. The application example realizes the automatic evolution of the rules on the basis of the rule transparency, and provides more possibility for the block chain to be applied to a multi-party cooperative scene.
Corresponding to the above flow implementation, an embodiment of the present specification further provides a device for modifying a block chain intelligent contract rule. The apparatus may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, the logical device is formed by reading a corresponding computer program instruction into a memory for running through a Central Processing Unit (CPU) of the device. In terms of hardware, the device in which the apparatus for modifying the intelligent contract rule of the block chain is located generally includes other hardware such as a chip for transmitting and receiving wireless signals and/or other hardware such as a board card for implementing a network communication function, in addition to the CPU, the memory and the storage shown in fig. 6.
Fig. 7 is a device for modifying a blockchain intelligent contract rule, which is applied to a blockchain node where the intelligent contract is deployed, and is expressed by configurable parameters, where the device includes a proposal transaction processing unit, a voting transaction processing unit, and a rule updating unit, where: the proposal transaction processing unit is used for receiving proposal transactions of contract alliance members, and the proposal transactions carry configurable parameter target values; generating an initial value of a ticket obtaining statistic item of the configurable parameter target value; the voting transaction processing unit is used for receiving the voting transaction of other contract alliance members to the configurable parameter target value, and updating the voting statistical item of the configurable parameter target value according to a preset voting rule and based on the initial value; and the rule updating unit is used for updating the intelligent contract rule running on the block chain according to the configurable parameter target value when the ticket obtaining statistic item of the configurable parameter target value meets a preset passing condition.
In one implementation, the initial value of the ticketing statistic item is determined according to the member weight of a contract alliance member initiating proposal transaction; the predetermined ticket counting rule comprises: and calculating the vote value of the current vote according to the member weight of the contract alliance member initiating the voting transaction, and updating the vote counting item of the configurable parameter target value by adopting the vote value.
In the above implementation manner, the member weight is generated according to an established behavior of a contract alliance member participating in the intelligent contract; the device further comprises: and the member weight maintenance unit is used for updating the member weight of each contract alliance member related to the established behavior in the block chain account book according to the initiated established behavior after receiving the transaction of the established behavior initiated by the contract alliance member, and performing consensus on the updated member weight with other block chain nodes.
In the above implementation, the member weight is determined according to at most one of the following: member limit weight, member frequency weight, member association degree weight and member voting win-lose weight; the member quota weight is determined according to the quota of the contract union member adopting the intelligent contract to complete the service in the first time period and the total quota of all services adopting the intelligent contract to complete the service in the first time period; the member frequency weight is determined according to the times of the contract union members adopting the intelligent contract to complete the service in the second time period and the total times of all the services adopting the intelligent contract in the second time period; the member association degree weight is determined according to the number of other contract union members related to the contract union members when the members adopt the intelligent contracts to complete the services; the member voting win-lose weight is determined according to whether the historical proposal initiated and voted by the member of the affiliated contract union passes or not.
Optionally, the proposed transaction carries a specified usage weight; the voting transaction carries a designated use weight; the designated usage weight does not exceed a member weight of a contract federation member initiating the transaction; the initial value of the ticket-obtaining statistic item is determined according to the appointed use weight carried in the proposal transaction; the predetermined ticket counting rule comprises: and calculating the vote value of the current vote according to the designated use weight carried in the voting transaction, and updating the vote counting item of the configurable parameter target value by adopting the vote value.
Optionally, the intelligent contract provides a proposal interface and a voting interface for each configurable parameter respectively; the proposal transaction processing unit receives proposal transactions of contract alliance members, wherein the proposal transactions carry configurable parameter target values and comprise: receiving the call of contract alliance members to a proposal interface of configurable parameters, wherein the call instruction comprises the target value of the configurable parameters; the voting transaction processing unit receives the voting transaction of other contract alliance members to the configurable parameter target value, and comprises the following steps: and receiving the call of the voting interface of the configurable parameters by other contract union members.
Optionally, the contract federation members include: a blockchain account that participated in the intelligent contract.
Embodiments of the present description provide a computer device that includes a memory and a processor. Wherein the memory has stored thereon a computer program executable by the processor; the processor, when executing the stored computer program, performs the steps of the method for modifying blockchain intelligent contract rules of the embodiments of the present specification. For a detailed description of the steps of the method for modifying the intelligent contract rules of the blockchain, reference is made to the preceding contents, which are not repeated.
Embodiments of the present description provide a computer-readable storage medium having stored thereon computer programs which, when executed by a processor, perform the steps of the method of embodiments of the present description for modifying blockchain intelligent contract rules. For a detailed description of the steps of the method for modifying the intelligent contract rules of the blockchain, reference is made to the preceding contents, which are not repeated.
While the invention has been described in terms of what is presently considered to be the most practical and preferred embodiment, it is to be understood that the invention is not to be limited to the disclosed embodiment, but on the contrary, is intended to cover various modifications, equivalents, and alternatives falling within the spirit and scope of the invention as defined by the appended claims.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.

Claims (16)

1. A method of modifying a blockchain intelligent contract rule for use at a blockchain node at which the intelligent contract is deployed, the intelligent contract rule being expressed in terms of configurable parameters, the method comprising:
receiving proposal transaction of contract alliance members, wherein the proposal transaction carries configurable parameter target values; generating an initial value of a ticket obtaining statistic item of the configurable parameter target value;
receiving the voting transaction of other contract alliance members to the configurable parameter target value, and updating the vote counting item of the configurable parameter target value according to a preset vote counting rule and based on the initial value;
and when the ticket obtaining statistic item of the configurable parameter target value meets a preset passing condition, updating the intelligent contract rule running on the block chain according to the configurable parameter target value.
2. The method of claim 1, wherein the initial value of the ticketing statistics is determined according to member weights of contract federation members initiating proposal transactions;
the predetermined ticket counting rule comprises the following steps: and calculating the vote value of the current vote according to the member weight of the contract alliance member initiating the voting transaction, and updating the vote counting item of the configurable parameter target value by adopting the vote value.
3. The method of claim 2, the member weights being generated according to an established behavior of contract federation members to participate in the intelligent contract;
the method further comprises the following steps: after receiving the transaction of the established behaviors initiated by the contract alliance members, updating the member weight of each contract alliance member related to the established behaviors in the blockchain account book according to the initiated established behaviors, and performing consensus on the updated member weight with other blockchain nodes.
4. The method of claim 2, the membership weight being determined according to at most one of: member limit weight, member frequency weight, member association degree weight and member voting win-lose weight;
the member quota weight is determined according to the quota of the contract union member adopting the intelligent contract to complete the service in the first time period and the total quota of all services adopting the intelligent contract to complete the service in the first time period;
the member frequency weight is determined according to the times of the contract union members adopting the intelligent contract to complete the service in the second time period and the total times of all the services adopting the intelligent contract in the second time period;
the member association degree weight is determined according to the number of other contract union members related to the contract union members when the members adopt the intelligent contracts to complete the services;
the member voting win-lose weight is determined according to whether the historical proposal initiated and voted by the member of the affiliated contract union passes or not.
5. The method of claim 1, the proposal transaction carrying a specified usage weight; the voting transaction carries a designated use weight; the designated usage weight does not exceed a member weight of a contract federation member initiating the transaction;
the initial value of the ticket-obtaining statistic item is determined according to the appointed use weight carried in the proposal transaction;
the predetermined ticket counting rule comprises: and calculating the vote value of the current vote according to the designated use weight carried in the voting transaction, and updating the vote counting item of the configurable parameter target value by adopting the vote value.
6. The method of claim 1, the intelligent contract providing a proposal interface and a voting interface, respectively, for each configurable parameter;
the receiving a proposal transaction of a contract alliance member, wherein the proposal transaction carries a configurable parameter target value, and comprises the following steps: receiving the call of contract union members to the proposal interface of the configurable parameters, wherein the call instruction comprises the target value of the configurable parameters;
the receiving of voting transactions of other contract federation members on the configurable parameter target value comprises: and receiving the call of the voting interface of the configurable parameters by other contract union members.
7. The method of claim 1, the contract federation member comprising: a blockchain account that participated in the intelligent contract.
8. An apparatus for modifying blockchain intelligent contract rules for use at blockchain nodes at which the intelligent contracts are deployed, the intelligent contract rules being expressed in terms of configurable parameters, the apparatus comprising:
a proposal transaction processing unit, configured to receive a proposal transaction of a contract alliance member, where the proposal transaction carries a configurable parameter target value; generating an initial value of a ticket obtaining statistic item of the configurable parameter target value;
the voting transaction processing unit is used for receiving the voting transaction of other contract alliance members to the configurable parameter target value, and updating the voting statistical item of the configurable parameter target value according to a preset voting rule and based on the initial value;
and the rule updating unit is used for updating the intelligent contract rule running on the block chain according to the configurable parameter target value when the ticket obtaining statistic item of the configurable parameter target value meets a preset passing condition.
9. The apparatus of claim 8, the initial value of the ticketing statistics is determined according to member weights of contract federation members initiating proposal transactions;
the predetermined ticket counting rule comprises the following steps: and calculating the vote value of the current vote according to the member weight of the contract alliance member initiating the voting transaction, and updating the vote counting item of the configurable parameter target value by adopting the vote value.
10. The apparatus of claim 9, the member weight is generated according to an established behavior of a contract federation member to participate in the intelligent contract;
the device further comprises: and the member weight maintenance unit is used for updating the member weight of each contract alliance member related to the established behavior in the block chain account book according to the initiated established behavior after receiving the transaction of the established behavior initiated by the contract alliance member, and performing consensus on the updated member weight with other block chain nodes.
11. The apparatus of claim 9, the member weight determined according to at most one of: member limit weight, member frequency weight, member association degree weight and member voting win-lose weight;
the member quota weight is determined according to the quota of the contract union member adopting the intelligent contract to complete the service in the first time period and the total quota of all services adopting the intelligent contract to complete the service in the first time period;
the member frequency weight is determined according to the times of the contract union members adopting the intelligent contract to complete the service in the second time period and the total times of all the services adopting the intelligent contract in the second time period;
the member association degree weight is determined according to the number of other contract union members related to the contract union members when the members adopt the intelligent contracts to complete the services;
the member voting win-lose weight is determined according to whether the historical proposal initiated and voted by the member of the affiliated contract union passes or not.
12. The apparatus of claim 8, the proposal transaction carrying a specified usage weight; the voting transaction carries a designated use weight; the designated usage weight does not exceed a member weight of a contract federation member initiating the transaction;
the initial value of the ticket-obtaining statistic item is determined according to the appointed use weight carried in the proposal transaction;
the predetermined ticket counting rule comprises: and calculating the vote value of the current vote according to the designated use weight carried in the voting transaction, and updating the vote counting item of the configurable parameter target value by adopting the vote value.
13. The apparatus of claim 8, the intelligent contract providing a proposal interface and a voting interface, respectively, for each configurable parameter;
the proposal transaction processing unit receives proposal transactions of contract alliance members, wherein the proposal transactions carry configurable parameter target values and comprise: receiving the call of contract alliance members to a proposal interface of configurable parameters, wherein the call instruction comprises the target value of the configurable parameters;
the voting transaction processing unit receives the voting transaction of other contract alliance members to the configurable parameter target value, and comprises the following steps: and receiving the call of the voting interface of the configurable parameters by other contract union members.
14. The apparatus of claim 8, the contract federation member comprising: a blockchain account that participated in the intelligent contract.
15. A computer device, comprising: a memory and a processor; the memory having stored thereon a computer program executable by the processor; the processor, when executing the computer program, performs the method of any of claims 1 to 7.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202210119185.2A 2022-02-08 2022-02-08 Method and device for modifying intelligent contract rules of block chain Pending CN114549198A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210119185.2A CN114549198A (en) 2022-02-08 2022-02-08 Method and device for modifying intelligent contract rules of block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210119185.2A CN114549198A (en) 2022-02-08 2022-02-08 Method and device for modifying intelligent contract rules of block chain

Publications (1)

Publication Number Publication Date
CN114549198A true CN114549198A (en) 2022-05-27

Family

ID=81673687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210119185.2A Pending CN114549198A (en) 2022-02-08 2022-02-08 Method and device for modifying intelligent contract rules of block chain

Country Status (1)

Country Link
CN (1) CN114549198A (en)

Similar Documents

Publication Publication Date Title
WO2020063175A1 (en) Method and apparatus for allocating virtual resources
US20200302533A1 (en) Blockchain-based exchange method and apparatus for available resource quotas
CN110765200B (en) Asset procurement method and device based on block chain and electronic equipment
CN110706114A (en) Block chain-based default asset processing method and device and electronic equipment
TW202105276A (en) Allocating virtual resource based on block chain
CN110458631B (en) Bill number distribution method and device based on block chain and electronic equipment
CN113037817B (en) Method and device for starting intelligent contract, electronic equipment and storage medium
US11403604B2 (en) Blockchain-based set exchange method and apparatus for available resource quotas
CN111383117A (en) Asset management method and device based on block chain and electronic equipment
CN110738566A (en) asset screening method and device based on block chain and electronic equipment
CN112560114B (en) Method and device for calling intelligent contract
CN111738810A (en) Public service data processing method and device based on block chain
US11393031B2 (en) Blockchain-based method and apparatus for pre-exchanging available resource quotas
CN112015577B (en) Intelligent contract calling method and device
CN115456772A (en) Intelligent contract creating method and device
CN113112358A (en) Block chain-based decision method and device and electronic equipment
CN112288412A (en) Block chain-based digital legal note management method and device
CN111383118A (en) Asset management method and device based on block chain and electronic equipment
CN114549198A (en) Method and device for modifying intelligent contract rules of block chain
CN116629510A (en) Service type manufacturing resource matching method and system based on block chain
Marko et al. Management of Decentralized Autonomous Organizations
CN110992021A (en) Intelligent contract-based fund management method, device and equipment
CN112019454B (en) Resource processing method, device and storage medium
CN112288336A (en) Enterprise management method and device based on block chain
Weize et al. Blockchain-based Multi-skill Mobile Crowdsourcing Services

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