CN115470292B - Block chain consensus method, device, electronic equipment and readable storage medium - Google Patents

Block chain consensus method, device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115470292B
CN115470292B CN202211008632.3A CN202211008632A CN115470292B CN 115470292 B CN115470292 B CN 115470292B CN 202211008632 A CN202211008632 A CN 202211008632A CN 115470292 B CN115470292 B CN 115470292B
Authority
CN
China
Prior art keywords
voting
target
users
user
blockchain
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
CN202211008632.3A
Other languages
Chinese (zh)
Other versions
CN115470292A (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.)
Shenzhen Woxiang Technology Co ltd
Original Assignee
Shenzhen Woxiang 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 Shenzhen Woxiang Technology Co ltd filed Critical Shenzhen Woxiang Technology Co ltd
Priority to CN202211008632.3A priority Critical patent/CN115470292B/en
Publication of CN115470292A publication Critical patent/CN115470292A/en
Application granted granted Critical
Publication of CN115470292B publication Critical patent/CN115470292B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification
    • 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
    • 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
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a block chain consensus method, a device, electronic equipment and a readable storage medium, which are applied to the technical field of block chains, wherein the block chain consensus method comprises the following steps: the method comprises the steps of obtaining the mortgage funds and the type of a blockchain of each user, and classifying each user according to the mortgage funds to obtain classification results, wherein the classification results comprise voting users and users to be selected; selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users; and completing the consensus of each block in the block chain through each target user. The application solves the technical problem of low control diversity of the block chain.

Description

