Search

CN-118802098-B - Block chain consensus method, device, equipment, storage medium and product

CN118802098BCN 118802098 BCN118802098 BCN 118802098BCN-118802098-B

Abstract

The invention belongs to the technical field of blockchains, and discloses a blockchain consensus method, a device, equipment, a storage medium and a product. The method comprises the steps of determining a block chain node with highest classification accuracy according to a characteristic convolution value of a new label image when the block chain node acquires the new label image, taking the block chain link point with the highest classification accuracy as a consensus node, and initiating uplink consensus based on the consensus node. By means of the method, the block chain and the image recognition are fused, nonsensical hash calculation is converted into calculation for improving the image classification accuracy when the block chain is in consensus, the block chain consensus efficiency is improved, the computing power resource is saved, and the computing resource utilization efficiency is improved.

Inventors

  • WEI JIANRONG
  • FAN KE
  • WEI CHAO
  • GE PENG
  • WANG XINYU
  • YU HUANDONG

Assignees

  • 中移动金融科技有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260505
Application Date
20240307

Claims (9)

  1. 1. A block chain consensus method is characterized in that, the block chain consensus method comprises the following steps: When a new tag image is acquired by a block chain node, carrying out convolution processing on an abstract matrix of the new tag image and a convolution kernel of an image classification model on the block chain node corresponding to the new tag image to obtain a convolution matrix corresponding to each new tag image; taking the maximum element in the convolution matrix as a characteristic convolution value corresponding to the new label image; Based on the characteristic convolution value of the new label image, determining a characteristic convolution mean value of each blockchain node, and taking the blockchain node corresponding to the maximum characteristic convolution mean value in the characteristic convolution mean values as the blockchain node with the highest classification accuracy; And taking the block chain link point with the highest classification accuracy as a consensus node, and initiating uplink consensus based on the consensus node.
  2. 2. The method of claim 1, wherein when the new tag image is acquired by the blockchain node, before determining the blockchain link point with the highest classification accuracy according to the characteristic convolution value of the new tag image, the method further comprises: constructing a corresponding image classification model on each blockchain node based on the label image to be trained stored on the blockchain node; And taking the block chain link point with the highest classification accuracy as a consensus node, and after initiating uplink consensus based on the consensus node, further comprising: Updating the image classification model on the blockchain node based on the new label image, and storing the parameters of the updated image classification model on the blockchain.
  3. 3. The method of claim 1, wherein the blockchain consensus method further comprises: determining a characteristic convolution threshold of the blockchain node based on the characteristic convolution mean of the blockchain node; Determining an abnormal image in the new label image of the blockchain node based on the characteristic convolution threshold, wherein the characteristic convolution value of the abnormal image is smaller than or equal to the characteristic convolution threshold; And eliminating the abnormal image from the new label image of the blockchain node.
  4. 4. The method of claim 3, wherein the determining the characteristic convolution threshold for the blockchain node based on the characteristic convolution mean for the blockchain node comprises: Determining the characteristic convolution variance of each blockchain node based on the characteristic convolution mean value of the blockchain node and the characteristic convolution value of the new label image of the blockchain node; constructing a normal distribution function for each blockchain node based on the characteristic convolution mean and the characteristic convolution variance of the blockchain node; And determining a characteristic convolution value threshold value of each block chain node meeting a characteristic convolution value quantity proportion condition based on the normal distribution function and the abnormality index of the block chain node.
  5. 5. The method of claim 2, wherein storing parameters of the updated image classification model on the blockchain comprises: storing the parameters of the updated image classification model in leaf nodes of the merck tree, and determining father nodes of the leaf nodes according to hash values of the leaf nodes; Constructing a corresponding block body based on the leaf node and the father node; determining a block header identification code based on a hash value of a preset field, wherein the preset field at least comprises a block size, a parent block identification code, a block body identification code, a block creation time and a consensus node identification code; Constructing a corresponding block header based on the block header identification code, the block size, the parent block identification code, the block body identification code, the block creation time and the consensus node identification code; And storing the block head and the block body corresponding to the parameters on the block chain node.
  6. 6. A blockchain consensus device, the blockchain consensus device comprising: The uplink consensus module is used for determining the block chain node with highest classification accuracy according to the characteristic convolution value of the new label image when the new label image is acquired by the block chain link point; The uplink consensus module is further configured to use the block link point with the highest classification accuracy as a consensus node, and initiate uplink consensus based on the consensus node; The uplink consensus module is further used for carrying out convolution processing on the abstract matrix of the new tag image and the convolution kernel of the image classification model on the block chain node corresponding to the new tag image when the new tag image is acquired by the block chain node, so as to obtain a convolution matrix corresponding to each new tag image; taking the maximum element in the convolution matrix as a characteristic convolution value corresponding to the new label image; And determining a characteristic convolution mean value of each blockchain node based on the characteristic convolution value of the new label image, and taking the blockchain node corresponding to the maximum characteristic convolution mean value in the characteristic convolution mean values as the blockchain node with the highest classification accuracy.
  7. 7. A blockchain consensus device comprising a memory, a processor and a blockchain consensus program stored on the memory and executable on the processor, the blockchain consensus program configured to implement the steps of the blockchain consensus method according to any of the claims 1 to 5.
  8. 8. A storage medium having stored thereon a blockchain consensus program, the blockchain consensus program when executed by a processor implementing the steps of the blockchain consensus method according to any of claims 1 to 5.
  9. 9. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the blockchain consensus method according to any of claims 1 to 5.

