WO2022247069A1 - Blockchain-based mining method and apparatus, and mobile terminal and storage medium - Google Patents

Blockchain-based mining method and apparatus, and mobile terminal and storage medium Download PDF

Info

Publication number
WO2022247069A1
WO2022247069A1 PCT/CN2021/119096 CN2021119096W WO2022247069A1 WO 2022247069 A1 WO2022247069 A1 WO 2022247069A1 CN 2021119096 W CN2021119096 W CN 2021119096W WO 2022247069 A1 WO2022247069 A1 WO 2022247069A1
Authority
WO
WIPO (PCT)
Prior art keywords
mobile terminal
block
target mobile
information
identity information
Prior art date
Application number
PCT/CN2021/119096
Other languages
French (fr)
Chinese (zh)
Inventor
宋轩
邹若彤
张浩然
庄湛
云沐晟
潘泰仰
Original Assignee
南方科技大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 南方科技大学 filed Critical 南方科技大学
Publication of WO2022247069A1 publication Critical patent/WO2022247069A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • Embodiments of the present invention relate to the technical field of blockchain, and in particular, to a blockchain-based mining method, device, mobile terminal, and storage medium.
  • Blockchain is a distributed data storage technology model based on P2P network, consensus mechanism, encryption algorithm and other technologies that is jointly participated and maintained by many network nodes.
  • Its consensus mechanism refers to the consensus reached among all bookkeeping nodes to determine the validity of the blockchain content, which is an important mechanism to ensure the stable operation of the blockchain.
  • the most commonly used consensus mechanisms are Proof of Work (POW), Proof of Stake (POS), and Delegated Proof of Stake (DPOS).
  • POW is the most commonly used, and its core design idea is to propose a computational problem with asymmetric characteristics, that is, it is difficult to find the answer to this problem, but it is very easy to verify the answer to this problem.
  • the mining algorithms applicable to the POW consensus mechanism are roughly divided into two categories.
  • the first category is called computational difficulty
  • the second category is called memory difficulty.
  • the algorithms of these two methods are simple and easy to implement, neither of them produces any real social value, and wastes a lot of computing power and power resources, making it difficult to shorten the block confirmation time.
  • the blockchain system designed based on the original POW consensus mechanism scheme is also vulnerable to computing power attacks and bifurcation attacks of the Bitcoin network .
  • Embodiments of the present invention provide a blockchain-based mining method, device, mobile terminal, and storage medium to solve problems such as waste of computing power and power resources, high computational difficulty, and vulnerability to attacks caused during the mining process.
  • the embodiment of the present invention provides a blockchain-based mining method, the method comprising:
  • Judging whether close interaction occurs with the target mobile terminal if so, obtaining the identity information of the target mobile terminal; sending the identity information of the target mobile terminal to a server, and receiving the target mobile terminal returned by the server encrypted identity information;
  • the block to be generated is generated.
  • the embodiment of the present invention also provides a blockchain-based mining device, which includes:
  • the information acquisition module is used to obtain the block header information of the block to be generated released by the block chain;
  • a close interaction determination module configured to determine whether close interaction occurs with the target mobile terminal, and if so, obtain the identity information of the target mobile terminal;
  • An information encryption module configured to send the identity information of the target mobile terminal to a server, and receive the encrypted identity information of the target mobile terminal returned by the server;
  • An information generating module configured to generate physical interaction information according to the encrypted identity information of the target mobile terminal and its own encrypted identity information and store it locally;
  • a random item generating module configured to generate a random item according to the locally stored physical interaction information
  • a hash value calculation module configured to calculate a hash value according to the block header information and the random item
  • a block generation module configured to generate the block to be generated if the hash value satisfies the block generation condition.
  • the embodiment of the present invention also provides a mobile terminal, the mobile terminal includes:
  • processors one or more processors
  • memory for storing one or more programs
  • the one or more processors implement the blockchain-based mining method provided by any embodiment of the present invention.
  • the embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the blockchain-based mining method provided by any embodiment of the present invention is implemented. .
  • the embodiment of the present invention provides a blockchain-based mining method. Firstly, the block header information of the block to be generated issued by the blockchain is obtained, and then it is judged whether there is a close interaction between the mobile terminal and the target mobile terminal. , then obtain the identity information of the target mobile terminal, and then send the identity information to the server to receive the corresponding encrypted identity information returned by the server, and then use the encrypted identity information of the target mobile terminal and its own encrypted identity information to generate physical interaction information storage Locally, a random item is generated according to the locally stored physical interaction information, and a hash value is calculated according to the obtained block header information and the generated random item, so as to generate a block to be generated when the hash value meets the block generation condition.
  • the method provided by the embodiment of the present invention uses the random items generated by the close physical interaction information between miners to replace the random items generated at high speed by using a large number of computing resources in the traditional method to carry out blockchain mining, based on the real-world physical interaction Finiteness and confidence to ensure the equality of mining equipment, thereby reducing the dependence of the mining process on computing power, and lowering the threshold for mining, that is, reducing the cost of mining and increasing the enthusiasm of users to participate in mining.
  • super computing power nodes are not easy to appear, which makes the computing power dispersed and can effectively prevent attacks.
  • the private information of the user can be kept confidential, thereby improving the security of user information.
  • Fig. 1 is the flowchart of the blockchain-based mining method provided by Embodiment 1 of the present invention
  • FIG. 2 is a schematic structural diagram of a blockchain-based mining device provided in Embodiment 2 of the present invention.
  • FIG. 3 is a schematic structural diagram of a mobile terminal provided by Embodiment 3 of the present invention.
  • FIG. 1 is a flowchart of a blockchain-based mining method provided by Embodiment 1 of the present invention.
  • This embodiment can be applied to the situation where common mobile devices are used for mining through physical interaction, and the method can be executed by the blockchain-based mining device provided by the embodiment of the present invention, which can be implemented by hardware and/or software Generally, it can be integrated into a mobile terminal, which can be, but not limited to, various notebook computers, smart phones, tablet computers, and portable wearable devices. As shown in Figure 1, it specifically includes the following steps:
  • the block header information may include block version number, parent block hash value, Merkle tree root hash value, timestamp, difficulty target, etc.
  • block generation conditions can be determined according to the block header information.
  • the hash calculation of the block header can be performed through the secure hash algorithm SHA-256, and the block generation condition can be that the calculated 256-bit value is less than the difficulty target in the block header information.
  • the mining difficulty can be adjusted periodically, that is, the required difficulty target can be re-determined. For example, assume that the preset time is expected_time, and every N An adjustment is made after each block, and the adjustment period is about expected_time/1440N days, which can be adjusted by the following formula:
  • target represents the new difficulty target
  • current_target represents the current difficulty target
  • actual_time represents the real average block generation time.
  • the difficulty target is regularly adjusted up or down through the above formula, so that the block generation time tends to be stable.
  • close interaction can be an interactive state that lasts for a preset duration within a preset distance range.
  • close interaction can be an interactive state that lasts for a preset duration within a preset distance range.
  • the identity information may be information such as a hardware address (Media Access Control Address, MAC) of the mobile terminal that can uniquely determine the identity of the terminal.
  • MAC Media Access Control Address
  • the close interaction can be based on the close interaction determined by Bluetooth, then when the mobile terminal participates in the mining process, it can scan other devices through Bluetooth, and collect the MAC address of the other party when the close interaction occurs .
  • judging whether close interaction occurs with the target mobile terminal includes: obtaining the Bluetooth strength and motion state of the target mobile terminal; and judging whether close interaction occurs with the target mobile terminal according to the Bluetooth strength and motion state.
  • signals such as Bluetooth strength and motion status of the target mobile terminal can be used to judge whether close interaction occurs, and further, its own motion state can be added for comparison to improve the accuracy of close interaction determination.
  • the motion state may be the acceleration of the mobile terminal and the like.
  • d represents the measurement distance
  • RSSI represents the Bluetooth strength
  • abs() represents the absolute value
  • a represents the signal strength at a distance of one meter
  • n represents the environmental attenuation factor.
  • judging whether a close interaction occurs with the target mobile terminal according to the Bluetooth strength and motion state includes: inputting the Bluetooth strength and motion state into the trained deep learning model to obtain a predicted close interaction probability, and according to the close interaction
  • the interaction probability judges whether close interaction occurs with the target mobile terminal.
  • this embodiment can further propose a method for predicting the close interaction probability, which can be implemented specifically by using a trained deep learning model.
  • the deep learning model can be a deep neural network (Deep Neural Networks, DNN), etc.
  • the input can be the Bluetooth strength and motion status signals collected by the mobile terminal of the mining user through Bluetooth broadcasting, and the output is the close interaction probability.
  • a probability value can be obtained, so that the current mobile terminal and the target mobile terminal can be more accurately analyzed according to this probability value Possibility of close interaction between them.
  • the target mobile terminal before obtaining the identity information of the target mobile terminal, it also includes: if it is determined that there is a close interaction with the target mobile terminal, then obtaining the side channel data of the target mobile terminal; combining the side channel data of the target mobile terminal with its own The side channel data is sent to the server, and the validity result of the close interaction determined and obtained according to the side channel data of the target mobile terminal and its own side channel data returned by the server is received.
  • the side channel data refers to the interaction data of other channels generated when there is close interaction with the target mobile terminal.
  • These data can be stored in the storage space of the mobile terminal, and specifically can include GPS data and WiFi data, etc., side channel data It can enhance the probability of a real event happening and being recognized. Then, when it is determined by any of the above methods that close interaction has occurred between the mobile terminal and the target mobile terminal, the side channel data of the target mobile terminal can be obtained and stored locally, and at the same time, its own side channel data can be collected to map the side channel data of the target mobile terminal.
  • the channel data and its own side channel data are sent to the server, and the confidence algorithm in the server is used to judge whether the two parties in the close interaction actually interact, that is, to determine whether the current close interaction is an effective close interaction, thereby improving the credibility and fairness of the mining process sex.
  • the server After the server completes the judgment, it can return the validity result of the corresponding close interaction to the mobile terminal, so that the mobile terminal can determine whether to trigger subsequent events according to the validity result, specifically, only when the validity result is valid , obtain the identity information of the target mobile terminal, and then generate physical interaction information and generate random numbers, etc., if the validity result is invalid, it is not considered that there is close interaction between the mobile terminal and the target mobile terminal, and the subsequent mining process.
  • the identity information of the target mobile terminal can be sent to the server to encrypt the identity information, thereby protecting the user's private information.
  • an encryption method such as AES can be used to encrypt Identity information is encrypted.
  • a relational database including identity information and encrypted identity information can be maintained on the server side, so that the mobile terminal can use the obtained identity information of the target mobile terminal to obtain a unique encrypted identity information.
  • the mobile terminal obtains the encrypted identity information of the target mobile terminal, it can be stored locally, and the user of the mobile terminal is restricted from viewing the identity information of other mining users locally.
  • the mobile terminal can send its own identity information to the server before participating in mining, so as to obtain its own encrypted identity information and store it locally for future use.
  • the server may not record or store private information such as the number of close contacts, close contact locations, and close contact objects of the user, so as to protect the privacy of the user.
  • the mobile terminal can generate a new physical interaction information and store it locally after each acquisition of the encrypted identity information of the target mobile terminal, that is, all the physical interaction information generated after starting to participate in mining can be stored locally.
  • the amount of stored physical interaction information can be limited. Specifically, the earlier physical interaction information can be deleted in the order of generation time.
  • the generation time of the stored physical interaction information can also be limited. Specifically, the physical interaction information before the preset time range can be deleted. Information is removed so that recent physical interaction information can be used later to generate random items.
  • the mobile terminal can generate random items according to locally stored physical interaction information, different physical interaction information can be randomly arranged, and the generated random items can form a block header together with previously obtained block header information.
  • the hash value of the reconstructed block header can be calculated through the secure hash algorithm SHA-256.
  • the block generation condition can be that the 256-bit value generated by the calculation determined above is smaller than the difficulty target in the block header information.
  • the block to be generated is generated. If not, you can change the order of physical interaction information to regenerate random items, and calculate the hash value again to determine whether it can meet the block production conditions until a miner successfully completes the block production.
  • the block includes a block header and a block body, and the block body mainly contains transaction information.
  • the transaction information is stored in a Merkle tree, so that nodes can verify the packaged transaction data.
  • the block to be generated after generating the block to be generated if the hash value satisfies the block generation condition, it also includes: confirming that the block to be generated has completed block generation according to the preset block generation confirmation mechanism; Random items are used to settle block rewards.
  • new transactions will be broadcast to all nodes, and each node will collect new transactions into a block.
  • a node solves the block problem according to the generated random items, then Generate the block to be generated and broadcast the block to be generated to all nodes. All nodes accept the block to be generated only when all transactions in the block to be generated are verified by hash and there are no invalid transactions such as double-spending transactions.
  • settlement of block rewards is based on random items, including: distributing block rewards to block miners and other miners participating in the generation of random items according to the preset distribution ratio; The contribution of the number of close interactions in the process is redistributed to the block rewards distributed by other miners.
  • 50% of the block reward can be allocated to the block miners, and the other 50% can be allocated to other miners participating in the generation of random items, and can be based on other miners in the process of generating random items
  • the contribution of the number of close interactions is redistributed to the 50% of the block rewards allocated by other miners, and can be distributed according to the following distribution formula:
  • r represents the reward that some other miner can get
  • t represents the number of close interactions contributed by the other miner in the process of generating random items
  • T represents the total number of close interactions used to generate random items, that is, the physical interaction information used
  • the amount of , R represents the block reward distributed by all other miners.
  • the method also includes: creating a volunteer user, and the volunteer user enables the authority to obtain the number of real-time close interactions; randomly select at least one sample from the volunteer users as a benchmark volunteer user; set the benchmark volunteer user's real-time The median of the number of close interactions is determined as the benchmark number of interactions; correspondingly, the settlement of block rewards is based on random items, including: settlement of block rewards based on random items and benchmark interactions; in accordance with the preset block confirmation mechanism After confirming that the block to be generated is completed, it also includes: settlement of the sharing rewards of the benchmark volunteer users according to the real-time close interaction times and the benchmark interaction times of each benchmark volunteer user, and the sharing reward changes linearly with the block reward.
  • a volunteer user can be an attribute obtained by an ordinary user applying for sharing rewards from the server, and is a user of the same level as an ordinary user. After receiving an application from an ordinary user, a corresponding volunteer user can be created for the ordinary user.
  • volunteer users can cancel their sharing permissions at any time and actively change to ordinary users. At this time, the number of real-time close interactions will no longer be recorded.
  • the preset maximum number of interactions can be determined by the 3 ⁇ confidence interval range of the daily contact times of all volunteers selected in the same period of the previous day. In particular, when the data is large enough, the daily contact times of all volunteer users will conform to the normal distributed.
  • a certain sample can be randomly selected from volunteer users as a benchmark volunteer user. By re-random selection before each block is produced, some users can be prevented from being used as benchmark volunteer users for a long time, making the standard used each time more authentic and reliable.
  • the median of the real-time close interactions of all benchmark volunteer users can be determined as the benchmark interaction times, which is used for adjustment of subsequent block rewards.
  • the determined benchmark interaction times can be recorded in In the block header information.
  • the amount of block rewards is related to the distribution of the close interaction times of all users on that day.
  • the number of incentive interactions can be set according to the determined benchmark interaction times to adjust the block rewards. Specifically, the following formula can be applied:
  • P represents the number of incentive interactions
  • M represents the number of benchmark interactions
  • K represents the adjustment factor
  • the specific value of the adjustment factor can be determined by the user scale and the number of daily close interactions of users. The average daily close interaction of all users on that day The closer the number of interactions is to the number of incentive interactions, the higher the block reward.
  • the initial block reward can be an ideal reward value, and the ideal reward value will be halved every time a certain block is generated, and the current block reward should not be higher than the ideal reward value.
  • the volunteer users selected as the benchmark can obtain a certain sharing reward, which can change linearly with the actual block generation reward and is shared by all benchmark volunteer users.
  • the sharing reward can be settled according to the following formula:
  • A represents the proximity value
  • L represents the number of real-time close interactions provided by a benchmark volunteer user
  • M represents the number of benchmark interactions
  • s represents the sharing reward that the benchmark volunteer user can get
  • a sum represents the sum of all benchmark volunteer users Close to the sum of values
  • S represents the total sharing reward. That is, when the number of real-time close interactions of the benchmark volunteer user is closer to the benchmark number of interactions, the more sharing rewards can be obtained.
  • packaging rewards can also be set, that is, when the blocks are successfully distributed and the block rewards are distributed, certain rewards can be obtained according to the total amount of transactions packaged by the user. Similar to the Gas mechanism of the Ethereum system, the user's transactions The probability of being verified and packaged faster can be obtained by increasing the paid Gas value, and part of the Gas is used as a packaging reward.
  • the method provided in this embodiment has the characteristics of light weight because the physical interaction technology can only be applied to mobile devices, and the computing power of mobile devices is relatively small and the amount of packaged transaction data in each block is small.
  • the popularity of mobile devices is high and the threshold for use is low, which can attract more users to participate in mining in daily life and increase the scale of users, thereby realizing the dispersion of computing power and enhancing system security.
  • Based on the lightweight characteristics of this method it is suitable for blockchain-Internet of Things technology, and supports mobile devices for large-scale users of the Internet of Things.
  • the distributed computing power of large-scale users, as well as the limitation and confidence of physical interaction can prevent malicious attacks and bring system security, so that it can have more and wider applications in smart cities and smart medical care.
  • the technical solution provided by the embodiment of the present invention first obtains the block header information of the block to be generated released by the block chain, and then judges whether close interaction occurs between the mobile terminal and the target mobile terminal, and if so, obtains the target mobile terminal Then send the identity information to the server to receive the corresponding encrypted identity information returned by the server, and then use the encrypted identity information of the target mobile terminal and its own encrypted identity information to generate physical interaction information and store it locally, so that according to the local storage
  • the physical interaction information generates random items, and calculates the hash value according to the obtained block header information and the generated random items, so as to generate the block to be generated when the hash value meets the block generation conditions.
  • the mining is guaranteed based on the limitation and confidence of the physical interaction in the real world
  • the equipment is equal, thereby reducing the dependence of the mining process on computing power, and lowering the mining threshold, that is, reducing the cost of mining and increasing the enthusiasm of users to participate in mining.
  • super computing power nodes are not easy to appear, which makes the computing power dispersed and can effectively prevent attacks.
  • the private information of the user can be kept confidential, thereby improving the security of user information.
  • Fig. 2 is a schematic structural diagram of a block chain-based mining device provided by Embodiment 2 of the present invention.
  • the device can be implemented by hardware and/or software, and generally can be integrated into a mobile terminal to execute any of the present invention.
  • the mobile terminal can be, but not limited to, various notebook computers, smart phones, tablet computers, and portable wearable devices.
  • the device includes:
  • the information acquisition module 21 is used to acquire the block header information of the blocks to be generated issued by the block chain;
  • the close interaction judgment module 22 is used to judge whether there is a close interaction with the target mobile terminal, if so, obtain the identity information of the target mobile terminal;
  • the information encryption module 23 is used for sending the identity information of the target mobile terminal to the server, and receiving the encrypted identity information of the target mobile terminal returned by the server;
  • the information generation module 24 is used to generate physical interaction information according to the encrypted identity information of the target mobile terminal and its own encrypted identity information and store it locally;
  • a random item generating module 25 configured to generate random items according to locally stored physical interaction information
  • Hash value calculation module 26 for calculating the hash value according to block header information and random items
  • the block generating module 27 is configured to generate a block to be generated if the hash value satisfies the block generation condition.
  • the technical solution provided by the embodiment of the present invention first obtains the block header information of the block to be generated released by the block chain, and then judges whether close interaction occurs between the mobile terminal and the target mobile terminal, and if so, obtains the target mobile terminal Then send the identity information to the server to receive the corresponding encrypted identity information returned by the server, and then use the encrypted identity information of the target mobile terminal and its own encrypted identity information to generate physical interaction information and store it locally, so that according to the local storage
  • the physical interaction information generates random items, and calculates the hash value according to the obtained block header information and the generated random items, so as to generate the block to be generated when the hash value meets the block generation conditions.
  • the mining is guaranteed based on the limitation and confidence of the physical interaction in the real world
  • the equipment is equal, thereby reducing the dependence of the mining process on computing power, and lowering the mining threshold, that is, reducing the cost of mining and increasing the enthusiasm of users to participate in mining.
  • super computing power nodes are not easy to appear, which makes the computing power dispersed and can effectively prevent attacks.
  • the private information of the user can be kept confidential, thereby improving the security of user information.
  • the close interaction determination module 22 includes:
  • a data acquisition unit configured to acquire the Bluetooth strength and motion status of the target mobile terminal
  • the close interaction determination unit is configured to determine whether close interaction occurs with the target mobile terminal according to the Bluetooth strength and motion state.
  • the close interaction determination unit is specifically used for:
  • the blockchain-based mining device also includes:
  • the side channel data acquisition module is used to acquire the side channel data of the target mobile terminal if it is determined that there is close interaction with the target mobile terminal before acquiring the identity information of the target mobile terminal;
  • the close connection validity determination module is used to send the side channel data of the target mobile terminal and its own side channel data to the server, and receive the close interaction determined by the side channel data of the target mobile terminal and its own side channel data returned by the server effectiveness results.
  • the blockchain-based mining device also includes:
  • the block confirmation module is used to confirm that the block to be generated is completed according to the preset block confirmation mechanism after the block to be generated is generated if the hash value satisfies the block generation condition;
  • the block reward settlement module is used to settle the block reward according to random items.
  • the optional block reward settlement module includes:
  • a block reward allocation unit is used to distribute block rewards to block miners and other miners participating in random item generation according to the preset distribution ratio
  • the redistribution unit is used to redistribute the block rewards allocated to other miners according to the contribution of the close interaction times of each miner in the process of generating random items.
  • the blockchain-based mining device also includes:
  • Volunteer user creation module which is used to create volunteer users, and volunteer users have the authority to obtain the number of real-time intimate interactions
  • the benchmark volunteer user selection module is used to randomly select at least one sample from the volunteer users as the benchmark volunteer user;
  • the benchmark interaction number determination module is used to determine the median of the real-time close interaction times of the benchmark volunteer users as the benchmark number of interactions;
  • block reward settlement module is specifically used for:
  • the blockchain-based mining device also includes:
  • the sharing reward settlement module is used to settle the sharing rewards of the benchmark volunteer users according to the real-time close interaction times and the benchmark interaction times of each benchmark volunteer user after confirming that the block to be generated is completed according to the preset block confirmation mechanism , the sharing reward changes linearly with the block reward.
  • the blockchain-based mining device provided by the embodiments of the present invention can execute the blockchain-based mining method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
  • the included units and modules are only divided according to functional logic, but are not limited to the above-mentioned divisions, as long as the corresponding functions can be realized
  • the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present invention.
  • Fig. 3 is a schematic structural diagram of a mobile terminal provided by Embodiment 3 of the present invention, showing a block diagram of an exemplary mobile terminal suitable for implementing the embodiments of the present invention.
  • the mobile terminal shown in FIG. 3 is only an example, and should not limit the functions and scope of use of this embodiment of the present invention.
  • the mobile terminal includes a processor 31, a memory 32, an input device 33, and an output device 34; the number of processors 31 in the mobile terminal can be one or more, and one processor 31 is taken as an example in Figure 3 , the processor 31, the memory 32, the input device 33 and the output device 34 in the mobile terminal may be connected through a bus or in other ways. In FIG. 3, connection through a bus is taken as an example.
  • the memory 32 can be used to store software programs, computer-executable programs and modules, such as program instructions/modules corresponding to the blockchain-based mining method in the embodiment of the present invention (for example, based on the block chain Information acquisition module 21, close interaction determination module 22, information encryption module 23, information generation module 24, random item generation module 25, hash value calculation module 26 and block generation module 27) in the block chain mining device.
  • the processor 31 executes various functional applications and data processing of the mobile terminal by running the software programs, instructions and modules stored in the memory 32, that is, realizes the aforementioned blockchain-based mining method.
  • the memory 32 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required by a function; the data storage area may store data created according to the use of the mobile terminal, and the like.
  • the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices.
  • the memory 32 may further include a memory that is set remotely relative to the processor 31, and these remote memories may be connected to the mobile terminal through a network.
  • Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 33 can be used to obtain the block header information of the blocks to be generated issued by the block chain, and to generate key signal inputs related to user settings and function control of the mobile terminal.
  • the output device 34 can be used for broadcasting the generated blocks and so on.
  • Embodiment 4 of the present invention also provides a storage medium containing computer-executable instructions, the computer-executable instructions are used to execute a blockchain-based mining method when executed by a computer processor, the method comprising:
  • the storage medium may be any of various types of memory devices or storage devices.
  • the term "storage medium” is intended to include: installation media such as CD-ROMs, floppy disks, or tape drives; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc. ; non-volatile memory, such as flash memory, magnetic media (eg hard disk or optical storage); registers or other similar types of memory elements, etc.
  • the storage medium may also include other types of memory or combinations thereof.
  • the storage medium may be located in a computer system in which the program is executed, or may be located in a different second computer system connected to the computer system through a network such as the Internet.
  • the second computer system may provide program instructions to the computer for execution.
  • storage medium may include two or more storage media that may reside in different locations, such as in different computer systems connected by a network.
  • the storage medium may store program instructions (eg embodied as computer programs) executable by one or more processors.
  • a storage medium containing computer-executable instructions provided by an embodiment of the present invention
  • the computer-executable instructions are not limited to the method operations described above, and can also execute the blockchain-based blockchain provided by any embodiment of the present invention. Related operations in the mining method.
  • a computer readable signal medium may include a data signal carrying computer readable program code in baseband or as part of a carrier wave. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. .
  • Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • the present invention can be realized by means of software and necessary general-purpose hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment .
  • the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a floppy disk of a computer , read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disc, etc., including several instructions to make a computer device (which can be a personal computer) , server, or network device, etc.) execute the methods described in various embodiments of the present invention.
  • a computer-readable storage medium such as a floppy disk of a computer , read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disc, etc.