Block chain consensus method, device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a blockchain consensus method, a blockchain consensus device, an electronic device, and a readable storage medium.
Background
With the rapid development of technology, the blockchain technology is also developed and matured more and more, at present, the accounting staff is selected through the property certification of each node, so that the accounting staff can complete the blockchain consensus, but a small part of people with more properties always master the blockchain control capability (namely, the blockchain is centralized), and the blockchain control diversity is lower.
Disclosure of Invention
The application mainly aims to provide a block chain consensus method, a device, electronic equipment and a readable storage medium, which aim to solve the technical problem of low control diversity of block chains in the prior art.
In order to achieve the above object, the present application provides a blockchain consensus method applied to a blockchain consensus device, the blockchain consensus method comprising:
the method comprises the steps of obtaining the mortgage funds and the type of a blockchain of each user, and classifying each user according to the mortgage funds to obtain classification results, wherein the classification results comprise voting users and users to be selected;
selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users;
and completing the consensus of each block in the block chain through each target user.
Optionally, the step of selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users includes:
selecting a target voting prediction model corresponding to the block chain from preset voting prediction models according to the type;
and selecting at least one target user from the users to be selected according to the target voting prediction model and the mortgage funds corresponding to the voting users.
Optionally, the type includes a homogeneous type blockchain and a heterogeneous type blockchain, the preset voting prediction model includes a standard model and a weighted model, and the step of selecting a target voting prediction model corresponding to the blockchain from the preset voting prediction model according to the type includes:
if the type of the blockchain is a isomorphic blockchain, a standard model is selected as a target voting prediction model corresponding to the blockchain;
and if the type of the blockchain is heterogeneous blockchain, selecting a weighted model as a target voting prediction model corresponding to the blockchain.
Optionally, the step of selecting at least one target user from the users to be selected according to the target voting prediction model and the mortgage funds corresponding to the voting users includes:
acquiring the number of preset verification nodes;
determining voting results of the users to be selected according to the mortgage funds corresponding to the voting users;
selecting a target user from the users to be selected according to the voting result and the target voting prediction model, removing the target user from the users to be selected, and returning to the execution step: and selecting one target user from the users to be selected according to the voting result and the target voting prediction model until the target users with the preset verification node number are selected.
Optionally, the step of selecting a target user from the users to be selected according to the voting result and the target voting prediction model includes:
generating a voting score of each user to be selected according to the voting result and the target voting prediction model;
selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
Optionally, the step of generating a voting score of each candidate user according to the voting result and the target voting prediction model includes:
determining the load of each user to be selected according to the voting result;
and generating voting scores of the users to be selected according to the load and the target voting prediction model.
Optionally, the blockchain consensus method further includes:
obtaining a weighting weight corresponding to each voting user, and weighting the voting result according to the weighting weight to obtain a weighted voting result;
generating an initial voting score of each user to be selected according to the weighted voting result;
selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user;
Updating the initial voting score according to the target user and the weighted voting result, and returning to the execution step: selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
In order to achieve the above object, the present application also provides a blockchain consensus apparatus applied to a blockchain consensus device, the blockchain consensus apparatus comprising:
the system comprises an acquisition module, a classification module and a processing module, wherein the acquisition module is used for acquiring the mortgage funds and the type of a blockchain of each user, classifying each user according to the mortgage funds to obtain a classification result, and the classification result comprises voting users and users to be selected;
the selecting module is used for selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users;
and the consensus module is used for completing consensus of all blocks in the block chain through all the target users.
Optionally, the selecting module is further configured to:
selecting a target voting prediction model corresponding to the block chain from preset voting prediction models according to the type;
And selecting at least one target user from the users to be selected according to the target voting prediction model and the mortgage funds corresponding to the voting users.
Optionally, the types include homogeneous blockchains and heterogeneous blockchains, the preset voting prediction model includes a standard model and a weighted model, and the selecting module is further configured to:
if the type of the blockchain is a isomorphic blockchain, a standard model is selected as a target voting prediction model corresponding to the blockchain;
and if the type of the blockchain is heterogeneous blockchain, selecting a weighted model as a target voting prediction model corresponding to the blockchain.
Optionally, the selecting module is further configured to:
acquiring the number of preset verification nodes;
determining voting results of the users to be selected according to the mortgage funds corresponding to the voting users;
selecting a target user from the users to be selected according to the voting result and the target voting prediction model, removing the target user from the users to be selected, and returning to the execution step: and selecting one target user from the users to be selected according to the voting result and the target voting prediction model until the target users with the preset verification node number are selected.
Optionally, the selecting module is further configured to:
generating a voting score of each user to be selected according to the voting result and the target voting prediction model;
selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
Optionally, the selecting module is further configured to:
determining the load of each user to be selected according to the voting result;
and generating voting scores of the users to be selected according to the load and the target voting prediction model.
Optionally, the blockchain consensus device is further configured to:
obtaining a weighting weight corresponding to each voting user, and weighting the voting result according to the weighting weight to obtain a weighted voting result;
generating an initial voting score of each user to be selected according to the weighted voting result;
selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user;
updating the initial voting score according to the target user and the weighted voting result, and returning to the execution step: selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
The application also provides an electronic device comprising: the system comprises a memory, a processor, and a program of the blockchain consensus method stored on the memory and executable on the processor, wherein the program of the blockchain consensus method, when executed by the processor, can implement the steps of the blockchain consensus method as described above.
The present application also provides a computer readable storage medium having stored thereon a program for implementing a blockchain consensus method, the program for implementing the steps of the blockchain consensus method as described above when executed by a processor.
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a blockchain consensus method as described above.
Compared with a method for selecting a billing person through property evidence or billing capability of each node so as to complete blockchain consensus through each billing person, the application obtains mortgage funds of each user and types of blockchains and classifies each user according to the mortgage funds to obtain classification results, wherein the classification results comprise voting users and users to be selected; selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users; and the target users complete the consensus of each block in the blockchain, classify each user according to the mortgage funds to obtain classification results, and select the target users according to the classification results and the types of the blockchain, so that the consensus of the blockchain is completed, and the technical defect that fewer people with more property or stronger billing capability always master the control capability of the blockchain due to the fact that only the property certification or billing capability of each node is used for selecting the billing person is avoided, thereby improving the control diversity of the blockchain.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart of a first embodiment of a blockchain consensus method of the present application;
FIG. 2 is a flowchart illustrating a second embodiment of a blockchain consensus method of the present application;
FIG. 3 is a diagram illustrating an exemplary scenario of the blockchain consensus method of the present application;
FIG. 4 is a schematic diagram of a device structure according to the blockchain consensus method of the present application;
fig. 5 is a schematic diagram of an apparatus structure of a hardware operating environment related to a block chain consensus method in an embodiment of the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
In order to make the above objects, features and advantages of the present application more comprehensible, the following description of the embodiments accompanied with the accompanying drawings will be given in detail. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Example 1
An embodiment of the present application provides a blockchain consensus method, in a first embodiment of the blockchain consensus method of the present application, referring to fig. 1, the blockchain consensus method includes:
step S10, obtaining the mortgage funds and the type of the blockchain of each user, and classifying each user according to the mortgage funds to obtain classification results, wherein the classification results comprise voting users and users to be selected;
step S20, selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users;
step S30, completing the consensus of each block in the blockchain by each target user.
In this embodiment, it should be noted that the mortgage funds are funds that each user qualifies for mortgage to the blockchain in order to obtain as a voting user or a candidate user.
It will be appreciated that, to solve the problem of low control diversity of the blockchain, the accounting staff may be selected by the accounting capability of each node, so that the accounting staff is required to complete the blockchain consensus, and the method needs to calculate the calculation power of each node, and the calculation power of each node is added into the transaction authentication of the network, so that the calculation power consumption is high, thereby causing the system power consumption to be high, so that there is a technical defect that the low calculation power consumption of the system and the high control diversity of the blockchain cannot be considered, and to solve the defect, steps S10 to S30 exemplarily include: receiving mortgage funds of each user, mortgage the mortgage funds to a blockchain by calling an intelligent contract, obtaining structural information of the blockchain, generating a type label of the blockchain according to the structural information, and classifying each user according to the mortgage funds to obtain a classification result; selecting at least one target user from the users to be selected according to the type labels and the mortgage funds corresponding to the voting users; and completing the consensus of each block in the block chain through each target user.
As an example, the step of classifying each user according to the mortgage funds to obtain a classification result includes:
judging whether the mortgage funds meet a preset first condition, classifying the users corresponding to the mortgage funds as the users to be selected if the mortgage funds meet the preset first condition, and judging whether the mortgage funds meet a preset second condition if the mortgage funds do not meet the preset first condition; if the mortgage funds meet a preset second condition, classifying the users corresponding to the mortgage funds as the voting users; and if the mortgage funds do not meet the preset second condition, removing the users corresponding to the mortgage funds.
As an example, the step of classifying each user according to the mortgage funds to obtain a classification result includes:
judging whether the mortgage fund is larger than or equal to a preset first amount threshold, and classifying the user corresponding to the mortgage fund as the user to be selected if the mortgage fund is larger than or equal to the preset first amount threshold; judging whether the mortgage fund is larger than or equal to a preset second amount threshold value or not if the mortgage fund is smaller than the preset first amount threshold value, wherein the preset first amount threshold value is larger than or equal to the preset second amount threshold value, and classifying a user corresponding to the mortgage fund as the voting user if the mortgage fund is larger than or equal to the preset second amount threshold value; and if the mortgage funds are smaller than a preset second amount threshold, clearing the users corresponding to the mortgage funds.
In step S20, the step of selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users includes:
step S21, selecting a target voting prediction model corresponding to the block chain from preset voting prediction models according to the type;
and S22, selecting at least one target user from the users to be selected according to the target voting prediction model and the mortgage funds corresponding to the voting users.
Illustratively, steps S21 through S22 include: inquiring a preset configuration file according to the type tag of the blockchain to obtain a target voting prediction model corresponding to the blockchain, wherein the preset configuration file comprises an association relationship between the type tag of the blockchain and the target voting prediction model corresponding to the blockchain; and selecting at least one target user from the users to be selected according to the target voting prediction model and the mortgage funds corresponding to the voting users.
In step S21, the types include homogeneous blockchains and heterogeneous blockchains, the preset voting prediction model includes a standard model and a weighted model, and the step of selecting a target voting prediction model corresponding to the blockchain from the preset voting prediction model according to the types includes:
Step A10, if the type of the blockchain is a isomorphic blockchain, selecting a standard model as a target voting prediction model corresponding to the blockchain;
and step A20, if the type of the blockchain is heterogeneous blockchain, selecting a weighted model as a target voting prediction model corresponding to the blockchain.
Illustratively, steps a 10-a 20 include: if the type label of the blockchain is a isomorphic label, a standard model is selected as a target voting prediction model corresponding to the blockchain; and if the type label of the blockchain is an heterogeneous label, selecting a weighted model as a target voting prediction model corresponding to the blockchain.
In step S22, the step of selecting at least one target user from the users to be selected according to the target voting prediction model and the mortgage funds corresponding to the voting users includes:
step B10, obtaining the number of preset verification nodes;
step B20, determining voting results of the users to be selected according to the mortgage funds corresponding to the voting users;
step B30, selecting a target user from the users to be selected according to the voting result and the target voting prediction model, removing the target user from the users to be selected, and returning to the execution step: and selecting one target user from the users to be selected according to the voting result and the target voting prediction model until the target users with the preset verification node number are selected.
In this embodiment, it should be noted that, the number of the preset verification nodes is smaller than the number of nodes in the blockchain, and the number of the preset verification nodes may be set by a manager of the blockchain, or may be an experience value.
Illustratively, steps B10 through B30 include: acquiring the number of preset verification nodes; determining a voting result of each user to be selected according to the mortgage funds corresponding to the voting users and the voting appointed users of the voting users, wherein the voting appointed users are users which the voting users cast, and the voting result comprises the voting information of the users to be selected and the voting users corresponding to the voting information; selecting a target user from the users to be selected according to the voting result and the target voting prediction model, removing the target user from the users to be selected, and returning to the execution step: and selecting one target user from the users to be selected according to the voting result and the target voting prediction model until the target users with the preset verification node number are selected.
Compared with a method for selecting a billing person through property proof or billing capability of each node so as to complete the block chain consensus through each billing person, the block chain consensus method provided by the embodiment of the application obtains the mortgage funds of each user and the type of the block chain, and classifies each user according to the mortgage funds to obtain a classification result, wherein the classification result comprises voting users and users to be selected; selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users; and the target users complete the consensus of each block in the blockchain, classify each user according to the mortgage funds to obtain classification results, and select the target users according to the classification results and the types of the blockchain, so that the consensus of the blockchain is completed, and the technical defect that fewer people with more property or stronger billing capability always master the control capability of the blockchain due to the fact that only the property certification or billing capability of each node is used for selecting the billing person is avoided, thereby improving the control diversity of the blockchain.
Example two
Further, referring to fig. 2, in another embodiment of the present application, the same or similar contents as those of the first embodiment can be referred to the description above, and the description is omitted. On this basis, in step B30, the step of selecting a target user from the candidate users according to the voting result and the target voting prediction model includes:
step B31, generating a voting score of each user to be selected according to the voting result and the target voting prediction model;
and step B32, selecting a target voting score meeting a preset condition from the voting scores, and taking a candidate user corresponding to the target voting score as the target user.
In this embodiment, it should be noted that the preset condition is a preset condition for determining that the candidate user is a voting score of the target user.
Illustratively, steps B31 through B32 include: mapping voting characteristics corresponding to the voting results of the users to be selected into voting scores of the users to be selected through the target voting prediction model; selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
As an example, before the step of selecting, from the voting scores, a target voting score that satisfies a preset condition, and taking, as the target user, a candidate user corresponding to the target voting score, the method further includes:
judging whether the target voting score is the minimum value in each voting score; if the target voting score is the minimum value in the voting scores, judging that the target voting score meets a preset condition; and if the target voting score is not the minimum value in the voting scores, judging that the target voting score does not meet a preset condition.
In step B31, the step of generating a voting score of each candidate user according to the voting result and the target voting prediction model includes:
step C10, determining the load of each user to be selected according to the voting result;
and step C20, generating voting scores of the candidate users according to the load and the target voting prediction model.
Illustratively, steps C10 through C20 include: taking the quotient of the number of votes obtained corresponding to each user to be selected and the number of preset verification nodes in the voting result as the load of each user to be selected; and mapping the load characteristics corresponding to the loads into voting scores of the users to be selected through the target voting prediction model.
Wherein, the block chain consensus method further comprises:
step D10, obtaining a weighting weight corresponding to each voting user, and weighting the voting result according to the weighting weight to obtain a weighted voting result;
step D20, generating initial voting scores of the users to be selected according to the weighted voting results;
step D30, selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user;
step D40, updating the initial voting score according to the target user and the weighted voting result, and returning to the execution step: selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
Illustratively, steps D10 through D40 include: generating a weighting weight corresponding to each voting user according to the mortgage funds corresponding to each voting user and the voting appointed user of the voting user, and weighting the voting result according to the weighting weight to obtain a weighted voting result; mapping the weighted voting characteristics corresponding to the weighted voting results into initial voting scores of the users to be selected through a weighted model; selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user; according to the target user and the weighted voting result, an updated voting feature is constructed, the updated voting feature is mapped into an updated voting score corresponding to each user to be selected through the weighted model, the weighted voting score is updated according to the updated voting score, and the execution steps are returned: selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
As an example, referring to fig. 3, fig. 3 includes: blockchains (illustrated total daily interest generated by the whole network), nodes, target users (illustrated authenticators), and voting users (illustrated nominators). The interest is divided into nodes by blockchains, commissions of the nodes are extracted by target users, and the rest interest is distributed according to the mortgage proportion of voting users.
Compared with a method for selecting a billing person through property proof or billing capability of each node so as to complete the block chain consensus through each billing person, the block chain consensus method provided by the embodiment of the application obtains the mortgage funds of each user and the type of the block chain, and classifies each user according to the mortgage funds to obtain a classification result, wherein the classification result comprises voting users and users to be selected; selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users; and the target users complete the consensus of each block in the blockchain, classify each user according to the mortgage funds to obtain classification results, and select the target users according to the classification results and the types of the blockchain, so that the consensus of the blockchain is completed, and the technical defect that fewer people with more property or stronger billing capability always master the control capability of the blockchain due to the fact that only the property certification or billing capability of each node is used for selecting the billing person is avoided, thereby improving the control diversity of the blockchain.
Example III
The embodiment of the application also provides a block chain consensus device, which is applied to block chain consensus equipment and comprises:
the system comprises an acquisition module, a classification module and a processing module, wherein the acquisition module is used for acquiring the mortgage funds and the type of a blockchain of each user, classifying each user according to the mortgage funds to obtain a classification result, and the classification result comprises voting users and users to be selected;
the selecting module is used for selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users;
and the consensus module is used for completing consensus of all blocks in the block chain through all the target users.
Optionally, the selecting module is further configured to:
selecting a target voting prediction model corresponding to the block chain from preset voting prediction models according to the type;
and selecting at least one target user from the users to be selected according to the target voting prediction model and the mortgage funds corresponding to the voting users.
Optionally, the types include homogeneous blockchains and heterogeneous blockchains, the preset voting prediction model includes a standard model and a weighted model, and the selecting module is further configured to:
If the type of the blockchain is a isomorphic blockchain, a standard model is selected as a target voting prediction model corresponding to the blockchain;
and if the type of the blockchain is heterogeneous blockchain, selecting a weighted model as a target voting prediction model corresponding to the blockchain.
Optionally, the selecting module is further configured to:
acquiring the number of preset verification nodes;
determining voting results of the users to be selected according to the mortgage funds corresponding to the voting users;
selecting a target user from the users to be selected according to the voting result and the target voting prediction model, removing the target user from the users to be selected, and returning to the execution step: and selecting one target user from the users to be selected according to the voting result and the target voting prediction model until the target users with the preset verification node number are selected.
Optionally, the selecting module is further configured to:
generating a voting score of each user to be selected according to the voting result and the target voting prediction model;
selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
Optionally, the selecting module is further configured to:
determining the load of each user to be selected according to the voting result;
and generating voting scores of the users to be selected according to the load and the target voting prediction model.
Optionally, the blockchain consensus device is further configured to:
obtaining a weighting weight corresponding to each voting user, and weighting the voting result according to the weighting weight to obtain a weighted voting result;
generating an initial voting score of each user to be selected according to the weighted voting result;
selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user;
updating the initial voting score according to the target user and the weighted voting result, and returning to the execution step: selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
The block chain consensus device provided by the application solves the technical problem of low control diversity of the block chain by adopting the block chain consensus method in the embodiment. Compared with the prior art, the block chain consensus device provided by the embodiment of the application has the same beneficial effects as the block chain consensus method provided by the embodiment, and other technical features in the block chain consensus device are the same as the features disclosed by the method of the embodiment, and are not repeated herein.
Example IV
An embodiment of the present application provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the blockchain consensus method of the previous embodiments.
Referring now to fig. 5, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic device may include a processing means (e.g., a central processing unit, a graphic processor, etc.) that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) or a program loaded from a storage means into a Random Access Memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM and RAM are connected to each other via a bus. An input/output (I/O) interface is also connected to the bus.
In general, the following systems may be connected to the I/O interface: input devices including, for example, touch screens, touch pads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices including, for example, liquid Crystal Displays (LCDs), speakers, vibrators, etc.; storage devices including, for example, magnetic tape, hard disk, etc.; a communication device. The communication means may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While electronic devices having various systems are shown in the figures, it should be understood that not all of the illustrated systems are required to be implemented or provided. More or fewer systems may alternatively be implemented or provided.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from ROM. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by a processing device.
The electronic equipment provided by the application solves the technical problem of low control diversity of the block chain by adopting the block chain consensus method in the embodiment. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the application are the same as those of the blockchain consensus method provided by the embodiment, and other technical features of the electronic device are the same as those disclosed by the method of the embodiment, so that the description is omitted herein.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the description of the above embodiments, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Example five
The present embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon for performing the method of the blockchain consensus method of the previous embodiments.
The computer readable storage medium according to the embodiments of the present application may be, for example, a usb disk, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this embodiment, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The above-described computer-readable storage medium may be contained in an electronic device; or may exist alone without being assembled into an electronic device.
The computer-readable storage medium carries one or more programs that, when executed by an electronic device, cause the electronic device to: the method comprises the steps of obtaining the mortgage funds and the type of a blockchain of each user, and classifying each user according to the mortgage funds to obtain classification results, wherein the classification results comprise voting users and users to be selected; selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users; and completing the consensus of each block in the block chain through each target user.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. Wherein the name of the module does not constitute a limitation of the unit itself in some cases.
The computer readable storage medium provided by the application stores the computer readable program instructions for executing the block chain consensus method, and solves the technical problem of low control diversity of the block chain. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the embodiment of the application are the same as those of the block chain consensus method provided by the implementation, and are not described in detail herein.
Example six
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a blockchain consensus method as described above.
The computer program product provided by the application solves the technical problem of low control diversity of the blockchain. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as those of the blockchain consensus method provided by the above embodiment, and are not described in detail herein.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein, or any application, directly or indirectly, within the scope of the application.

