CN111737765A - Method and device for managing block chain resources - Google Patents

Method and device for managing block chain resources Download PDF

Info

Publication number
CN111737765A
CN111737765A CN202010759162.9A CN202010759162A CN111737765A CN 111737765 A CN111737765 A CN 111737765A CN 202010759162 A CN202010759162 A CN 202010759162A CN 111737765 A CN111737765 A CN 111737765A
Authority
CN
China
Prior art keywords
blockchain
user
target
resources
motion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010759162.9A
Other languages
Chinese (zh)
Inventor
黄琪
韩喆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202010759162.9A priority Critical patent/CN111737765A/en
Publication of CN111737765A publication Critical patent/CN111737765A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Finance (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The present specification provides a method and an apparatus for managing blockchain resources, where the method may include: receiving a resource creating transaction, wherein the resource creating transaction comprises movement data, user identity information and movement equipment information, and the movement data is generated by the movement of a target user corresponding to the user identity information on movement equipment corresponding to the movement equipment information; verifying whether the motion equipment corresponding to the motion equipment information is registered in a block chain; and under the condition that the sports equipment is determined to be registered in the blockchain, executing intelligent contract code for managing blockchain resources to convert the sports data into target blockchain resources belonging to the target user, and managing the blockchain resources corresponding to the user identity information according to the number of the target blockchain resources.

Description

Method and device for managing block chain resources
Technical Field
The present disclosure relates to the field of information technologies, and in particular, to a method and an apparatus for managing block chain resources.
Background
The blockchain technique (also known as the distributed ledger technique) is a decentralized distributed database technique. Due to the adoption of a decentralized network structure, a consensus mechanism and a chain block structure, the block chain technology has the characteristics of decentralized, public transparency, no tampering, trustiness and the like, and is suitable for a plurality of application scenes with high requirements on data reliability.
Disclosure of Invention
In view of the above, one or more embodiments of the present disclosure provide a method and apparatus for managing blockchain resources.
To achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments of the present specification, a method for managing blockchain resources is provided, which is applied to a blockchain node; the method comprises the following steps:
receiving a resource creating transaction, wherein the resource creating transaction comprises movement data, user identity information and movement equipment information, and the movement data is generated by the movement of a target user corresponding to the user identity information on movement equipment corresponding to the movement equipment information;
verifying whether the motion equipment corresponding to the motion equipment information is registered in a block chain;
and under the condition that the sports equipment is determined to be registered in the blockchain, executing intelligent contract code for managing blockchain resources to convert the sports data into target blockchain resources belonging to the target user, and managing the blockchain resources corresponding to the user identity information according to the number of the target blockchain resources.
According to a second aspect of one or more embodiments of the present specification, a method for managing blockchain resources is provided, which is applied to a client; the method comprises the following steps:
acquiring target data, wherein the target data comprises motion data, user identity information and motion equipment information, and the motion data is generated by the motion of a target user corresponding to the user identity information on motion equipment corresponding to the motion equipment information;
and sending the target data to a blockchain node, so that the blockchain node converts the sports data into target blockchain resources belonging to the target user by executing intelligent contract codes for managing blockchain resources under the condition that the sports equipment is determined to be registered in a blockchain, wherein the quantity of the target blockchain resources is used for managing the blockchain resources corresponding to the user identity information.
According to a third aspect of one or more embodiments of the present specification, an apparatus for managing blockchain resources is provided, which is applied to a blockchain node; the device comprises:
the resource creating transaction comprises movement data, user identity information and movement equipment information, and the movement data is generated by movement of a target user corresponding to the user identity information on movement equipment corresponding to the movement equipment information;
the verification unit is used for verifying whether the sports equipment corresponding to the sports equipment information is registered in the block chain;
and the execution unit is used for executing intelligent contract codes for managing blockchain resources under the condition that the sports equipment is determined to be registered in the blockchain, so that the sports data is converted into target blockchain resources belonging to the target user, and the blockchain resources corresponding to the user identity information are managed according to the number of the target blockchain resources.
According to a fourth aspect of one or more embodiments of the present specification, an apparatus for managing blockchain resources is provided, which is applied to a client; the device comprises:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring target data, the target data comprises motion data, user identity information and motion equipment information, and the motion data is generated by the motion of a target user corresponding to the user identity information on motion equipment corresponding to the motion equipment information;
a sending unit, configured to send the target data to a blockchain node, so that the blockchain node, when determining that the sports device is registered in a blockchain, converts the sports data into a target blockchain resource belonging to the target user by executing an intelligent contract code for managing blockchain resources, where the amount of the target blockchain resource is used to manage the blockchain resource corresponding to the user identity information.
According to a fifth aspect of one or more embodiments of the present specification, there is provided an electronic device. The electronic device includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method according to the first aspect or the second aspect by executing the executable instructions.
According to a sixth aspect of one or more embodiments of the present description, there is provided a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method according to the first or second aspect.
Drawings
Fig. 1 is a schematic diagram of a network architecture provided in an exemplary embodiment of the present specification.
Fig. 2 is a flowchart of a method for managing blockchain resources according to an exemplary embodiment of the present disclosure.
Fig. 3 is a flowchart of another block chain resource management method according to an exemplary embodiment of the present disclosure.
Fig. 4 is a flowchart of another block chain resource management method according to an exemplary embodiment of the present disclosure.
Fig. 5 is a schematic diagram of a blockchain account provided in an exemplary embodiment of the present disclosure.
Fig. 6 is a schematic diagram of another blockchain account provided by an exemplary embodiment of the present specification.
Fig. 7 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Fig. 8 is a block diagram of an apparatus for managing blockchain resources according to an exemplary embodiment of the present disclosure.
Fig. 9 is a block diagram of another apparatus for managing blockchain resources according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
Blockchains are generally divided into three types: public chain (Public Blockchain), private chain (PrivateBlockchain) and alliance chain (Consortium Blockchain). In addition, there are various types of combinations, such as private chain + federation chain, federation chain + public chain, and other different combinations. The most decentralized of these is the public chain. The public chain is represented by bitcoin and ether house, and the participants joining the public chain can read the data record on the chain, participate in transaction, compete for the accounting right of the new block, and the like, and each participant (i.e. node) can freely join and leave the network. The private chain is opposite, the data writing authority of the network is controlled by a certain organization or organization, and the data reading authority is regulated by the organization; briefly, the private chain can be a weakly centralized system with strict restrictions and few participating nodes, so that the private chain is more suitable for use within a particular organization. A federation chain is a block chain between a public chain and a private chain, and "partial decentralization" can be achieved. Each node in the federation chain usually has a corresponding entity organization or organization, and participants jointly maintain the operation of the block chain by authorizing to join the network and forming a profit-related federation. When receiving the blockchain transaction, the blockchain node may process the blockchain transaction in a manner in the related art, and does not need to implement special processing different from the related art, so that the blockchain node may be applied to the technical solution of the present specification regardless of the public chain, the private chain, or the alliance chain.
In the blockchain network, corresponding blockchain transactions are submitted to blockchain link points, corresponding intelligent contracts can be triggered and executed by the blockchain transactions, and complex functions can be realized by calling the intelligent contracts.
Of course, different intelligent contracts can be triggered and executed in the blockchain network through blockchain transaction to realize different functions, and each intelligent contract is used for realizing the corresponding function. Alternatively, different functions may be implemented by calling different interfaces in the same intelligent contract, one or more interfaces may be defined in the intelligent contract, each interface being used for implementing a corresponding function, and then when the intelligent contract is called through a blockchain transaction, which interface or interfaces defined in the intelligent contract are declared to be called to implement the corresponding function. Smart contracts are pre-deployed executable code on a blockchain that allows trusted transactions to be conducted without third parties, and which are traceable and irreversible. The management of the blockchain resources can be realized by invoking an intelligent contract, for example, converting the data under the chain into the corresponding blockchain resources, transferring the blockchain resources, or querying the quantity, etc.
With the popularization of healthy life, more and more people walk into a gymnasium or use outdoor fitness equipment in public places such as communities, schools and the like to exercise. At present, users corresponding to fitness equipment of a fitness room or outdoor fitness equipment are frequently changed, so that different exercise data generated by different users using the fitness equipment are often difficult to accurately associate with the users.
The intelligent contract can be called through the blockchain transaction to realize the management of blockchain resources obtained by converting the motion data. The following examples are given for illustrative purposes.
Fig. 1 is a schematic diagram of a network architecture provided by an exemplary embodiment. As shown in fig. 1, the client 10 may generate a blockchain transaction and may submit the transaction to the blockchain node 11n, so that the node 11n may chain the blockchain transaction submitted by the client 10 after recognizing with other nodes, and thus, may verify the blockchain transaction submitted by the client 10. Of course, node 11n, as well as other nodes, may invoke smart contracts to implement corresponding functionality based on blockchain transactions. The smart device 10 may include a smart device or a smart collection module included in the sports device, and the smart device 10 may further include an electronic device, such as a mobile phone, a tablet device, a notebook computer, a handheld computer (PDAs), a wearable device (e.g., smart glasses, a smart watch, etc.), and one or more embodiments of the present disclosure are not limited thereto.
Fig. 2 illustrates a method for managing blockchain resources according to this specification. As shown in fig. 2, the method is applied to a blockchain node; the method may comprise the steps of:
step 202, receiving a resource creating transaction, where the resource creating transaction includes motion data, user identity information, and motion device information, and the motion data is generated by a target user corresponding to the user identity information moving on a motion device corresponding to the motion device information.
In an embodiment, the exercise data may include a time length of operation of the corresponding exercise device, geographic location information corresponding to the exercise device, an exercise time period, and consumed energy, such as calories, etc., the exercise device may include a treadmill, a spinning bike, a spring-grip, or an elliptical trainer, etc., and the exercise device may be a public exercise device in an exercise room or a public place, or may be a private exercise device, which is not limited in this specification. The user identity information may include a user account, a code of the user, or exclusive identification information, and the like, and may also be a public key or a private key in an asymmetric key pair maintained by the user, which is not limited in this specification. The motion device information may include a code, exclusive identification information, and the like of the device, and may also be a public key or a private key in an asymmetric key pair maintained by the motion device, which is not limited in this specification. The motion data are generated by the motion device corresponding to the motion device information, the motion device may have a network communication function, the motion device may directly upload the motion data to the block chain network, or the motion device may be connected to other electronic devices such as the user equipment through wifi, BLE (Bluetooth Low Energy, Bluetooth Low power consumption) and other near field communication technologies, and the motion device may send the motion data to the electronic devices such as the user equipment, and upload the motion data to the block chain network by the other electronic devices such as the user equipment.
In an embodiment, the block link point may receive a resource creation transaction submitted by the client, where the resource creation transaction may include motion data and user identity information, and the motion data may be generated by a target user corresponding to the user identity information performing a motion. The client may be a motion device that generates the motion data, a user device corresponding to the target user, or other electronic devices that are different from the motion device and the user device, and the like, which is not limited in this specification.
Step 204, verifying whether the motion device corresponding to the motion device information is registered in the block chain.
In an embodiment, the block link point may query whether the motion device information is recorded in a preset device registration set, and if the motion device information is recorded in the device registration set, it may be determined that the motion device is already registered in the block chain; and if the mobile device is not recorded in the device registration set, refusing to execute the resource creation transaction. The device registration set may record information corresponding to the sports device that submitted the registration transaction to the block link point and registered successfully.
In an embodiment, the motion device information may include a second signature generated by the motion device that generates the motion data for the motion data, that is, the motion data is signed by using a private key in an asymmetric key pair maintained by the motion device, then the block chain node may execute an intelligent contract code for signature verification, the block chain node may find, from public key information of a plurality of pre-stored motion devices, a second public key corresponding to the motion device that generates the motion data, or the resource creation transaction may include a certificate trust chain of the motion device, and the block chain node may obtain, from the certificate trust chain, the second public key corresponding to the motion device. The blockchain node may verify the second signature according to the second public key, and in the event that the second signature is verified according to the second public key, may determine that the mobile device is already registered in the blockchain. The asymmetric key pair may be generated by the motion device under the link or by other ways, and the key source is not limited in this specification.
And step 206, under the condition that the sports equipment is determined to be registered in the blockchain, executing intelligent contract code for managing blockchain resources to convert the sports data into target blockchain resources belonging to the target user, and managing the blockchain resources corresponding to the user identity information according to the number of the target blockchain resources.
In an embodiment, in case of verifying that the sports device is registered in the blockchain, the blockchain link point may directly execute an intelligent contract code for managing blockchain resources according to the resource creation transaction, thereby converting the sports data into target blockchain resources attributed to the target user, and may manage blockchain resources corresponding to the user identity information according to the number of the target blockchain resources.
In an embodiment, when each piece of user identity information has a corresponding blockchain account, the blockchain link point may update the blockchain account corresponding to the user identity information of the target user according to the number of the target blockchain resources, thereby implementing management of the blockchain resources. For example, the Balance (Balance) in the blockchain account corresponding to the user identity information of the target user is updated, and the like, which is not limited in this specification.
In an embodiment, in a case that a mapping relationship between the number of blockchain resources per conversion and corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing blockchain resources, a blockchain link point may generate a mapping relationship between the number of target blockchain resources and user identity information corresponding to a target user, and may record the mapping relationship to a blockchain account corresponding to an intelligent contract for managing blockchain resources, thereby implementing management of blockchain resources.
Of course, when there is a corresponding blockchain account in each user identity information, a mapping relationship between the number of blockchain resources converted each time and the corresponding user identity information may also be maintained in the blockchain account corresponding to the intelligent contract for managing blockchain resources, which is not limited in this specification. The blockchain link point may update the blockchain account corresponding to the user identity information of the target user according to the number of the target blockchain, and at the same time, the blockchain link point may generate a mapping relationship between the number of the target blockchain resource and the user identity information corresponding to the target user, and may record the mapping relationship to the blockchain account corresponding to the intelligent contract for managing the blockchain resource, thereby implementing management of the blockchain resource.
In an embodiment, the user identity information may include a first signature generated by the target user for the motion data, that is, the motion data is signed by using a private key in an asymmetric key pair maintained by the target user, then the block chain node may execute an intelligent contract code for signature verification, the block chain node may find the first public key corresponding to the target user from pre-stored public key information of multiple users, or the resource creation transaction may include a certificate trust chain of the target user, and the block chain node may obtain the first public key corresponding to the target user from the certificate trust chain, where the source of the public key is not limited in this specification. The blockchain node may verify the first signature according to the first public key, and only execute the intelligent contract code for managing blockchain resources when the first signature is verified according to the first public key, so as to convert the motion data into target blockchain resources belonging to the target user, and may manage the blockchain resources corresponding to the user identity information according to the number of the target blockchain resources. That is to say, the precondition for converting the motion data into the target blockchain resource belonging to the target user and managing the blockchain resource corresponding to the user identity information according to the number of the target blockchain resources may include: and the first signature is verified to pass. The asymmetric key pair may be generated by a user device corresponding to a target user in a chain or by other ways, and the source of the key is not limited in this specification.
In an embodiment, the user identity information may include a first signature generated by the target user for the motion data, and the received resource creation transaction may include a second signature generated by the motion device generating the motion data for the motion data, then the block link node may execute an intelligent contract code for signature verification, may acquire a first public key corresponding to the target user and a second public key corresponding to the motion device, respectively, so that the first signature may be verified according to the first public key and the second signature may be verified according to the second public key, and in a case that the first public key verifies the first signature and the second public key verifies the second signature, the block link node executes the intelligent contract code for managing the block link resources, so as to convert the motion data into the target block link resources belonging to the target user, and may manage the block link resources corresponding to the user identity information according to the number of the target block link resources. That is to say, the precondition for converting the motion data into the target blockchain resource belonging to the target user and managing the blockchain resource corresponding to the user identity information according to the number of the target blockchain resources may include: and respectively verifying the first signature and the second signature. In this specification, the order of generation of the first signature and the second signature is not limited, and the first signature may be generated first and then the second signature may be generated, or the second signature may be generated first and then the first signature may be generated.
In an embodiment, the block link point may further execute an intelligent contract code for verifying the motion data, so that the motion data may be matched with historical motion data, where all the motion data received by the block link node within a preset time period are recorded in the historical motion data, and the preset time period may be set according to an actual requirement, which is not limited in this specification. And the blockchain node executes the intelligent contract code for managing blockchain resources only if historical motion data matching the motion data is not found. That is to say, the precondition for converting the motion data into the target blockchain resource belonging to the target user and managing the blockchain resource corresponding to the user identity information according to the number of the target blockchain resources may include: no historical motion data matching the motion data is found. In the case where the historical motion data matching the motion data is found, the intelligent contract code for managing the blockchain resources may be rejected from being executed, so that the same motion data may be prevented from being used multiple times.
In an embodiment, the block link point may further receive a query transaction sent by a client, where the client may be a motion device generating the motion data, a user device corresponding to a target user, or another electronic device, and the description herein is not limited thereto. Under the condition that each piece of user identity information has a corresponding blockchain account, the blockchain link point can execute an intelligent contract code for inquiring blockchain resources according to the inquiry transaction, and then the blockchain link point can directly read the total number of blockchain resources corresponding to the target user from the blockchain account corresponding to the user identity information of the target user.
In an embodiment, the blockchain link point may further receive an inquiry transaction sent by the client, and in a case that a mapping relationship between the number of blockchain resources per conversion and corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing blockchain resources, the blockchain link point may execute an intelligent contract code for inquiring blockchain resources according to the inquiry transaction, so that a specific mapping relationship including the user identity information of the target user may be screened out from the mapping relationship maintained by the blockchain account corresponding to the intelligent contract for managing blockchain resources, and the number of blockchain resources per conversion included in the screened specific mapping relationship may be counted, thereby obtaining the total number of blockchain resources corresponding to the target user.
In one embodiment, the blockchain link point may receive a resource transfer transaction initiated by a first user, and in the case that there exists a corresponding blockchain account for each user identity information, the blockchain link point may transfer a specified amount of blockchain resources from the blockchain account corresponding to the first user to the blockchain account corresponding to a second user by executing an intelligent contract code for transferring blockchain resources.
In an embodiment, a blockchain link point may receive a resource transfer transaction initiated by a first user, and in a case that a mapping relationship between the number of blockchain resources per conversion and corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing blockchain resources, the blockchain link point may change, by calling an intelligent contract code for transferring blockchain resources, user identity information of the first user in the mapping relationship containing a specified number of blockchain resources maintained in the blockchain account corresponding to the intelligent contract for managing blockchain resources into user identity information of a second user. For example, the number of the blockchain resources transferred from the first user to the second user is 10, the blockchain link point may include a mapping relationship "blockchain resource 20," user identity information of the first user "is modified to" blockchain resource 10, "user identity information of the first user" and "blockchain resource 10," user identity information of the second user "of the mapping relationship, and the like, which is not limited in this specification.
In an embodiment, the resource transfer transaction may further include a specific signature of the first user for a specific number of blockchain resources, that is, the specific number of blockchain resources are signed by using a private key of an asymmetric key pair maintained by the first user. The block chain node may execute the intelligent contract code for signature verification, may obtain a specified public key corresponding to the first user, may verify the specified signature according to the specified public key, and only if the specified signature is verified, the block chain node executes the intelligent contract code for transferring the block chain resource. That is, the precondition for executing the intelligent contract code for transferring the blockchain resources includes: the specified signature is verified.
In an embodiment, in a situation that a mapping relationship between the number of blockchain resources converted each time and corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing blockchain resources, and the mapping relationship may further include identification information of a corresponding piece of sports equipment and identification information of a sports venue to which the piece of sports equipment belongs, where the identification information may include a corresponding number or name, and the like, which is not limited in this specification.
Then, the block link point may receive a passenger flow query transaction, where the passenger flow query transaction may include identification information of a target moving location or identification information of each target moving device, the block link point may execute an intelligent contract code for querying a passenger flow situation, the block link point may screen all specific mapping relationships including the target moving location from the mapping relationships, the block link point may count the number of block link resources converted each time according to the specific mapping relationships, or the block link point may screen all specific mapping relationships including the target moving device from the mapping relationships, and then the block link point may count the number of block link resources converted each time according to the specific mapping relationships, and the like, which is not limited in this specification. For example, the treadmill a and the treadmill B belong to the gym 01, the treadmill C and the treadmill D belong to the gym 02, and when the block link point receives a passenger flow query transaction for the gym 01, the block link point may execute an intelligent contract code for querying a passenger flow situation, and then the block link point may screen a mapping relation including the treadmill a and the treadmill B from a mapping relation maintained in a block chain account corresponding to an intelligent contract for managing block chain resources, and may perform statistics on the mapping relation including the treadmill a and the treadmill B, for example, may perform statistics on the number of block chain resources converted by the treadmill a and the treadmill B each time, may perform statistics on the number of times the treadmill a and the treadmill B are used, and the like.
Of course, in the intelligent contract for inquiring passenger flow conditions, only the statistics of the corresponding fitness equipment can be limited to be returned, and the privacy information of the corresponding user is not returned, so that the leakage of the privacy information of the user is avoided. The statistical value can be used for adjusting the production and operation strategy of the sport place, can evaluate the passenger flow volume of the sport place and the like, and is beneficial to the continuous and stable development of the sport place. And the intelligent contract can also limit that the received passenger flow inquiry transaction contains the signature of the corresponding motion equipment and execute the intelligent contract for inquiring the passenger flow condition only under the condition that the signature of the motion equipment is verified, thereby avoiding the leakage of the service condition of the motion equipment and preventing a third party from stealing related data.
In an embodiment, the intelligent contract code for managing blockchain resources, the intelligent contract code for verifying sports data, the intelligent contract code for signature verification, the intelligent contract code for querying blockchain resources, and the intelligent contract code for transferring blockchain resources may correspond to a plurality of interfaces in the same intelligent contract, respectively, or the intelligent contract code for managing blockchain resources, the intelligent contract code for verifying sports data, the intelligent contract code for signature verification, the intelligent contract code for querying blockchain resources, and the intelligent contract code for transferring blockchain resources may correspond to a plurality of intelligent contracts, respectively, which is not limited in this specification.
As can be seen from the above technical solutions, in this specification, a resource creation transaction is received, an intelligent contract code for managing a blockchain resource is executed, motion data can be converted into a target blockchain resource belonging to a target user, and the motion data can be converted into a quantifiable blockchain resource, so that a user can process the blockchain resource belonging to the user through a resource transfer transaction or an inquiry transaction, thereby improving the enthusiasm of the user for using a motion device, and at the same time, the user or the motion device generating the motion data can sign the motion data, thereby preventing the motion data from being tampered during transmission, preventing a third party from tampering user identity information, improving the accuracy and reliability of the transformed blockchain resource, and enabling the motion device to perform near-field communication with a user device corresponding to the user, in case that the sports device does not have the network communication function, the user device may upload the sports data received from the sports device to the blockchain network, so that more sports data generated by the sports device may be converted into blockchain resources.
Fig. 3 is a flowchart illustrating a method for managing blockchain resources according to the present disclosure. As shown in fig. 3, the method may be applied to a client; the method may comprise the steps of:
step 302, target data is obtained, where the target data includes motion data, user identity information, and motion device information, and the motion data is generated by a target user corresponding to the user identity information moving on a motion device corresponding to the motion device information.
In an embodiment, the client may be a sports device that generates sports data, a user device corresponding to a target user, or other electronic devices, which is not limited in this specification. The exercise data may include a time length of the corresponding exercise device, geographic location information corresponding to the exercise device, an exercise time period, and consumed energy, such as calories, etc., the exercise device may include a treadmill, a spinning bike, a spring-grip, or an elliptical trainer, etc., the exercise device may be a public exercise device in a gymnasium or a public place, or may be a private exercise device, which is not limited in this specification. The user identity information may include a user account, a code of the user, or exclusive identification information, and the like, and may also be a public key or a private key in an asymmetric key pair maintained by the user, which is not limited in this specification. The motion device information may include a code, exclusive identification information, and the like of the device, and may also be a public key or a private key in an asymmetric key pair maintained by the motion device, which is not limited in this specification.
In an embodiment, the client may obtain target data, where the target data may include motion data, user identity information, and motion device information, and the motion data may be generated by a target user corresponding to the user identity information performing a motion, and the motion data is generated by a motion device corresponding to the motion device information included in the target data.
In an embodiment, the target data may include a first signature generated by the target user for the target data and a second signature generated by the sports device generating the sports data for the sports data, that is, the target data is signed by a private key of an asymmetric key pair maintained by the target user and signed by a private key of an asymmetric key pair maintained by the sports device, respectively. Alternatively, only the first signature generated by the target user for the target data may be included in the target data. Alternatively, the target data may only include the second signature generated for the motion data by the motion device that generates the motion data, which is not limited in this specification.
Step 304, sending the target data to a blockchain node, so that the blockchain node converts the sports data into a target blockchain resource belonging to the target user by executing an intelligent contract code for managing blockchain resources under the condition that the sports equipment is determined to be registered in a blockchain, wherein the amount of the target blockchain resource is used for managing the blockchain resource corresponding to the user identity information.
In an embodiment, the client may send the target data to the blockchain node, so that the blockchain node may convert the sports data into a target blockchain resource attributed to the target user by executing an intelligent contract code for managing blockchain resources, and the amount of the target blockchain resource may be used for managing blockchain resources corresponding to the user identity information, in case of verifying that the sports device is already registered in the blockchain.
In an embodiment, the client may send the target data to the blockchain node, and the blockchain node may query whether the sports equipment information is recorded in a preset equipment registration set, and if the sports equipment information is recorded in the equipment registration set, it may be determined that the sports equipment is already registered in the blockchain; and if the mobile device is not recorded in the device registration set, refusing to execute the resource creation transaction. The device registration set may record information corresponding to the sports device that submitted the registration transaction to the block link point and registered successfully.
In an embodiment, in a case that the target data may include a first signature generated by a target user for the target data and a second signature generated by a sports device generating the sports data for the sports data, after receiving the target data, the block link node may execute an intelligent contract code for signature verification, verify the first signature and the second signature respectively, and in a case that the first signature and the second signature are verified, the block link node executes the intelligent contract code for managing block link resources, converts the sports data into the target block link resources belonging to the target user, and the amount of the target block link resources may be used for managing the block link resources corresponding to the user identity information.
In an embodiment, in the case that only the first signature generated by the target user for the target data may be included in the target data, after receiving the target data, the block chain node may execute the smart contract code for signature verification first to verify the first signature. And under the condition that the first signature verification passes, the blockchain node executes intelligent contract codes for managing blockchain resources, and converts the motion data into target blockchain resources belonging to the target user; or, in the case that the target data includes only the second signature generated by the sports device generating the sports data for the sports data, after receiving the target data, the block link point may execute the smart contract code for signature verification first to verify the second signature. And in case the second signature verification passes, the blockchain node executes the intelligent contract code for managing blockchain resources, and converts the motion data into target blockchain resources belonging to the target user.
As can be seen from the above technical solutions, in this specification, a resource creation transaction is received, an intelligent contract code for managing a blockchain resource is executed, motion data can be converted into a target blockchain resource belonging to a target user, and the motion data can be converted into a quantifiable blockchain resource, so that a user can process the blockchain resource belonging to the user through a resource transfer transaction or an inquiry transaction, thereby improving the enthusiasm of the user for using a motion device, and at the same time, the user or the motion device generating the motion data can sign the motion data, thereby preventing the motion data from being tampered during transmission, preventing a third party from tampering user identity information, improving the accuracy and reliability of the transformed blockchain resource, and enabling the motion device to perform near-field communication with a user device corresponding to the user, in case that the sports device does not have the network communication function, the user device may upload the sports data received from the sports device to the blockchain network, so that more sports data generated by the sports device may be converted into blockchain resources.
For the convenience of understanding, the technical solution of the present specification will be further explained with reference to fig. 4. Fig. 4 is a flowchart illustrating a method for managing blockchain resources according to an exemplary embodiment of the present disclosure. Assume that user a exercises using the exercise device 01 to generate corresponding exercise data and that the blockchain resource may be a corresponding exercise score. As shown in fig. 4, the following steps may be included:
step 401, registering the sports equipment and the user.
In this embodiment, each piece of sports equipment may submit a registration transaction to a block link point, where the registration transaction may include public key information in an asymmetric key pair maintained by each piece of sports equipment and an equipment number of each piece of sports equipment, and the block link point may execute an intelligent contract code for registration according to the registration transaction, so that a mapping relationship between the public key information and the equipment number of each piece of sports equipment may be recorded in a block link account corresponding to the intelligent contract for registration, such as the equipment binding snapshot library shown in fig. 5. The device number of the sports device is recorded in the block chain account, so that the public key information corresponding to the device number can be conveniently and quickly searched subsequently, and the processing efficiency can be improved. Of course, the registration transaction may only include the public key information in the asymmetric key pair maintained by the motion device, which is not limited in this specification.
Similarly, each user may submit a registration transaction to the blockchain node, where the registration transaction may include public key information in the asymmetric key pair maintained by each user and a user number corresponding to each user, and then the blockchain node may execute an intelligent contract code for registration according to the registration transaction, so that a mapping relationship between the public key information and the user number of each user may be recorded in a blockchain account corresponding to the intelligent contract for registration, such as the user binding snapshot library shown in fig. 5. The user number of the sports equipment is recorded in the blockchain account, so that the public key information corresponding to each user can be conveniently and quickly searched subsequently, and the processing efficiency can be improved. Of course, the registration transaction may only include the public key information in the asymmetric key pair maintained by the user, which is not limited in this specification.
In step 402, the motion device 01 generates motion data X.
Step 403, sending the target data to the user A.
In the present embodiment, assuming that the user a exercises with the exercise device 01 for 20 minutes and the exercise distance is 3 kilometers, the exercise device 01 may generate exercise data X, which may include: the exercise time is as follows: 19:00-19:20, the movement time length T =20min, the movement distance L =3km and the equipment number 01. And the motion device 01 may generate a first signature for the motion data X, that is, the motion data X is signed by using a device private key of an asymmetric key pair maintained by the motion device 01, so as to generate target data including the motion data X and the first signature. The near field communication can be performed between the motion device 01 and the user device M corresponding to the user a, and then the motion device 01 can send the acquired target data to the user device M.
Step 404, processing the target data.
At step 405, a resource creation transaction is generated.
In this embodiment, the user a may perform a second signature on the motion data X in the obtained target data, that is, perform a signature on the motion data X by using a user private key of an asymmetric key pair maintained by the user a. The user A can generate a resource creation transaction and submit the resource creation transaction to the block node through the user equipment M, the resource creation transaction can include the motion data X, the first signature and the second signature, and the resource creation transaction can also include the equipment number 01 of the motion equipment 01 and the user number A of the user A.
In this embodiment, the sports device and the user respectively sign the sports data, so that the sports data can be effectively prevented from being tampered in the transmission process, meanwhile, the information of the sports device or the information of the user can be prevented from being tampered in the transmission process, and the reliability and the accuracy of the sports data received by the link nodes of the block can be improved.
At step 406, the smart contract for signature verification is executed.
In this embodiment, after receiving the resource creation transaction, the block link point may execute an intelligent contract code for signature verification, and the block link point may quickly find, according to the device number 01 and the user number a included in the resource creation transaction, a device public key 001 corresponding to the motion device 01 and a user public key 001 corresponding to the user a from the block chain account corresponding to the intelligent contract for registration, so that the first signature may be verified according to the device public key 001, and the second signature may be verified according to the user public key 001.
If the first signature is verified and the second signature is verified, the process proceeds to step 407. Wherein, the first signature verification pass can indicate that the sports data X is generated by the sports equipment 01 and is not tampered in the transmission process, and the second signature verification pass can indicate that the sports data X is generated by the user A for exercise and is not tampered in the transmission process.
And if the first signature or the second signature fails to verify, the resource creation transaction is rejected to be processed if the resource creation transaction is abnormal. The abnormal condition may include that the motion data X is tampered.
In step 407, an intelligent contract for verifying the motion data is executed.
In this embodiment, the link points of the block may execute an intelligent contract code for verifying the motion data, and the motion data X may be matched with the historical motion data, assuming that all the motion data received by the link nodes of the block within 10 minutes are recorded in the historical motion data.
If the blockchain node does not find the motion data X in the historical motion data, step 408 is performed.
If the block link point finds the historical motion data matched with the motion data X, the motion data X is uploaded, so that the resource creation transaction is rejected for processing, and the same motion data can be prevented from being processed for multiple times.
At step 408, an intelligent contract for managing blockchain resources is executed.
In this embodiment, the block chain node may execute intelligent contract code for managing block chain resources, so that the motion data X may be converted into motion credits attributed to the user a. The conversion rule between the motion data and the motion score is set in the intelligent contract for managing the blockchain resources, and of course, the conversion rule may be updated by means of upgrading the intelligent contract for managing the blockchain resources, and the conversion rule may be set according to actual needs, which is not limited in this specification.
In the present embodiment, it is assumed that the conversion rule between motion data and motion is: motion integral = length of motion times distance of motion, where length of motion is in minutes and distance of motion is in kilometers. Then it can be determined that user a achieved the exercise score =20 x 3=60 points for the current workout.
In this embodiment, when each piece of user identity information has a corresponding blockchain account, the blockchain link point may add the motion score 60 generated by this conversion to the blockchain account corresponding to the user a. Assume that the user a's corresponding blockchain account has a total movement integral of 80 points after updating.
Alternatively, in the case that the mapping relationship between the number of blockchain resources per conversion and the corresponding user identity information is maintained in the blockchain account corresponding to the intelligent contract for managing blockchain resources, the blockchain link point may generate the mapping relationship between the motion score 60 and the user a, and record the mapping relationship into the blockchain account corresponding to the intelligent contract for managing blockchain resources, as shown in fig. 6. Of course, the mapping relationship may also record specific motion data and identification information such as a device number corresponding to the device, which is not limited in this specification.
At step 409, a query transaction is received.
In step 410, a smart contract for querying motion integrals is executed.
In this embodiment, in the case that there is a corresponding blockchain account for each user identity information, the blockchain link point may receive a query transaction for querying the motion score of the user a. The block chain node may execute an intelligent contract code for querying the motion score according to the query transaction, and the block chain node may directly read the total number of the motion score corresponding to the user a, that is, 80 points, from the block chain account corresponding to the user a.
In this embodiment, in the case that a mapping relationship between the number of the motion scores of each conversion and the corresponding user identity information is maintained in the blockchain account corresponding to the intelligent contract for managing blockchain resources, the blockchain link point may receive an inquiry transaction for inquiring the motion scores of the user a. Then the block chain node may execute the intelligent contract code for querying the motion score according to the query transaction, and the block chain node may filter out a specific mapping relationship containing the user a from the block chain account corresponding to the intelligent contract for managing the block chain resources, as shown in fig. 6, where the specific mapping relationship includes "user a, motion score: 20 points "and" user a, motion score 60 points ", then the motion score for each conversion included in the specific mapping relationship can be counted, so that the total number of motion scores corresponding to the user a, that is, 80 points, can be obtained.
In step 411, a motion point transfer transaction is received.
At step 412, a smart contract for transferring motion integrals is executed.
In this embodiment, in the case that each user identity information has a corresponding blockchain account, a blockchain link point may receive a point transfer transaction initiated by a user a, where the point transfer transaction may include transferring a sports point 20 point from the user a to a user B, and the point transfer transaction may further include a specified signature of the user a for the sports point 20 point. The block chain node may execute the smart contract code for signature verification so that the specified signature may be verified against user a's user public key 001. In the case that the designated signature is verified, the block chain link point may execute the smart contract code for transferring the motion score, so that the motion score 20 in the block chain account corresponding to the user a may be transferred to the block chain account corresponding to the user B. However, in the case that the verification of the specified signature fails, it indicates that the credit transfer transaction is abnormal, so that the credit transfer transaction may be rejected and warning information may be provided to corresponding personnel, which is not limited in this specification.
In this embodiment, in a situation that a mapping relationship between the number of the movement points per conversion and the corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing blockchain resources, a blockchain node may receive a point transfer transaction initiated by a user a, where the point transfer transaction may include transferring the movement points 20 points from the user a to a user B, and the point transfer transaction may further include a specified signature of the user a for the movement points 20 points. The block chain node may execute the smart contract code for signature verification so that the specified signature may be verified against user a's user public key 001. In the case that the designated signature is verified, the blockchain link point may execute the smart contract code for transferring the motion score, and may use a mapping relationship "user a, motion score: 20 points "change to" user B, motion score: 20min ", thereby realizing the transfer of motion integration.
In this embodiment, the user a signs the motion score to be transferred included in the score transfer transaction, so that the blockchain node can verify the identity information of the user a conveniently, the security of the process of transferring the motion score can be ensured, and the motion score can be effectively prevented from being transferred by others due to counterfeiting the identity information of the user.
In the present embodiment, it is assumed that an intelligent contract for registration, an intelligent contract for signature verification, an intelligent contract for checking motion data, an intelligent contract for managing a block chain resource, an intelligent contract for inquiring motion points, and an intelligent contract for transferring motion points correspond to a plurality of intelligent contracts, respectively, and of course, an intelligent contract for registration, an intelligent contract for signature verification, an intelligent contract for checking motion data, an intelligent contract for managing a block chain resource, an intelligent contract for inquiring motion points, and an intelligent contract for transferring motion points may correspond to a plurality of different interfaces in the same intelligent contract, respectively, which is not limited in this specification.
As can be seen from the above technical solutions, in this specification, a resource creation transaction is received, an intelligent contract code for managing a blockchain resource is executed, motion data can be converted into a target blockchain resource belonging to a target user, and the motion data can be converted into a quantifiable blockchain resource, so that a user can process the blockchain resource belonging to the user through a resource transfer transaction or an inquiry transaction, thereby improving the enthusiasm of the user for using a motion device, and at the same time, the user or the motion device generating the motion data can sign the motion data, thereby preventing the motion data from being tampered during transmission, preventing a third party from tampering user identity information, improving the accuracy and reliability of the transformed blockchain resource, and enabling the motion device to perform near-field communication with a user device corresponding to the user, in case that the sports device does not have the network communication function, the user device may upload the sports data received from the sports device to the blockchain network, so that more sports data generated by the sports device may be converted into blockchain resources.
Fig. 7 shows a schematic structural diagram of an electronic device according to an exemplary embodiment of the present description. Referring to fig. 7, at the hardware level, the electronic device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile storage 710, but may also include hardware required for other services. The processor 702 reads a corresponding computer program from the non-volatile memory 710 into the memory 708 and then runs the computer program, thereby forming a management device of the blockchain resources on a logical level. Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
Referring to fig. 8, in a software implementation, the apparatus for managing blockchain resources may include a receiving unit 802, a verifying unit 804, and an executing unit 806. Wherein:
a receiving unit 802, configured to receive a resource creation transaction, where the resource creation transaction includes motion data, user identity information, and motion device information, and the motion data is generated by a target user corresponding to the user identity information moving on a motion device corresponding to the motion device information;
a verifying unit 804, configured to verify whether the motion device corresponding to the motion device information is registered in the blockchain;
an executing unit 806, configured to execute, if it is determined that the motion device is registered in a blockchain, an intelligent contract code for managing blockchain resources, to convert the motion data into a target blockchain resource belonging to the target user, and manage, according to the number of the target blockchain resource, a blockchain resource corresponding to the user identity information.
Optionally, the method further includes:
a motion data verification unit 808, configured to execute an intelligent contract code for verifying motion data to match the motion data with historical motion data;
the precondition that the motion data is converted into a target blockchain resource belonging to the target user and the blockchain resource corresponding to the user identity information is managed according to the number of the target blockchain resources includes: historical motion data matching the motion data is not found.
Optionally, the method further includes:
a first signature verification unit 810, where the user identity information includes a first signature generated by the target user for the motion data, and is used to execute an intelligent contract code for signature verification to obtain a first public key corresponding to the target user, and verify the first signature according to the first public key;
the precondition that the motion data is converted into a target blockchain resource belonging to the target user and the blockchain resource corresponding to the user identity information is managed according to the number of the target blockchain resources includes: and the first signature is verified.
Optionally, the verification unit 804 is specifically configured to:
inquiring whether the motion equipment information is recorded in a preset equipment information set; if the motion equipment information is recorded in a preset equipment information set, judging that the motion equipment is registered in a block chain;
or, in a case that the sports device information includes a second signature generated by the sports device for the sports data, the smart contract code is configured to execute a smart contract code for signature verification to obtain a second public key corresponding to the sports device, and verify the second signature according to the second public key; wherein if the second signature is verified, it is determined that the sports device is registered in a blockchain.
Optionally, the exercise device comprises a public exercise device.
Optionally, the execution unit 806 is specifically configured to:
under the condition that each piece of user identity information has a corresponding block chain account, updating the block chain account corresponding to the user identity information of the target user according to the quantity of the target block chain resources;
or, in a case that a mapping relationship between the number of blockchain resources per conversion and corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing blockchain resources, generating a mapping relationship between the number of target blockchain resources and user identity information corresponding to the target user.
Optionally, the method further includes:
a query transaction executing unit 812, configured to receive a query transaction, and execute an intelligent contract code for querying a blockchain resource according to the query transaction when each piece of user identity information has a corresponding blockchain account, so as to read a total number of blockchain resources corresponding to the target user from the blockchain account corresponding to the user identity information of the target user;
and under the condition that the mapping relation between the number of the blockchain resources converted each time and the corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing the blockchain resources, executing an intelligent contract code for inquiring the blockchain resources according to the inquiry transaction so as to screen out a specific mapping relation containing the user identity information corresponding to the target user from the mapping relation, and counting the number of the blockchain resources converted each time in the specific mapping relation to obtain the total number of the blockchain resources corresponding to the target user.
Optionally, the method further includes:
a resource transfer transaction execution unit 814, configured to receive a resource transfer transaction initiated by a first user, and execute an intelligent contract code for transferring a blockchain resource according to the resource transfer transaction when each piece of user identity information has a corresponding blockchain account, so as to transfer a specified amount of blockchain resources from the blockchain account corresponding to the first user to the blockchain account corresponding to a second user;
and under the condition that the mapping relation between the quantity of the blockchain resources converted each time and the corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing blockchain resources, executing an intelligent contract code for transferring blockchain resources according to the resource transfer transaction so as to update the user identity information of the first user in the mapping relation containing the specified quantity of blockchain resources into the identity information of a second user.
Optionally, the method further includes:
a designated signature verification unit 816, where the resource transfer transaction further includes a designated signature of the first user for the designated number of blockchain resources, and is configured to execute an intelligent contract code for signature verification, so as to obtain a designated public key corresponding to the first user, and verify the designated signature according to the designated public key; wherein the precondition for executing the intelligent contract code for transferring the blockchain resources comprises: and the specified signature is verified.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
Referring to fig. 9, in a software implementation, the apparatus for managing blockchain resources may include an obtaining unit 902 and a sending unit 904. Wherein:
an obtaining unit 902, configured to obtain target data, where the target data includes motion data, user identity information, and motion device information, and the motion data is generated by a target user corresponding to the user identity information moving on a motion device corresponding to the motion device information;
a sending unit 904, configured to send the target data to a blockchain node, so that the blockchain node, in a case that it is determined that the sports device is registered in a blockchain, converts the sports data into a target blockchain resource belonging to the target user by executing an intelligent contract code for managing blockchain resources, where the amount of the target blockchain resource is used for managing the blockchain resource corresponding to the user identity information.
Optionally, the target data includes a first signature generated by the target user for the motion data and/or includes a second signature generated by a motion device generating the motion data for the motion data.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (17)

1. A management method of block chain resources is applied to block chain nodes; the method comprises the following steps:
receiving a resource creating transaction, wherein the resource creating transaction comprises movement data, user identity information and movement equipment information, and the movement data is generated by the movement of a target user corresponding to the user identity information on movement equipment corresponding to the movement equipment information;
verifying whether the motion equipment corresponding to the motion equipment information is registered in a block chain;
and under the condition that the sports equipment is determined to be registered in the blockchain, executing intelligent contract code for managing blockchain resources to convert the sports data into target blockchain resources belonging to the target user, and managing the blockchain resources corresponding to the user identity information according to the number of the target blockchain resources.
2. The method of claim 1, further comprising:
executing intelligent contract code for verifying movement data to match the movement data with historical movement data;
the precondition that the motion data is converted into a target blockchain resource belonging to the target user and the blockchain resource corresponding to the user identity information is managed according to the number of the target blockchain resources includes: historical motion data matching the motion data is not found.
3. The method of claim 1, the user identity information comprising a first signature generated by the target user for the athletic data; the method further comprises the following steps:
executing an intelligent contract code for signature verification to obtain a first public key corresponding to the target user, and verifying the first signature according to the first public key;
the precondition that the motion data is converted into a target blockchain resource belonging to the target user and the blockchain resource corresponding to the user identity information is managed according to the number of the target blockchain resources includes: and the first signature is verified.
4. The method of claim 1 or 3, verifying whether the sports device corresponding to the sports device information is registered in a blockchain, comprising:
inquiring whether the motion equipment information is recorded in a preset equipment information set; if the motion equipment information is recorded in a preset equipment information set, judging that the motion equipment is registered in a block chain;
or, in a case that the sports device information includes a second signature generated by the sports device for the sports data, executing an intelligent contract code for signature verification to obtain a second public key corresponding to the sports device, and verifying the second signature according to the second public key; wherein if the second signature is verified, it is determined that the sports device is registered in a blockchain.
5. The method of claim 1, the athletic device comprising a public fitness device.
6. The method of claim 1, managing the blockchain resources corresponding to the user identity information according to the number of the target blockchain resources, comprising:
under the condition that each piece of user identity information has a corresponding block chain account, updating the block chain account corresponding to the user identity information of the target user according to the quantity of the target block chain resources;
or, in a case that a mapping relationship between the number of blockchain resources per conversion and corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing blockchain resources, generating a mapping relationship between the number of target blockchain resources and user identity information corresponding to the target user.
7. The method of claim 6, further comprising:
receiving query transactions, and executing an intelligent contract code for querying block chain resources according to the query transactions under the condition that each piece of user identity information has a corresponding block chain account, so as to read the total number of the block chain resources corresponding to the target user from the block chain account corresponding to the user identity information of the target user;
and under the condition that the mapping relation between the number of the blockchain resources converted each time and the corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing the blockchain resources, executing an intelligent contract code for inquiring the blockchain resources according to the inquiry transaction so as to screen out a specific mapping relation containing the user identity information corresponding to the target user from the mapping relation, and counting the number of the blockchain resources converted each time in the specific mapping relation to obtain the total number of the blockchain resources corresponding to the target user.
8. The method of claim 6, further comprising:
receiving resource transfer transaction initiated by a first user, and executing an intelligent contract code for transferring block chain resources according to the resource transfer transaction under the condition that each piece of user identity information has a corresponding block chain account so as to transfer a specified amount of block chain resources from the block chain account corresponding to the first user to the block chain account corresponding to a second user;
and under the condition that the mapping relation between the quantity of the blockchain resources converted each time and the corresponding user identity information is maintained in a blockchain account corresponding to an intelligent contract for managing blockchain resources, executing an intelligent contract code for transferring blockchain resources according to the resource transfer transaction so as to update the user identity information of the first user in the mapping relation containing the specified quantity of blockchain resources into the identity information of a second user.
9. The method of claim 8, further comprising in the resource transfer transaction a specified signature of the first user for the specified amount of blockchain resources; the method further comprises the following steps:
executing an intelligent contract code for signature verification to obtain a specified public key corresponding to the first user, and verifying the specified signature according to the specified public key;
wherein the precondition for executing the intelligent contract code for transferring the blockchain resources comprises: and the specified signature is verified.
10. A management method of block chain resources is applied to a client; the method comprises the following steps:
acquiring target data, wherein the target data comprises motion data, user identity information and motion equipment information, and the motion data is generated by the motion of a target user corresponding to the user identity information on motion equipment corresponding to the motion equipment information;
and sending the target data to a blockchain node, so that the blockchain node converts the sports data into target blockchain resources belonging to the target user by executing intelligent contract codes for managing blockchain resources under the condition that the sports equipment is determined to be registered in a blockchain, wherein the quantity of the target blockchain resources is used for managing the blockchain resources corresponding to the user identity information.
11. The method of claim 10, the target data including therein a first signature generated by the target user for the motion data and/or including therein a second signature generated by a motion device generating the motion data for the motion data.
12. A management device of block chain resources is applied to block chain nodes; the device comprises:
the resource creating transaction comprises movement data, user identity information and movement equipment information, and the movement data is generated by movement of a target user corresponding to the user identity information on movement equipment corresponding to the movement equipment information;
the verification unit is used for verifying whether the sports equipment corresponding to the sports equipment information is registered in the block chain;
and the execution unit is used for executing intelligent contract codes for managing blockchain resources under the condition that the sports equipment is determined to be registered in the blockchain, so that the sports data is converted into target blockchain resources belonging to the target user, and the blockchain resources corresponding to the user identity information are managed according to the number of the target blockchain resources.
13. A block chain resource management device is applied to a client; the device comprises:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring target data, the target data comprises motion data, user identity information and motion equipment information, and the motion data is generated by the motion of a target user corresponding to the user identity information on motion equipment corresponding to the motion equipment information;
a sending unit, configured to send the target data to a blockchain node, so that the blockchain node, when determining that the sports device is registered in a blockchain, converts the sports data into a target blockchain resource belonging to the target user by executing an intelligent contract code for managing blockchain resources, where the amount of the target blockchain resource is used to manage the blockchain resource corresponding to the user identity information.
14. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 1-9 by executing the executable instructions.
15. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 9.
16. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 10-11 by executing the executable instructions.
17. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the steps of the method according to any one of claims 10-11.
CN202010759162.9A 2020-07-31 2020-07-31 Method and device for managing block chain resources Pending CN111737765A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010759162.9A CN111737765A (en) 2020-07-31 2020-07-31 Method and device for managing block chain resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010759162.9A CN111737765A (en) 2020-07-31 2020-07-31 Method and device for managing block chain resources

Publications (1)

Publication Number Publication Date
CN111737765A true CN111737765A (en) 2020-10-02

Family

ID=72656809

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010759162.9A Pending CN111737765A (en) 2020-07-31 2020-07-31 Method and device for managing block chain resources

Country Status (1)

Country Link
CN (1) CN111737765A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113077255A (en) * 2021-03-30 2021-07-06 上海万向区块链股份公司 Account establishing and recovering system based on intelligent contract
CN113886135A (en) * 2020-10-20 2022-01-04 支付宝(杭州)信息技术有限公司 Block chain data recovery method and device
CN116757849A (en) * 2023-08-14 2023-09-15 中资科技(江苏)有限公司 Asset management system and method based on block chain

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108171430A (en) * 2017-12-29 2018-06-15 深圳市轱辘车联数据技术有限公司 Data processing method, mobile unit and UBI analysis centers server
CN108538358A (en) * 2018-03-05 2018-09-14 上海康斐信息技术有限公司 A kind of block chain reward on total mark method, system for wearable device
CN108650270A (en) * 2018-05-16 2018-10-12 苏宁易购集团股份有限公司 Data sharing method based on alliance's chain and incentive mechanism and system
CN108881380A (en) * 2018-05-04 2018-11-23 青岛海尔空调电子有限公司 data transmission system and method based on cloud service
CN109065099A (en) * 2018-07-16 2018-12-21 曾巨鹏 A kind of block chain management system of sport health contribution data excitation
CN109241009A (en) * 2018-08-21 2019-01-18 中国平安人寿保险股份有限公司 Prevent file from repeating the method and its control method and device that upload
CN109509554A (en) * 2018-11-22 2019-03-22 中链科技有限公司 Based on the data of physiological index evaluation method of block chain, apparatus and system
CN109727655A (en) * 2018-12-29 2019-05-07 百度在线网络技术(北京)有限公司 Sport health motivational techniques, device, equipment, server and medium
CN109741188A (en) * 2019-01-23 2019-05-10 山东金川银脉智能科技有限公司 Shared share business transaction platform in operation mode

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108171430A (en) * 2017-12-29 2018-06-15 深圳市轱辘车联数据技术有限公司 Data processing method, mobile unit and UBI analysis centers server
CN108538358A (en) * 2018-03-05 2018-09-14 上海康斐信息技术有限公司 A kind of block chain reward on total mark method, system for wearable device
CN108881380A (en) * 2018-05-04 2018-11-23 青岛海尔空调电子有限公司 data transmission system and method based on cloud service
CN108650270A (en) * 2018-05-16 2018-10-12 苏宁易购集团股份有限公司 Data sharing method based on alliance's chain and incentive mechanism and system
CN109065099A (en) * 2018-07-16 2018-12-21 曾巨鹏 A kind of block chain management system of sport health contribution data excitation
CN109241009A (en) * 2018-08-21 2019-01-18 中国平安人寿保险股份有限公司 Prevent file from repeating the method and its control method and device that upload
CN109509554A (en) * 2018-11-22 2019-03-22 中链科技有限公司 Based on the data of physiological index evaluation method of block chain, apparatus and system
CN109727655A (en) * 2018-12-29 2019-05-07 百度在线网络技术(北京)有限公司 Sport health motivational techniques, device, equipment, server and medium
CN109741188A (en) * 2019-01-23 2019-05-10 山东金川银脉智能科技有限公司 Shared share business transaction platform in operation mode

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113886135A (en) * 2020-10-20 2022-01-04 支付宝(杭州)信息技术有限公司 Block chain data recovery method and device
CN113077255A (en) * 2021-03-30 2021-07-06 上海万向区块链股份公司 Account establishing and recovering system based on intelligent contract
CN116757849A (en) * 2023-08-14 2023-09-15 中资科技(江苏)有限公司 Asset management system and method based on block chain
CN116757849B (en) * 2023-08-14 2023-10-20 中资科技(江苏)有限公司 Asset management system and method based on block chain

Similar Documents

Publication Publication Date Title
CN109559228B (en) Resource transfer method, device, computer equipment and readable storage medium
CN111737765A (en) Method and device for managing block chain resources
CN108667632A (en) Based on the credit record sharing method and device of block chain, electronic equipment
CN104639517B (en) The method and apparatus for carrying out authentication using human body biological characteristics
CN111177800B (en) Block chain-based data processing method and device and electronic equipment
CN109376008A (en) A kind of distribution method and device of virtual resource
CN107395353A (en) A kind of block chain common recognition method and device
US11106659B2 (en) Blockchain-based recording and querying operations
CN111914023A (en) Bill management method and device based on block chain and electronic equipment
CN113221191B (en) Block chain-based data evidence storage method, device, equipment and storage medium
CA3087107A1 (en) Blockchain-based virtual resource delivery and crowdfunding method and device
CN112365367B (en) Regional portrait method and device based on device electric quantity and storage medium
CN110163755A (en) Data compression, querying method and device and electronic equipment based on block chain
CN107294974A (en) The method and apparatus for recognizing target clique
CN108304935A (en) Machine learning model training method, device and computer equipment
CN110517145A (en) Data trade method and relevant device based on multi-tiling interchain
CN111723159A (en) Data verification method and device based on block chain
CN115205001A (en) Electronic certificate processing method, device and equipment
CN112364222B (en) Regional portrait method of user age, computer equipment and storage medium
CN109447652A (en) A kind of quick payment method, device and equipment
CN111222885B (en) Data processing request endorsement method and device, computer equipment and storage medium
CN110348983B (en) Transaction information management method and device, electronic equipment and non-transitory storage medium
CN110278524B (en) User position determining method, graph model generating method, device and server
KR102192327B1 (en) Method for evaluating and predicting trust index using small data
CN111461191A (en) Method and device for determining image sample set for model training and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20201002

RJ01 Rejection of invention patent application after publication