CN116562885B - Supply chain system management method, device, equipment and medium based on block chain - Google Patents

Supply chain system management method, device, equipment and medium based on block chain Download PDF

Info

Publication number
CN116562885B
CN116562885B CN202310828144.5A CN202310828144A CN116562885B CN 116562885 B CN116562885 B CN 116562885B CN 202310828144 A CN202310828144 A CN 202310828144A CN 116562885 B CN116562885 B CN 116562885B
Authority
CN
China
Prior art keywords
consensus
consensus node
supply chain
nodes
node
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.)
Active
Application number
CN202310828144.5A
Other languages
Chinese (zh)
Other versions
CN116562885A (en
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.)
Beijing Xinda Financial Education Technology Co ltd
Original Assignee
Beijing Xinda Financial Education Technology 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 Beijing Xinda Financial Education Technology Co ltd filed Critical Beijing Xinda Financial Education Technology Co ltd
Priority to CN202310828144.5A priority Critical patent/CN116562885B/en
Publication of CN116562885A publication Critical patent/CN116562885A/en
Application granted granted Critical
Publication of CN116562885B publication Critical patent/CN116562885B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/22Payment schemes or models
    • G06Q20/223Payment schemes or models based on the use of peer-to-peer networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1061Peer-to-peer [P2P] networks using node-based peer discovery mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/52Network services specially adapted for the location of the user terminal
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a supply chain system management method, a supply chain system management device, supply chain system management equipment and a supply chain system management medium based on a block chain, wherein the method comprises the steps of obtaining transaction information to be verified, and determining a first number based on the geographic position of a supply chain participant corresponding to the transaction information, wherein the first number is the number of consensus nodes participating in the consensus; determining the second number of sub-users selected randomly in each consensus node of the block chain, and mapping the second number into a weight value when the consensus node participates in consensus; selecting a first number of consensus nodes from the consensus nodes based on the weight values and the reputation values of the consensus nodes, and taking the first number of consensus nodes as target consensus nodes participating in the consensus; and verifying the transaction message through the target consensus node to obtain a verification result. By adopting the technical scheme, the authenticity and the accuracy of the transaction information among all the participants in the supply chain are improved.

Description