Claims (9)

1. A blockchain consensus method, the blockchain consensus method comprising:
the method comprises the steps of obtaining the mortgage funds and the type of a blockchain of each user, and classifying each user according to the mortgage funds to obtain classification results, wherein the classification results comprise voting users and users to be selected;
selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users;
completing consensus of each block in the block chain through each target user;
the step of selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users comprises the following steps:
selecting a target voting prediction model corresponding to the block chain from preset voting prediction models according to the type;
and selecting at least one target user from the users to be selected according to the target voting prediction model and the mortgage funds corresponding to the voting users.
2. The blockchain consensus method of claim 1, wherein the types include homogeneous blockchains and heterogeneous blockchains, the preset voting prediction model includes a standard model and a weighted model, and the step of selecting a target voting prediction model corresponding to the blockchain from among the preset voting prediction models according to the types includes:
If the type of the blockchain is a isomorphic blockchain, a standard model is selected as a target voting prediction model corresponding to the blockchain;
and if the type of the blockchain is heterogeneous blockchain, selecting a weighted model as a target voting prediction model corresponding to the blockchain.
3. The blockchain consensus method of claim 1, wherein the step of selecting at least one target user among the candidate users based on the target voting prediction model and the mortgage funds corresponding to the voting users comprises:
acquiring the number of preset verification nodes;
determining voting results of the users to be selected according to the mortgage funds corresponding to the voting users;
selecting a target user from the users to be selected according to the voting result and the target voting prediction model, removing the target user from the users to be selected, and returning to the execution step: and selecting one target user from the users to be selected according to the voting result and the target voting prediction model until the target users with the preset verification node number are selected.
4. The blockchain consensus method of claim 3, wherein the step of selecting a target user among the candidate users based on the voting results and the target voting prediction model comprises:
Generating a voting score of each user to be selected according to the voting result and the target voting prediction model;
selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
5. The blockchain consensus method of claim 4, wherein the step of generating a voting score for each of the candidate users based on the voting results and the target voting prediction model comprises:
determining the load of each user to be selected according to the voting result;
and generating voting scores of the users to be selected according to the load and the target voting prediction model.
6. The blockchain consensus method of claim 1, wherein the blockchain consensus method further comprises:
obtaining a weighting weight corresponding to each voting user, and weighting the voting result according to the weighting weight to obtain a weighted voting result;
generating an initial voting score of each user to be selected according to the weighted voting result;
selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user;
Updating the initial voting score according to the target user and the weighted voting result, and returning to the execution step: selecting a target voting score meeting a preset condition from the voting scores, and taking a user to be selected corresponding to the target voting score as the target user.
7. A blockchain consensus device, the blockchain consensus device comprising:
the system comprises an acquisition module, a classification module and a processing module, wherein the acquisition module is used for acquiring the mortgage funds and the type of a blockchain of each user, classifying each user according to the mortgage funds to obtain a classification result, and the classification result comprises voting users and users to be selected;
the selecting module is used for selecting at least one target user from the users to be selected according to the type and the mortgage funds corresponding to the voting users;
the consensus module is used for completing consensus of all blocks in the block chain through all target users;
the selecting module is further configured to:
selecting a target voting prediction model corresponding to the block chain from preset voting prediction models according to the type;
and selecting at least one target user from the users to be selected according to the target voting prediction model and the mortgage funds corresponding to the voting users.
8. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the blockchain consensus method of any of claims 1 to 6.
9. A computer-readable storage medium, having stored thereon a program that implements a blockchain consensus method, the program implementing the blockchain consensus method being executed by a processor to implement the steps of the blockchain consensus method according to any of claims 1 to 6.
CN202211008632.3A 2022-08-22 2022-08-22 Block chain consensus method, device, electronic equipment and readable storage medium Active CN115470292B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211008632.3A CN115470292B (en) 2022-08-22 2022-08-22 Block chain consensus method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211008632.3A CN115470292B (en) 2022-08-22 2022-08-22 Block chain consensus method, device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN115470292A CN115470292A (en) 2022-12-13
CN115470292B true CN115470292B (en) 2023-10-10