Abstract

Disclosed in the embodiments of the present invention are a blockchain-based mining method and apparatus, and a mobile terminal and a storage medium. The method comprises: acquiring block header information, which is released by a blockchain, of a block to be generated; determining whether close interaction with a target mobile terminal occurs, and if so, acquiring identity information of the target mobile terminal; sending the identity information of the target mobile terminal to a server, and receiving encrypted identity information of the target mobile terminal that is returned by the server; generating physical interaction information according to the encrypted identity information of the target mobile terminal and encrypted identity information of the current mobile terminal itself, and storing the physical interaction information locally; generating a random item according to the locally stored physical interaction information; calculating a Hash value according to the block header information and the random item; and if the Hash value satisfies a block forming condition, generating the block to be generated. By means of the technical solution provided in the embodiments of the present invention, the dependence of mining on a computing power is reduced, computing power resources and electricity resources are saved on, and mining costs are also reduced, thereby improving the enthusiasm of users for participating in mining.

Description

一种基于区块链的挖矿方法、装置、移动终端及存储介质A blockchain-based mining method, device, mobile terminal and storage medium 技术领域technical field
本发明实施例涉及区块链技术领域,尤其涉及一种基于区块链的挖矿方法、装置、移动终端及存储介质。Embodiments of the present invention relate to the technical field of blockchain, and in particular, to a blockchain-based mining method, device, mobile terminal, and storage medium.
背景技术Background technique
区块链是一种基于P2P网络、共识机制、加密算法等技术的由许多网络节点共同参与和维护的分布式数据存储技术模式。其共识机制是指全部记账节点之间达成的共识,从而确定区块链内容的有效性,这是保证区块链稳定工作的重要机制。其中,最常用的共识机制为工作量证明机制(POW)、股权证明机制(POS)和委任权益证明(DPOS)等。其中,POW是最常用的,其核心设计思路是提出一个具有不对称特性的计算难题,即寻找出这个难题的答案是困难的,但将这个难题答案进行验证是非常容易的。适用于POW共识机制的挖矿算法大致分为两类,第一类叫做计算困难,第二类叫内存困难。虽然这两种方式算法简单,容易实现,但两者都不产生任何实际的社会价值,并且浪费了大量的算力和电力资源,区块的确认时间难以缩短。同时由于挖矿和算力密切相关,随着矿池的出现将算力集中,基于原有的POW共识机制方案设计的区块链系统也就容易受到比特币网络的算力攻击和分叉攻击。Blockchain is a distributed data storage technology model based on P2P network, consensus mechanism, encryption algorithm and other technologies that is jointly participated and maintained by many network nodes. Its consensus mechanism refers to the consensus reached among all bookkeeping nodes to determine the validity of the blockchain content, which is an important mechanism to ensure the stable operation of the blockchain. Among them, the most commonly used consensus mechanisms are Proof of Work (POW), Proof of Stake (POS), and Delegated Proof of Stake (DPOS). Among them, POW is the most commonly used, and its core design idea is to propose a computational problem with asymmetric characteristics, that is, it is difficult to find the answer to this problem, but it is very easy to verify the answer to this problem. The mining algorithms applicable to the POW consensus mechanism are roughly divided into two categories. The first category is called computational difficulty, and the second category is called memory difficulty. Although the algorithms of these two methods are simple and easy to implement, neither of them produces any real social value, and wastes a lot of computing power and power resources, making it difficult to shorten the block confirmation time. At the same time, due to the close relationship between mining and computing power, with the emergence of mining pools to concentrate computing power, the blockchain system designed based on the original POW consensus mechanism scheme is also vulnerable to computing power attacks and bifurcation attacks of the Bitcoin network .
技术问题technical problem
本发明实施例提供一种基于区块链的挖矿方法、装置、移动终端及存储介质,以解决挖矿过程中造成的算力与电力资源浪费、计算难度大以及易于被攻击等问题。Embodiments of the present invention provide a blockchain-based mining method, device, mobile terminal, and storage medium to solve problems such as waste of computing power and power resources, high computational difficulty, and vulnerability to attacks caused during the mining process.
技术解决方案technical solution
第一方面,本发明实施例提供了一种基于区块链的挖矿方法,该方法包括:In the first aspect, the embodiment of the present invention provides a blockchain-based mining method, the method comprising:
获取区块链发布的待生成区块的区块头信息;Obtain the block header information of the block to be generated released by the blockchain;
判断是否与目标移动终端之间发生密接交互,若是,则获取所述目标移动终端的身份信息;将所述目标移动终端的身份信息发送到服务器,并接收所述服务器返回的所述目标移动终端的加密身份信息;Judging whether close interaction occurs with the target mobile terminal, if so, obtaining the identity information of the target mobile terminal; sending the identity information of the target mobile terminal to a server, and receiving the target mobile terminal returned by the server encrypted identity information;
根据所述目标移动终端的加密身份信息和自身的加密身份信息生成物理交互信息并存储在本地;generating physical interaction information according to the encrypted identity information of the target mobile terminal and its own encrypted identity information and storing it locally;
根据本地存储的所述物理交互信息生成随机项;generating a random item according to the locally stored physical interaction information;
根据所述区块头信息和所述随机项计算哈希值;calculating a hash value according to the block header information and the random item;
若所述哈希值满足出块条件,则生成所述待生成区块。If the hash value satisfies the block generation condition, the block to be generated is generated.
第二方面,本发明实施例还提供了一种基于区块链的挖矿装置,该装置包括:In the second aspect, the embodiment of the present invention also provides a blockchain-based mining device, which includes:
信息获取模块,用于获取区块链发布的待生成区块的区块头信息;The information acquisition module is used to obtain the block header information of the block to be generated released by the block chain;
密接交互判定模块,用于判断是否与目标移动终端之间发生密接交互,若是,则获取所述目标移动终端的身份信息;A close interaction determination module, configured to determine whether close interaction occurs with the target mobile terminal, and if so, obtain the identity information of the target mobile terminal;
信息加密模块,用于将所述目标移动终端的身份信息发送到服务器,并接收所述服务器返回的所述目标移动终端的加密身份信息;An information encryption module, configured to send the identity information of the target mobile terminal to a server, and receive the encrypted identity information of the target mobile terminal returned by the server;
信息生成模块,用于根据所述目标移动终端的加密身份信息和自身的加密身份信息生成物理交互信息并存储在本地;An information generating module, configured to generate physical interaction information according to the encrypted identity information of the target mobile terminal and its own encrypted identity information and store it locally;
随机项生成模块,用于根据本地存储的所述物理交互信息生成随机项;A random item generating module, configured to generate a random item according to the locally stored physical interaction information;
哈希值计算模块,用于根据所述区块头信息和所述随机项计算哈希值;a hash value calculation module, configured to calculate a hash value according to the block header information and the random item;
区块生成模块,用于若所述哈希值满足出块条件,则生成所述待生成区块。A block generation module, configured to generate the block to be generated if the hash value satisfies the block generation condition.
第三方面,本发明实施例还提供了一种移动终端,该移动终端包括:In the third aspect, the embodiment of the present invention also provides a mobile terminal, the mobile terminal includes:
一个或多个处理器;one or more processors;
存储器,用于存储一个或多个程序;memory for storing one or more programs;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本发明任意实施例所提供的基于区块链的挖矿方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the blockchain-based mining method provided by any embodiment of the present invention.
第四方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现本发明任意实施例所提供的基于区块链的挖矿方法。In the fourth aspect, the embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the blockchain-based mining method provided by any embodiment of the present invention is implemented. .
有益效果Beneficial effect
本发明实施例提供了一种基于区块链的挖矿方法,首先获取区块链发布的待生成区块的区块头信息,然后判断本移动终端是否与目标移动终端之间发生密接交互,若是,则获取目标移动终端的身份信息,再将该身份信息发送到服务器,以接收服务器返回的对应的加密身份信息,接着使用目标移动终端的加密身份信息和自身的加密身份信息生成物理交互信息存储在本地,从而根据本地存储的物理交互信息生成随机项,并根据获取的区块头信息和生成的随机项计算哈希值,以在哈希值满足出块条件的情况下生成待生成区块。本发明实施例所提供的方法,通过利用矿工之间的密接物理交互信息生成的随机项代替传统方法中使用大量计算资源高速生成的随机项来进行区块链挖矿,基于真实世界物理交互的有限性和置信性来确保挖矿设备平等,从而减少了挖矿过程对算力的依赖,并降低了挖矿门槛,即降低了挖矿成本,提高了用户参与挖矿的积极性。同时,由于用户之间进行物理交互的次数有限,不容易出现超强算力节点,从而使得算力分散,可有效防范攻击。另外,通过对获取到的移动终端的身份信息进行加密,并使用加密后的信息生成物理交互信息进而生成随机项,能够对用户的私人信息进行保密,从而提高用户信息安全。The embodiment of the present invention provides a blockchain-based mining method. Firstly, the block header information of the block to be generated issued by the blockchain is obtained, and then it is judged whether there is a close interaction between the mobile terminal and the target mobile terminal. , then obtain the identity information of the target mobile terminal, and then send the identity information to the server to receive the corresponding encrypted identity information returned by the server, and then use the encrypted identity information of the target mobile terminal and its own encrypted identity information to generate physical interaction information storage Locally, a random item is generated according to the locally stored physical interaction information, and a hash value is calculated according to the obtained block header information and the generated random item, so as to generate a block to be generated when the hash value meets the block generation condition. The method provided by the embodiment of the present invention uses the random items generated by the close physical interaction information between miners to replace the random items generated at high speed by using a large number of computing resources in the traditional method to carry out blockchain mining, based on the real-world physical interaction Finiteness and confidence to ensure the equality of mining equipment, thereby reducing the dependence of the mining process on computing power, and lowering the threshold for mining, that is, reducing the cost of mining and increasing the enthusiasm of users to participate in mining. At the same time, due to the limited number of physical interactions between users, super computing power nodes are not easy to appear, which makes the computing power dispersed and can effectively prevent attacks. In addition, by encrypting the acquired identity information of the mobile terminal, and using the encrypted information to generate physical interaction information and then generate random items, the private information of the user can be kept confidential, thereby improving the security of user information.
附图说明Description of drawings
图1为本发明实施例一提供的基于区块链的挖矿方法的流程图;Fig. 1 is the flowchart of the blockchain-based mining method provided by Embodiment 1 of the present invention;
图2为本发明实施例二提供的基于区块链的挖矿装置的结构示意图;FIG. 2 is a schematic structural diagram of a blockchain-based mining device provided in Embodiment 2 of the present invention;
图3为本发明实施例三提供的移动终端的结构示意图。FIG. 3 is a schematic structural diagram of a mobile terminal provided by Embodiment 3 of the present invention.
本发明的实施方式Embodiments of the present invention
下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings but not all structures.
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processing, many of the steps may be performed in parallel, concurrently, or simultaneously. Additionally, the order of steps may be rearranged. The process may be terminated when its operations are complete, but may also have additional steps not included in the figure. The processing may correspond to a method, function, procedure, subroutine, subroutine, or the like.
实施例一Embodiment one
图1为本发明实施例一提供的基于区块链的挖矿方法的流程图。本实施例可适用于使用普通移动设备通过物理交互的方式进行挖矿的情况,该方法可以由本发明实施例提供的基于区块链的挖矿装置来执行,该装置可以由硬件和/或软件的方式来实现,一般可集成于移动终端中,该移动终端可以但不限于是各种笔记本电脑、智能手机、平板电脑和便携式可穿戴设备等。如图1所示,具体包括如下步骤:FIG. 1 is a flowchart of a blockchain-based mining method provided by Embodiment 1 of the present invention. This embodiment can be applied to the situation where common mobile devices are used for mining through physical interaction, and the method can be executed by the blockchain-based mining device provided by the embodiment of the present invention, which can be implemented by hardware and/or software Generally, it can be integrated into a mobile terminal, which can be, but not limited to, various notebook computers, smart phones, tablet computers, and portable wearable devices. As shown in Figure 1, it specifically includes the following steps:
S11、获取区块链发布的待生成区块的区块头信息。S11. Obtain the block header information of the block to be generated issued by the block chain.
其中,区块头信息可以包括区块版本号、父区块哈希值、默克尔树根哈希值、时间戳、难度目标等等,根据该区块头信息可以确定出块条件。示例性的,基于比特币的出块算法,可以通过安全散列算法SHA-256对区块头进行哈希计算,则出块条件可以是计算产生的256位数值小于区块头信息中的难度目标。为了将出块时间控制在预设时间,即预期平均出块时间,可以定期调整挖矿难度,即重新确定所需的难度目标,示例性的,假设预设时间为expected_time,并在每产生N个区块之后进行一次调整,则调整的周期约为expected_time/1440N天,具体可以通过如下公式进行调整:Among them, the block header information may include block version number, parent block hash value, Merkle tree root hash value, timestamp, difficulty target, etc., and block generation conditions can be determined according to the block header information. Exemplarily, based on the bitcoin-based block generation algorithm, the hash calculation of the block header can be performed through the secure hash algorithm SHA-256, and the block generation condition can be that the calculated 256-bit value is less than the difficulty target in the block header information. In order to control the block generation time at the preset time, that is, the expected average block generation time, the mining difficulty can be adjusted periodically, that is, the required difficulty target can be re-determined. For example, assume that the preset time is expected_time, and every N An adjustment is made after each block, and the adjustment period is about expected_time/1440N days, which can be adjusted by the following formula:
Figure PCTCN2021119096-appb-000001
Figure PCTCN2021119096-appb-000001
其中,target表示新难度目标,current_target表示当前难度目标,actual_time表示真实平均出块时间,通过上述公式定期对难度目标进行上调或者下调,从而使得出块时间趋于稳定。Among them, target represents the new difficulty target, current_target represents the current difficulty target, and actual_time represents the real average block generation time. The difficulty target is regularly adjusted up or down through the above formula, so that the block generation time tends to be stable.
S12、判断是否与目标移动终端之间发生密接交互,若是,则获取目标移动终端的身份信息。其中,密接交互可以是在预设距离范围内持续预设时长的交互状态,通过将判定真实世界的密接交互作为触发生成随机项进而计算哈希值的唯一条件,可以有效的避免用户伪造数据。在用户使用移动终端的过程中,还可能包括其他的一些物理交互过程,则当发生交互时,可以首先判断本移动终端是否与其他移动终端发生了密接交互,若发生,则将该其他移动终端作为目标移动终端,并获取目标移动终端的身份信息,以便后续生成随机项。其中,身份信息可以是移动终端的硬件地址(Media Access Control Address,MAC)等可唯一确定终端身份的信息。在本实施例中,密接交互可以是基于蓝牙所确定的密接交互,则当本移动终端参与到挖矿的过程中时,可以通过蓝牙扫描其他设备,并在发生密接交互时采集对方的MAC地址。S12. Determine whether close interaction occurs with the target mobile terminal, and if so, acquire identity information of the target mobile terminal. Among them, close interaction can be an interactive state that lasts for a preset duration within a preset distance range. By determining the close interaction in the real world as the only condition to trigger the generation of random items and then calculate the hash value, it can effectively prevent users from falsifying data. During the user's use of the mobile terminal, it may also include some other physical interaction processes. When an interaction occurs, it can first be judged whether the mobile terminal has closely interacted with other mobile terminals. If so, the other mobile terminal As a target mobile terminal, and obtain the identity information of the target mobile terminal, so as to subsequently generate random items. Wherein, the identity information may be information such as a hardware address (Media Access Control Address, MAC) of the mobile terminal that can uniquely determine the identity of the terminal. In this embodiment, the close interaction can be based on the close interaction determined by Bluetooth, then when the mobile terminal participates in the mining process, it can scan other devices through Bluetooth, and collect the MAC address of the other party when the close interaction occurs .
可选的,判断是否与目标移动终端之间发生密接交互,包括:获取目标移动终端的蓝牙强度和运动状态;根据蓝牙强度和运动状态判断是否与目标移动终端之间发生密接交互。具体的,可以通过目标移动终端的蓝牙强度和运动状态等信号对是否发生密接交互进行判断,进一步还可以加入自身的运动状态以进行比较来提高密接交互确定的准确性。其中,运动状态可以是移动终端的加速度等等。在获得了目标移动终端的蓝牙强度之后,可以根据如下公式计算得到本移动终端与目标移动终端之间的测量距离:Optionally, judging whether close interaction occurs with the target mobile terminal includes: obtaining the Bluetooth strength and motion state of the target mobile terminal; and judging whether close interaction occurs with the target mobile terminal according to the Bluetooth strength and motion state. Specifically, signals such as Bluetooth strength and motion status of the target mobile terminal can be used to judge whether close interaction occurs, and further, its own motion state can be added for comparison to improve the accuracy of close interaction determination. Wherein, the motion state may be the acceleration of the mobile terminal and the like. After obtaining the Bluetooth strength of the target mobile terminal, the measurement distance between the mobile terminal and the target mobile terminal can be calculated according to the following formula:
Figure PCTCN2021119096-appb-000002
Figure PCTCN2021119096-appb-000002
其中,d表示测量距离,RSSI表示蓝牙强度,abs()表示取绝对值,a表示相隔一米时的信号强度,n表示环境衰减因子。在计算得到对应的测量距离之后,即可与密接交互的预设距离范围进行比较以对密接交互进行判断。Among them, d represents the measurement distance, RSSI represents the Bluetooth strength, abs() represents the absolute value, a represents the signal strength at a distance of one meter, and n represents the environmental attenuation factor. After the corresponding measurement distance is calculated, it can be compared with the preset distance range of the close interaction to judge the close interaction.
进一步可选的,根据蓝牙强度和运动状态判断是否与目标移动终端之间发生密接交互,包括:将蓝牙强度和运动状态输入训练后的深度学习模型,以得到预测的密接交互概率,并根据密接交互概率判断是否与目标移动终端之间发生密接交互。具体的,由于上述测量距离的计算方法的精准度不够高,且a的值会因为移动终端的型号不同而改变,同时,蓝牙在不同环境下会受到多种干扰和阻挡,而使得n的取值会变得非常不准确。因此,本实施例可进一步提出一种密接交互概率的预测方法,具体可以使用训练后的深度学习模型来实现。该深度学习模型可以是深度神经网络(Deep Neural Networks,DNN)等,输入可以是挖矿用户的移动终端通过蓝牙广播的形式收集的蓝牙强度以及运动状态等信号,输出则是密接交互概率。通过训练好的深度学习模型来对收集的来自其他移动终端的多种信号进行分析和判定,可以得到一个概率值,从而根据这个概率值即可更加准确的分析当前本移动终端与目标移动终端之 间发生密接交互的可能性。Further optionally, judging whether a close interaction occurs with the target mobile terminal according to the Bluetooth strength and motion state includes: inputting the Bluetooth strength and motion state into the trained deep learning model to obtain a predicted close interaction probability, and according to the close interaction The interaction probability judges whether close interaction occurs with the target mobile terminal. Specifically, because the accuracy of the calculation method for measuring the distance is not high enough, and the value of a will change due to different models of mobile terminals, and at the same time, Bluetooth will be subject to various interferences and obstacles in different environments, so that the selection of n Values can become very inaccurate. Therefore, this embodiment can further propose a method for predicting the close interaction probability, which can be implemented specifically by using a trained deep learning model. The deep learning model can be a deep neural network (Deep Neural Networks, DNN), etc. The input can be the Bluetooth strength and motion status signals collected by the mobile terminal of the mining user through Bluetooth broadcasting, and the output is the close interaction probability. Through the trained deep learning model to analyze and judge the various signals collected from other mobile terminals, a probability value can be obtained, so that the current mobile terminal and the target mobile terminal can be more accurately analyzed according to this probability value Possibility of close interaction between them.
可选的,在获取目标移动终端的身份信息之前,还包括:若判定与目标移动终端之间发生密接交互,则获取目标移动终端的侧信道数据;将目标移动终端的侧信道数据和自身的侧信道数据发送到服务器,并接收服务器返回的根据目标移动终端的侧信道数据和自身的侧信道数据确定得到的密接交互的有效性结果。Optionally, before obtaining the identity information of the target mobile terminal, it also includes: if it is determined that there is a close interaction with the target mobile terminal, then obtaining the side channel data of the target mobile terminal; combining the side channel data of the target mobile terminal with its own The side channel data is sent to the server, and the validity result of the close interaction determined and obtained according to the side channel data of the target mobile terminal and its own side channel data returned by the server is received.
其中,侧信道数据是指当与目标移动终端发生密接交互时产生的其他信道的交互数据,这些数据可以被本移动终端的存储空间存储,具体可以包括GPS数据和WiFi数据等等,侧信道数据可以增强一个真实事件发生且被认同的概率。则当通过上述任意方法确定本移动终端与目标移动终端之间发生了密接交互时,可以获取目标移动终端的侧信道数据存储在本地,同时收集自身的侧信道数据,以将目标移动终端的侧信道数据和自身的侧信道数据发送到服务器,并通过服务器中置信度算法判断密接交互双方是否真实发生交互,即确定当前密接交互是否为有效密接交互,从而提高挖矿过程的可信度和公平性。服务器在完成判断后,可以向本移动终端返回相应的密接交互的有效性结果,从而本移动终端可以根据该有效性结果确定是否需要触发后续的事件,具体可以是仅在该有效性结果为有效时,获取目标移动终端的身份信息,进而生成物理交互信息以及生成随机数等等,若该有效性结果为无效,则不认为本移动终端与目标移动终端之间发生了密接交互,不触发后续的挖矿过程。Among them, the side channel data refers to the interaction data of other channels generated when there is close interaction with the target mobile terminal. These data can be stored in the storage space of the mobile terminal, and specifically can include GPS data and WiFi data, etc., side channel data It can enhance the probability of a real event happening and being recognized. Then, when it is determined by any of the above methods that close interaction has occurred between the mobile terminal and the target mobile terminal, the side channel data of the target mobile terminal can be obtained and stored locally, and at the same time, its own side channel data can be collected to map the side channel data of the target mobile terminal. The channel data and its own side channel data are sent to the server, and the confidence algorithm in the server is used to judge whether the two parties in the close interaction actually interact, that is, to determine whether the current close interaction is an effective close interaction, thereby improving the credibility and fairness of the mining process sex. After the server completes the judgment, it can return the validity result of the corresponding close interaction to the mobile terminal, so that the mobile terminal can determine whether to trigger subsequent events according to the validity result, specifically, only when the validity result is valid , obtain the identity information of the target mobile terminal, and then generate physical interaction information and generate random numbers, etc., if the validity result is invalid, it is not considered that there is close interaction between the mobile terminal and the target mobile terminal, and the subsequent mining process.
S13、将目标移动终端的身份信息发送到服务器,并接收服务器返回的目标移动终端的加密身份信息。S13. Send the identity information of the target mobile terminal to the server, and receive the encrypted identity information of the target mobile terminal returned by the server.
具体的,在获取到目标移动终端的身份信息之后,可以将目标移动终端的身份信息发送到服务器,以对身份信息进行加密,从而对用户的私人信息进行保护,具体可以采用AES等加密方式对身份信息进行加密。在服务器端可以维护一个包含身份信息和加密身份信息的关系型数据库,从而使得本移动终端可以利用所获得的目标移动终端的身份信息得到一个唯一的加密身份信息。本移动终端得到目标移动终端的加密身份信息之后可以存储在本地,并限制本移动终端的用户本地查看其他挖矿用户的身份信息。同时,本移动终端可以在参与挖矿之前,向服务器发送自身的身份信息,从而获得自身的加密身份信息并存储在本地以备用。另外,服务器可以不对用户的密接次数、密接位置以及密接对象等隐私信息进行记录或存储,以对用户的隐私进行保护。Specifically, after the identity information of the target mobile terminal is obtained, the identity information of the target mobile terminal can be sent to the server to encrypt the identity information, thereby protecting the user's private information. Specifically, an encryption method such as AES can be used to encrypt Identity information is encrypted. A relational database including identity information and encrypted identity information can be maintained on the server side, so that the mobile terminal can use the obtained identity information of the target mobile terminal to obtain a unique encrypted identity information. After the mobile terminal obtains the encrypted identity information of the target mobile terminal, it can be stored locally, and the user of the mobile terminal is restricted from viewing the identity information of other mining users locally. At the same time, the mobile terminal can send its own identity information to the server before participating in mining, so as to obtain its own encrypted identity information and store it locally for future use. In addition, the server may not record or store private information such as the number of close contacts, close contact locations, and close contact objects of the user, so as to protect the privacy of the user.
S14、根据目标移动终端的加密身份信息和自身的加密身份信息生成物理交互信息并存储在本地。S14. Generate physical interaction information according to the encrypted identity information of the target mobile terminal and its own encrypted identity information, and store it locally.
具体的,本移动终端可以在每获取一次目标移动终端的加密身份信息之后就生成一个新的物理交互信息存储在本地,即本地可以存储开始参与挖矿后生成的所有物理交互信息,进一步的,可以限制存储的物理交互信息的数量,具体可以按照生成时间的先后顺序对较早的物理交互信息删除,还可以限制存储的物理交互信息的生成时间,具体可以将预设时间范围以前的物理交互信息删除,从而后续可以使用最近的物理交互信息来生成随机项。Specifically, the mobile terminal can generate a new physical interaction information and store it locally after each acquisition of the encrypted identity information of the target mobile terminal, that is, all the physical interaction information generated after starting to participate in mining can be stored locally. Further, The amount of stored physical interaction information can be limited. Specifically, the earlier physical interaction information can be deleted in the order of generation time. The generation time of the stored physical interaction information can also be limited. Specifically, the physical interaction information before the preset time range can be deleted. Information is removed so that recent physical interaction information can be used later to generate random items.
S15、根据本地存储的物理交互信息生成随机项。S15. Generate a random item according to the locally stored physical interaction information.
具体的,本移动终端可以根据本地存储的物理交互信息生成随机项,不同的物理交互信息之间可以随机排列,生成的随机项可以与之前获得的区块头信息共同构成区块头。Specifically, the mobile terminal can generate random items according to locally stored physical interaction information, different physical interaction information can be randomly arranged, and the generated random items can form a block header together with previously obtained block header information.
S16、根据区块头信息和随机项计算哈希值。S16. Calculate the hash value according to the block header information and random items.
具体的,在每次生成随机项之后,可以通过安全散列算法SHA-256对重新构成的区块头进行哈希值的计算。Specifically, after each random item is generated, the hash value of the reconstructed block header can be calculated through the secure hash algorithm SHA-256.
S17、若哈希值满足出块条件,则生成待生成区块。S17. If the hash value satisfies the block generation condition, generate a block to be generated.
具体的,出块条件即可以是上述所确定的计算产生的256位数值小于区块头信息中的难度目标。在计算得到哈希值之后,即可判断该哈希值是否满足出块条件,若满足,则生成待生成区块。若不满足,则可以变更物理交互信息之间的排列顺序以重新生成随机项,并再次计算 哈希值判断其是否可以满足出块条件,直至有矿工成功完成出块。其中,区块包括区块头和区块体,区块体主要包含交易信息,可选的,交易信息存储于默克尔树中,以便于节点对打包的交易数据进行验证。Specifically, the block generation condition can be that the 256-bit value generated by the calculation determined above is smaller than the difficulty target in the block header information. After the hash value is calculated, it can be judged whether the hash value satisfies the block production condition, and if so, the block to be generated is generated. If not, you can change the order of physical interaction information to regenerate random items, and calculate the hash value again to determine whether it can meet the block production conditions until a miner successfully completes the block production. Among them, the block includes a block header and a block body, and the block body mainly contains transaction information. Optionally, the transaction information is stored in a Merkle tree, so that nodes can verify the packaged transaction data.
在上述技术方案的基础上,可选的,在若哈希值满足出块条件,则生成待生成区块之后,还包括:根据预设出块确认机制确认待生成区块完成出块;根据随机项对出块奖励进行结算。具体的,在区块链中,新的交易将会被广播给所有的节点,每个节点将新交易收集到一个区块中,当某个节点根据生成的随机项解决了出块难题,则生成待生成区块,并将该待生成区块广播给所有的节点,所有节点仅在该待生成区块内所有的交易都被哈希验证有效且没有双花交易等无效交易时接受该待生成区块,并通过创建区块链中的下一个区块来表示对该待生成区块的接受程度,还可以使用该区块的哈希作为新随机项的一部分,从而确认待生成区块完成出块。在待生成区块的出块被确认之后,即可对该待生成区块的出块奖励进行结算,其中的出块奖励即为成功解决出块难题所能获得的奖励。On the basis of the above technical solution, optionally, after generating the block to be generated if the hash value satisfies the block generation condition, it also includes: confirming that the block to be generated has completed block generation according to the preset block generation confirmation mechanism; Random items are used to settle block rewards. Specifically, in the blockchain, new transactions will be broadcast to all nodes, and each node will collect new transactions into a block. When a node solves the block problem according to the generated random items, then Generate the block to be generated and broadcast the block to be generated to all nodes. All nodes accept the block to be generated only when all transactions in the block to be generated are verified by hash and there are no invalid transactions such as double-spending transactions. Generate a block and indicate acceptance of the block to be generated by creating the next block in the blockchain, and can also use the hash of the block as part of the new random entry to confirm the block to be generated Complete the block. After the block to be generated is confirmed, the block reward of the block to be generated can be settled, and the block reward is the reward that can be obtained by successfully solving the problem of block generation.
进一步可选的,根据随机项对出块奖励进行结算,包括:按照预设分配比例将出块奖励分配给出块矿工和参与随机项生成的其他矿工;根据其他矿工中各个矿工在生成随机项过程中的密接交互次数贡献对其他矿工分配得到的出块奖励再次进行分配。Further optionally, settlement of block rewards is based on random items, including: distributing block rewards to block miners and other miners participating in the generation of random items according to the preset distribution ratio; The contribution of the number of close interactions in the process is redistributed to the block rewards distributed by other miners.
具体的,可以将出块奖励的百分之五十分配给出块矿工,而将另外的百分之五十分配给参与随机项生成的其他矿工,并可以根据其他矿工在生成随机项过程中的密接交互次数贡献对其他矿工分配得到的百分之五十的出块奖励再次进行分配,并可以按照如下的分配公式进行分配:Specifically, 50% of the block reward can be allocated to the block miners, and the other 50% can be allocated to other miners participating in the generation of random items, and can be based on other miners in the process of generating random items The contribution of the number of close interactions is redistributed to the 50% of the block rewards allocated by other miners, and can be distributed according to the following distribution formula:
Figure PCTCN2021119096-appb-000003
Figure PCTCN2021119096-appb-000003
其中,r表示某个其他矿工可以得到的奖励,t表示该其他矿工在生成随机项过程中贡献的密接交互次数,T表示生成随机项所使用的密接交互次数总数,即所使用的物理交互信息的数量,R表示所有其他矿工分配得到的出块奖励。Among them, r represents the reward that some other miner can get, t represents the number of close interactions contributed by the other miner in the process of generating random items, T represents the total number of close interactions used to generate random items, that is, the physical interaction information used The amount of , R represents the block reward distributed by all other miners.
进一步可选的,方法还包括:创建志愿者用户,志愿者用户开启被获取实时密接交互次数的权限;从志愿者用户中随机选择至少一个样本作为基准志愿者用户;将基准志愿者用户的实时密接交互次数的中位数确定为基准交互次数;相应的,根据随机项对出块奖励进行结算,包括:根据随机项以及基准交互次数对出块奖励进行结算;在根据预设出块确认机制确认待生成区块完成出块之后,还包括:根据各个基准志愿者用户的实时密接交互次数和基准交互次数对基准志愿者用户的分享奖励进行结算,分享奖励随出块奖励线性变化。Further optionally, the method also includes: creating a volunteer user, and the volunteer user enables the authority to obtain the number of real-time close interactions; randomly select at least one sample from the volunteer users as a benchmark volunteer user; set the benchmark volunteer user's real-time The median of the number of close interactions is determined as the benchmark number of interactions; correspondingly, the settlement of block rewards is based on random items, including: settlement of block rewards based on random items and benchmark interactions; in accordance with the preset block confirmation mechanism After confirming that the block to be generated is completed, it also includes: settlement of the sharing rewards of the benchmark volunteer users according to the real-time close interaction times and the benchmark interaction times of each benchmark volunteer user, and the sharing reward changes linearly with the block reward.
具体的,志愿者用户可以是普通用户向服务器申请分享奖励所获得的属性,是普通用户的同级用户,当接收到普通用户的申请后,可以为该普通用户创建相应的志愿者用户。在作为志愿者用户的期间,需要同意开启被记录及获取实时密接交互次数的权限,并受到对实时密接交互次数的真实性(是否被伪造)和可靠性(是否能代表群体实际密接交互频率)的验证。同时,志愿者用户可以随时取消其共享权限,主动更改为普通用户,则此时其实时密接交互次数将不再被记录。如果某个志愿者用户的实时密接交互次数超过了预设最大交互次数,则超过了可接受的正常水平,判定为一次不合格分享,此时该志愿者提供的信息将不可靠,因此,可以将该志愿者用户更改为普通用户,同时忽略预设时间范围(如一个月)内的志愿者申请,以避免近期使用该志愿者用户作为标准。其中,预设最大交互次数可以取决于前一天同一时段全部被选中的志愿者日密接次数的3σ置信区间范围,特别的,当数据足够大时,全部志愿者用户的日密接次数将符合正态分布。Specifically, a volunteer user can be an attribute obtained by an ordinary user applying for sharing rewards from the server, and is a user of the same level as an ordinary user. After receiving an application from an ordinary user, a corresponding volunteer user can be created for the ordinary user. During the period as a volunteer user, you need to agree to enable the permission to be recorded and obtain the number of real-time close interactions, and be subject to the authenticity (whether it is forged) and reliability (whether it can represent the actual frequency of close interactions of the group) of the number of real-time close interactions verification. At the same time, volunteer users can cancel their sharing permissions at any time and actively change to ordinary users. At this time, the number of real-time close interactions will no longer be recorded. If the number of real-time close interactions of a volunteer user exceeds the preset maximum number of interactions, it exceeds the acceptable normal level, and it is judged as an unqualified sharing. At this time, the information provided by the volunteer will be unreliable. Therefore, you can Change the volunteer user to an ordinary user, and ignore volunteer applications within a preset time range (such as one month), so as to avoid using the volunteer user as a standard in the near future. Among them, the preset maximum number of interactions can be determined by the 3σ confidence interval range of the daily contact times of all volunteers selected in the same period of the previous day. In particular, when the data is large enough, the daily contact times of all volunteer users will conform to the normal distributed.
在每一次出块开始时,可以从志愿者用户中随机选择一定样本作为基准志愿者用户。通过每次出块之前的重新随机选取,可以避免某些用户长期作为基准志愿者用户被使用,使得每次所使用的标准更加真实可靠。在确定了基准志愿者用户之后,可以将所有基准志愿者用户的 实时密接交互次数中的中位数确定为基准交互次数,用于后续出块奖励的调整,所确定的基准交互次数可以记录在区块头信息中。相应的,出块奖励的数额与当日全部用户的密接交互次数分布相关,可以根据确定的基准交互次数设置激励交互次数来调整出块奖励,具体可以应用如下公式:At the beginning of each block generation, a certain sample can be randomly selected from volunteer users as a benchmark volunteer user. By re-random selection before each block is produced, some users can be prevented from being used as benchmark volunteer users for a long time, making the standard used each time more authentic and reliable. After determining the benchmark volunteer users, the median of the real-time close interactions of all benchmark volunteer users can be determined as the benchmark interaction times, which is used for adjustment of subsequent block rewards. The determined benchmark interaction times can be recorded in In the block header information. Correspondingly, the amount of block rewards is related to the distribution of the close interaction times of all users on that day. The number of incentive interactions can be set according to the determined benchmark interaction times to adjust the block rewards. Specifically, the following formula can be applied:
P=M×KP=M×K
其中,P表示激励交互次数,M表示基准交互次数,K表示调整因子,且1<K<2,调整因子的具体数值可以由用户规模和用户日密接交互次数决定,当日所有用户的平均日密接交互次数越接近激励交互次数,则出块奖励越高。初始的出块奖励可以为一理想奖励值,并在每生成一定区块后将理想奖励值减半,同时控制当前的出块奖励不得高于理想奖励值。相应的,在成功完成出块之后,被选作为基准的志愿者用户可以获得一定的分享奖励,该分享奖励可以随实际的出块奖励进行线性变化,并由所有基准志愿者用户共有。具体可以根据如下公式对分享奖励进行结算:Among them, P represents the number of incentive interactions, M represents the number of benchmark interactions, and K represents the adjustment factor, and 1<K<2. The specific value of the adjustment factor can be determined by the user scale and the number of daily close interactions of users. The average daily close interaction of all users on that day The closer the number of interactions is to the number of incentive interactions, the higher the block reward. The initial block reward can be an ideal reward value, and the ideal reward value will be halved every time a certain block is generated, and the current block reward should not be higher than the ideal reward value. Correspondingly, after successfully completing the block generation, the volunteer users selected as the benchmark can obtain a certain sharing reward, which can change linearly with the actual block generation reward and is shared by all benchmark volunteer users. Specifically, the sharing reward can be settled according to the following formula:
Figure PCTCN2021119096-appb-000004
Figure PCTCN2021119096-appb-000004
Figure PCTCN2021119096-appb-000005
Figure PCTCN2021119096-appb-000005
其中,A表示接近值,L表示某个基准志愿者用户提供的实时密接交互次数,M表示基准交互次数,s表示该基准志愿者用户可以得到的分享奖励,A sum表示所有基准志愿者用户的接近值之和,S表示总的分享奖励。即当基准志愿者用户的实时密接交互次数与基准交互次数越接近时,可以得到的分享奖励越多。通过设立志愿者用户,并在每次出块之前,从中随机选取基准志愿者用户,再将基准志愿者用户的实时密接交互次数的中位数确定为基准交互次数,进而根据该基准交互次数设置有差别的挖矿奖励机制,使得符合当前社会状态的密接交互次数可以对应更高的奖励,有效的防止了矿工之间通过频繁交互进行恶意挖矿。 Among them, A represents the proximity value, L represents the number of real-time close interactions provided by a benchmark volunteer user, M represents the number of benchmark interactions, s represents the sharing reward that the benchmark volunteer user can get, and A sum represents the sum of all benchmark volunteer users Close to the sum of values, S represents the total sharing reward. That is, when the number of real-time close interactions of the benchmark volunteer user is closer to the benchmark number of interactions, the more sharing rewards can be obtained. By setting up volunteer users and randomly selecting benchmark volunteer users before each block, the median of the real-time close interaction times of benchmark volunteer users is determined as the benchmark interaction times, and then set according to the benchmark interaction times Different mining reward mechanisms allow higher rewards for the number of close interactions in line with the current social state, effectively preventing malicious mining through frequent interactions between miners.
可选的,还可以设置打包奖励,即在出块成功对出块奖励进行分配的同时,可以根据用户所打包的交易总量获取一定的奖励,类似于以太坊系统的Gas机制,用户的交易可以通过提高支付的Gas值来获得更快被验证打包的概率,并将其中部分Gas作为打包奖励。Optionally, packaging rewards can also be set, that is, when the blocks are successfully distributed and the block rewards are distributed, certain rewards can be obtained according to the total amount of transactions packaged by the user. Similar to the Gas mechanism of the Ethereum system, the user's transactions The probability of being verified and packaged faster can be obtained by increasing the paid Gas value, and part of the Gas is used as a packaging reward.
本实施例所提供的方法,由于物理交互技术只可应用于移动设备上,移动设备算力相对较小且每个区块打包交易数据量较少,具有轻量级的特点。移动设备普及性高、使用门槛低,可吸引更多用户在日常生活中参与挖矿,增大用户规模,从而实现算力分散,增强系统安全性。基于本方法轻量级的特点,使其适用于区块链-物联网技术中,支持可移动设备适用于物联网的大规模用户。大规模用户分散的算力,以及物理交互的有限性和置信性可防止恶意攻击,带来系统的安全性,从而可在智慧城市、智慧医疗等方面有更多更广泛的应用。The method provided in this embodiment has the characteristics of light weight because the physical interaction technology can only be applied to mobile devices, and the computing power of mobile devices is relatively small and the amount of packaged transaction data in each block is small. The popularity of mobile devices is high and the threshold for use is low, which can attract more users to participate in mining in daily life and increase the scale of users, thereby realizing the dispersion of computing power and enhancing system security. Based on the lightweight characteristics of this method, it is suitable for blockchain-Internet of Things technology, and supports mobile devices for large-scale users of the Internet of Things. The distributed computing power of large-scale users, as well as the limitation and confidence of physical interaction can prevent malicious attacks and bring system security, so that it can have more and wider applications in smart cities and smart medical care.
本发明实施例所提供的技术方案,首先获取区块链发布的待生成区块的区块头信息,然后判断本移动终端是否与目标移动终端之间发生密接交互,若是,则获取目标移动终端的身份信息,再将该身份信息发送到服务器,以接收服务器返回的对应的加密身份信息,接着使用目标移动终端的加密身份信息和自身的加密身份信息生成物理交互信息存储在本地,从而根据本地存储的物理交互信息生成随机项,并根据获取的区块头信息和生成的随机项计算哈希值,以在哈希值满足出块条件的情况下生成待生成区块。通过利用矿工之间的密接物理交互信息生成的随机项代替传统方法中使用大量计算资源高速生成的随机项来进行区块链挖矿,基于真实世界物理交互的有限性和置信性来确保挖矿设备平等,从而减少了挖矿过程对算力的依赖,并降低了挖矿门槛,即降低了挖矿成本,提高了用户参与挖矿的积极性。同时,由于用户之间进行物理交互的次数有限,不容易出现超强算力节点,从而使得算力分散,可有效防范攻击。另外,通过对获取到的移动终端的身份信息进行加密,并使用加密后的信息生成物理交互信息进而生成随机项,能够对用户的私人信息进行保密,从而提高用户信息安全。The technical solution provided by the embodiment of the present invention first obtains the block header information of the block to be generated released by the block chain, and then judges whether close interaction occurs between the mobile terminal and the target mobile terminal, and if so, obtains the target mobile terminal Then send the identity information to the server to receive the corresponding encrypted identity information returned by the server, and then use the encrypted identity information of the target mobile terminal and its own encrypted identity information to generate physical interaction information and store it locally, so that according to the local storage The physical interaction information generates random items, and calculates the hash value according to the obtained block header information and the generated random items, so as to generate the block to be generated when the hash value meets the block generation conditions. By using the random items generated by the close physical interaction information between the miners to replace the random items generated at high speed by using a large number of computing resources in the traditional method to carry out blockchain mining, the mining is guaranteed based on the limitation and confidence of the physical interaction in the real world The equipment is equal, thereby reducing the dependence of the mining process on computing power, and lowering the mining threshold, that is, reducing the cost of mining and increasing the enthusiasm of users to participate in mining. At the same time, due to the limited number of physical interactions between users, super computing power nodes are not easy to appear, which makes the computing power dispersed and can effectively prevent attacks. In addition, by encrypting the acquired identity information of the mobile terminal, and using the encrypted information to generate physical interaction information and then generate random items, the private information of the user can be kept confidential, thereby improving the security of user information.
实施例二Embodiment two
图2为本发明实施例二提供的基于区块链的挖矿装置的结构示意图,该装置可以由硬件和/或软件的方式来实现,一般可集成于移动终端中,用于执行本发明任意实施例所提供的基于区块链的挖矿方法,该移动终端可以但不限于是各种笔记本电脑、智能手机、平板电脑和便携式可穿戴设备等。如图2所示,该装置包括:Fig. 2 is a schematic structural diagram of a block chain-based mining device provided by Embodiment 2 of the present invention. The device can be implemented by hardware and/or software, and generally can be integrated into a mobile terminal to execute any of the present invention. In the blockchain-based mining method provided in the embodiment, the mobile terminal can be, but not limited to, various notebook computers, smart phones, tablet computers, and portable wearable devices. As shown in Figure 2, the device includes:
信息获取模块21,用于获取区块链发布的待生成区块的区块头信息;The information acquisition module 21 is used to acquire the block header information of the blocks to be generated issued by the block chain;
密接交互判定模块22,用于判断是否与目标移动终端之间发生密接交互,若是,则获取目标移动终端的身份信息;The close interaction judgment module 22 is used to judge whether there is a close interaction with the target mobile terminal, if so, obtain the identity information of the target mobile terminal;
信息加密模块23,用于将目标移动终端的身份信息发送到服务器,并接收服务器返回的目标移动终端的加密身份信息;The information encryption module 23 is used for sending the identity information of the target mobile terminal to the server, and receiving the encrypted identity information of the target mobile terminal returned by the server;
信息生成模块24,用于根据目标移动终端的加密身份信息和自身的加密身份信息生成物理交互信息并存储在本地;The information generation module 24 is used to generate physical interaction information according to the encrypted identity information of the target mobile terminal and its own encrypted identity information and store it locally;
随机项生成模块25,用于根据本地存储的物理交互信息生成随机项;A random item generating module 25, configured to generate random items according to locally stored physical interaction information;
哈希值计算模块26,用于根据区块头信息和随机项计算哈希值;Hash value calculation module 26, for calculating the hash value according to block header information and random items;
区块生成模块27,用于若哈希值满足出块条件,则生成待生成区块。The block generating module 27 is configured to generate a block to be generated if the hash value satisfies the block generation condition.
本发明实施例所提供的技术方案,首先获取区块链发布的待生成区块的区块头信息,然后判断本移动终端是否与目标移动终端之间发生密接交互,若是,则获取目标移动终端的身份信息,再将该身份信息发送到服务器,以接收服务器返回的对应的加密身份信息,接着使用目标移动终端的加密身份信息和自身的加密身份信息生成物理交互信息存储在本地,从而根据本地存储的物理交互信息生成随机项,并根据获取的区块头信息和生成的随机项计算哈希值,以在哈希值满足出块条件的情况下生成待生成区块。通过利用矿工之间的密接物理交互信息生成的随机项代替传统方法中使用大量计算资源高速生成的随机项来进行区块链挖矿,基于真实世界物理交互的有限性和置信性来确保挖矿设备平等,从而减少了挖矿过程对算力的依赖,并降低了挖矿门槛,即降低了挖矿成本,提高了用户参与挖矿的积极性。同时,由于用户之间进行物理交互的次数有限,不容易出现超强算力节点,从而使得算力分散,可有效防范攻击。另外,通过对获取到的移动终端的身份信息进行加密,并使用加密后的信息生成物理交互信息进而生成随机项,能够对用户的私人信息进行保密,从而提高用户信息安全。The technical solution provided by the embodiment of the present invention first obtains the block header information of the block to be generated released by the block chain, and then judges whether close interaction occurs between the mobile terminal and the target mobile terminal, and if so, obtains the target mobile terminal Then send the identity information to the server to receive the corresponding encrypted identity information returned by the server, and then use the encrypted identity information of the target mobile terminal and its own encrypted identity information to generate physical interaction information and store it locally, so that according to the local storage The physical interaction information generates random items, and calculates the hash value according to the obtained block header information and the generated random items, so as to generate the block to be generated when the hash value meets the block generation conditions. By using the random items generated by the close physical interaction information between the miners to replace the random items generated at high speed by using a large number of computing resources in the traditional method to carry out blockchain mining, the mining is guaranteed based on the limitation and confidence of the physical interaction in the real world The equipment is equal, thereby reducing the dependence of the mining process on computing power, and lowering the mining threshold, that is, reducing the cost of mining and increasing the enthusiasm of users to participate in mining. At the same time, due to the limited number of physical interactions between users, super computing power nodes are not easy to appear, which makes the computing power dispersed and can effectively prevent attacks. In addition, by encrypting the acquired identity information of the mobile terminal, and using the encrypted information to generate physical interaction information and then generate random items, the private information of the user can be kept confidential, thereby improving the security of user information.
在上述技术方案的基础上,可选的,密接交互判定模块22,包括:On the basis of the above technical solution, optionally, the close interaction determination module 22 includes:
数据获取单元,用于获取目标移动终端的蓝牙强度和运动状态;A data acquisition unit, configured to acquire the Bluetooth strength and motion status of the target mobile terminal;
密接交互判定单元,用于根据蓝牙强度和运动状态判断是否与目标移动终端之间发生密接交互。The close interaction determination unit is configured to determine whether close interaction occurs with the target mobile terminal according to the Bluetooth strength and motion state.
在上述技术方案的基础上,可选的,密接交互判定单元具体用于:On the basis of the above technical solution, optionally, the close interaction determination unit is specifically used for:
将蓝牙强度和运动状态输入训练后的深度学习模型,以得到预测的密接交互概率,并根据密接交互概率判断是否与目标移动终端之间发生密接交互。Input the Bluetooth strength and motion state into the trained deep learning model to obtain the predicted close interaction probability, and judge whether close interaction occurs with the target mobile terminal according to the close interaction probability.
在上述技术方案的基础上,可选的,该基于区块链的挖矿装置,还包括:On the basis of the above technical solution, optionally, the blockchain-based mining device also includes:
侧信道数据获取模块,用于在获取目标移动终端的身份信息之前,若判定与目标移动终端之间发生密接交互,则获取目标移动终端的侧信道数据;The side channel data acquisition module is used to acquire the side channel data of the target mobile terminal if it is determined that there is close interaction with the target mobile terminal before acquiring the identity information of the target mobile terminal;
密接有效性判定模块,用于将目标移动终端的侧信道数据和自身的侧信道数据发送到服务器,并接收服务器返回的根据目标移动终端的侧信道数据和自身的侧信道数据确定得到的密接交互的有效性结果。The close connection validity determination module is used to send the side channel data of the target mobile terminal and its own side channel data to the server, and receive the close interaction determined by the side channel data of the target mobile terminal and its own side channel data returned by the server effectiveness results.
在上述技术方案的基础上,可选的,该基于区块链的挖矿装置,还包括:On the basis of the above technical solution, optionally, the blockchain-based mining device also includes:
出块确认模块,用于在若哈希值满足出块条件,则生成待生成区块之后,根据预设出块确认机制确认待生成区块完成出块;The block confirmation module is used to confirm that the block to be generated is completed according to the preset block confirmation mechanism after the block to be generated is generated if the hash value satisfies the block generation condition;
出块奖励结算模块,用于根据随机项对出块奖励进行结算。The block reward settlement module is used to settle the block reward according to random items.
在上述技术方案的基础上,可选的,出块奖励结算模块,包括:On the basis of the above technical solutions, the optional block reward settlement module includes:
出块奖励分配单元,用于按照预设分配比例将出块奖励分配给出块矿工和参与随机项生成的其他矿工;A block reward allocation unit is used to distribute block rewards to block miners and other miners participating in random item generation according to the preset distribution ratio;
再次分配单元,用于根据其他矿工中各个矿工在生成随机项过程中的密接交互次数贡献对其他矿工分配得到的出块奖励再次进行分配。The redistribution unit is used to redistribute the block rewards allocated to other miners according to the contribution of the close interaction times of each miner in the process of generating random items.
在上述技术方案的基础上,可选的,该基于区块链的挖矿装置,还包括:On the basis of the above technical solution, optionally, the blockchain-based mining device also includes:
志愿者用户创建模块,用于创建志愿者用户,志愿者用户开启被获取实时密接交互次数的权限;Volunteer user creation module, which is used to create volunteer users, and volunteer users have the authority to obtain the number of real-time intimate interactions;
基准志愿者用户选择模块,用于从志愿者用户中随机选择至少一个样本作为基准志愿者用户;基准交互次数确定模块,用于将基准志愿者用户的实时密接交互次数的中位数确定为基准交互次数;The benchmark volunteer user selection module is used to randomly select at least one sample from the volunteer users as the benchmark volunteer user; the benchmark interaction number determination module is used to determine the median of the real-time close interaction times of the benchmark volunteer users as the benchmark number of interactions;
相应的,出块奖励结算模块具体用于:Correspondingly, the block reward settlement module is specifically used for:
根据随机项以及基准交互次数对出块奖励进行结算;Settle block rewards based on random items and benchmark interactions;
该基于区块链的挖矿装置,还包括:The blockchain-based mining device also includes:
分享奖励结算模块,用于在根据预设出块确认机制确认待生成区块完成出块之后,根据各个基准志愿者用户的实时密接交互次数和基准交互次数对基准志愿者用户的分享奖励进行结算,分享奖励随出块奖励线性变化。The sharing reward settlement module is used to settle the sharing rewards of the benchmark volunteer users according to the real-time close interaction times and the benchmark interaction times of each benchmark volunteer user after confirming that the block to be generated is completed according to the preset block confirmation mechanism , the sharing reward changes linearly with the block reward.
本发明实施例所提供的基于区块链的挖矿装置可执行本发明任意实施例所提供的基于区块链的挖矿方法,具备执行方法相应的功能模块和有益效果。The blockchain-based mining device provided by the embodiments of the present invention can execute the blockchain-based mining method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
值得注意的是,在上述基于区块链的挖矿装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。It is worth noting that in the above-mentioned embodiments of the blockchain-based mining device, the included units and modules are only divided according to functional logic, but are not limited to the above-mentioned divisions, as long as the corresponding functions can be realized In addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present invention.
实施例三Embodiment Three
图3为本发明实施例三提供的移动终端的结构示意图,示出了适于用来实现本发明实施方式的示例性移动终端的框图。图3显示的移动终端仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。如图3所示,该移动终端包括处理器31、存储器32、输入装置33及输出装置34;移动终端中处理器31的数量可以是一个或多个,图3中以一个处理器31为例,移动终端中的处理器31、存储器32、输入装置33及输出装置34可以通过总线或其他方式连接,图3中以通过总线连接为例。Fig. 3 is a schematic structural diagram of a mobile terminal provided by Embodiment 3 of the present invention, showing a block diagram of an exemplary mobile terminal suitable for implementing the embodiments of the present invention. The mobile terminal shown in FIG. 3 is only an example, and should not limit the functions and scope of use of this embodiment of the present invention. As shown in Figure 3, the mobile terminal includes a processor 31, a memory 32, an input device 33, and an output device 34; the number of processors 31 in the mobile terminal can be one or more, and one processor 31 is taken as an example in Figure 3 , the processor 31, the memory 32, the input device 33 and the output device 34 in the mobile terminal may be connected through a bus or in other ways. In FIG. 3, connection through a bus is taken as an example.
存储器32作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本发明实施例中的基于区块链的挖矿方法对应的程序指令/模块(例如,基于区块链的挖矿装置中的信息获取模块21、密接交互判定模块22、信息加密模块23、信息生成模块24、随机项生成模块25、哈希值计算模块26及区块生成模块27)。处理器31通过运行存储在存储器32中的软件程序、指令以及模块,从而执行移动终端的各种功能应用以及数据处理,即实现上述的基于区块链的挖矿方法。The memory 32, as a computer-readable storage medium, can be used to store software programs, computer-executable programs and modules, such as program instructions/modules corresponding to the blockchain-based mining method in the embodiment of the present invention (for example, based on the block chain Information acquisition module 21, close interaction determination module 22, information encryption module 23, information generation module 24, random item generation module 25, hash value calculation module 26 and block generation module 27) in the block chain mining device. The processor 31 executes various functional applications and data processing of the mobile terminal by running the software programs, instructions and modules stored in the memory 32, that is, realizes the aforementioned blockchain-based mining method.
存储器32可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据移动终端的使用所创建的数据等。此外,存储器32可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器32可进一步包括相对于处理器31远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。The memory 32 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required by a function; the data storage area may store data created according to the use of the mobile terminal, and the like. In addition, the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. In some examples, the memory 32 may further include a memory that is set remotely relative to the processor 31, and these remote memories may be connected to the mobile terminal through a network.
上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
输入装置33可用于获取区块链发布的待生成区块的区块头信息,以及产生与移动终端的用 户设置和功能控制有关的键信号输入等。输出装置34可用于将生成的区块进行广播等等。The input device 33 can be used to obtain the block header information of the blocks to be generated issued by the block chain, and to generate key signal inputs related to user settings and function control of the mobile terminal. The output device 34 can be used for broadcasting the generated blocks and so on.
实施例四Embodiment Four
本发明实施例四还提供一种包含计算机可执行指令的存储介质,该计算机可执行指令在由计算机处理器执行时用于执行一种基于区块链的挖矿方法,该方法包括:Embodiment 4 of the present invention also provides a storage medium containing computer-executable instructions, the computer-executable instructions are used to execute a blockchain-based mining method when executed by a computer processor, the method comprising:
获取区块链发布的待生成区块的区块头信息;Obtain the block header information of the block to be generated released by the blockchain;
判断是否与目标移动终端之间发生密接交互,若是,则获取目标移动终端的身份信息;Judging whether there is a close interaction with the target mobile terminal, if so, obtaining the identity information of the target mobile terminal;
将目标移动终端的身份信息发送到服务器,并接收服务器返回的目标移动终端的加密身份信息;Sending the identity information of the target mobile terminal to the server, and receiving the encrypted identity information of the target mobile terminal returned by the server;
根据目标移动终端的加密身份信息和自身的加密身份信息生成物理交互信息并存储在本地;根据本地存储的物理交互信息生成随机项;Generate physical interaction information according to the encrypted identity information of the target mobile terminal and its own encrypted identity information and store it locally; generate random items according to the locally stored physical interaction information;
根据区块头信息和随机项计算哈希值;Calculate hash value based on block header information and random items;
若哈希值满足出块条件,则生成待生成区块。If the hash value satisfies the block generation conditions, a block to be generated is generated.
存储介质可以是任何的各种类型的存储器设备或存储设备。术语“存储介质”旨在包括:安装介质,例如CD-ROM、软盘或磁带装置;计算机系统存储器或随机存取存储器,诸如DRAM、DDR RAM、SRAM、EDO RAM,兰巴斯(Rambus)RAM等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的计算机系统中,或者可以位于不同的第二计算机系统中,第二计算机系统通过网络(诸如因特网)连接到计算机系统。第二计算机系统可以提供程序指令给计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机系统中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如具体实现为计算机程序)。The storage medium may be any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media such as CD-ROMs, floppy disks, or tape drives; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc. ; non-volatile memory, such as flash memory, magnetic media (eg hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. Also, the storage medium may be located in a computer system in which the program is executed, or may be located in a different second computer system connected to the computer system through a network such as the Internet. The second computer system may provide program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems connected by a network. The storage medium may store program instructions (eg embodied as computer programs) executable by one or more processors.
当然,本发明实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的方法操作,还可以执行本发明任意实施例所提供的基于区块链的挖矿方法中的相关操作。Of course, a storage medium containing computer-executable instructions provided by an embodiment of the present invention, the computer-executable instructions are not limited to the method operations described above, and can also execute the blockchain-based blockchain provided by any embodiment of the present invention. Related operations in the mining method.
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer readable signal medium may include a data signal carrying computer readable program code in baseband or as part of a carrier wave. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. .
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本发明可借助软件及必需的通用硬件来实现,当然也可以通过硬件实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the above description about the implementation, those skilled in the art can clearly understand that the present invention can be realized by means of software and necessary general-purpose hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment . Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a floppy disk of a computer , read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disc, etc., including several instructions to make a computer device (which can be a personal computer) , server, or network device, etc.) execute the methods described in various embodiments of the present invention.
注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多 其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, and the present invention The scope is determined by the scope of the appended claims.