Supply chain system management method, device, equipment and medium based on block chain
Technical Field
The invention belongs to the technical field of data processing, and particularly relates to a supply chain system management method, device, equipment and medium based on a blockchain.
Background
With the rapid development of technology, the blockchain technology is used as a distributed account book technology, which brings deep influence to the fields of finance, intelligent manufacturing, supply chains, logistics and the like, and drives a new round of technology innovation and application innovation.
In the conventional supply chain financial mode, each participant uses a separate system to manage separate businesses, including internal systems of the core enterprise, vendor supply and sales and financial systems, third party financing service systems, commercial banks or funds provider systems, and other auxiliary verification logistics, warehousing, funds flow related systems, and the like. In the existing supply chain management method based on the blockchain technology, the respective business of each participant is uniformly managed in the blockchain, when the participant initiates a new transaction, the new transaction needs to be commonly identified through a blockchain common identification mechanism, and only when more than half of blockchain nodes agree with the current transaction, the transaction can be added into the blockchain to manage the transaction information among the participants, wherein the selection of the common identification nodes in the existing blockchain common identification mechanism directly influences the common identification result of the current transaction information, so that the authenticity and accuracy of the transaction information are influenced.
In summary, how to improve the authenticity and accuracy of transaction information among all parties in a supply chain by improving a blockchain consensus algorithm has become a technical problem to be solved in the blockchain technical field.
Disclosure of Invention
The invention mainly aims to provide a supply chain system management method, a supply chain system management device, supply chain system management equipment and supply chain system management medium based on a block chain. The aim is to improve the authenticity and accuracy of transaction information between participants in a supply chain by improving a blockchain consensus algorithm.
In order to achieve the above object, the present invention provides a blockchain-based supply chain system management method including:
acquiring transaction information to be verified, and determining a first number based on the geographic position of a supply chain participant corresponding to the transaction information, wherein the first number is the number of consensus nodes participating in the consensus;
determining a second number of sub-users selected randomly in each consensus node of the blockchain, and mapping the second number into a weight value when the consensus node participates in consensus;
selecting the first number of consensus nodes from the consensus nodes as target consensus nodes participating in the current consensus based on the weight values and the reputation values of the consensus nodes;
And verifying the transaction message through the target consensus node to obtain a verification result.
Optionally, the step of determining the first number based on the geographic location of the supply chain participant corresponding to the transaction information includes:
detecting whether a supply chain participant is in a single geographic region based on the geographic location of the supply chain participant corresponding to the transaction information;
if the supply chain participants are detected to be in a single geographic area, taking the preset quantity as a first quantity;
if the supply chain participant is detected to be in a plurality of geographic areas, determining the area number of the geographic areas in which the supply chain participant is located, and calculating the first number based on the preset number and the area number.
Optionally, the step of determining a second number of sub-users each randomly selected in each consensus node of the blockchain includes:
generating a random number based on the verifiable random function;
calculating a random probability value corresponding to the random number based on the byte length of the random number;
and determining a second number of randomly selected sub-users in a first consensus node according to the random probability value, wherein the first consensus node is any one of the consensus nodes of the block chain.
Optionally, the step of determining the second number of randomly selected sub-users in the first consensus node according to the random probability value comprises:
determining a probability distribution interval where the random probability value is located according to the random probability value;
and determining a second number of randomly selected sub-users in the first consensus node based on the cumulative distribution curve of the probability distribution interval and the binomial distribution.
Optionally, the step of selecting the first number of consensus nodes from the consensus nodes as target consensus nodes participating in the current consensus based on the weight values and the reputation values of the consensus nodes includes:
selecting the first number of second consensus nodes from the consensus nodes based on the weight values;
detecting whether the reputation value of the second consensus node is larger than a preset threshold value or not based on the reputation value of each consensus node;
if the reputation value of the second consensus node is detected to be larger than the preset threshold value, the second consensus node is used as a target consensus node participating in the current consensus;
and if the reputation value of the second consensus node is detected to be smaller than or equal to the preset threshold value, replacing the second consensus node with a third consensus node with the largest reputation value in the rest nodes, and taking the third consensus node as the target consensus node, wherein the rest nodes are other consensus nodes except the second consensus node in the consensus nodes.
Optionally, the step of selecting the first number of second consensus nodes from the consensus nodes based on the weight values includes:
selecting a plurality of maximum target weight values from the weight values based on the magnitude relation among the weight values, wherein the number of the target weight values is the first number;
and taking the consensus node corresponding to each target weight value as a second consensus node.
Optionally, after the step of verifying the transaction message by the target consensus node, the method further includes:
and when the verification result is verification passing, the transaction information is counted into a blockchain account book, and the reputation value of the target consensus node is updated based on the verification result.
In addition, in order to achieve the above object, the present invention also provides a supply chain system management device based on a blockchain, the supply chain system management device based on a blockchain including:
the system comprises a consensus node number module, a first quantity judgment module and a second quantity judgment module, wherein the consensus node number module is used for acquiring transaction information to be verified and determining the first quantity based on the geographic position of a supply chain participant corresponding to the transaction information, wherein the first quantity is the number of consensus nodes participating in the consensus;
The weight value module is used for determining the second number of the sub-users selected randomly in each consensus node of the block chain, and mapping the second number into the weight value when each consensus node participates in consensus;
the target consensus node module is used for selecting the first number of consensus nodes from the consensus nodes based on the weight values and the reputation values of the consensus nodes as target consensus nodes participating in the current consensus;
and the verification module is used for verifying the message to be transacted through the target consensus node to obtain a verification result.
In addition, to achieve the above object, the present invention also provides a terminal device including: the system comprises a memory, a processor and a blockchain-based supply chain hypervisor stored on the memory and executable on the processor, wherein the blockchain-based supply chain hypervisor of the terminal device implements the steps of the blockchain-based supply chain system management method as described above when executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer readable storage medium having stored thereon a blockchain-based supply chain system management program which, when executed by a processor, implements the steps of the blockchain-based supply chain system management method as described above.
The embodiment of the invention provides a supply chain system management method, a supply chain system management device, supply chain system management equipment and a supply chain system management medium based on a blockchain, wherein the method acquires transaction information to be verified, and determines a first quantity based on the geographic position of a supply chain participant corresponding to the transaction information, wherein the first quantity is the quantity of consensus nodes participating in the current consensus; determining a second number of sub-users selected randomly in each consensus node of the blockchain, and mapping the second number into a weight value when the consensus node participates in consensus; selecting the first number of consensus nodes from the consensus nodes as target consensus nodes participating in the current consensus based on the weight values and the reputation values of the consensus nodes; and verifying the message to be transacted through the target consensus node to obtain a verification result.
The method comprises the steps of obtaining transaction information to be verified currently, determining the number of consensus nodes participating in the consensus based on the geographic position of a supply chain participant corresponding to the transaction information, namely the first number, determining the number of sub-users randomly selected from the consensus nodes of a block chain, namely the second number, mapping the second number into weight values when the consensus nodes participate in the consensus, selecting the first number of consensus nodes from the consensus nodes based on the weight values and reputation values corresponding to the consensus nodes as target consensus nodes participating in the consensus, and finally verifying the transaction information through the target consensus nodes to obtain a verification result. Therefore, the invention improves the authenticity and accuracy of the transaction information among all the participants in the supply chain by determining the number of the nodes participating in the consensus based on the geographic position of the transaction initiator and determining the final consensus node participating in the current consensus based on the weight value and the credit value of each consensus node in the blockchain.
Drawings
FIG. 1 is a schematic device architecture diagram of a hardware operating environment of a terminal device according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first exemplary block chain-based supply chain system management method according to the present invention;
FIG. 3 is a schematic diagram of an overall flow diagram of a blockchain-based supply chain system management method according to an embodiment of the present invention;
FIG. 4 is a block diagram illustrating a functional module of an embodiment of a blockchain-based supply chain system management device.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware running environment of a terminal device according to an embodiment of the present invention.
The terminal equipment of the embodiment of the invention can be the terminal equipment applied to the technical field of data processing. Specifically, the terminal device may be a smart phone, a PC (PerSonal Computer ), a tablet computer, a portable computer, or the like.
As shown in fig. 1, the terminal device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a DiSplay (diselay), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the terminal device structure shown in fig. 1 is not limiting of the terminal device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in FIG. 1, an operating system, a network communication module, a user interface module, and a blockchain-based supply chain hypervisor may be included in memory 1005 as one type of computer storage medium.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client and communicating data with the client; and the processor 1001 may be configured to invoke the blockchain-based supply chain hypervisor stored in the memory 1005 and perform the following operations:
acquiring transaction information to be verified, and determining a first number based on the geographic position of a supply chain participant corresponding to the transaction information, wherein the first number is the number of consensus nodes participating in the consensus;
determining a second number of sub-users selected randomly in each consensus node of the blockchain, and mapping the second number into a weight value when the consensus node participates in consensus;
Selecting the first number of consensus nodes from the consensus nodes as target consensus nodes participating in the current consensus based on the weight values and the reputation values of the consensus nodes;
and verifying the transaction message through the target consensus node to obtain a verification result.
Optionally, the processor 1001 may also be configured to invoke a blockchain-based supply chain hypervisor stored in the memory 1005 and perform the following:
detecting whether a supply chain participant is in a single geographic region based on the geographic location of the supply chain participant corresponding to the transaction information;
if the supply chain participants are detected to be in a single geographic area, taking the preset quantity as a first quantity;
if the supply chain participant is detected to be in a plurality of geographic areas, determining the area number of the geographic areas in which the supply chain participant is located, and calculating the first number based on the preset number and the area number.
Optionally, the processor 1001 may also be configured to invoke a blockchain-based supply chain hypervisor stored in the memory 1005 and perform the following:
generating a random number based on the verifiable random function;
Calculating a random probability value corresponding to the random number based on the byte length of the random number;
and determining a second number of randomly selected sub-users in a first consensus node according to the random probability value, wherein the first consensus node is any one of the consensus nodes of the block chain.
Optionally, the processor 1001 may also be configured to invoke a blockchain-based supply chain hypervisor stored in the memory 1005 and perform the following:
determining a probability distribution interval where the random probability value is located according to the random probability value;
and determining a second number of randomly selected sub-users in the first consensus node based on the cumulative distribution curve of the probability distribution interval and the binomial distribution.
Optionally, the processor 1001 may also be configured to invoke a blockchain-based supply chain hypervisor stored in the memory 1005 and perform the following:
selecting the first number of second consensus nodes from the consensus nodes based on the weight values;
detecting whether the reputation value of the second consensus node is larger than a preset threshold value or not based on the reputation value of each consensus node;
if the reputation value of the second consensus node is detected to be larger than the preset threshold value, the second consensus node is used as a target consensus node participating in the current consensus;
And if the reputation value of the second consensus node is detected to be smaller than or equal to the preset threshold value, replacing the second consensus node with a third consensus node with the largest reputation value in the rest nodes, and taking the third consensus node as the target consensus node, wherein the rest nodes are other consensus nodes except the second consensus node in the consensus nodes.
Optionally, the processor 1001 may also be configured to invoke a blockchain-based supply chain hypervisor stored in the memory 1005 and perform the following:
selecting a plurality of maximum target weight values from the weight values based on the magnitude relation among the weight values, wherein the number of the target weight values is the first number;
and taking the consensus node corresponding to each target weight value as a second consensus node.
Optionally, the processor 1001 may be further configured to invoke a blockchain-based supply chain system management program stored in the memory 1005, and after the step of verifying the transaction message by the target consensus node, further perform the following operation:
and when the verification result is verification passing, the transaction information is counted into a blockchain account book, and the reputation value of the target consensus node is updated based on the verification result.
Based on the above terminal device, various embodiments of the supply chain system management method based on blockchain are provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a blockchain-based supply chain system management method according to the present invention. It should be noted that although a logical order is depicted in the flowchart, in some cases the blockchain-based supply chain system management method of the present invention may of course perform the steps depicted or described in a different order than that depicted.
In a first embodiment of the blockchain-based supply chain system management method of the present invention, the blockchain-based supply chain system management method of the present invention includes:
step S10, obtaining transaction information to be verified, and determining a first number based on the geographic position of a supply chain participant corresponding to the transaction information, wherein the first number is the number of consensus nodes participating in the current consensus;
in this embodiment, the terminal device obtains transaction information to be verified, and determines the number of consensus nodes participating in the present consensus (hereinafter referred to as a first number to show distinction) based on the geographic position of the supply chain participant corresponding to the transaction information.
Further, in a possible embodiment, in the step S10, the step of determining the first number based on the geographic location of the supply chain participant corresponding to the transaction information may include: step S101, detecting whether a supply chain participant is in a single geographic area or not based on the geographic position of the supply chain participant corresponding to the transaction information;
in this embodiment, the terminal device detects whether the supply chain participant initiating the current transaction is in a single geographical area based on the geographical location to which the supply chain participant corresponds to the transaction information to be verified.
Illustratively, the geographic scope in which the present supply chain resides is divided into a plurality of geographic areas in advance, and the geographic location in which the supply chain participant node initiating the current transaction resides is detected as belonging to a single geographic area or a plurality of geographic areas.
Step S102, if the supply chain participants are detected to be in a single geographic area, taking the preset quantity as a first quantity;
in this embodiment, if the terminal device detects that the supply chain participant is in a single geographic area, the preset number is taken as the first number.
It should be noted that, based on different design requirements of practical applications, in different possible embodiments, the preset number may be any value meeting practical requirements, and the present invention is not limited to the specific size of the preset threshold number.
Step S103, if it is detected that the supply chain participant is in a plurality of geographical areas, determining the number of areas of the geographical area in which the supply chain participant is located, and calculating the first number based on the preset number and the number of areas.
In this embodiment, if the terminal device detects that the supply chain participant initiating the current transaction is in a plurality of geographical areas, determining the area number of the geographical areas in which the supply chain participant is located, and calculating the first number based on the preset number and the area number.
For example, when the terminal device detects that the number of the supply chain participating nodes initiating the current transaction is 3 and detects that the 3 participating nodes are respectively distributed in different geographical areas, the number of the geographical areas where the participating nodes are located may be determined to be 3, and assuming that the preset number is 30, the first number is 90, that is, the number of the areas corresponding to the participating nodes is in a proportional relation with the first number.
Step S20, determining the second number of sub-users selected randomly in each consensus node of the blockchain, and mapping the second number into a weight value when the consensus node participates in consensus;
in this embodiment, the terminal device determines the number of sub-users (hereinafter referred to as the second number to illustrate distinction) that are randomly selected in each consensus node of the blockchain, and maps the second number to a weight value when the consensus node participates in consensus.
The terminal device models the weight value of the consensus node as the number of sub-users, specifically, randomly selects a plurality of sub-users from the sub-users of each consensus node, and takes the number of the sub-users selected in each consensus node as the weight value of the consensus node when participating in the consensus voting.
For example, when each consensus node is selected, for the consensus node with the weight of w, the number of sub-users owned by the consensus node is w, and the number of sub-users selected by using the sub-user selection algorithm each time in a specific step of the consensus algorithm may be a value of 0,1,2, …, w, the number of the selected sub-users of the consensus node represents the voting weight owned by the consensus node in the consensus step, that is, if the number of the selected sub-users is 0, the consensus node is not selected in the current consensus step; when the number of selected sub-users is i, representing that the consensus node transmits voting information once in the current consensus step, the consensus node sums the voting number to be i in the current consensus step. Specifically, if a consensus node with a weight value of 100 in one selection has 5 sub-users selected, the consensus node sends a voting message every time in the consensus step, which indicates that the node actually sums up to 5 votes in the consensus step, and so on.
Step S30, selecting the first number of consensus nodes from the consensus nodes as target consensus nodes participating in the current consensus based on the weight values and the reputation values of the consensus nodes;
in this embodiment, the terminal device selects, based on the weight values and the reputation values of the consensus nodes, a first number of consensus nodes from the consensus nodes as target consensus nodes participating in the present consensus.
Further, in a possible embodiment, the step S30 may include:
step S301, selecting the first number of second consensus nodes from the consensus nodes based on the weight values;
in this embodiment, the terminal device selects a first number of consensus nodes (hereinafter referred to as second consensus nodes to show distinction) from the consensus nodes based on the weight values corresponding to the consensus nodes.
Further, in a possible embodiment, the step S301 may include:
step A10, selecting a plurality of maximum target weight values from the weight values based on the magnitude relation among the weight values, wherein the number of the target weight values is the first number;
And step A20, taking the consensus node corresponding to each target weight value as a second consensus node.
In this embodiment, the terminal device selects, based on the magnitude relation between the weight values, a plurality of maximum target weight values from the weight values, where the number of the target weight values is equal to the first number, and uses the consensus node corresponding to each target weight value as the second consensus node.
For example, assuming that the first number is 30, after determining the weight values corresponding to the consensus nodes, the weight values are ordered according to a rule from big to small, the weight value arranged in the first 30 bits is determined as a target weight value, and the consensus node corresponding to each of the 30 target weight values is taken as the first consensus node.
Step S302, detecting whether the reputation value of the second consensus node is larger than a preset threshold value or not based on the reputation value of each consensus node;
in this embodiment, the terminal device detects whether the reputation value of the second consensus node is greater than a preset threshold based on the reputation value of each consensus node.
It should be noted that, a behavior record table corresponding to all consensus nodes in the blockchain is pre-established, the behavior record table records node credits commonly maintained by all nodes in the supply chain, and each node can be classified into a good node, an intermediate node and a malicious node according to the node credits.
For example, the terminal device sequentially detects whether reputation values corresponding to the first 30 second consensus nodes with weight values arranged in the first 30 are greater than a preset threshold.
Step S303, if the reputation value of the second consensus node is detected to be larger than the preset threshold value, the second consensus node is used as a target consensus node participating in the current consensus;
in this embodiment, if the terminal device detects that the reputation value of the second consensus node is greater than the preset threshold, the second consensus node is used as the target consensus node participating in the current consensus.
For example, if the terminal device detects that the reputation values of the 30 second consensus nodes are all greater than the preset threshold, the current 30 second consensus nodes are used as target consensus nodes participating in the current consensus.
Step S304, if the reputation value of the second consensus node is detected to be less than or equal to the preset threshold, replacing the second consensus node with a third consensus node with the largest reputation value in the remaining nodes, and taking the third consensus node as the target consensus node, wherein the remaining nodes are other consensus nodes except the second consensus node in the consensus nodes.
In this embodiment, if the terminal device detects that the reputation value of the second consensus node is less than or equal to the preset threshold, the terminal device replaces the second consensus node with the highest reputation value among the remaining nodes (hereinafter referred to as the third consensus node to show the distinction), and takes the third consensus node as the target consensus node, where the remaining nodes are other consensus nodes except the second consensus node among the remaining nodes.
If the terminal device detects that the reputation value of 4 consensus nodes in the 30 second consensus nodes is smaller than the preset threshold value, 4 consensus nodes with highest reputation values are selected from the other consensus nodes except the 30 consensus nodes, namely the third consensus node, the third consensus node is used for replacing the 4 consensus nodes with reputation values smaller than the preset threshold value, and the third consensus node is used as a target consensus node participating in the current consensus.
And step S40, verifying the transaction message through the target consensus node to obtain a verification result.
In this embodiment, the terminal device verifies the transaction message through the target consensus node, and a verification result is obtained.
Illustratively, after 30 target consensus nodes are selected, each target consensus node votes for the current transaction information, and if the target consensus node exceeding 2 of 3 agrees to the current transaction information, the verification result is determined to be verification passing.
Further, in a possible embodiment, after the step S40, the method may further include:
and B10, when the verification result is verification passing, the transaction information is counted into a blockchain account book, and the reputation value of the target consensus node is updated based on the verification result.
In this embodiment, when the verification result of the current transaction information is verification passing, the terminal device counts the transaction information into the blockchain ledger, and updates the reputation value of the target consensus node based on the verification result.
As shown in fig. 3, the terminal device first determines the geographical area where the initiator of the transaction information to be verified is located, determines the number of consensus nodes required for the current consensus based on the geographical area, then selects the required number of target consensus nodes based on the weight value and the reputation value of each consensus node in the blockchain, verifies the current transaction information by a plurality of target consensus nodes to obtain a verification result, counts the transaction information into the blockchain ledger, broadcasts the blockchain after the verification result of the current transaction information is verification pass, adds 1 to the reputation value of the target consensus node agreeing to the current transaction information, subtracts 1 to the reputation value of the target consensus node against the current transaction information, and in addition, keeps the reputation value of the target consensus node successfully sending the voting message unchanged.
In the embodiment, the supply chain system management method based on the blockchain acquires transaction information to be verified, and determines the first number of consensus nodes participating in the consensus based on the geographic position of a supply chain participant corresponding to the transaction information; detecting whether a supply chain participant initiating a current transaction is in a single geographic region or not based on the geographic position of the supply chain participant corresponding to the transaction information to be verified; if the supply chain participants are detected to be in a single geographic area, taking the preset quantity as a first quantity; if the supply chain participant initiating the current transaction is detected to be in a plurality of geographic areas, determining the area number of the geographic areas in which the supply chain participant is located, and calculating the first number based on the preset number and the area number; determining the second number of sub-users selected randomly in each consensus node of the block chain, and mapping the second number into a weight value when the consensus node participates in consensus; selecting a plurality of maximum target weight values from the weight values based on the magnitude relation among the weight values, wherein the number of the target weight values is equal to the first number, and the consensus nodes corresponding to the target weight values are used as second consensus nodes; detecting whether the reputation value of the second consensus node is larger than a preset threshold value or not based on the reputation value of each consensus node; if the reputation value of the second consensus node is detected to be larger than the preset threshold value, the second consensus node is used as a target consensus node participating in the current consensus; if the reputation value of the second consensus node is detected to be smaller than or equal to a preset threshold value, replacing the second consensus node with a third consensus node with the highest reputation value in the rest nodes, and taking the third consensus node as a target consensus node, wherein the rest nodes are other consensus nodes except the second consensus node in all the consensus nodes; verifying the transaction message through the target consensus node to obtain a verification result; and when the verification result of the current transaction information is verification passing, the transaction information is counted into a blockchain account book, and the reputation value of the target consensus node is updated based on the verification result.
In this way, the embodiment of the invention determines the number of the consensus nodes participating in the current consensus based on the geographic position of the supply chain participant corresponding to the transaction information, namely the first number, then determines the number of the sub-users randomly selected from the consensus nodes of the block chain, namely the second number, maps the second number to the weight value when the consensus nodes participate in the consensus, selects the first number of the consensus nodes from the consensus nodes based on the weight value and the reputation value corresponding to the consensus nodes as the target consensus nodes participating in the current consensus, and finally verifies the transaction information through the target consensus nodes to obtain the verification result. Therefore, the invention improves the authenticity and accuracy of the transaction information among all the participants in the supply chain by determining the number of the nodes participating in the consensus based on the geographic position of the transaction initiator and determining the final consensus node participating in the current consensus based on the weight value and the credit value of each consensus node in the blockchain.
Further, based on the first embodiment of the blockchain-based supply chain system management method of the present invention described above, a second embodiment of the blockchain-based supply chain system management method of the present invention is presented.
In this embodiment, in step S20, the step of "determining the second number of sub-users each randomly selected in each consensus node of the blockchain" may include:
step S201, generating a random number based on the verifiable random function;
step S202, calculating a random probability value corresponding to the random number based on the byte length of the random number;
step S203, determining a second number of randomly selected sub-users in a first consensus node according to the random probability value, where the first consensus node is any one of the consensus nodes of the blockchain.
In this embodiment, the terminal device generates a random number based on a verifiable random function, calculates a random probability value corresponding to the random number based on a byte length of the random number, and then determines a second number of randomly selected sub-users in a first consensus node according to the random probability value, where the first consensus node is any one of the consensus nodes of the blockchain.
In the process of selecting the consensus node, when the random number selection algorithm generates a random number, a corresponding probability value can be obtained by calculating the random number, specifically, the probability value is:
Then, the number of randomly selected sub-users in the consensus node is determined based on the probability value. Further, in a possible embodiment, the step S203 may include:
step C10, determining a probability distribution interval where the random probability value is located according to the random probability value;
and step C20, determining a second number of randomly selected sub-users in the first consensus node based on the probability distribution interval and the cumulative distribution curve of binomial distribution.
In this embodiment, the terminal device determines a probability distribution interval in which the random probability value is located according to the random probability value, and determines the second number of randomly selected sub-users in the first consensus node based on the probability distribution interval and a cumulative distribution curve of binomial distribution.
Illustratively, the binomial distribution cumulative distribution curve corresponds to a graph of a binomial distribution cumulative distribution function. For the consensus node with weight w, the number of the sub-users owned by the consensus node is w, and the consensus node is in a specific step of the consensus algorithmThe number of sub-users selected each time using the sub-user selection algorithm may be a value of one of 0,1,2, …, w. Assuming that the sum of weight values selected by all participating consensus nodes is w, and the expected number of node sub-users to be selected in a specific consensus step is e, wherein the expected probability value can be used for calculating the probability that any one sub-user of any consensus node is selected, and the probability that any one sub-user of any consensus node is selected is:
And the probability that m sub-users of the consensus node are selected isHere->Representing the number of combinations of m sub-users selected from the w sub-users. Thereby, on the cumulative distribution curve of the binomial distribution selected by the corresponding child user, the probability interval [0,1 ] on the vertical axis]Can be divided into->And the remaining series interval +> ). And then, determining the number of the sub-users selected by the consensus node by checking which interval in the probability interval division the probability value is located. Specifically, if the probability value is located +.>In the interval, the number of the sub-users selected by the consensus node is 6, and so on.
In the embodiment, the supply chain system management method based on the block chain generates a random number based on a verifiable random function, and calculates a random probability value corresponding to the random number based on the byte length of the random number; and determining a probability distribution interval where the random probability value is located according to the random probability value, and determining a second number of randomly selected sub-users in the first consensus node based on the probability distribution interval and a binomial distribution cumulative distribution curve.
Therefore, the number of the selected sub-users is determined by randomly selecting the sub-users in the consensus node, so that the weight value of the consensus node, the probability of the consensus node being selected to participate in the operation of the consensus algorithm and the voting weight of the consensus node after being selected are reflected, and the randomness and fairness of the selection of the consensus node are greatly improved.
In addition, the embodiment of the invention also provides a supply chain system management device based on the block chain.
Referring to fig. 4, fig. 4 is a functional block diagram of an embodiment of a blockchain-based supply chain system management device according to the present invention, as shown in fig. 4, the blockchain-based supply chain system management device according to the present invention includes:
the consensus node number module 10 is configured to obtain transaction information to be verified, and determine a first number based on a geographic location of a supply chain participant corresponding to the transaction information, where the first number is a number of consensus nodes participating in the consensus;
the weight value module 20 is configured to determine a second number of sub-users that are randomly selected from each consensus node of the blockchain, and map the second number to a weight value when each consensus node participates in consensus;
a target consensus node module 30, configured to select, from the consensus nodes, the first number of consensus nodes as target consensus nodes participating in the current consensus based on the weight values and the reputation values of the consensus nodes;
and the verification module 40 is configured to verify the message to be transacted through the target consensus node, so as to obtain a verification result.
Optionally, the consensus node number module 10 includes:
a geographic area detection unit, configured to detect whether a supply chain participant is in a single geographic area based on a geographic location of the supply chain participant corresponding to the transaction information;
a single area unit configured to take a preset number as a first number if it is detected that the supply chain participant is in a single geographic area;
and the non-single area unit is used for determining the area number of the geographic area in which the supply chain participant is located if the supply chain participant is detected to be in a plurality of geographic areas, and calculating the first number based on the preset number and the area number.
Optionally, the weight value module 20 includes:
a random function unit for generating a random number based on the verifiable random function;
a random probability value unit, configured to calculate a random probability value corresponding to the random number based on a byte length of the random number;
and the sub-user quantity unit is used for determining a second quantity of randomly selected sub-users in a first consensus node according to the random probability value, wherein the first consensus node is any one of the consensus nodes of the block chain.
Optionally, the child user number unit includes:
a distribution interval subunit, configured to determine a probability distribution interval where the random probability value is located according to the random probability value;
and the binomial distribution subunit is configured to determine a second number of randomly selected sub-users in the first consensus node based on the probability distribution interval and a cumulative distribution curve of binomial distribution.
Optionally, the target consensus node module 30 comprises:
a weight value unit, configured to select the first number of second consensus nodes from the consensus nodes based on each weight value;
the reputation value unit is used for detecting whether the reputation value of the second consensus node is larger than a preset threshold value or not based on the reputation value of each consensus node;
the node reservation unit is used for taking the second consensus node as a target consensus node participating in the current consensus if the reputation value of the second consensus node is detected to be greater than the preset threshold value;
and the node replacement unit is used for replacing the second consensus node with a third consensus node with the largest reputation value in the rest nodes if the reputation value of the second consensus node is detected to be smaller than or equal to the preset threshold value, and taking the third consensus node as the target consensus node, wherein the rest nodes are other consensus nodes except the second consensus node in the consensus nodes.
Optionally, the weight value unit includes:
a weight value selecting subunit, configured to select a plurality of maximum target weight values from the weight values based on a magnitude relation between the weight values, where the number of the target weight values is the first number;
and the second consensus node subunit is used for taking the consensus node corresponding to each target weight value as a second consensus node.
Optionally, the supply chain system management device based on the blockchain of the invention further comprises:
and the verification passing module is used for counting the transaction information into a blockchain account book when the verification result is verification passing, and updating the reputation value of the target consensus node based on the verification result.
The present invention also provides a computer storage medium having stored thereon a blockchain-based supply chain hypervisor that when executed by a processor implements the steps of a blockchain-based supply chain hypervisor method as described in any of the embodiments above.
The specific embodiments of the computer storage medium of the present invention are substantially the same as the above embodiments of the blockchain-based supply chain hypervisor method of the present invention, and are not described herein.
The present invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the blockchain-based supply chain system management method of the present invention as described in any of the above embodiments, which are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a TWS headset or the like) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (8)