Family

ID=84366267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211008632.3A Active CN115470292B (en) 2022-08-22 2022-08-22 Block chain consensus method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115470292B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108647967A (en) * 2018-05-10 2018-10-12 北京京东尚科信息技术有限公司 Select the method, apparatus and common recognition node of block chain common recognition mechanism
CN110458677A (en) * 2019-07-31 2019-11-15 阿里巴巴集团控股有限公司 Bill based on block chain checks and writes off method and device, electronic equipment, storage medium
CN110807844A (en) * 2019-10-09 2020-02-18 国网上海市电力公司 Power grid base tower inspection method based on block chain technology
CN111741114A (en) * 2020-06-24 2020-10-02 陈鹏 System, method and equipment capable of monitoring cross-chain interaction based on block chain
CN112104482A (en) * 2020-08-11 2020-12-18 佛山赛思禅科技有限公司 Consensus method based on parallel voting
CN112581290A (en) * 2020-12-28 2021-03-30 江苏苏宁银行股份有限公司 Block chain-based equipment pledge financing method, system, electronic equipment and medium
CN112822159A (en) * 2020-12-28 2021-05-18 杭州趣链科技有限公司 Permission control method and device for block chain account, electronic equipment and storage medium
CN112883190A (en) * 2021-01-28 2021-06-01 平安科技(深圳)有限公司 Text classification method and device, electronic equipment and storage medium
CN114827135A (en) * 2021-01-12 2022-07-29 腾讯科技(深圳)有限公司 Cross-chain cooperative treatment system, method, equipment and storage medium
CN114925403A (en) * 2022-05-18 2022-08-19 易观科技股份有限公司 Block chain mixed consensus data processing method and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108647967A (en) * 2018-05-10 2018-10-12 北京京东尚科信息技术有限公司 Select the method, apparatus and common recognition node of block chain common recognition mechanism
CN110458677A (en) * 2019-07-31 2019-11-15 阿里巴巴集团控股有限公司 Bill based on block chain checks and writes off method and device, electronic equipment, storage medium
CN110807844A (en) * 2019-10-09 2020-02-18 国网上海市电力公司 Power grid base tower inspection method based on block chain technology
CN111741114A (en) * 2020-06-24 2020-10-02 陈鹏 System, method and equipment capable of monitoring cross-chain interaction based on block chain
CN112104482A (en) * 2020-08-11 2020-12-18 佛山赛思禅科技有限公司 Consensus method based on parallel voting
CN112581290A (en) * 2020-12-28 2021-03-30 江苏苏宁银行股份有限公司 Block chain-based equipment pledge financing method, system, electronic equipment and medium
CN112822159A (en) * 2020-12-28 2021-05-18 杭州趣链科技有限公司 Permission control method and device for block chain account, electronic equipment and storage medium
CN114827135A (en) * 2021-01-12 2022-07-29 腾讯科技(深圳)有限公司 Cross-chain cooperative treatment system, method, equipment and storage medium
CN112883190A (en) * 2021-01-28 2021-06-01 平安科技(深圳)有限公司 Text classification method and device, electronic equipment and storage medium
CN114925403A (en) * 2022-05-18 2022-08-19 易观科技股份有限公司 Block chain mixed consensus data processing method and system