Description

Block chain consensus method, device, equipment, storage medium and product Technical Field The present invention relates to the field of blockchain technologies, and in particular, to a blockchain consensus method, device, apparatus, storage medium, and computer program product. Background The blockchain is a distributed decentralized database, has the characteristics of non-falsification and traceability, and has wide application prospects. However, when the blockchain is in consensus, all nodes need to continuously perform nonsensical hash calculation, compete for the consensus initiating authority, so that the computational resources are seriously wasted, the consensus efficiency is low, and the computational resources are difficult to efficiently utilize. The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art. Disclosure of Invention The invention mainly aims to provide a block chain consensus method, a device, equipment, a storage medium and a computer program product, which aim to solve the technical problems that the block chain has lower consensus efficiency and is difficult to efficiently utilize computational resources when consensus is carried out in the prior art. To achieve the above object, the present invention provides a blockchain consensus method, the method comprising the steps of: when a new label image is acquired by a block chain node, determining the block chain node with highest classification accuracy according to the characteristic convolution value of the new label image; And taking the block chain link point with the highest classification accuracy as a consensus node, and initiating uplink consensus based on the consensus node. Optionally, before determining the block link point with the highest classification accuracy according to the characteristic convolution value of the new label image when the block chain node acquires the new label image, the method further includes: constructing a corresponding image classification model on each blockchain node based on the label image to be trained stored on the blockchain node; And taking the block chain link point with the highest classification accuracy as a consensus node, and after initiating uplink consensus based on the consensus node, further comprising: Updating the image classification model on the blockchain node based on the new label image, and storing the parameters of the updated image classification model on the blockchain. Optionally, when the blockchain node acquires a new label image, determining the blockchain node with the highest classification accuracy according to the characteristic convolution value of the new label image, including: When the block chain node acquires a new label image, carrying out convolution processing on an abstract matrix of the new label image and a convolution kernel of an image classification model on the block chain node corresponding to the new label image to obtain a convolution matrix corresponding to each new label image; taking the maximum element in the convolution matrix as a characteristic convolution value corresponding to the new label image; Determining a characteristic convolution mean value of each blockchain node based on the characteristic convolution value of the new label image; And determining the maximum characteristic convolution mean value from the characteristic convolution mean values, wherein the classification accuracy of the block chain node corresponding to the maximum characteristic convolution mean value is highest. Optionally, the blockchain consensus method further includes: determining a characteristic convolution threshold of the blockchain node based on the characteristic convolution mean of the blockchain node; Determining an abnormal image in the new label image of the blockchain node based on the characteristic convolution threshold, wherein the characteristic convolution value of the abnormal image is smaller than or equal to the characteristic convolution threshold; And eliminating the abnormal image from the new label image of the blockchain node. Optionally, the determining the characteristic convolution threshold of the blockchain node based on the characteristic convolution mean of the blockchain node includes: Determining the characteristic convolution variance of each blockchain node based on the characteristic convolution mean value of the blockchain node and the characteristic convolution value of the new label image of the blockchain node; constructing a normal distribution function for each blockchain node based on the characteristic convolution mean and the characteristic convolution variance of the blockchain node; And determining a characteristic convolution value threshold value of each block chain node meeting a characteristic convolution value quantity proportion condition based o