1. A blockchain-based supply chain system management method, characterized in that the blockchain-based supply chain system management method comprises:
acquiring transaction information to be verified, and determining a first number based on the geographic position of a supply chain participant corresponding to the transaction information, wherein the first number is the number of consensus nodes participating in the consensus;
generating a random number based on the verifiable random function;
calculating a random probability value corresponding to the random number based on the byte length of the random number;
determining a second number of randomly selected sub-users in a first consensus node according to the random probability value, wherein the first consensus node is any one of the consensus nodes of the block chain;
mapping the second quantity into a weight value when the consensus node participates in consensus;
Selecting the first number of second consensus nodes from the consensus nodes based on the weight values;
detecting whether the reputation value of the second consensus node is larger than a preset threshold value or not based on the reputation value of each consensus node, wherein the preset threshold value is the average value of the reputation values corresponding to each intermediate node in each consensus node;
if the reputation value of the second consensus node is detected to be larger than the preset threshold value, the second consensus node is used as a target consensus node participating in the current consensus;
if the reputation value of the second consensus node is detected to be smaller than or equal to the preset threshold value, replacing the second consensus node with a third consensus node with the largest reputation value in the rest nodes, and taking the third consensus node as the target consensus node, wherein the rest nodes are other consensus nodes except the second consensus node in the consensus nodes;
and verifying the transaction information through the target consensus node to obtain a verification result.
2. The blockchain-based supply chain system management method of claim 1, wherein the step of determining the first number based on the geographic location of the supply chain participant to which the transaction information corresponds comprises:
Detecting whether a supply chain participant is in a single geographic region based on the geographic location of the supply chain participant corresponding to the transaction information;
if the supply chain participants are detected to be in a single geographic area, taking the preset quantity as a first quantity;
if the supply chain participant is detected to be in a plurality of geographic areas, determining the area number of the geographic areas in which the supply chain participant is located, and calculating the first number based on the preset number and the area number.
3. The blockchain-based supply chain system management method of claim 1, wherein the step of determining the second number of randomly selected child users in the first consensus node based on the random probability value comprises:
determining a probability distribution interval where the random probability value is located according to the random probability value;
and determining a second number of randomly selected sub-users in the first consensus node based on the cumulative distribution curve of the probability distribution interval and the binomial distribution.
4. The blockchain-based supply chain system management method of claim 1, wherein the step of selecting the first number of second consensus nodes from among the consensus nodes based on each of the weight values comprises:
Selecting a plurality of maximum target weight values from the weight values based on the magnitude relation among the weight values, wherein the number of the target weight values is the first number;
and taking the consensus node corresponding to each target weight value as a second consensus node.
5. The blockchain-based supply chain system management method of any of claims 1 to 4, wherein after the step of verifying the transaction information by the target consensus node to obtain a verification result, the method further comprises:
and when the verification result is verification passing, the transaction information is counted into a blockchain account book, and the reputation value of the target consensus node is updated based on the verification result.
6. A blockchain-based supply chain system management device, comprising:
the system comprises a consensus node number module, a first quantity judgment module and a second quantity judgment module, wherein the consensus node number module is used for acquiring transaction information to be verified and determining the first quantity based on the geographic position of a supply chain participant corresponding to the transaction information, wherein the first quantity is the number of consensus nodes participating in the consensus;
The weight value module is used for generating a random number based on the verifiable random function; calculating a random probability value corresponding to the random number based on the byte length of the random number; determining a second number of randomly selected sub-users in a first consensus node according to the random probability value, wherein the first consensus node is any one of the consensus nodes of the block chain; mapping the second quantity into weight values when each consensus node participates in consensus;
a target consensus node module, configured to select the first number of second consensus nodes from the consensus nodes based on each of the weight values; detecting whether the reputation value of the second consensus node is larger than a preset threshold value or not based on the reputation value of each consensus node, wherein the preset threshold value is the average value of the reputation values corresponding to each intermediate node in each consensus node; if the reputation value of the second consensus node is detected to be larger than the preset threshold value, the second consensus node is used as a target consensus node participating in the current consensus; if the reputation value of the second consensus node is detected to be smaller than or equal to the preset threshold value, replacing the second consensus node with a third consensus node with the largest reputation value in the rest nodes, and taking the third consensus node as the target consensus node, wherein the rest nodes are other consensus nodes except the second consensus node in the consensus nodes;
And the verification module is used for verifying the information to be transacted through the target consensus node to obtain a verification result.
7. A terminal device, characterized in that the terminal device comprises: memory, a processor, and a blockchain-based supply chain hypervisor stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the blockchain-based supply chain system management method of any of claims 1 to 5.
8. A computer readable storage medium having stored thereon a blockchain-based supply chain system management program that when executed by a processor implements the steps of the blockchain-based supply chain system management method of any of claims 1 to 5.
CN202310828144.5A 2023-07-07 2023-07-07 Supply chain system management method, device, equipment and medium based on block chain Active CN116562885B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310828144.5A CN116562885B (en) 2023-07-07 2023-07-07 Supply chain system management method, device, equipment and medium based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310828144.5A CN116562885B (en) 2023-07-07 2023-07-07 Supply chain system management method, device, equipment and medium based on block chain