Also Published As

Publication number Publication date
CN115470292A (en) 2022-12-13

Similar Documents

Publication Publication Date Title
CN114091617A (en) Federal learning modeling optimization method, electronic device, storage medium, and program product
CN110865898B (en) Method, device, medium and equipment for converging crash call stack
CN110287810B (en) Vehicle door motion detection method, device and computer readable storage medium
CN111738316B (en) Zero sample learning image classification method and device and electronic equipment
CN110765752B (en) Test question generation method and device, electronic equipment and computer readable storage medium
CN113392018B (en) Traffic distribution method and device, storage medium and electronic equipment
CN110555861B (en) Optical flow calculation method and device and electronic equipment
CN116563007A (en) Credit risk prediction method, electronic equipment and readable storage medium
CN116894188A (en) Service tag set updating method and device, medium and electronic equipment
CN115470292B (en) Block chain consensus method, device, electronic equipment and readable storage medium
CN111626990A (en) Target detection frame processing method and device and electronic equipment
CN116151961A (en) Credit risk prediction method, electronic device and readable storage medium
CN111680754B (en) Image classification method, device, electronic equipment and computer readable storage medium
CN116416018A (en) Content output method, content output device, computer readable medium and electronic equipment
CN110490926B (en) Elevation determination method and device and electronic equipment
CN112416989A (en) Management method and device of Internet performance broker platform and electronic equipment
CN111738311A (en) Multitask-oriented feature extraction method and device and electronic equipment
CN114647721B (en) Educational intelligent robot control method, device and medium
CN113448550B (en) Method and device for realizing collection management of classes, electronic equipment and computer medium
CN116974684B (en) Map page layout method, map page layout device, electronic equipment and computer readable medium
CN113177174B (en) Feature construction method, content display method and related device
CN112688863B (en) Gateway data processing method and device and electronic equipment
CN111367555B (en) Assertion method, assertion device, electronic equipment and computer readable medium
CN114489896B (en) Content display method and device, storage medium and electronic equipment
CN117493217A (en) Test case generation method and device, readable medium and electronic equipment

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