Claims (10)

  1. 一种基于区块链的挖矿方法,其特征在于,包括:A blockchain-based mining method, characterized in that it comprises:
    获取区块链发布的待生成区块的区块头信息;Obtain the block header information of the block to be generated released by the blockchain;
    判断是否与目标移动终端之间发生密接交互,若是,则获取所述目标移动终端的身份信息;Judging whether close interaction occurs with the target mobile terminal, if so, obtaining the identity information of the target mobile terminal;
    将所述目标移动终端的身份信息发送到服务器,并接收所述服务器返回的所述目标移动终端的加密身份信息;sending the identity information of the target mobile terminal to a server, and receiving the encrypted identity information of the target mobile terminal returned by the server;
    根据所述目标移动终端的加密身份信息和自身的加密身份信息生成物理交互信息并存储在本地;generating physical interaction information according to the encrypted identity information of the target mobile terminal and its own encrypted identity information and storing it locally;
    根据本地存储的所述物理交互信息生成随机项;generating a random item according to the locally stored physical interaction information;
    根据所述区块头信息和所述随机项计算哈希值;calculating a hash value according to the block header information and the random item;
    若所述哈希值满足出块条件,则生成所述待生成区块。If the hash value satisfies the block generation condition, the block to be generated is generated.
  2. 根据权利要求1所述的基于区块链的挖矿方法,其特征在于,所述判断是否与目标移动终端之间发生密接交互,包括:The blockchain-based mining method according to claim 1, wherein said judging whether close interaction occurs with the target mobile terminal includes:
    获取所述目标移动终端的蓝牙强度和运动状态;Obtain the Bluetooth strength and motion status of the target mobile terminal;
    根据所述蓝牙强度和所述运动状态判断是否与所述目标移动终端之间发生密接交互。Judging whether close interaction occurs with the target mobile terminal according to the Bluetooth strength and the motion state.
  3. 根据权利要求2所述的基于区块链的挖矿方法,其特征在于,所述根据所述蓝牙强度和所述运动状态判断是否与所述目标移动终端之间发生密接交互,包括:The blockchain-based mining method according to claim 2, wherein the judging whether close interaction occurs with the target mobile terminal according to the Bluetooth strength and the motion state includes:
    将所述蓝牙强度和所述运动状态输入训练后的深度学习模型,以得到预测的密接交互概率,并根据所述密接交互概率判断是否与所述目标 移动终端之间发生密接交互。Input the bluetooth strength and the motion state into the trained deep learning model to obtain the predicted close interaction probability, and judge whether close interaction occurs with the target mobile terminal according to the close interaction probability.
  4. 根据权利要求1所述的基于区块链的挖矿方法,其特征在于,在所述获取所述目标移动终端的身份信息之前,还包括:The blockchain-based mining method according to claim 1, wherein, before said acquiring the identity information of said target mobile terminal, further comprising:
    若判定与所述目标移动终端之间发生密接交互,则获取所述目标移动终端的侧信道数据;If it is determined that a close interaction with the target mobile terminal occurs, acquiring side channel data of the target mobile terminal;
    将所述目标移动终端的侧信道数据和自身的侧信道数据发送到所述服务器,并接收所述服务器返回的根据所述目标移动终端的侧信道数据和自身的侧信道数据确定得到的密接交互的有效性结果。Sending the side channel data of the target mobile terminal and its own side channel data to the server, and receiving the close interaction returned by the server and determined according to the side channel data of the target mobile terminal and its own side channel data effectiveness results.
  5. 根据权利要求1所述的基于区块链的挖矿方法,其特征在于,在所述若所述哈希值满足出块条件,则生成所述待生成区块之后,还包括:The mining method based on block chain according to claim 1, wherein, after said if said hash value satisfies the condition of producing a block, after generating said block to be generated, further comprising:
    根据预设出块确认机制确认所述待生成区块完成出块;Confirm that the block to be generated is completed according to the preset block confirmation mechanism;
    根据所述随机项对出块奖励进行结算。The block reward is settled according to the random item.
  6. 根据权利要求5所述的基于区块链的挖矿方法,其特征在于,所述根据所述随机项对出块奖励进行结算,包括:The blockchain-based mining method according to claim 5, wherein said settlement of block rewards according to said random items includes:
    按照预设分配比例将所述出块奖励分配给出块矿工和参与所述随机项生成的其他矿工;According to the preset distribution ratio, the block rewards are distributed to the block miners and other miners participating in the generation of the random items;
    根据所述其他矿工中各个矿工在生成所述随机项过程中的密接交互次数贡献对所述其他矿工分配得到的出块奖励再次进行分配。The block generation rewards allocated to the other miners are redistributed according to the contribution of the number of close interactions of each of the other miners in the process of generating the random item.
  7. 根据权利要求5所述的基于区块链的挖矿方法,其特征在于,所述方法还包括:The blockchain-based mining method according to claim 5, wherein the method further comprises:
    创建志愿者用户,所述志愿者用户开启被获取实时密接交互次数的权 限;Create a volunteer user, and the volunteer user opens the authority to obtain the number of real-time close interactions;
    从所述志愿者用户中随机选择至少一个样本作为基准志愿者用户;将所述基准志愿者用户的实时密接交互次数的中位数确定为基准交互次数;Randomly select at least one sample from the volunteer users as a benchmark volunteer user; determine the median of the number of real-time close interactions of the benchmark volunteer users as the benchmark interaction number;
    相应的,所述根据所述随机项对出块奖励进行结算,包括:Correspondingly, the settlement of the block reward according to the random item includes:
    根据所述随机项以及所述基准交互次数对所述出块奖励进行结算;Settle the block generation reward according to the random item and the reference number of interactions;
    在所述根据预设出块确认机制确认所述待生成区块完成出块之后,还包括:After confirming that the block to be generated is completed according to the preset block confirmation mechanism, it also includes:
    根据各个所述基准志愿者用户的实时密接交互次数和所述基准交互次数对所述基准志愿者用户的分享奖励进行结算,所述分享奖励随所述出块奖励线性变化。The sharing rewards of the benchmark volunteer users are settled according to the real-time close interaction times of each benchmark volunteer user and the benchmark interaction times, and the sharing rewards vary linearly with the block generation rewards.
  8. 一种基于区块链的挖矿装置,其特征在于,包括:A blockchain-based mining device, characterized in that it comprises:
    信息获取模块,用于获取区块链发布的待生成区块的区块头信息;The information acquisition module is used to obtain the block header information of the block to be generated released by the block chain;
    密接交互判定模块,用于判断是否与目标移动终端之间发生密接交互,若是,则获取所述目标移动终端的身份信息;A close interaction determination module, configured to determine whether close interaction occurs with the target mobile terminal, and if so, obtain the identity information of the target mobile terminal;
    信息加密模块,用于将所述目标移动终端的身份信息发送到服务器,并接收所述服务器返回的所述目标移动终端的加密身份信息;An information encryption module, configured to send the identity information of the target mobile terminal to a server, and receive the encrypted identity information of the target mobile terminal returned by the server;
    信息生成模块,用于根据所述目标移动终端的加密身份信息和自身的加密身份信息生成物理交互信息并存储在本地;An information generating module, configured to generate physical interaction information according to the encrypted identity information of the target mobile terminal and its own encrypted identity information and store it locally;
    随机项生成模块,用于根据本地存储的所述物理交互信息生成随机项;A random item generating module, configured to generate a random item according to the locally stored physical interaction information;
    哈希值计算模块,用于根据所述区块头信息和所述随机项计算哈希值;a hash value calculation module, configured to calculate a hash value according to the block header information and the random item;
    区块生成模块,用于若所述哈希值满足出块条件,则生成所述待生成 区块。A block generating module, configured to generate the block to be generated if the hash value satisfies the block-out condition.
  9. 一种移动终端,其特征在于,包括:A mobile terminal, characterized in that it comprises:
    一个或多个处理器;one or more processors;
    存储器,用于存储一个或多个程序;memory for storing one or more programs;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7中任一所述的基于区块链的挖矿方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the blockchain-based mining method according to any one of claims 1-7.
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-7中任一所述的基于区块链的挖矿方法。A computer-readable storage medium on which a computer program is stored, wherein when the program is executed by a processor, the blockchain-based mining method according to any one of claims 1-7 is implemented.
PCT/CN2021/119096 2021-05-27 2021-09-17 Blockchain-based mining method and apparatus, and mobile terminal and storage medium WO2022247069A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110587394.5 2021-05-27
CN202110587394.5A CN113364596A (en) 2021-05-27 2021-05-27 Ore digging method and device based on block chain, mobile terminal and storage medium