Publications (2)

Publication Number Publication Date
CN116562885A CN116562885A (en) 2023-08-08
CN116562885B true CN116562885B (en) 2023-09-29

Family

ID=87500426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310828144.5A Active CN116562885B (en) 2023-07-07 2023-07-07 Supply chain system management method, device, equipment and medium based on block chain

Country Status (1)

Country Link
CN (1) CN116562885B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110505313A (en) * 2019-09-25 2019-11-26 广东卓启投资有限责任公司 A kind of super node choosing method, device and equipment
WO2022149239A1 (en) * 2021-01-07 2022-07-14 日本電信電話株式会社 Information processing device, method for selecting adjacent node, and program
KR20220142210A (en) * 2021-04-14 2022-10-21 아주대학교산학협력단 Adaptive transaction processing node and method for blockchain
CN115865366A (en) * 2022-11-24 2023-03-28 浙江吉利控股集团有限公司 Block chain voting method, device, terminal equipment and storage medium
CN116233140A (en) * 2022-08-03 2023-06-06 熵链科技(厦门)有限公司 Method, device, equipment and storage medium for determining block-out node based on weight

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200162261A1 (en) * 2018-11-18 2020-05-21 Ramachandran Iyer System and method of blockchain consensus mechanism with custom hardware based on geographic distribution, density, node asset and reputation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110505313A (en) * 2019-09-25 2019-11-26 广东卓启投资有限责任公司 A kind of super node choosing method, device and equipment
WO2022149239A1 (en) * 2021-01-07 2022-07-14 日本電信電話株式会社 Information processing device, method for selecting adjacent node, and program
KR20220142210A (en) * 2021-04-14 2022-10-21 아주대학교산학협력단 Adaptive transaction processing node and method for blockchain
CN116233140A (en) * 2022-08-03 2023-06-06 熵链科技(厦门)有限公司 Method, device, equipment and storage medium for determining block-out node based on weight
CN115865366A (en) * 2022-11-24 2023-03-28 浙江吉利控股集团有限公司 Block chain voting method, device, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN116562885A (en) 2023-08-08

