Data computing power recovery and energy consumption control method and system based on AI and blockchain

Through AI and blockchain-based methods, we build blocks to build environments, sort model priority, generate target hash values, build target blockchain, and disable the computing end with excessive energy consumption, solving the computing power of blockchain data calculation The problems of low utilization rate and waste of energy consumption have achieved efficient computing power recovery and energy consumption control.

CN118860665BActive Publication Date: 2024-12-27SHENZHEN XUNCE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411304532.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-27
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

The utilization rate of blockchain data computing power is low, resulting in waste of energy consumption and computing power.

Method used

Through AI and blockchain-based methods, we build blocks to build environments, obtain initial model sequences, sort model priority, use computing power calculation units to generate target hash values, build target blockchains, and disable computing terminals with excessive energy consumption exceeding standards , realize computing power recovery and energy consumption control.

Benefits of technology

The utilization rate of blockchain data computing power is improved, and the energy consumption and waste of computing power in data computing are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860665B_ABST
    Figure CN118860665B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and is a method and system for data computing power recovery and energy consumption control based on AI and blockchain, comprising: receiving a block establishment instruction, confirming a block establishment environment according to the block establishment instruction, obtaining an initial model sequence using a model acquisition unit, obtaining target model data, a target computing end and a model generation time using a model generation unit and initial model data, judging whether the model generation time is greater than a preset generation time threshold, obtaining block data, obtaining an i-th new block using the target computing end, block data, a target hash value and target model data, summarizing new blocks corresponding to the initial model data to obtain a new block set, constructing a target blockchain based on the new block set, completing computing power recovery for blockchain data calculation, confirming a disabled computing end in the target computing ends corresponding to m initial model data based on an energy consumption control unit, and completing energy consumption control for blockchain data calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and system for data computing power recovery and energy consumption control based on AI and blockchain. Background Art

[0002] Blockchain is a decentralized distributed ledger that is tamper-proof, secure and reliable. It combines distributed storage, peer-to-peer transmission, consensus mechanism, cryptography and other technologies to record transactions and information through an ever-growing data block chain to ensure data security and transparency. Blockchain technology is gradually being applied to various distributed systems due to its decentralized, tamper-proof and traceable characteristics. Summary of the invention

[0003] The present invention provides a data computing power recovery and energy consumption control method and system based on AI and blockchain, the main purpose of which is to improve the utilization rate of blockchain data computing power and reduce energy consumption and waste of computing power in data.

[0004] To achieve the above objectives, the present invention provides a data computing power recovery and energy consumption control method based on AI and blockchain, comprising:

[0005] Receiving a block establishment instruction, and confirming a block establishment environment according to the block establishment instruction, wherein the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit, and an energy consumption control unit;

[0006] Using a model acquisition unit to acquire an initial model sequence, wherein the initial model sequence includes m initial model data;

[0007] The following operations are performed on the i-th initial model data in the initial model sequence in sequence, where: , and i is an integer;

[0008] Based on the i-th initial model data, an i-1-th new block is identified, and a target model data, a target computing end and a model generation time are acquired using a model generation unit and the initial model data;

[0009] Determine whether the model generation time is greater than a preset generation time threshold;

[0010] If the model generation time is greater than the generation time threshold, the target hash value is obtained using the computing power calculation unit and the preset hash function;

[0011] If the model generation time is less than or equal to the generation time threshold, the target hash value is calculated using the computing power calculation unit, the model generation time and the generation time threshold;

[0012] Obtain block data using the block retrieval unit and the i-1th new block, where the block data consists of the parent block hash value, block version number and timestamp;

[0013] Obtain the i-th new block using the target computing end, block data, target hash value and target model data;

[0014] The new blocks corresponding to the initial model data are aggregated to obtain a new block set, wherein the new block set includes m new blocks, a target blockchain is constructed based on the new block set, computing power recovery for blockchain data calculation is completed, and the energy consumption control unit is used to confirm the disabled computing end in the target computing end corresponding to the m initial model data, thereby completing the energy consumption control for blockchain data calculation.

[0015] Optionally, the acquiring the initial model sequence by using a model acquiring unit includes:

[0016] Starting a model acquisition unit, wherein the model acquisition unit is composed of a model analyzer connected to m clients;

[0017] Using m clients to obtain m initial model data, and the initial model data corresponds to the client one by one, wherein the initial model data includes M samples, an initial model architecture and an evaluation value;

[0018] The following operations are performed on each of the m initial model data:

[0019] The model complexity is calculated using the model analyzer, M samples and the initial model architecture. The calculation formula is as follows:

[0020] ;

[0021] in, is the model complexity, is the breadth of the initial model architecture, is the depth of the initial model architecture, is the feature dimension of the Jth sample among M samples, where , and J and M are integers;

[0022] The model priority is calculated using the model complexity and evaluation value. The calculation formula is as follows:

[0023] ;

[0024] in, is the model priority, is the preset optimal complexity, is the evaluation value;

[0025] Summarizing m model priorities corresponding to m initial model data to obtain a model priority set, performing a sorting operation on the m model priorities in the model priority set in ascending order to obtain a model priority sequence, and confirming an initial model sequence based on the model priority sequence, wherein the initial model data in the initial model sequence correspond to the model priorities in the model priority sequence one by one;

[0026] The initial model sequence is as follows:

[0027] ;

[0028] in, , and They respectively represent the first, second and mth initial model data in the initial model sequence.

[0029] Optionally, the step of acquiring target model data, target computing end, and model generation time by using the model generation unit and the initial model data includes:

[0030] Starting a model generation unit, wherein the model generation unit is composed of a data receiving end and a model verification end connected to n different data computing ends;

[0031] The initial model data is sent to each of n different data computing terminals, wherein the data receiving terminal is used to receive the AI ​​model data calculated by the n different data computing terminals, and the time when the initial model data is sent to each of the n different data computing terminals is taken as the initial time, and the initial time is taken as the starting point and the time is recorded in real time to obtain the operation time, and a first time threshold is preset, and the AI ​​model data corresponds to the data computing terminal one by one;

[0032] Detect in real time whether the data receiving end has received the AI ​​model data calculated by one of the n different data computing ends;

[0033] When it is detected that the data receiving end receives the AI ​​model data, the data receiving end sends the received AI model data to the model verification end, and uses the model verification end to determine whether the AI ​​model data meets a preset first model threshold;

[0034] If the AI ​​model data meets the first model threshold, the data receiving end is closed, and the operation time is used as the model generation time, the AI ​​model data that meets the first model threshold is used as the target model data, and the data computing end corresponding to the AI ​​model data is used as the target computing end;

[0035] If the AI ​​model data does not meet the first model threshold, the AI ​​model data that does not meet the first model threshold is recorded as the first model data, and the step of detecting in real time whether the data receiving end has received the AI ​​model data calculated by one of the n different data computing ends is returned until the operation time reaches the first time threshold and the received AI model data do not meet the first model threshold, then the first model data is aggregated to obtain a first model data set, and the second model threshold is calculated by the first model threshold;

[0036] The following operations are performed on the first model data in the first model data set:

[0037] The second time threshold is obtained by using the first time threshold, wherein the second time threshold is twice the first time threshold, the second time threshold is used as the first time threshold, the first model data is used as the AI ​​model data, and the second model threshold is used as the first model threshold, and the step of real-time detection of whether the data receiving end has received the AI ​​model data calculated by one of the n different data computing ends is returned until the AI ​​model data meets the first model threshold.

[0038] Optionally, the using the model verification end to determine whether the AI ​​model data meets a preset first model threshold includes:

[0039] Start the model verification end, where the model verification end includes a test set and a verification set;

[0040] When the model verification end receives the AI ​​model data, it inputs the test set into the AI ​​model data to obtain the output set;

[0041] Using the output set and the validation set to obtain the model accuracy, and comparing the model accuracy with the first model threshold;

[0042] If the model accuracy is greater than or equal to the first model threshold, the AI ​​model data meets the first model threshold;

[0043] If the model accuracy is less than the first model threshold, the AI ​​model data does not meet the first model threshold.

[0044] Optionally, the second model threshold is calculated from the first model threshold, and the calculation formula is as follows:

[0045] ;

[0046] in, is the second model threshold, is the first model threshold.

[0047] Optionally, calculating the target hash value using the computing power calculation unit, the model generation time, and the generation time threshold includes:

[0048] Obtaining a conversion hash value using a computing power calculation unit and a preset initial hash value, wherein the conversion hash value is the initial hash value in decimal;

[0049] The relay hash value is calculated using the model generation time, generation time threshold, and conversion hash value. The calculation formula is as follows:

[0050] ;

[0051] in, is the relay hash value, To convert the hash value, is the generation time threshold; Generate time for the model;

[0052] The target hash value is obtained by using the computing power calculation unit and the relay hash value, wherein the target hash value is the relay hash value in hexadecimal.

[0053] Optionally, the acquiring block data by using the block retrieval unit and the i-1th new block includes:

[0054] Start the block retrieval unit, use the block retrieval unit to retrieve the i-1th new block, obtain the parent block hash value and block version number, and use the time when the block retrieval unit retrieves the i-1th new block as the timestamp;

[0055] The parent block hash value, block version number and timestamp are used as block data.

[0056] Optionally, the obtaining the i-th new block by using the target computing end, the block data, the target hash value and the target model data includes:

[0057] Placing the preset second hash function into the target computing end to obtain a function computing end;

[0058] Calculate the information hash value using the function computing end, target model data, and pre-acquired transaction information;

[0059] Get any random number and use the function calculation end, block data, information hash value and random number calculation to update the hash value;

[0060] Compare the updated hash value with the target hash value;

[0061] If the updated hash value is greater than or equal to the target hash value, return to the step of obtaining any random number until the updated hash value is less than the target hash value, and use the any random number as the target random number;

[0062] The target random number, block data, target hash value and information hash value are combined to obtain the block header, the target model data and transaction information are combined to obtain the block body, and the block header and block body are combined to obtain the i-th new block.

[0063] Optionally, the energy consumption control unit confirms the disabled computing end among the target computing ends corresponding to the m initial model data, including:

[0064] The following operations are performed on each of the target computing ends corresponding to the m initial model data:

[0065] The target computing end is used to obtain the operating energy consumption and operating time, and the energy consumption rate is calculated using the energy consumption control unit, operating energy consumption and operating time. The calculation formula is as follows;

[0066] ;

[0067] in, is the energy consumption rate, a is the preset weight coefficient, Q is the operating energy consumption, is the running time, is the preset energy consumption reference value;

[0068] Summarize the energy consumption rates to obtain an energy consumption rate set, and perform a sorting operation on the m energy consumption rates in the energy consumption rate set in descending order to obtain an energy consumption rate sequence;

[0069] The first five energy consumption rates in the energy consumption rate sequence are selected, and the target computing end corresponding to each energy consumption rate in the first five energy consumption rates is used as the disabled computing end.

[0070] To achieve the above objectives, the present invention also provides a data computing power recovery and energy consumption control system based on AI and blockchain, comprising:

[0071] A block environment confirmation module, used to receive a block establishment instruction, and confirm a block establishment environment according to the block establishment instruction, wherein the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit, and an energy consumption control unit;

[0072] The AI ​​model generation module is used to obtain an initial model sequence using a model acquisition unit, wherein the initial model sequence includes m initial model data, and sequentially performs the following operations on the i-th initial model data in the initial model sequence, wherein: , where i is an integer, an i-1th new block is identified based on the i-th initial model data, and a target model data, a target computing end and a model generation time are acquired using a model generation unit and the initial model data;

[0073] The target block establishment module is used to determine whether the model generation time is greater than the preset generation time threshold. If the model generation time is greater than the generation time threshold, the target hash value is obtained by using the computing power calculation unit and the preset hash function. If the model generation time is less than or equal to the generation time threshold, the target hash value is calculated by using the computing power calculation unit, the model generation time and the generation time threshold, and the block retrieval unit and the i-1th new block are used to obtain block data, wherein the block data consists of the parent block hash value, the block version number and the timestamp, and the i-th new block is obtained by using the target calculation end, the block data, the target hash value and the target model data;

[0074] The computing power energy consumption control module is used to summarize the new blocks corresponding to the initial model data to obtain a new block set, wherein the new block set includes m new blocks, build a target blockchain based on the new block set, complete the computing power recovery for blockchain data calculation, and complete the energy consumption control for blockchain data calculation by confirming the disabled computing end in the target computing end corresponding to the m initial model data based on the energy consumption control unit.

[0075] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0076] a memory storing at least one instruction; and

[0077] The processor executes the instructions stored in the memory to implement the above-mentioned data computing power recovery and energy consumption control method based on AI and blockchain.

[0078] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the above-mentioned data computing power recovery and energy consumption control method based on AI and blockchain.

[0079] The present invention is to solve the problem described in the background technology. The present invention receives a block establishment instruction and confirms a block establishment environment according to the block establishment instruction, wherein the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit and an energy consumption control unit. It can be seen that the present invention provides a systematic working environment for each unit by constructing a complete block establishment environment, thereby ensuring the continuity of the new block when it is established; further, the model acquisition unit is used to obtain an initial model sequence, wherein the initial model sequence includes m initial model data. It can be seen that the embodiment of the present invention determines the priority of the block corresponding to each initial model data when it is established by sorting the initial model data; the following operations are performed on the i-th initial model data in the initial model sequence in turn, wherein, , and i is an integer. Based on the i-th initial model data, the i-1th new block is confirmed, and the target model data, the target computing end and the model generation time are obtained by using the model generation unit and the initial model data. It can be seen that the embodiment of the present invention uses the computing power of the data computing end to calculate the AI ​​model data, and uses the target model data as part of the proof of work to realize computing power recovery; it is determined whether the model generation time is greater than the preset generation time threshold. If the model generation time is greater than the generation time threshold, the computing power calculation unit and the preset hash function are used to obtain the target hash value. If the model generation time is less than or equal to the generation time threshold, the computing power calculation unit, the model generation time and the generation time threshold are used to calculate the target hash value. It can be seen that the embodiment of the present invention uses the model generation time and the generation time threshold to determine the target hash value for screening subsequent update hash values; the block retrieval unit and the i-1th new block are used to obtain block data, wherein the block data is obtained by the parent block hash. The block data is composed of the hash value, block version number and timestamp. It can be seen that the embodiment of the present invention obtains the information of the previous block through the block retrieval unit and integrates it to facilitate the generation of new blocks; the target computing end, block data, target hash value and target model data are used to obtain the i-th new block. It can be seen that the embodiment of the present invention uses the process of calculating and updating the hash value as part of the computing power consumption to complete the proof of work to generate a new block; the new blocks are summarized to obtain a new block set, and the target blockchain is constructed based on the new block set to complete the computing power recovery of the blockchain data calculation. Based on the energy consumption control unit, the disabled computing end is confirmed in the target computing end corresponding to the m initial model data, and the energy consumption control of the blockchain data calculation is completed. It can be seen that after the blockchain is generated, the embodiment of the present invention retrieves the energy consumption of different target computing ends, and disables the target computing end with excessive energy consumption, which prevents some target computing ends from consuming a lot of computing power and energy consumption and maliciously competing with other target computing ends and wasting energy consumption. Therefore, the present invention can improve the utilization rate of blockchain data computing power and reduce the energy consumption and computing power waste in data calculation. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 A flow chart of a method for data computing power recovery and energy consumption control based on AI and blockchain provided in one embodiment of the present invention;

[0081] Figure 2 A schematic diagram of the structure of a blockchain for a method for data computing power recovery and energy consumption control based on AI and blockchain provided in one embodiment of the present invention;

[0082] Figure 3 A functional module diagram of a data computing power recovery and energy consumption control system based on AI and blockchain provided in one embodiment of the present invention;

[0083] Figure 4A schematic diagram of the structure of an electronic device for implementing the data computing power recovery and energy consumption control method based on AI and blockchain provided in one embodiment of the present invention.

[0084] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0085] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0086] The embodiment of the present application provides a method for data computing power recovery and energy consumption control based on AI and blockchain. The execution subject of the data computing power recovery and energy consumption control method based on AI and blockchain includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided in the embodiment of the present application. In other words, the data computing power recovery and energy consumption control method based on AI and blockchain can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.

[0087] Reference Figure 1 As shown, it is a flow chart of a method for data computing power recovery and energy consumption control based on AI and blockchain provided in one embodiment of the present invention. In this embodiment, the method for data computing power recovery and energy consumption control based on AI and blockchain includes:

[0088] S1. Receive a block establishment instruction, and confirm a block establishment environment according to the block establishment instruction, wherein the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit, and an energy consumption control unit.

[0089] It should be explained that the block creation instruction is generally initiated by the developer of the blockchain. For example, Xiao Zhang is a developer of a blockchain. Now Xiao Zhang has written the blockchain code and needs to start building the blockchain, so Xiao Zhang initiates the block creation instruction.

[0090] In the embodiment of the present invention, the environment for establishing a blockchain is a block establishment environment, and the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit and an energy consumption control unit, wherein the model acquisition unit is composed of a model analyzer connected to m clients, and the model generation unit is composed of a data receiving end and a model verification end connected to n different data computing ends. For the specific application of the client, the data computing end, the model analyzer, the data receiving end, the data verification end, the block retrieval unit, the computing power calculation unit and the energy consumption control unit, please refer to the subsequent embodiments.

[0091] In detail, the receiving of the block creation instruction and determining the block creation environment according to the block creation instruction includes:

[0092] After receiving the block establishment instruction, the model acquisition unit, the model generation unit, the computing power calculation unit, the block retrieval unit and the energy consumption control unit are self-tested;

[0093] When the self-test passes, the parameters of the model analyzer, data receiving end and data verification end are set respectively until the parameters are set successfully, and a block establishment environment including a model analyzer, a data receiving end, a data verification end, a computing power calculation unit, a block retrieval unit and an energy consumption control unit is obtained.

[0094] It should be explained that the parameters for setting the model analyzer, the data receiving end and the data verification end include the data analysis time, the number of analyses, etc.

[0095] S2. Utilize a model acquisition unit to acquire an initial model sequence, wherein the initial model sequence includes m initial model data.

[0096] In detail, the obtaining of the initial model sequence by using the model obtaining unit includes:

[0097] Starting a model acquisition unit, wherein the model acquisition unit is composed of a model analyzer connected to m clients;

[0098] Using m clients to obtain m initial model data, and the initial model data corresponds to the client one by one, wherein the initial model data includes M samples, an initial model architecture and an evaluation value;

[0099] The following operations are performed on each of the m initial model data:

[0100] The model complexity is calculated using the model analyzer, M samples and the initial model architecture. The calculation formula is as follows:

[0101] ;

[0102] in, is the model complexity, is the breadth of the initial model architecture, is the depth of the initial model architecture, is the feature dimension of the Jth sample among M samples, where , and J and M are integers;

[0103] The model priority is calculated using the model complexity and evaluation value. The calculation formula is as follows:

[0104] ;

[0105] in, is the model priority, is the preset optimal complexity, is the evaluation value;

[0106] Summarizing m model priorities corresponding to m initial model data to obtain a model priority set, performing a sorting operation on the m model priorities in the model priority set in ascending order to obtain a model priority sequence, and confirming an initial model sequence based on the model priority sequence, wherein the initial model data in the initial model sequence correspond to the model priorities in the model priority sequence one by one;

[0107] The initial model sequence is as follows:

[0108] ;

[0109] in, , and They respectively represent the first, second and mth initial model data in the initial model sequence.

[0110] The key point is that the client refers to the computer used by the customer to provide initial model data. In an embodiment of the present invention, the initial model data refers to the data of the deep learning model. Optionally, a convolutional neural network model is selected as the deep learning model, and the initial model data is the data of the convolutional neural network model. The initial model data includes M samples, an initial model architecture and an evaluation value. The sample is the data used to train the deep learning model. The initial model architecture refers to the model type and the parameters of the model selected when building a deep learning model. For example, a convolutional neural network model with 10 layers and 10 neurons in each layer can be selected as the initial model architecture. The evaluation value is provided by the client to reflect the difficulty of training the deep learning model, and the larger the evaluation value, the greater the difficulty of training the deep learning model.

[0111] It should be explained that the model analyzer is a data analysis software programmed in Python. By inputting the sample and the initial model architecture into the model analyzer, the feature dimension of the sample, as well as the depth and breadth of the initial model architecture can be obtained. The feature dimension refers to the number of attributes or variables of the sample, which can reflect the complexity of the sample. For images, the feature dimension is the resolution of the image. For text, the feature vector is the size of the vocabulary or the dimension of the word vector. For example, the feature dimension of a 32×32 color image is 3072. Optionally, the depth of the initial model architecture refers to the number of layers of the convolutional neural network, and the breadth of the initial model architecture refers to the number of neurons in each layer of the convolutional neural network.

[0112] It should be understood that the data analysis software programmed in Python is prior art and will not be described in detail here.

[0113] Importantly, model complexity reflects the complexity of the deep learning model after successful training with the initial model data. The higher the model complexity, the more complex the structure of the deep learning model. Model priority reflects the priority of the initial model data for training the deep learning model. The lower the model priority, the more suitable the initial model data is for training the deep learning model. The optimal complexity is set by the blockchain developer.

[0114] For example, Xiao Zhao, as a blockchain developer, expects that the generation time of each new block of the blockchain is 1 hour. Xiao Zhao obtains multiple deep convolutional neural network models that can be successfully trained in 1 hour, and uses the average of the complexity corresponding to the multiple deep convolutional neural network models as the optimal complexity. Afterwards, the model priority of the three initial model data is calculated by the optimal complexity, where the three initial model data are: , and , , and The model priorities are: 23%, 46%, 12% respectively. The initial model sequence confirmed by the model priority sequence is:

[0115]

[0116] It is understandable that the embodiments of the present invention prioritize the initial model data that is more suitable for training the deep learning model by sorting the initial model data, thereby ensuring that the first few new blocks of the blockchain are easy to generate and attracting more clients to participate in the calculation of the initial model data. When the number of clients increases, more computing power will be used to calculate the initial model data. At this time, it will be easier to calculate the initial model data that is sorted later in the initial model sequence.

[0117] S3, sequentially perform the following operations on the i-th initial model data in the initial model sequence, where: , and i is an integer, based on the i-th initial model data, the i-1th new block is confirmed, and the target model data, the target computing end and the model generation time are obtained by using the model generation unit and the initial model data.

[0118] Exemplarily, the second initial model data is retrieved in the initial model sequence using the third initial model data, thereby confirming the second new block associated with the second initial model data.

[0119] In detail, the method of using the model generation unit and the initial model data to obtain the target model data, the target computing end and the model generation time includes:

[0120] Starting a model generation unit, wherein the model generation unit is composed of a data receiving end and a model verification end connected to n different data computing ends;

[0121] The initial model data is sent to each of n different data computing terminals, wherein the data receiving terminal is used to receive the AI ​​model data calculated by the n different data computing terminals, and the time when the initial model data is sent to each of the n different data computing terminals is taken as the initial time, and the initial time is taken as the starting point and the time is recorded in real time to obtain the operation time, and a first time threshold is preset, and the AI ​​model data corresponds to the data computing terminal one by one;

[0122] Detect in real time whether the data receiving end has received the AI ​​model data calculated by one of the n different data computing ends;

[0123] When it is detected that the data receiving end receives the AI ​​model data, the data receiving end sends the received AI model data to the model verification end, and uses the model verification end to determine whether the AI ​​model data meets a preset first model threshold;

[0124] If the AI ​​model data meets the first model threshold, the data receiving end is closed, and the operation time is used as the model generation time, the AI ​​model data that meets the first model threshold is used as the target model data, and the data computing end corresponding to the AI ​​model data is used as the target computing end;

[0125] If the AI ​​model data does not meet the first model threshold, the AI ​​model data that does not meet the first model threshold is recorded as the first model data, and the step of detecting in real time whether the data receiving end has received the AI ​​model data calculated by one of the n different data computing ends is returned until the operation time reaches the first time threshold and the received AI model data do not meet the first model threshold, then the first model data is aggregated to obtain a first model data set, and the second model threshold is calculated by the first model threshold;

[0126] The following operations are performed on the first model data in the first model data set:

[0127] The second time threshold is obtained by using the first time threshold, wherein the second time threshold is twice the first time threshold, the second time threshold is used as the first time threshold, the first model data is used as the AI ​​model data, and the second model threshold is used as the first model threshold, and the step of real-time detection of whether the data receiving end has received the AI ​​model data calculated by one of the n different data computing ends is returned until the AI ​​model data meets the first model threshold.

[0128] Furthermore, the using the model verification end to determine whether the AI ​​model data meets a preset first model threshold includes:

[0129] Start the model verification end, where the model verification end includes a test set and a verification set;

[0130] When the model verification end receives the AI ​​model data, it inputs the test set into the AI ​​model data to obtain the output set;

[0131] Using the output set and the validation set to obtain the model accuracy, and comparing the model accuracy with the first model threshold;

[0132] If the model accuracy is greater than or equal to the first model threshold, the AI ​​model data meets the first model threshold;

[0133] If the model accuracy is less than the first model threshold, the AI ​​model data does not meet the first model threshold.

[0134] In detail, the second model threshold is calculated from the first model threshold, and the calculation formula is as follows:

[0135] ;

[0136] in, is the second model threshold, is the first model threshold.

[0137] It should be explained that AI model data refers to the trained deep learning model and its parameters, for example, the parameters may be the learning rate and the number of training rounds, etc. The data computing end refers to the computer that receives the initial model data and obtains the AI ​​model data based on the initial model data, and each data computing end is different. For example, if the initial model data is sent to computers A, B, and C, then computers A, B, and C are the three data computing ends.

[0138] Importantly, the data receiving end is a computer for receiving AI model data calculated by n different data computing ends, and the receiving conditions are set. Only AI model data that meets the specified format will be received, where the specified format is determined by the type of deep learning model. The model verification end is a computer with built-in model verification software, which has built-in test sets and verification sets for testing deep learning models. The test set is a data set for inputting AI model data. After the deep learning model in the AI ​​model data is calculated, the test set outputs a data set containing the calculation results, and the data set is used as the output set. The verification set is a data set used to test the output set. By comparing the output set and the verification set, the percentage of the same data in the output set and the verification set to all the data in the output set is used as the model accuracy. For example, there are 10 data in the output set, and only 5 of them are the same as the verification set, then the model accuracy is 50%.

[0139] It should be understood that the model verification software is programmed in Python, and the technology of programming model verification software in Python is existing technology and will not be described in detail here.

[0140] It is understandable that the first model threshold is a model accuracy set by the developer and is used to filter AI model data. The first time threshold is a time value set by the developer. When this time value is reached, it means that the operation time is too long, that is, the trained AI model data is difficult to reach the first model threshold, and the first model threshold needs to be adjusted to the second model threshold.

[0141] Exemplarily, the first time threshold is 20 minutes, and the second time threshold is 40 minutes. After the initial model data is sent to each of the 100 different data computing terminals, each data computing terminal simultaneously uses the initial model data to train the deep learning model. After a period of time, a data computing terminal is successfully trained, and it sends the deep learning model and its parameters as AI model data to the data receiving terminal. If the format of the AI ​​model data meets the receiving conditions, the data receiving terminal successfully receives the AI ​​model data and sends it to the model verification terminal. After verification by the model verification terminal, it is found that the AI ​​model data does not meet the first model threshold: 80%, then the AI ​​model data is recorded as the first model data, and continue to wait until the AI ​​model data meets the receiving conditions. After 20 minutes, if there is still no AI model data that can meet the first model threshold, the second model threshold is calculated to be 78% through the first model threshold, and the second model threshold is used to replace the previous first model threshold. The previous first model data is used as the AI ​​model data and compared with the replaced first model threshold. If it is found that the first model threshold is still not met, continue to wait for new AI model data to be input and verified. After waiting for 40 minutes, the first model threshold is updated again, and so on. After 70 minutes, the AI ​​model data sent by Xiao Wang's data computing end meets the first model threshold. The model generation time is 70 minutes, the target model data is the AI ​​model data, and the target computing end is Xiao Wang's data computing end.

[0142] It should be understood that in reality, the proof of work required to establish a blockchain is obtained through hash operations, which are meaningless in themselves and waste a lot of computer computing power. The embodiments of the present invention invest the computing power of the data computing end into meaningful deep learning model training, and use the successfully trained deep learning model as part of the proof of work to achieve computing power recovery.

[0143] S4. Determine whether the model generation time is greater than a preset generation time threshold. If the model generation time is greater than the generation time threshold, use the computing power calculation unit and the preset hash function to obtain the target hash value. If the model generation time is less than or equal to the generation time threshold, use the computing power calculation unit, the model generation time and the generation time threshold to calculate the target hash value.

[0144] In detail, the method of calculating the target hash value using the computing power calculation unit, the model generation time and the generation time threshold includes:

[0145] Obtaining a conversion hash value using a computing power calculation unit and a preset initial hash value, wherein the conversion hash value is the initial hash value in decimal;

[0146] The relay hash value is calculated using the model generation time, generation time threshold, and conversion hash value. The calculation formula is as follows:

[0147] ;

[0148] in, is the relay hash value, To convert the hash value, is the generation time threshold; Generate time for the model;

[0149] The target hash value is obtained by using the computing power calculation unit and the relay hash value, wherein the target hash value is the relay hash value in hexadecimal.

[0150] It should be explained that the generation time threshold is set by the developer and represents the time when the developer expects to generate a new block. For example, if the developer expects to generate a block every hour, the generation time threshold is 1 hour. The computing power calculation unit is a computer with a built-in base conversion software. The base conversion software is a prior art that can convert decimal numbers into hexadecimal numbers. The initial hash value is set by the developer according to the difficulty target in the proof of work and is a hexadecimal number. The converted hash value is obtained by converting the initial hash value into decimal. The relay hash value is calculated from the converted hash value. The target hash value is a 256-bit hexadecimal number, which is mainly used to filter subsequent update hash values.

[0151] For example, the SHA-256 algorithm is used as the hash function. When the model generation time is greater than the generation time threshold, the SHA-256 algorithm shows that its maximum value is , and convert it into hexadecimal through the computing power calculation unit to obtain the target hash value.

[0152] It should be understood that the embodiment of the present invention compares the model generation time with the generation time threshold. If the model generation time is less than the generation time threshold, it means that the process of generating the target model data is relatively simple and insufficient to complete the proof of work. In this case, a subsequent process of calculating and updating the hash value is required to further supplement the proof of work. If the model generation time is greater than the generation time threshold, it means that the process of generating the target model data is relatively complex and sufficient to complete the proof of work. There is no need to consume more computing power in the subsequent process of calculating and updating the hash value. Therefore, the target hash value is set to the maximum value of the hash function, that is, no matter what random number is used for hash calculation, the calculated hash value must be less than the maximum value, and the subsequent generation of new blocks can be directly performed.

[0153] S5. Obtain block data using the block retrieval unit and the i-1th new block, wherein the block data consists of a parent block hash value, a block version number, and a timestamp.

[0154] In detail, the block data is obtained by using the block search unit and the i-1th new block, including:

[0155] Start the block retrieval unit, use the block retrieval unit to retrieve the i-1th new block, obtain the parent block hash value and block version number, and use the time when the block retrieval unit retrieves the i-1th new block as the timestamp;

[0156] The parent block hash value, block version number and timestamp are used as block data.

[0157] Exemplarily, the second new block is obtained using the target computing end of the second new block, the target hash value of the second new block, the target model data of the second new block, and the preset block data of the first new block, and then the third new block is obtained using the target computing end of the third new block, the target hash value of the third new block, the target model data of the third new block, and the block data of the second new block, and so on, until the i-1th new block is obtained, and the block data for establishing the i-th new block is obtained using the i-1th new block.

[0158] Furthermore, the block retrieval unit is a block analysis software programmed in Python, which can retrieve the information of the i-1th new block and integrate the information into data for output. The parent block hash value refers to the hash value obtained by hashing the block header of the i-1th new block. The block version number is a 4-byte field that indicates the protocol version followed by the new block. The main function of the timestamp is to authenticate the time when the data was generated, so as to verify whether the data has been tampered with after it was generated.

[0159] It should be understood that the block analysis software programmed in Python is prior art and will not be described in detail here.

[0160] S6. Obtain the i-th new block using the target computing end, block data, target hash value and target model data.

[0161] In detail, the method of obtaining the i-th new block by using the target computing end, block data, target hash value and target model data includes:

[0162] Placing the preset second hash function into the target computing end to obtain a function computing end;

[0163] Calculate the information hash value using the function computing end, target model data, and pre-acquired transaction information;

[0164] Get any random number and use the function calculation end, block data, information hash value and random number calculation to update the hash value;

[0165] Compare the updated hash value with the target hash value;

[0166] If the updated hash value is greater than or equal to the target hash value, return to the step of obtaining any random number until the updated hash value is less than the target hash value, and use the any random number as the target random number;

[0167] The target random number, block data, target hash value and information hash value are combined to obtain the block header, the target model data and transaction information are combined to obtain the block body, and the block header and block body are combined to obtain the i-th new block.

[0168] It should be explained that the function computing end refers to the target computing end after the hash function is set. The information hash value is a 256-bit, hexadecimal number, which is the result of the function computing end performing a hash operation on the transaction information and the target model data. The update hash value is a 256-bit, hexadecimal number, which is the result of the function computing end performing a hash operation on the merged block data, the information hash value, and the random number. The pre-acquired transaction information is obtained by the developer, and the new block can be used to save this transaction information.

[0169] Exemplarily, in the target computing end, Python's hashlib library is used and the algorithm of the second hash function is set to SHA-256 to obtain a function computing end, and the function computing end is used to perform hash operations on the transaction information and the target model data to obtain a 256-bit number, that is, the number is the information hash value, and then the random module in Python is used to generate a random number, and the data in the block data, information hash value and random number are extracted and merged into a number set, and the number set is substituted into the hash function for calculation to obtain a 256-bit number. When this number is greater than or equal to the target hash value, random numbers are continued to be generated and calculated until a random number appears, and the calculated number is less than the target hash value, and the random number is recorded as the target random number.

[0170] See also Figure 2 As shown, it is a structural diagram of the blockchain, wherein the structure of the i-th new block reflects the combination method of combining the target random number, block data, target hash value and information hash value to obtain a block header, combining the target model data and transaction information to obtain a block body, and combining the block header and the block body to obtain the i-th new block.

[0171] S7. Summarize the new blocks corresponding to the initial model data to obtain a new block set, wherein the new block set includes m new blocks, construct a target blockchain based on the new block set, complete the computing power recovery for blockchain data calculation, and confirm the disabled computing end in the target computing end corresponding to the m initial model data based on the energy consumption control unit to complete the energy consumption control for blockchain data calculation.

[0172] Specifically, the energy consumption control unit identifies the disabled computing end from the target computing ends corresponding to the m initial model data, including:

[0173] The following operations are performed on each of the target computing ends corresponding to the m initial model data:

[0174] The target computing end is used to obtain the operating energy consumption and operating time, and the energy consumption rate is calculated using the energy consumption control unit, operating energy consumption and operating time. The calculation formula is as follows;

[0175] ;

[0176] in, is the energy consumption rate, a is the preset weight coefficient, Q is the operating energy consumption, is the running time, is the preset energy consumption reference value;

[0177] Summarize the energy consumption rates to obtain an energy consumption rate set, and perform a sorting operation on the m energy consumption rates in the energy consumption rate set in descending order to obtain an energy consumption rate sequence;

[0178] The first five energy consumption rates in the energy consumption rate sequence are selected, and the target computing end corresponding to each energy consumption rate in the first five energy consumption rates is used as the disabled computing end.

[0179] See also Figure 2 As shown, it is a schematic diagram of the structure of the blockchain. Because the hash value of the parent block in the i-th new block in the new block set is obtained by hashing the block header in the i-1-th new block in the new block set, the two new blocks have a corresponding relationship and are regarded as connected to each other, and so on, until they are connected to the m-th new block in the new block set, completing the construction of the target blockchain based on the new block set.

[0180] It should be explained that the energy consumption control unit is a computer with a built-in computing software programmed by Python. When the operating energy consumption and operating time are input, the computing software calculates the energy consumption rate and outputs it. The energy consumption rate reflects the energy consumption per unit time of the target computing end when generating a new block. The higher the energy consumption rate, the greater the energy consumption per unit time. The operating energy consumption is the energy consumed by the target computing end when generating a new block. The operating time is the time taken by the target computing end to generate a new block. The preset energy consumption reference value is set by the developer. The preset weight coefficient is determined by factors in the actual environment and adjusted in real time, such as the network speed when the developer receives information from the target computing end, the temperature of the environment, etc.

[0181] It should be understood that the computing software programmed in Python is prior art and will not be described in detail here.

[0182] For example, Xiao Li is a user of a target computing terminal. He sends the operating energy consumption and operating time of the target computing terminal during operation to the energy consumption control unit, calculates the energy consumption rate, and so on, obtains m energy consumption rates, and after sorting them from large to small, the obtained energy consumption rate sequence is as follows:

[0183]

[0184] Among them, the energy consumption rate of the target computing end used by Xiao Li is , is in the top five, then the target computing end used by Xiao Li is disabled due to high energy consumption and cannot be used for the next blockchain generation.

[0185] The present invention is to solve the problem described in the background technology. The present invention receives a block establishment instruction and confirms a block establishment environment according to the block establishment instruction, wherein the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit and an energy consumption control unit. It can be seen that the present invention provides a systematic working environment for each unit by constructing a complete block establishment environment, thereby ensuring the continuity of the new block when it is established; further, the model acquisition unit is used to obtain an initial model sequence, wherein the initial model sequence includes m initial model data. It can be seen that the embodiment of the present invention determines the priority of the block corresponding to each initial model data when it is established by sorting the initial model data; the following operations are performed on the i-th initial model data in the initial model sequence in turn, wherein, , and i is an integer. Based on the i-th initial model data, the i-1th new block is confirmed, and the target model data, the target computing end and the model generation time are obtained by using the model generation unit and the initial model data. It can be seen that the embodiment of the present invention uses the computing power of the data computing end to calculate the AI ​​model data, and uses the target model data as part of the proof of work to realize computing power recovery; it is determined whether the model generation time is greater than the preset generation time threshold. If the model generation time is greater than the generation time threshold, the computing power calculation unit and the preset hash function are used to obtain the target hash value. If the model generation time is less than or equal to the generation time threshold, the computing power calculation unit, the model generation time and the generation time threshold are used to calculate the target hash value. It can be seen that the embodiment of the present invention uses the model generation time and the generation time threshold to determine the target hash value for screening subsequent update hash values; the block retrieval unit and the i-1th new block are used to obtain block data, wherein the block data is obtained by the parent block hash. The block data is composed of the hash value, block version number and timestamp. It can be seen that the embodiment of the present invention obtains the information of the previous block through the block retrieval unit and integrates it to facilitate the generation of new blocks; the target computing end, block data, target hash value and target model data are used to obtain the i-th new block. It can be seen that the embodiment of the present invention uses the process of calculating and updating the hash value as part of the computing power consumption to complete the proof of work to generate a new block; the new blocks are summarized to obtain a new block set, and the target blockchain is constructed based on the new block set to complete the computing power recovery of the blockchain data calculation. Based on the energy consumption control unit, the disabled computing end is confirmed in the target computing end corresponding to the m initial model data, and the energy consumption control of the blockchain data calculation is completed. It can be seen that after the blockchain is generated, the embodiment of the present invention retrieves the energy consumption of different target computing ends, and disables the target computing end with excessive energy consumption, which prevents some target computing ends from consuming a lot of computing power and energy consumption and maliciously competing with other target computing ends and wasting energy consumption. Therefore, the present invention can improve the utilization rate of blockchain data computing power and reduce the energy consumption and computing power waste in data calculation.

[0186] like Figure 3 As shown, it is a functional module diagram of a data computing power recovery and energy consumption control system based on AI and blockchain provided by one embodiment of the present invention.

[0187] The data computing power recovery and energy consumption control system 100 based on AI and blockchain of the present invention can be installed in an electronic device. According to the functions implemented, the data computing power recovery and energy consumption control system 100 based on AI and blockchain can include a block environment confirmation module 101, an AI model generation module 102, a target block establishment module 103 and a computing power energy consumption control module 104. The module of the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0188] The block environment confirmation module 101 is used to receive a block establishment instruction and confirm a block establishment environment according to the block establishment instruction, wherein the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit and an energy consumption control unit;

[0189] The AI ​​model generation module 102 is used to obtain an initial model sequence using a model acquisition unit, wherein the initial model sequence includes m initial model data, and sequentially performs the following operations on the i-th initial model data in the initial model sequence, wherein: , where i is an integer, an i-1th new block is identified based on the i-th initial model data, and a target model data, a target computing end and a model generation time are acquired using a model generation unit and the initial model data;

[0190] The target block establishment module 103 is used to determine whether the model generation time is greater than a preset generation time threshold. If the model generation time is greater than the generation time threshold, the target hash value is obtained by using the computing power calculation unit and the preset hash function. If the model generation time is less than or equal to the generation time threshold, the target hash value is calculated by using the computing power calculation unit, the model generation time and the generation time threshold, and the block data is obtained by using the block retrieval unit and the i-1th new block, wherein the block data consists of the parent block hash value, the block version number and the timestamp, and the i-th new block is obtained by using the target calculation end, the block data, the target hash value and the target model data;

[0191] The computing power energy consumption control module 104 is used to aggregate the new blocks corresponding to the initial model data to obtain a new block set, wherein the new block set includes m new blocks, construct a target blockchain based on the new block set, complete the computing power recovery for blockchain data calculation, and complete the energy consumption control for blockchain data calculation by confirming the disabled computing end in the target computing end corresponding to the m initial model data based on the energy consumption control unit.

[0192] In detail, each module in the data computing power recovery and energy consumption control system 100 based on AI and blockchain in the embodiment of the present invention adopts the same method as above when used. Figure 1 The data computing power recovery based on AI and blockchain and the energy consumption control method described in the text are the same technical means and can produce the same technical effects, so they will not be repeated here.

[0193] like Figure 4 , is a schematic diagram of the structure of an electronic device for implementing a method for data computing power recovery and energy consumption control based on AI and blockchain provided by one embodiment of the present invention.

[0194] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a data computing power recovery and energy consumption control method program based on AI and blockchain.

[0195] Among them, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 also includes an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the data calculation power recovery and energy consumption control method program based on AI and blockchain, but also can be used to temporarily store data that has been output or is to be output.

[0196] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, and executes or executes the programs or modules stored in the memory 11 (such as the data calculation power recovery and energy consumption control method program based on AI and blockchain, etc.), and calls the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0197] The bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 may be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0198] Figure 4 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 4 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0199] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0200] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0201] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0202] The data computing power recovery and energy consumption control method program based on AI and blockchain stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0203] Receiving a block establishment instruction, and confirming a block establishment environment according to the block establishment instruction, wherein the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit, and an energy consumption control unit;

[0204] Using a model acquisition unit to acquire an initial model sequence, wherein the initial model sequence includes m initial model data;

[0205] The following operations are performed on the i-th initial model data in the initial model sequence in sequence, where: , and i is an integer;

[0206] Based on the i-th initial model data, an i-1-th new block is identified, and a target model data, a target computing end and a model generation time are acquired using a model generation unit and the initial model data;

[0207] Determine whether the model generation time is greater than a preset generation time threshold;

[0208] If the model generation time is greater than the generation time threshold, the target hash value is obtained using the computing power calculation unit and the preset hash function;

[0209] If the model generation time is less than or equal to the generation time threshold, the target hash value is calculated using the computing power calculation unit, the model generation time and the generation time threshold;

[0210] Obtain block data using the block retrieval unit and the i-1th new block, where the block data consists of the parent block hash value, block version number and timestamp;

[0211] Obtain the i-th new block using the target computing end, block data, target hash value and target model data;

[0212] The new blocks corresponding to the initial model data are aggregated to obtain a new block set, wherein the new block set includes m new blocks, a target blockchain is constructed based on the new block set, computing power recovery for blockchain data calculation is completed, and the energy consumption control unit is used to confirm the disabled computing end in the target computing end corresponding to the m initial model data, thereby completing the energy consumption control for blockchain data calculation.

[0213] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figures 1 to 4 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0214] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0215] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0216] Receiving a block establishment instruction, and confirming a block establishment environment according to the block establishment instruction, wherein the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit, and an energy consumption control unit;

[0217] Using a model acquisition unit to acquire an initial model sequence, wherein the initial model sequence includes m initial model data;

[0218] The following operations are performed on the i-th initial model data in the initial model sequence in sequence, where: , and i is an integer;

[0219] Based on the i-th initial model data, an i-1-th new block is identified, and a target model data, a target computing end and a model generation time are acquired using a model generation unit and the initial model data;

[0220] Determine whether the model generation time is greater than a preset generation time threshold;

[0221] If the model generation time is greater than the generation time threshold, the target hash value is obtained using the computing power calculation unit and the preset hash function;

[0222] If the model generation time is less than or equal to the generation time threshold, the target hash value is calculated using the computing power calculation unit, the model generation time and the generation time threshold;

[0223] Obtain block data using the block retrieval unit and the i-1th new block, where the block data consists of the parent block hash value, block version number and timestamp;

[0224] Obtain the i-th new block using the target computing end, block data, target hash value and target model data;

[0225] The new blocks corresponding to the initial model data are aggregated to obtain a new block set, wherein the new block set includes m new blocks, a target blockchain is constructed based on the new block set, computing power recovery for blockchain data calculation is completed, and the energy consumption control unit is used to confirm the disabled computing end in the target computing end corresponding to the m initial model data, thereby completing the energy consumption control for blockchain data calculation.

[0226] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the system embodiments described above are only illustrative, and actual implementation may have other division methods.

[0227] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0228] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0229] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0230] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A data computing power recovery and energy consumption control method based on AI and blockchain, characterized in that: The method comprises: Receiving a block establishment instruction, and confirming a block establishment environment according to the block establishment instruction, wherein the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit, and an energy consumption control unit; Using a model acquisition unit to acquire an initial model sequence, wherein the initial model sequence includes m initial model data; The following operations are performed on the i-th initial model data in the initial model sequence in sequence, where: , and i is an integer; Based on the i-th initial model data, an i-1-th new block is identified, and a target model data, a target computing end and a model generation time are acquired using a model generation unit and the initial model data; Determine whether the model generation time is greater than a preset generation time threshold; If the model generation time is greater than the generation time threshold, the target hash value is obtained using the computing power calculation unit and the preset hash function; If the model generation time is less than or equal to the generation time threshold, the target hash value is calculated using the computing power calculation unit, the model generation time and the generation time threshold; Obtain block data using the block retrieval unit and the i-1th new block, where the block data consists of the parent block hash value, block version number and timestamp; Obtain the i-th new block using the target computing end, block data, target hash value and target model data; Summarize the new blocks corresponding to the initial model data to obtain a new block set, wherein the new block set includes m new blocks, build a target blockchain based on the new block set, complete the computing power recovery of blockchain data calculation, and confirm the disabled computing end in the target computing end corresponding to the m initial model data based on the energy consumption control unit, and complete the energy consumption control of blockchain data calculation; The method of using the model generation unit and the initial model data to obtain the target model data, the target computing end and the model generation time includes: Starting a model generation unit, wherein the model generation unit is composed of a data receiving end and a model verification end connected to n different data computing ends; The initial model data is sent to each of n different data computing terminals, wherein the data receiving terminal is used to receive the AI ​​model data calculated by the n different data computing terminals, and the time when the initial model data is sent to each of the n different data computing terminals is taken as the initial time, and the initial time is taken as the starting point and the time is recorded in real time to obtain the operation time, and a first time threshold is preset, and the AI ​​model data corresponds to the data computing terminal one by one; Detect in real time whether the data receiving end has received the AI ​​model data calculated by one of the n different data computing ends; When it is detected that the data receiving end receives the AI ​​model data, the data receiving end sends the received AI model data to the model verification end, and uses the model verification end to determine whether the AI ​​model data meets a preset first model threshold; If the AI ​​model data meets the first model threshold, the data receiving end is closed, and the operation time is used as the model generation time, the AI ​​model data that meets the first model threshold is used as the target model data, and the data computing end corresponding to the AI ​​model data is used as the target computing end; If the AI ​​model data does not meet the first model threshold, the AI ​​model data that does not meet the first model threshold is recorded as the first model data, and the step of detecting in real time whether the data receiving end has received the AI ​​model data calculated by one of the n different data computing ends is returned until the operation time reaches the first time threshold and the received AI model data do not meet the first model threshold, then the first model data is aggregated to obtain a first model data set, and the second model threshold is calculated by the first model threshold; The following operations are performed on the first model data in the first model data set: Using the first time threshold to obtain the second time threshold, wherein the second time threshold is twice the first time threshold, the second time threshold is used as the first time threshold, the first model data is used as the AI ​​model data, and the second model threshold is used as the first model threshold, and returning to the step of detecting in real time whether the data receiving end has received the AI ​​model data calculated by one of the n different data computing ends until the AI ​​model data meets the first model threshold; The method of calculating the target hash value by using the computing power calculation unit, the model generation time and the generation time threshold includes: Obtaining a conversion hash value using a computing power calculation unit and a preset initial hash value, wherein the conversion hash value is the initial hash value in decimal; The relay hash value is calculated using the model generation time, generation time threshold, and conversion hash value. The calculation formula is as follows: ; in, is the relay hash value, To convert the hash value, is the generation time threshold; Generate time for the model; The target hash value is obtained by using the computing power calculation unit and the relay hash value, wherein the target hash value is the relay hash value in hexadecimal.

2. The data computing power recovery and energy consumption control method based on AI and blockchain as claimed in claim 1 is characterized in that: The step of acquiring the initial model sequence using the model acquisition unit includes: Starting a model acquisition unit, wherein the model acquisition unit is composed of a model analyzer connected to m clients; Using m clients to obtain m initial model data, and the initial model data corresponds to the client one by one, wherein the initial model data includes M samples, an initial model architecture and an evaluation value; The following operations are performed on each of the m initial model data: The model complexity is calculated using the model analyzer, M samples and the initial model architecture. The calculation formula is as follows: ; in, is the model complexity, is the breadth of the initial model architecture, is the depth of the initial model architecture, is the feature dimension of the Jth sample among M samples, where , and J and M are integers; The model priority is calculated using the model complexity and evaluation value. The calculation formula is as follows: ; in, is the model priority, is the preset optimal complexity, is the evaluation value; Summarizing m model priorities corresponding to m initial model data to obtain a model priority set, performing a sorting operation on the m model priorities in the model priority set in ascending order to obtain a model priority sequence, and confirming an initial model sequence based on the model priority sequence, wherein the initial model data in the initial model sequence correspond to the model priorities in the model priority sequence one by one; The initial model sequence is as follows: ; in, , and They respectively represent the first, second and mth initial model data in the initial model sequence.

3. The data computing power recovery and energy consumption control method based on AI and blockchain as claimed in claim 1 is characterized in that: The using the model verification end to determine whether the AI ​​model data meets a preset first model threshold includes: Start the model verification end, where the model verification end includes a test set and a verification set; When the model verification end receives the AI ​​model data, it inputs the test set into the AI ​​model data to obtain the output set; Using the output set and the validation set to obtain the model accuracy, and comparing the model accuracy with the first model threshold; If the model accuracy is greater than or equal to the first model threshold, the AI ​​model data meets the first model threshold; If the model accuracy is less than the first model threshold, the AI ​​model data does not meet the first model threshold.

4. The data computing power recovery and energy consumption control method based on AI and blockchain as claimed in claim 3 is characterized in that: The second model threshold is calculated from the first model threshold, and the calculation formula is as follows: ; in, is the second model threshold, is the first model threshold.

5. The data computing power recovery and energy consumption control method based on AI and blockchain as claimed in claim 4 is characterized in that: The method of obtaining block data by using the block retrieval unit and the i-1th new block includes: Start the block retrieval unit, use the block retrieval unit to retrieve the i-1th new block, obtain the parent block hash value and block version number, and use the time when the block retrieval unit retrieves the i-1th new block as the timestamp; The parent block hash value, block version number and timestamp are used as block data.

6. The data computing power recovery and energy consumption control method based on AI and blockchain as claimed in claim 5 is characterized in that: The method of obtaining the i-th new block by using the target computing end, block data, target hash value and target model data includes: Placing the preset second hash function into the target computing end to obtain a function computing end; Calculate the information hash value using the function computing end, target model data, and pre-acquired transaction information; Get any random number and use the function calculation end, block data, information hash value and random number calculation to update the hash value; Compare the updated hash value with the target hash value; If the updated hash value is greater than or equal to the target hash value, return to the step of obtaining any random number until the updated hash value is less than the target hash value, and use the any random number as the target random number; The target random number, block data, target hash value and information hash value are combined to obtain the block header, the target model data and transaction information are combined to obtain the block body, and the block header and block body are combined to obtain the i-th new block.

7. The data computing power recovery and energy consumption control method based on AI and blockchain as claimed in claim 6 is characterized in that: The energy consumption control unit confirms the disabled computing end among the target computing ends corresponding to the m initial model data, including: The following operations are performed on each of the target computing ends corresponding to the m initial model data: The target computing end is used to obtain the operating energy consumption and operating time, and the energy consumption rate is calculated using the energy consumption control unit, operating energy consumption and operating time. The calculation formula is as follows; ; in, is the energy consumption rate, a is the preset weight coefficient, Q is the operating energy consumption, is the running time, is the preset energy consumption reference value; Summarize the energy consumption rates to obtain an energy consumption rate set, and perform a sorting operation on the m energy consumption rates in the energy consumption rate set in descending order to obtain an energy consumption rate sequence; The first five energy consumption rates in the energy consumption rate sequence are selected, and the target computing end corresponding to each energy consumption rate in the first five energy consumption rates is used as the disabled computing end.

8. A data computing power recovery and energy consumption control system based on AI and blockchain, characterized in that: The method for data computing power recovery and energy consumption control based on AI and blockchain according to any one of claims 1 to 7 is used, and the system comprises: A block environment confirmation module, used to receive a block establishment instruction, and confirm a block establishment environment according to the block establishment instruction, wherein the block establishment environment includes: a model acquisition unit, a model generation unit, a computing power calculation unit, a block retrieval unit, and an energy consumption control unit; The AI ​​model generation module is used to obtain an initial model sequence using a model acquisition unit, wherein the initial model sequence includes m initial model data, and sequentially performs the following operations on the i-th initial model data in the initial model sequence, wherein: , where i is an integer, an i-1th new block is identified based on the i-th initial model data, and a target model data, a target computing end and a model generation time are acquired using a model generation unit and the initial model data; The target block establishment module is used to determine whether the model generation time is greater than the preset generation time threshold. If the model generation time is greater than the generation time threshold, the target hash value is obtained by using the computing power calculation unit and the preset hash function. If the model generation time is less than or equal to the generation time threshold, the target hash value is calculated by using the computing power calculation unit, the model generation time and the generation time threshold, and the block retrieval unit and the i-1th new block are used to obtain block data, wherein the block data consists of the parent block hash value, the block version number and the timestamp, and the i-th new block is obtained by using the target calculation end, the block data, the target hash value and the target model data; The computing power energy consumption control module is used to summarize the new blocks corresponding to the initial model data to obtain a new block set, wherein the new block set includes m new blocks, build a target blockchain based on the new block set, complete the computing power recovery for blockchain data calculation, and complete the energy consumption control for blockchain data calculation by confirming the disabled computing end in the target computing end corresponding to the m initial model data based on the energy consumption control unit.

Citation Information

Patent Citations

  • Verifiable calculation energy consumption optimization method based on block chain

    CN111800274A

  • High-performance computing power data processing system based on block chain

    CN117113434A

  • Digital archive system based on block chain

    CN118350047A