Publications (1)

Publication Number Publication Date
WO2022247069A1 true WO2022247069A1 (en) 2022-12-01

Family

ID=77528071

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/119096 WO2022247069A1 (en) 2021-05-27 2021-09-17 Blockchain-based mining method and apparatus, and mobile terminal and storage medium

Country Status (2)

Country Link
CN (1) CN113364596A (en)
WO (1) WO2022247069A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113364596A (en) * 2021-05-27 2021-09-07 南方科技大学 Ore digging method and device based on block chain, mobile terminal and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180109541A1 (en) * 2016-10-17 2018-04-19 Arm Ltd. Blockchain mining using trusted nodes
CN108365960A (en) * 2017-12-29 2018-08-03 北京欧链科技有限公司 Random number providing method and device
CN109087105A (en) * 2018-08-31 2018-12-25 深圳付贝科技有限公司 For digging the Hash Search method of mine, digging mine machine and block catenary system
CN109242299A (en) * 2018-08-31 2019-01-18 深圳付贝科技有限公司 Distribution digs mine method, digs mine machine and block catenary system
US20200195421A1 (en) * 2018-12-12 2020-06-18 Hewlett Packard Enterprise Development Lp Mining for internet access
CN111682946A (en) * 2020-05-29 2020-09-18 南方科技大学 Ore digging method and device based on block chain, computer equipment and storage medium
WO2020229950A1 (en) * 2019-05-10 2020-11-19 nChain Holdings Limited Methods and devices for recording work history and proving reputation in a blockchain network
CN112182565A (en) * 2020-08-31 2021-01-05 武汉市果壳璐网络科技有限公司 Mining method and device based on SCV, storage medium and equipment
CN113098677A (en) * 2021-04-06 2021-07-09 南方科技大学 Ore digging method and device based on block chain, computer equipment and storage medium
CN113364596A (en) * 2021-05-27 2021-09-07 南方科技大学 Ore digging method and device based on block chain, mobile terminal and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018046009A1 (en) * 2016-09-12 2018-03-15 上海鼎利信息科技有限公司 Block chain identity system
CN107656812A (en) * 2017-09-27 2018-02-02 咪咕文化科技有限公司 block chain processing method, system, node device, terminal and storage medium
CN109583893B (en) * 2018-11-21 2020-07-10 北京航空航天大学 Traceable block chain-based digital currency transaction system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180109541A1 (en) * 2016-10-17 2018-04-19 Arm Ltd. Blockchain mining using trusted nodes
CN108365960A (en) * 2017-12-29 2018-08-03 北京欧链科技有限公司 Random number providing method and device
CN109087105A (en) * 2018-08-31 2018-12-25 深圳付贝科技有限公司 For digging the Hash Search method of mine, digging mine machine and block catenary system
CN109242299A (en) * 2018-08-31 2019-01-18 深圳付贝科技有限公司 Distribution digs mine method, digs mine machine and block catenary system
US20200195421A1 (en) * 2018-12-12 2020-06-18 Hewlett Packard Enterprise Development Lp Mining for internet access
WO2020229950A1 (en) * 2019-05-10 2020-11-19 nChain Holdings Limited Methods and devices for recording work history and proving reputation in a blockchain network
CN111682946A (en) * 2020-05-29 2020-09-18 南方科技大学 Ore digging method and device based on block chain, computer equipment and storage medium
CN112182565A (en) * 2020-08-31 2021-01-05 武汉市果壳璐网络科技有限公司 Mining method and device based on SCV, storage medium and equipment
CN113098677A (en) * 2021-04-06 2021-07-09 南方科技大学 Ore digging method and device based on block chain, computer equipment and storage medium
CN113364596A (en) * 2021-05-27 2021-09-07 南方科技大学 Ore digging method and device based on block chain, mobile terminal and storage medium