Similar Documents

Publication Publication Date Title
US11550886B2 (en) Disambiguation and authentication of device users
CN108876560B (en) Method and device for performing credit evaluation on work publisher based on block chain
US8832840B2 (en) Mobile application security and management service
US20200294100A1 (en) Blockchain-based virtual resource delivery and crowdfunding
US20200175554A1 (en) Identification of targets for a campaign by referencing a blockchain and/or a distributed system file system
US11468508B2 (en) Capturable code for automatically formatting and addressing a text message to apply for an offer
CN104965844A (en) Information processing method and apparatus
CN102067126A (en) Monetizing and prioritizing results of a distributed search
CN108112038B (en) Method and device for controlling access flow
US20230108983A1 (en) Digital Content Control Based on Nonfungible Tokens
CN110852870A (en) Virtual resource transfer method, device, equipment and readable storage medium
CN116562885B (en) Supply chain system management method, device, equipment and medium based on block chain
CN112070342B (en) Microservice evaluation method and device, electronic equipment and computer readable storage medium
EP3407568A1 (en) Service processing method and device
CN110597886A (en) Data processing method and device and computer storage medium
US10402850B2 (en) Reliability metrics for real-time auctions
CN112511651B (en) Service access method and device based on block chain
US11829507B2 (en) Methods and systems for privacy protection verification
CN113835780A (en) Event response method and device
CN113298574A (en) Block chain-based point management method and device and storage medium
CN111194441B (en) Data management method and related system based on block chain
CN112328450A (en) Data monitoring method and device, computer equipment and storage medium
TWM580230U (en) Financial service application review system
US20240152918A1 (en) Distributed database with inter-related records relating to a vehicle
CN111581485B (en) Information distribution method and device

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
GR01 Patent grant
GR01 Patent grant