Also Published As

Publication number Publication date
CN113364596A (en) 2021-09-07

Similar Documents

Publication Publication Date Title
Aggarwal et al. Blockchain for smart communities: Applications, challenges and opportunities
Si et al. IoT information sharing security mechanism based on blockchain technology
WO2022042301A1 (en) Data processing method and apparatus, smart device and storage medium
US20220092586A1 (en) Off network identity tracking in anonymous cryptocurrency exchange networks
Hammi et al. Bubbles of Trust: A decentralized blockchain-based authentication system for IoT
Li et al. Rational protocols and attacks in blockchain system
Eyal The miner's dilemma
US20240113868A1 (en) Controlled cryptographic private key release
US11588643B2 (en) Blockchain management system
TW201947446A (en) Blockchain-based information supervision method and device
Ye et al. A trust-centric privacy-preserving blockchain for dynamic spectrum management in IoT networks
Zhou et al. Blockchain-enabled secure and trusted federated data sharing in IIoT
WO2022213546A1 (en) Blockchain-based mining method and apparatus, computer device and storage medium
Urmila et al. A comparitive study of blockchain applications for enhancing internet of things security
Zhu et al. Blockchain technology in internet of things
WO2022247069A1 (en) Blockchain-based mining method and apparatus, and mobile terminal and storage medium
Zhang et al. A reputation mechanism based Deep Reinforcement Learning and blockchain to suppress selfish node attack motivation in Vehicular Ad-Hoc Network
Gao et al. BFR-SE: a blockchain-based fair and reliable searchable encryption scheme for IoT with fine-grained access control in cloud environment
JP7422892B2 (en) Processing machine learning modeling data to improve classification accuracy
Feng et al. Blockchain-based secure crowdsourcing in wireless IoT
Hu et al. Blockchain-enhanced fair and efficient energy trading in industrial internet of things
Wang et al. Achieving reliable and anti-collusive outsourcing computation and verification based on blockchain in 5G-enabled IoT
Firdaus et al. A Blockchain-Assisted Distributed Edge Intelligence for Privacy-Preserving Vehicular Networks.
CN111262853B (en) Information transmission method, device, computer equipment and storage medium based on alliance chain
Sarkar et al. Cloud enabled Blockchain-based secured communication in mutual intelligent transportation using neural synchronization

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21942636

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE