WO2019214067A1 - 区块链上用户通信方法、装置、终端设备及存储介质 - Google Patents
区块链上用户通信方法、装置、终端设备及存储介质 Download PDFInfo
- Publication number
- WO2019214067A1 WO2019214067A1 PCT/CN2018/095902 CN2018095902W WO2019214067A1 WO 2019214067 A1 WO2019214067 A1 WO 2019214067A1 CN 2018095902 W CN2018095902 W CN 2018095902W WO 2019214067 A1 WO2019214067 A1 WO 2019214067A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- user
- value
- key
- blockchain
- address
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
Definitions
- the present application relates to the field of blockchain applications, and in particular, to a user communication method, device, terminal device and storage medium on a blockchain.
- the traditional blockchain system is only used to implement data sharing storage, and information interaction between participants cannot be realized. If information interaction needs to be performed on the blockchain, a data communication channel dedicated to information interaction needs to be established between the communication participants, so that the communication participants need to maintain communication with all other communication in addition to maintaining communication with the blockchain network. Participant's data communication channel.
- the information interaction mode of the blockchain increases the complexity of the blockchain system, increases the difficulty of constructing the blockchain system, and is impossible to achieve under certain network conditions.
- the embodiment of the present invention provides a user communication method, device, terminal device and storage medium on a blockchain, so as to solve the problem that the blockchain system of user communication on the current blockchain is too complicated and the construction difficulty is too high.
- an embodiment of the present application provides a method for user communication on a blockchain, including:
- the user A writes the key Kab in the value Mb corresponding to the communication address of the user B, the value corresponding to the key Kab is Data1, and the user A and the user B are two users randomly selected on the blockchain;
- the user B acquires the value Data1 based on the key Kab written in the value Mb corresponding to the communication address of the user B.
- the embodiment of the present application provides a user communication device on a blockchain, including:
- a communication address creation module configured to create a communication address of each user on the blockchain in a key value pair manner
- the key adding module the user A writes the key Kab in the value Mb corresponding to the communication address of the user B, the value corresponding to the key Kab is Data1, and the user A and the user B are arbitrarily selected two on the blockchain.
- the value acquisition module the user B acquires the value Data1 based on the key Kab written in the value Mb corresponding to the communication address of the user B.
- an embodiment of the present application provides a terminal device, including a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, where the processor executes the computer The following steps are implemented when reading the instruction:
- the user A writes the key Kab in the value Mb corresponding to the communication address of the user B, the value corresponding to the key Kab is Data1, and the user A and the user B are two users randomly selected on the blockchain;
- the user B acquires the value Data1 based on the key Kab written in the value Mb corresponding to the communication address of the user B.
- the embodiment of the present application provides one or more non-volatile readable storage media storing computer readable instructions, when the computer readable instructions are executed by one or more processors, such that the one or Multiple processors perform the following steps:
- the user A writes the key Kab in the value Mb corresponding to the communication address of the user B, the value corresponding to the key Kab is Data1, and the user A and the user B are two users randomly selected on the blockchain;
- the user B acquires the value Data1 based on the key Kab written in the value Mb corresponding to the communication address of the user B.
- a communication address of each user on the blockchain is created in a key-value pair manner, and a blockchain-based
- the communication address of the user on the blockchain for information exchange provides a basis for the realization of user information interaction on the subsequent blockchain.
- user A writes the key Kab in the value Mb corresponding to the communication address of the user B, and the value corresponding to the key Kab is Data1, and the user A and the user B are two randomly selected users on the blockchain, by combining the blockchain system.
- the characteristics and properties of the key-value pairs the user realizes the function of sending data from the A user to the B user through the communication address created by the key-value pair and the corresponding value.
- the user B obtains the value Data1 based on the key Kab written in the value Mb corresponding to the communication address of the user B, and the user B transmits the user's communication address and the characteristics according to the key value pair, and the read communication address includes the user A.
- the corresponding key of the data realizes the user communication function based on the blockchain of the blockchain system itself.
- Embodiment 1 is a flow chart of a method for user communication on a blockchain in Embodiment 1 of the present application.
- FIG. 2 is a specific flow chart of step S10 of FIG. 1.
- FIG. 3 is a specific flow chart of step S20 of FIG. 1.
- step S30 of FIG. 1 is a specific flow chart of step S30 of FIG. 1.
- FIG. 5 is a specific flowchart subsequent to step S30 in FIG. 1.
- FIG. 6 is a schematic block diagram of a user communication device on a blockchain in Embodiment 2 of the present application.
- FIG. 7 is a schematic diagram of a terminal device in Embodiment 4 of the present application.
- FIG. 1 is a flow chart showing a method of user communication on a blockchain in this embodiment.
- the user communication method on the blockchain can be applied to an application system based on a blockchain technology for performing point-to-point communication between any two users on the blockchain.
- the user communication method on the blockchain includes the following steps:
- S10 Create a communication address of each user on the blockchain in a key-value pair manner.
- the key-value is a data storage mode.
- the value refers to the specifically stored data.
- the key is the index of the data stored by it. The value can be directly obtained by searching for the corresponding key.
- the key value reflects a correspondence of data storage, and a data relationship pair composed of a key and its corresponding value is called a key value pair.
- Blockchain is a new application model for computer technologies such as distributed data storage, consensus mechanisms, and encryption algorithms. This embodiment is implemented based on a blockchain system, that is, the blockchain should be understood by the blockchain system. Among them, the blockchain system is essentially a decentralized distributed database system. It should be noted that the user on the blockchain in this embodiment should be understood as each user node on the blockchain system, that is, each related terminal on the blockchain system, and the terminal may be connected through a blockchain network. Terminals such as mobile phones, computers, tablets and servers.
- the communication address of each user on the blockchain is created in a key-value pair manner, and the communication address of each user on the blockchain is used as an index corresponding to the stored data, that is, a key in the key-value pair.
- step S10 the communication address of each user on the blockchain is created in a key-value pair manner, which specifically includes the following steps:
- S11 Create a user address of each user on the blockchain in a key-value pair manner.
- the user address is used to distinguish the address fields of different users on the blockchain, and the user addresses of any two users are different.
- the user address of each user on the blockchain is created in a key-value pair manner, and the address field of each user on the blockchain is determined.
- By creating the user address of each user on the blockchain it is possible to set a plurality of address types of different functions, such as a data sharing address and a communication address, based on the user address.
- S12 Create, according to the user address, a communication address of each user on the blockchain in a key-value pair manner, where the communication address of each user on the blockchain exists in the form of a key, which is represented as an address prefix + a user address.
- the communication address of each user on the blockchain exists in the form of a key, and the value corresponding to the communication address is the data stored in the communication address.
- the communication address can be regarded as the user's mailbox, and the data corresponding to the mailbox uniquely stored in the mailbox is the value in the key-value pair. If data storage is implemented by key-value pairing, the user's communication address is the key, and the value corresponding to the key is the data stored by the communication address.
- the address of each user on the blockchain is in the form of a key, which can be expressed as an address prefix + a user address.
- the address prefix is used to distinguish the identifier of the function implemented by the address. For example, if the user address of any user A in the blockchain is userAAA, and the communication address of the user A is MailuserAAA, the address prefix in the communication address is Mail, which is used to indicate that the address is an email address used for communication.
- the address can be represented by the address prefix + the user address, as long as the system name is unique.
- the communication address of the user A can also be directly represented by the user address userAAA.
- this embodiment represents the communication address of each user on the blockchain as the address prefix + user address.
- S20 The user A writes the key Kab in the value Mb corresponding to the communication address of the user B.
- the value corresponding to the key Kab is Data1
- the user A and the user B are two randomly selected users on the blockchain.
- User A and user B are two randomly selected users on the blockchain.
- the users here should also be understood as terminals on the blockchain system, specifically terminals connected through the blockchain network.
- the value corresponding to the communication address of the user B is Mb
- the key Kab and the value Data1 are a key value pair for storing the data that the user A uploads to the user B in the blockchain.
- the blockchain system is a decentralized distributed database system, which has the characteristics of data sharing and data unchangeable.
- the user A writes the key Kab in the value Mb corresponding to the communication address of the user B.
- the value corresponding to the key Kab is Data1, that is, the data that User A wants User B to receive is Data1.
- the write operation here is specifically a modification operation, and the key Kab is added (written) to the value Mb by a modification operation.
- the key Kab corresponding to the data is written into the value Mb, so that the user B can acquire the data transmitted by the A user by the value Mb (ie, the key).
- the value corresponding to Kab is Data1), so that User A and User B implement peer-to-peer communication on the blockchain.
- step S20 the user A writes the key Kab in the value Mb corresponding to the communication address of the user B, the value corresponding to the key Kab is Data1, and the user A and the user B are the area.
- the two users randomly selected on the blockchain include the following steps:
- the data prefix is similar to the address prefix.
- the data prefix is used to distinguish the identifier of the data.
- the data prefix can be represented by a timestamp plus a usage identifier.
- the time stamp and Commu abbreviation of Communication
- the data prefix can be combined with the user address of User B and the user address of User A to uniquely determine the key Kab.
- the data prefix can also be expressed in other ways (such as directly using Commu without carrying a time stamp to indicate that the data is used for communication), as long as the key represented by the data prefix can be uniquely distinguished.
- the user A writes the key Kab and the value Data1 corresponding to the key Kab to the blockchain in a key-value pair manner. If the key Kab is written to the blockchain system for the first time, the write operation is specifically a create operation; if the key Kab already exists and the user A still wants to continue to use the key Kab, the write operation is specifically a modification operation. Do not change the key Kab, modify the value of the key Kab corresponding to Data1.
- user A reads the communication address of user B on the blockchain.
- the communication address of user B is represented as the key MailUserBBB
- user A reads the communication address of user B on the blockchain, that is, the key MailUserBBB.
- the communication address of the user B and the corresponding value Mb are stored in a key-value pair manner, the user A can acquire the value Mb corresponding to the key (the communication address of the user B) according to the communication address of the user B.
- the user A when the user A reads the value Mb corresponding to the communication address of the user B, the user A executes a modification command, and adds the key Kab to the value Mb, which can be expressed as Mb+Kab. After the key Kab is added to the value Mb, the Mb is changed and the changed Mb is written back to the blockchain.
- the blockchain system has two concepts: the block and the current data state (world state in the fabric, UTXO in the bitcoin).
- the block is historical transaction information
- the current data state is the state of the system data obtained by all historical exchanges. All the operations of creating or modifying in this embodiment are obtained by sending a transaction and verifying by the blockchain system itself to obtain a block.
- All users on the final blockchain will execute the transaction according to the block, and modify the current data state.
- the trading action will be included in one block, there may be multiple transactions in one block; the reading operation will not generate blocks, not counting transactions; the blockchain system will generate blocks according to certain time intervals, each Each block contains all the transactions in this time interval.
- adding the key Kab to the value Mb is a transaction on the blockchain, and after verification by the blockchain system itself, the transaction will be packaged to the time interval after the time interval of the transaction is ended.
- all users on the last blockchain perform the modification of the current data state by adding the key Kab to the value Mb according to the block, that is, successfully writing the changed Mb back to the blockchain.
- the user B acquires the value Data1 based on the key Kab written in the value Mb corresponding to the communication address of the user B.
- the user B can acquire the key Kab written by the user A into the value Mb based on the value Mb corresponding to the communication address of the user B, and can obtain the key Kab according to the key Kab.
- the value of the key Kab corresponds to Data1.
- the value Data1 is the data sent by the user A to the user B, and the user B reads the value corresponding to the communication address of the user B through the block chain system according to the key Kab added by the user A in the communication address of the user B.
- Kab according to the relationship between the key Kab and the value Data1 is a key value pair, the value Data1 is obtained.
- Any two users point-to-point communication on the blockchain can be understood as virtualizing a communication channel on the blockchain system and realizing data communication between all users. Users only need to maintain network communication with the blockchain system to realize data sharing storage and data communication between all users, which can effectively simplify the construction of application systems and reduce system complexity without increasing the complexity of the blockchain system. Under the premise of the degree, the problem of users communicating on the blockchain is solved.
- step S30 the user B obtains the value Data1 based on the key Kab written in the value Mb corresponding to the communication address of the user B, and specifically includes the following steps:
- user B is any user except the user A in the blockchain, and user B reads its own communication address. Since the communication address of user B is the key corresponding to the value Mb, the user B is based on the blockchain system. The value Mb corresponding to the key is read by its own communication address.
- the user A has added the key Kab to the value Mb in step S23, the value Mb is changed after the key Kab is added, and the user B acquires the key Kab from the changed value Mb. It can be understood that if the key Kab is read from the value Mb corresponding to the communication address of the user B, since the key Kab is an index that the data sent by the user A to the user B is stored in the blockchain, the user exists in the blockchain. A data sent to user B.
- the value Data1 corresponding to the key Kab is directly obtained according to the key Kab, so as to read the data Data1 sent by the user A to the user B, thereby realizing the user A and the user. Point-to-point data interaction between B.
- step S20 is a process in which user A writes data to user B through the blockchain
- step S30 is a process in which user B acquires data sent by user A through the blockchain, and can be in the block based on steps S20 and S30.
- the point-to-point communication process in which the user A sends data to the user B and the user B receives the data of the user A does not need to separately create a data communication channel dedicated to information interaction, and does not need to increase the complexity and construction difficulty of the blockchain system.
- the user communication method on the blockchain further includes The following steps: detecting that the corresponding value Mb is changed based on the communication address of the user B, and the user B acquires the reminder information related to the change of the value Mb.
- the user B after the value Mb is changed, the user B will detect that the corresponding value Mb is changed according to the communication address of the user B. At this time, the user B will acquire the reminder information related to the change of the value Mb. Specifically, by performing a preset timing detection program, the value Mb corresponding to the communication address is automatically detected at every interval, and the value of the two detected values Mb is compared, and if the change occurs, the user is changed. B sends a reminder message related to the change in the value Mb. If the value Mb at the end of the previous time interval is compared with the value Mb at the end of the current time interval, if the value Mb at the two time points is different, the value Mb is considered to have changed. After the value Mb changes, an instruction to send a reminder information related to the change of the value Mb is executed, so that the user B can acquire the data update message in time, and collect the data Data1 in time.
- step S30 that is, after the user B obtains the value Data1 based on the key Kab written in the value Mb corresponding to the communication address of the user B, the user communication on the blockchain is performed.
- the method also includes the following steps:
- the value corresponding to the communication address of the user A is Ma
- the key Kba and the value Data2 are a key value pair for storing data uploaded by the user B to the user A in the blockchain.
- the value Data2 is associated with the value Data1.
- the data prefix of the key Kba can use a timestamp here to highlight the time for feedback.
- the user B writes the key Kba in the value Ma corresponding to the communication address of the user A.
- the value corresponding to the key Kba is Data2, that is, the data that the user B wants to send to the user A and fed back according to Data1 is Data2.
- the write operation is a modification operation, and the key Kba is added (written) to the value Ma by a modification operation. It can be understood that this step is similar to step S20.
- This step is a process in which user B feeds back the data (value Data2) after receiving the value Data1 sent by the user A. By writing the key Kba at the value Ma corresponding to the communication address of the user A, the purpose of writing the key Kba corresponding to the data into the value Ma is realized.
- step S30 This step is similar to step S30.
- user A receives the value Data1 sent by user A, and then feeds back the data (value Data2)
- user A reads the user B based on the block data.
- the user A since the value Ma corresponding to the communication address of the user A has been changed, the user A can obtain the key corresponding to the key according to the key Kba based on the key Kba written by the user B in the value Ma corresponding to the communication address of the user A.
- Value Data2 the value Data1 sent by user A, and then feeds back the data (value Data2)
- the value Data2 is the data that the user B feeds back to the user A, and the user A obtains the key Kba according to the key Kba added by the user B in the communication address of the user A, and then according to the key Kba and the value Data2.
- the relationship of a key-value pair acquires the value Data2, and the value Data2 that the user B feeds back to the user A according to the value Data1 sent by the user A is completed.
- the function of any two users on the blockchain to communicate with each other is realized. It can be understood that a communication channel is virtualized on the blockchain system to realize data communication between all users.
- the user only needs to maintain communication with the blockchain network to realize data sharing storage and data communication between all users, which can effectively simplify the construction of the application system and reduce the complexity of the system without increasing the complexity of the blockchain system. Under the premise, the problem of users communicating on the blockchain is solved.
- the blockchain has the characteristics of data sharing and data non-tampering.
- the user communication based on the blockchain should encrypt and save the data of the user communication on the blockchain and set limited authorized access to ensure the blockchain.
- the information on the user communication is secure, and only authorized users on the blockchain can decrypt the encrypted data for communication and realize user communication on the blockchain.
- the communication address of each user on the blockchain is first created in a key-value pair manner, and a blockchain-based user interaction information is performed on the blockchain.
- the communication address combined with the nature and characteristics of the blockchain system and the key-value pairs, provides the basis for the realization of user information interaction on subsequent blockchains.
- the user A writes the key Kab in the value Mb corresponding to the communication address of the user B, and the value corresponding to the key Kab is Data1, and the user A and the user B are arbitrarily selected two users on the blockchain, by using the key value pair.
- the key Kab corresponding to the value of the data of the user B to be sent by the user A is written in the value Mb corresponding to the communication address of the user B, so that the key Kab corresponding to the value Data1 is included in the Mb, and is created by the key value pair.
- the communication address and its corresponding value enable the function of transmitting data from the A user to the B user.
- the user B obtains the value Data1 based on the key Kab written in the value Mb corresponding to the communication address of the user B, and the user B transmits the user's communication address and the characteristics according to the key value pair, and the read communication address includes the user A.
- the key Kab corresponding to the value Data1 implements the user communication function based on the blockchain of the blockchain system itself.
- the user communication method on the blockchain provided by this embodiment virtualizes a communication channel on the blockchain system to implement data communication between any two users on the blockchain.
- the user only needs to maintain communication with the blockchain network to realize data sharing storage and data communication between all users, which can effectively simplify the construction of the application system and reduce the complexity of the system without increasing the complexity of the blockchain system.
- the problem of users communicating on the blockchain is solved.
- Fig. 6 is a block diagram showing the principle of the user communication device on the block chain corresponding to the user communication method on the blockchain in the first embodiment.
- the user communication device on the blockchain includes a communication address creation module 10, a key addition module 20, and a value acquisition module 30.
- the implementation functions of the communication address creation module 10, the key addition module 20, and the value acquisition module 30 are in one-to-one correspondence with the steps corresponding to the user communication method on the blockchain in the first embodiment. To avoid redundancy, the present embodiment does not describe the details. Said.
- the communication address creating module 10 is configured to create a communication address of each user on the blockchain in a key value pair manner.
- the key adding module 20 is configured to write the key Kab in the value Mb corresponding to the communication address of the user B, the value corresponding to the key Kab is Data1, and the user A and the user B are two randomly selected users on the blockchain.
- the value acquisition module 30 is configured to acquire the value Data1 by the user B based on the key Kab written in the value Mb corresponding to the communication address of the user B.
- the communication address creating module 10 includes a user address creating unit 11 and a communication address creating unit 12.
- the user address creating unit 11 is configured to create a user address of each user on the blockchain in a key-value pair manner.
- the communication address creating unit 12 is configured to create a communication address of each user on the blockchain in a key-value pair manner according to the user address, wherein the communication address of each user on the blockchain exists in the form of a key, which is represented as an address. Prefix + user address.
- the key adding module 20 includes a key value pair writing unit 21, a first value Mb acquiring unit 22, and a value Mb changing unit 23.
- the first value Mb acquisition unit 22 is configured for the user A to read the communication address of the user B on the blockchain, and obtain the corresponding value Mb according to the communication address of the user B.
- the value Mb changes the unit 23 for the user A to add the key Kab to the value Mb, and the changed value Mb will be written back to the blockchain.
- the value acquisition module 30 includes a second value Mb acquisition unit 31, a key Kab acquisition unit 32, and a value Data1 acquisition unit 33.
- the second value Mb acquisition unit 31 is configured to read the communication address of the user B by the user B, and obtain the value Mb.
- the key Kab acquisition unit 32 is for the user B to obtain the key Kab from the value Mb.
- the value Data1 acquisition unit 33 is for the user B to acquire the value Data1 corresponding to the key Kab according to the key Kab.
- the user communication device on the blockchain further includes a detection reminding module 40, configured to detect that the corresponding value Mb is changed based on the communication address of the user B, and the user B acquires the reminding information related to the change of the value Mb.
- a detection reminding module 40 configured to detect that the corresponding value Mb is changed based on the communication address of the user B, and the user B acquires the reminding information related to the change of the value Mb.
- the user communication device on the blockchain further includes a feedback module 50.
- the feedback key adding module 50 is configured to write the key Kba in the value Ma corresponding to the communication address of the user A, and the value corresponding to the key Kba is the value Data2 corresponding to the value Data1; the user A corresponds to the communication address of the user A.
- the key Kba written in the value Ma gets the value Data2.
- the communication address creating module 10 is configured to create a communication address of each user on the blockchain in a key value pair manner, and combine the blockchain system and the key value pair. The nature and characteristics provide the basis for the realization of user information interaction on the subsequent blockchain.
- the key adding module 20 is configured to write the key Kab in the value Mb corresponding to the communication address of the user B, the value corresponding to the key Kab is Data1, and the user A and the user B are two randomly selected users on the blockchain.
- the key Kab corresponding to the value Data1 that the user A wants to send to the user B is written into the value Mb corresponding to the communication address of the user B, so that the key Kab corresponding to the value Data1 is included in the Mb,
- the communication address created by the key-value pair mode and its corresponding value implement the function of transmitting data from the A user to the B user.
- the value obtaining module 30 is configured to obtain the value Data1 by the user B based on the key Kab written in the value Mb corresponding to the communication address of the user B, and the user B reads the communication address by using the communication address of the user B and according to the characteristics of the key value pair.
- the key Kab corresponding to the value Data1 sent by the user A is included, and the user communication function based on the blockchain system itself is realized.
- the user communication device on the blockchain provided in this embodiment is used to virtualize a communication channel on the blockchain system to implement data communication between any two users on the blockchain.
- the user only needs to maintain communication with the blockchain network to realize data sharing storage and data communication between all users, which can effectively simplify the construction of the application system and reduce the complexity of the system without increasing the complexity of the blockchain system. Under the premise, the problem of users communicating on the blockchain is solved.
- the embodiment provides one or more non-volatile readable storage media having computer readable instructions that, when executed by one or more processors, cause the one or more processors to execute The user communication method on the blockchain in Embodiment 1 is implemented. To avoid repetition, details are not described herein again. Alternatively, when the computer readable instructions are executed by one or more processors, causing the one or more processors to perform the functions of the modules/units in the user communication device on the blockchain in Embodiment 2, Avoid repetition, no more details here.
- Fig. 7 is a schematic diagram of a terminal device in this embodiment.
- terminal device 70 includes a processor 71, a memory 72, and computer readable instructions 73 stored in memory 72 and executable on processor 71.
- the processor 71 implements the various steps of the user communication method on the blockchain in Embodiment 1 when the computer readable instructions 73 are executed, such as steps S10, S20, and S30 shown in FIG.
- the processor 71 executes the computer readable instructions 73
- the functions of the modules/units of the user communication device on the blockchain in Embodiment 2 are implemented, as shown in FIG. 6, the communication address creation module 10, the key addition module 20, and the value acquisition module. 30 features.
- computer readable instructions 73 may be partitioned into one or more modules/units, one or more modules/units being stored in memory 72 and executed by processor 71 to complete the application.
- the one or more modules/units may be an instruction segment of a series of computer readable instructions 73 capable of performing a particular function, which is used to describe the execution of computer readable instructions 73 in the terminal device 70.
- the computer readable instructions 73 can be divided into the communication address creation module 10, the key addition module 20, and the value acquisition module 30 in Embodiment 2.
- the specific functions of each module are as shown in Embodiment 2, to avoid repetition, here. Do not repeat them one by one.
- the terminal device 70 can be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
- the terminal device may include, but is not limited to, a processor 71, a memory 72. It will be understood by those skilled in the art that FIG. 7 is merely an example of the terminal device 70, and does not constitute a limitation of the terminal device 70, and may include more or less components than those illustrated, or may combine certain components or different components.
- the terminal device may further include an input/output device, a network access device, a bus, and the like.
- the processor 71 may be a central processing unit (CPU), or may be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
- the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
- the memory 72 may be an internal storage unit of the terminal device 70, such as a hard disk or a memory of the terminal device 70.
- the memory 72 may also be an external storage device of the terminal device 70, such as a plug-in hard disk provided on the terminal device 70, a smart memory card (SMC), a Secure Digital (SD) card, and a flash memory card (Flash). Card) and so on.
- the memory 72 may also include both an internal storage unit of the terminal device 70 and an external storage device.
- the memory 72 is used to store computer readable instructions 73 and other programs and data required by the terminal device.
- the memory 72 can also be used to temporarily store data that has been or will be output.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated modules/units if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
- the present application implements all or part of the processes in the above embodiments, and may also be implemented by computer readable instructions 73, which may be stored in a computer readable form.
- the computer readable instructions 73 when executed by the processor, may implement the steps of the various method embodiments described above.
- the computer readable instructions 73 comprise code of computer readable instructions, the code of which may be in the form of source code, in the form of an object code, an executable file or some intermediate form or the like.
- the computer readable medium can include any entity or device capable of carrying the code of the computer readable instructions, a recording medium, a USB flash drive, a removable hard drive, a magnetic disk, an optical disk, a computer memory, a read only memory (ROM, Read- Only Memory), Random Access Memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media.
- ROM Read Only Memory
- RAM Random Access Memory
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请公开了一种区块链上用户通信方法、装置、终端设备及存储介质。该区块链上用户通信方法,包括:以键值对方式创建区块链上每一用户的通信地址;用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,所述用户A和所述用户B为区块链上任意选取的两个用户;用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1。采用该区块链上用户通信方法可以实现区块链系统上任意两个用户进行点对点通信,用户只需要维护与区块链网络的通信,即可实现数据共享存储和所有用户间的数据通信,可以有效简化应用系统的构建难度,降低系统复杂性,在不增加区块链系统复杂度的前提下,解决了区块链上用户进行通信的问题。
Description
本申请以2018年5月9日提交的申请号为201810437767.9,名称为“区块链上用户通信方法、装置、终端设备及存储介质”的中国发明专利申请为基础,并要求其优先权。
本申请涉及区块链应用领域,尤其涉及一种区块链上用户通信方法、装置、终端设备及存储介质。
传统的区块链系统仅用于实现数据共享存储,无法实现参与者之间的信息交互。如果需要在区块链上进行信息交互,需要通信参与者之间建立一个专用于信息交互的数据通信通道,使得通信参与者在维护与区块链网络通信之外,还需要维护与所有其他通信参与者的数据通信通道。这种区块链的信息交互方式,增加了区块链系统的复杂性,加大了区块链系统的构建难度,并且在某些网络条件下是不可能实现的。
发明内容
本申请实施例提供一种区块链上用户通信方法、装置、终端设备及存储介质,以解决当前区块链上用户通信的区块链系统过于复杂,构建难度过高的问题。
第一方面,本申请实施例提供一种区块链上用户通信方法,包括:
以键值对方式创建区块链上每一用户的通信地址;
用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,所述用户A和所述用户B为区块链上任意选取的两个用户;
用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1。
第二方面,本申请实施例提供一种区块链上用户通信装置,包括:
通信地址创建模块,用于以键值对方式创建区块链上每一用户的通信地址;
键添加模块,用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,所述用户A和所述用户B为区块链上任意选取的两个用户;
值获取模块,用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1。
第三方面,本申请实施例提供一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
以键值对方式创建区块链上每一用户的通信地址;
用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,所述用户A和所述用户B为区块链上任意选取的两个用户;
用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1。
第四方面,本申请实施例提供一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
以键值对方式创建区块链上每一用户的通信地址;
用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,所述用户A和所述用户B为区块链上任意选取的两个用户;
用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1。
本申请实施例所提供的区块链上用户通信方法、装置、终端设备及存储介质中,首先以键值对方式创建区块链上每一用户的通信地址,创建基于区块链的用于区块链上用户进行信息交互的通信地址,为后续区块链上用户信息交互的实现提供基础。然后用户A在用户B的通信地址对应的值Mb中写入键Kab,键Kab对应的值为Data1,用户A和用户B为区块链上任意选取的两个用户,通过结合区块链系统以及键值对的特点和性质,用户通过以键值对方式创建的通信地址及其对应的值实现了将数据从A用户发送到B用户的功能。最后用户B基于用户B的通信地址对应的值Mb中写入的键Kab,获取值Data1,用户B通过自身的通信地址以及根据键值对的特点,读取通信地址中包含有用户A发送过来的数据对应的键,实现了基于区块链系统本身的区块链上用户通信功能。
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要 使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例1中区块链上用户通信方法的一流程图。
图2是图1中步骤S10的一具体流程图。
图3是图1中步骤S20的一具体流程图。
图4是图1中步骤S30的一具体流程图。
图5是图1中步骤S30之后的一具体流程图。
图6是本申请实施例2中区块链上用户通信装置的一原理框图。
图7是本申请实施例4中终端设备的一示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
实施例1
图1示出本实施例中区块链上用户通信方法的一流程图。该区块链上用户通信方法可应用在以区块链为技术基础的应用系统上,用于进行区块链上任意两个用户之间的点对点通信。如图1所示,该区块链上用户通信方法包括如下步骤:
S10:以键值对方式创建区块链上每一用户的通信地址。
其中,键值(key-value)是一种数据存储方式,值指具体存储的数据,键即其存储的数据的索引,值可以通过查找其对应的键直接获取。键值反映的是一种数据存储的对应关系,由一个键及其对应的值所组成的数据关系对称为键值对。区块链是分布式数据存储、共识机制和加密算法等计算机技术的新型应用模式。本实施例是基于区块链系统实现的,即区块链应以区块链系统来理解。其中,区块链系统本质是一个去中心化的分布式数据库系统。需要说明的是,本实施例中区块链上的用户应理解为在区块链系统上的各个用户节点,即区块链系统上各个相关的终端,该终端可以是通过区块链网络相连的手机、电脑、平板和服务器等终端。
本实施例中,以键值对方式创建区块链上每一用户的通信地址,将区块链上每一用户 的通信地址作为存储的数据对应的索引,也即键值对中的键。通过为区块链上每一用户建立通信地址,能够实现根据区块链上用户的通信地址进行与该通信地址所对应的数据的修改和读取等操作,为后续实现区块链上任意两个用户之间的点对点通信提供了基础。
在一具体实施方式中,如图2所示,步骤S10中,以键值对方式创建区块链上每一用户的通信地址,具体包括如下步骤:
S11:以键值对方式创建区块链上每一用户的用户地址。
其中,用户地址是用于区分不同用户在区块链上的地址字段,任意两个用户的用户地址不相同。本实施例中,以键值对方式创建区块链上每一用户的用户地址,确定区块链上每一用户的地址字段。通过创建的区块链上每一用户的用户地址,可以以该用户地址为基础,设置多种不同功能的地址类型,如数据共享地址和通信地址等。
S12:根据用户地址,以键值对方式创建区块链上每一用户的通信地址,其中,区块链上每一用户的通信地址以键的形式存在,表示为地址前缀+用户地址。
本实施例中,区块链上每一用户的通信地址以键的形式存在,该通信地址对应的值即为通信地址中存储的数据。例如,可以把通信地址看成是用户的邮箱,该邮箱中存有与该邮箱唯一对应的数据即为键值对中的值。若通过键值对的方式实现数据存储时,用户的通信地址即为键,该键对应的值即为该通信地址存储的数据。
区块链上每一用户的通信地址以键的形式存在,具体可以表示为地址前缀+用户地址,其中,地址前缀用于区分该地址实现的功能的标识。例如,区块链上任意一个用户A的用户地址为userAAA,而该用户A的通信地址为MailuserAAA,则通信地址中的地址前缀为Mail,用于表示该地址是作为通信使用的邮箱地址。特别地,也可以不使用地址前缀+用户地址的方式表示通信地址,只要保证系统命名唯一即可,如用户A的通信地址也可以直接用用户地址userAAA进行表示。考虑到命名的规范性和合理性有利于区块链系统的合理设计和功能扩充,本实施例将区块链上每一用户的通信地址均表示为地址前缀+用户地址。
S20:用户A在用户B的通信地址对应的值Mb中写入键Kab,键Kab对应的值为Data1,用户A和用户B为区块链上任意选取的两个用户。
其中,用户A和用户B是区块链上任意选取的两个用户,这里的用户同样应理解为区块链系统上的终端,具体为通过区块链网络相连的终端。用户B的通信地址对应的值为Mb,键Kab和值Data1是一个键值对,这一键值对用于存储用户A在区块链上传送给用户B的数据。
本实施例中,区块链系统是一个去中心化的分布式数据库系统,拥有数据共享性以及 数据不可篡改性的特点,区块链上有任意两个用户:用户A和用户B。基于区块链系统,用户A在用户B的通信地址对应的值Mb中写入键Kab。该键Kab对应的值是Data1,即用户A想要用户B接收到的数据为Data1。其中,这里的写入操作具体为修改操作,通过修改操作将键Kab添加(写入)到值Mb中。通过在用户B的通信地址对应的值Mb写入键Kab,实现了将数据对应的键Kab写入到值Mb中,以使用户B可通过值Mb获取到A用户传送过来的数据(即键Kab对应的值为Data1)的目的,从而使得用户A与用户B在区块链上实现点对点通信。
在一具体实施方式中,如图3所示,步骤S20中,用户A在用户B的通信地址对应的值Mb中写入键Kab,键Kab对应的值为Data1,用户A和用户B为区块链上任意选取的两个用户,具体包括如下步骤:
S21:用户A以键值对方式向区块链上写入键Kab和与键Kab对应的值Data1,其中,键Kab=数据前缀+用户B的用户地址+用户A的用户地址。
其中,数据前缀与地址前缀类似,数据前缀是用来区分数据的标识,数据前缀可以用时间戳加上用途标识来表示。例如,可以采用时间戳和Commu(即Communication的缩写)这一用途标识作为键Kab的数据前缀,表示该键Kab建立的时间以及该键的用途(这里指该键用于通信)。在确定数据前缀后,可将该数据前缀结合用户B的用户地址和用户A的用户地址,以唯一确定键Kab。可以理解地,数据前缀也可以采用其他方式表示(如直接使用Commu而无需携带时间戳,用于表示该数据用于通信),只要能唯一区分该数据前缀代表的键即可。
本实施例中,在区块链系统上,用户A以键值对方式向区块链上写入键Kab和与键Kab对应的值Data1。其中,若键Kab是首次写入区块链系统,则该写入操作具体为创建操作;若键Kab已存在且用户A仍想继续使用该键Kab,则该写入操作具体为修改操作,不对键Kab作更改,修改键Kab对应的值Data1。其中,键Kab具体可以表示为键Kab=数据前缀+用户B的用户地址+用户A的用户地址,也可以表示为键Kab=数据前缀+用户A的用户地址+用户B的用户地址,键Kab还可以表示为其他方式,只要满足用户A能够将键Kab写入到值Mb中且用户B可以根据自身的通信地址获取到键Kab即可。
S22:用户A在区块链上读取用户B的通信地址,根据用户B的通信地址获取对应的值Mb。
本实施例中,用户A在区块链上读取用户B的通信地址,当用户B的通信地址表示为键MailUserBBB时,用户A在区块链上读取用户B的通信地址即为键MailUserBBB。由于 用户B的通信地址和对应的值Mb是以键值对方式进行存储的,则用户A根据用户B的通信地址即可获取该键(用户B的通信地址)对应的值Mb。
S23:用户A将键Kab添加到值Mb中,更改后的值Mb将写回到区块链上。
本实施例中,用户A在读取用户B的通信地址对应的值Mb时,执行修改指令,将键Kab添加到值Mb中,可以表示为Mb+Kab。将键Kab添加到值Mb后,Mb发生了更改,更改后的Mb将写回到区块链上。需要说明的是,区块链系统有两个概念:区块和当前数据状态(fabric中的world state,比特币中的UTXO)。区块中是历史交易信息,当前数据状态是由所有的历史交易所得到的系统数据状态。本实施例中所有的创建或修改等操作,都是通过发送一个交易,经过区块链系统本身的验证,得到一个区块。最终区块链上所有用户根据区块将交易执行,实现对当前数据状态的修改。另外,交易动作会包含在一个区块中,一个区块中可能有多个交易;读取操作不会产生区块,不算交易;区块链系统会按照一定的时间间隔产生区块,每个区块中包含这个时间间隔中所有的交易。本实施例中将键Kab添加到值Mb中是区块链上的一个交易,经过区块链系统本身的验证,在该交易所在的时间间隔结束后,该交易将被打包到该时间间隔的区块中,最后区块链上所有用户根据该区块将键Kab添加到值Mb这个交易执行,实现对当前数据状态的修改,即成功将更改后的Mb写回到区块链上。
S30:用户B基于用户B的通信地址对应的值Mb中写入的键Kab,获取值Data1。
本实施例中,由于用户B的通信地址对应的值Mb已被更改,用户B基于自身的通信地址对应的值Mb能够获取由用户A写入到值Mb中的键Kab,能够根据键Kab获取该键Kab对应的值Data1。可以理解地,值Data1即用户A发送给用户B的数据,用户B根据用户A在用户B的通信地址中添加的键Kab,通过区块链系统读取自身的通信地址对应的值Mb获取键Kab,再根据键Kab和值Data1是一个键值对的关系获取值Data1。通过键值对以及结合区块链系统的方式,实现了区块链上任意两个用户点对点进行通信的功能。该区块链上任意两个用户点对点进行通信可以理解为在区块链系统上虚拟出了一条通信通道,并实现所有用户之间的数据通信。用户只需要维护与区块链系统的网络通信,即可实现数据共享存储和所有用户间的数据通信,可以有效地简化应用系统的构建难度,降低系统复杂性,在不增加区块链系统复杂度的前提下,解决了区块链上用户进行通信的问题。
在一具体实施方式中,如图4所示,步骤S30中,用户B基于用户B的通信地址对应的值Mb中写入的键Kab,获取值Data1,具体包括如下步骤:
S31:用户B读取用户B的通信地址,获取值Mb。
本实施例中,用户B是区块链上除用户A外的任意一用户,用户B读取自身的通信地址,由于用户B的通信地址是值Mb对应的键,用户B基于区块链系统通过自身的通信地址读取到该键相对应的值Mb。
S32:用户B从值Mb中获取键Kab。
本实施例中,在步骤S23中用户A已将键Kab添加到值Mb中,值Mb在键Kab添加后发生了更改,用户B从更改后的值Mb中获取键Kab。可以理解地,若从用户B的通信地址对应的值Mb中读取到键Kab,由于键Kab是用户A给用户B发送的数据存储在区块链上的索引,说明区块链中存在用户A给用户B发送的数据。
S33:用户B根据键Kab获取键Kab对应的值Data1。
本实施例中,根据键Kab和值Data1是一个键值对的关系,直接根据键Kab获取键Kab对应的值Data1,以读取用户A发送给用户B的数据Data1,从而实现用户A与用户B之间点对点数据交互。
可以理解地,步骤S20是用户A通过区块链给用户B写入数据的过程,而步骤S30是用户B通过区块链获取用户A发送的数据的过程,基于步骤S20和S30可在区块链上实现用户A向用户B发送数据,且用户B接收用户A的数据的点对点通信过程,无需另行创建专用于信息交互的数据通信通道,无需增加区块链系统的复杂性和构建难度。
在一具体实施方式中,步骤S20之后,即在用户A在用户B的通信地址对应的值Mb中写入键Kab,键Kab对应的值为Data1之后,该区块链上用户通信方法还包括如下步骤:基于用户B的通信地址检测到对应的值Mb发生更改,用户B获取与值Mb发生更改相关的提醒信息。
本实施例中,在值Mb发生更改后,用户B将会根据自身的通信地址检测到对应的值Mb发生更改,此时,用户B将获取与值Mb发生更改相关的提醒信息。具体地,可以是通过执行预先设定的定时检测程序,每隔一时间间隔便自动检测通信地址对应的值Mb,并比较两次检测到的值Mb是否发生更改,若发生变更,则向用户B发送与值Mb发生更改相关的提醒信息。如将上一时间间隔结束时刻的值Mb和当前时刻时间间隔结束时刻的值Mb进行比较,若两个时间点的值Mb不同,则认为值Mb发生了更改。在值Mb发生变化之后,执行发送与值Mb发生更改相关的提醒信息的指令,能够使用户B及时获取数据更新的消息,及时收取数据Data1。
在一具体实施方式中,如图5所示,步骤S30之后,即在用户B基于用户B的通信地址对应的值Mb中写入的键Kab,获取值Data1之后,该区块链上用户通信方法还包括如下 步骤:
S40:用户B在用户A的通信地址对应的值Ma中写入键Kba,键Kba对应的值为与值Data1相对应的值Data2。
其中,用户A的通信地址对应的值为Ma,键Kba和值Data2是一个键值对,用于存储用户B在区块链上传给用户A的数据。值Data2与值Data1相关联。例如键Kba的数据前缀在这里可以使用时间戳,以突出进行反馈的时间。本实施例中,基于区块链系统,用户B在用户A的通信地址对应的值Ma中写入键Kba。该键Kba对应的值是Data2,即用户B想要给用户A发送的根据Data1反馈的数据为Data2。其中,写入操作为修改操作,通过修改操作将键Kba添加(写入)到值Ma中。可以理解地,本步骤与步骤S20相似,本步骤为用户B在接收到用户A发送的值Data1后,反馈发送数据(值Data2)的过程。通过在用户A的通信地址对应的值Ma写入键Kba,实现了将数据对应的键Kba写入到值Ma中的目的。
S50:用户A基于用户A的通信地址对应的值Ma中写入的键Kba获取值Data2。
本步骤与步骤S30相似,本步骤为用户B在接收到用户A发送的值Data1,后,反馈发送数据(值Data2)后,用户A基于区块链系统读取用户B根据值Data1反馈过来的数据(值Data2)的过程。本实施例中,由于用户A的通信地址对应的值Ma已被更改,用户A基于自身的通信地址对应的值Ma中的由用户B写入的键Kba,能够根据键Kba获取该键对应的值Data2。可以理解地,值Data2即用户B反馈给用户A的数据,用户A根据用户B在用户A的通信地址中添加的键Kba,通过自身的通信地址获取键Kba,再根据键Kba和值Data2是一个键值对的关系获取值Data2,完成用户B根据用户A发送的值Data1反馈给用户A的值Data2。通过键值对的方式以及结合区块链的特点,实现了区块链上任意两个用户点对点进行通信的功能。可以理解地,即在区块链系统上虚拟出一条通信通道,实现所有用户之间的数据通信。用户只需要维护与区块链网络的通信,即可实现数据共享存储和所有用户间的数据通信,可以有效地简化应用系统的构建难度,降低系统复杂性,在不增加区块链系统复杂度的前提下,解决了区块链上用户进行通信的问题。
需要说明的是,区块链具有数据共享和数据不可篡改等特点,基于区块链上的用户通信应该对区块链上用户通信的数据进行加密保存和设置有限授权访问,以保证区块链上用户通信的信息安全,在区块链上只有授权的用户才能够解密被加密的用于通信的数据,实现在区块链上的用户通信。
本实施例所提供的区块链上用户通信方法中,首先以键值对方式创建区块链上每一用 户的通信地址,创建基于区块链的用于区块链上用户进行信息交互的通信地址,结合区块链系统以及键值对的性质和特点,为后续区块链上用户信息交互的实现提供基础。然后用户A在用户B的通信地址对应的值Mb中写入键Kab,键Kab对应的值为Data1,用户A和用户B为区块链上任意选取的两个用户,通过利用键值对的特点将用户A要发送给用户B的值Data1对应的键Kab写入到用户B的通信地址对应的值Mb中,使得Mb中包含有值Data1对应的键Kab,通过以键值对方式创建的通信地址及其对应的值实现了将数据从A用户发送到B用户的功能。最后用户B基于用户B的通信地址对应的值Mb中写入的键Kab,获取值Data1,用户B通过自身的通信地址以及根据键值对的特点,读取通信地址中包含有用户A发送过来的值Data1对应的键Kab,实现了基于区块链系统本身的区块链上用户通信功能。本实施例所提供的区块链上用户通信方法即在区块链系统上虚拟出一条通信通道,实现区块链上任意两个用户之间的数据通信。用户只需要维护与区块链网络的通信,即可实现数据共享存储和所有用户间的数据通信,可以有效地简化应用系统的构建难度,降低系统复杂性,在不增加区块链系统复杂度的前提下,解决了区块链上用户进行通信的问题。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
实施例2
图6示出与实施例1中区块链上用户通信方法一一对应的区块链上用户通信装置的原理框图。如图6所示,该区块链上用户通信装置包括通信地址创建模块10、键添加模块20和值获取模块30。其中,通信地址创建模块10、键添加模块20和值获取模块30的实现功能与实施例1中区块链上用户通信方法对应的步骤一一对应,为避免赘述,本实施例不一一详述。
通信地址创建模块10,用于以键值对方式创建区块链上每一用户的通信地址。
键添加模块20,用于用户A在用户B的通信地址对应的值Mb中写入键Kab,键Kab对应的值为Data1,用户A和用户B为区块链上任意选取的两个用户。
值获取模块30,用于用户B基于用户B的通信地址对应的值Mb中写入的键Kab,获取值Data1。
优选地,通信地址创建模块10包括用户地址创建单元11和通信地址创建单元12。
用户地址创建单元11,用于以键值对方式创建区块链上每一用户的用户地址。
通信地址创建单元12,用于根据用户地址,以键值对方式创建区块链上每一用户的通信地址,其中,区块链上每一用户的通信地址以键的形式存在,表示为地址前缀+用户地 址。
优选地,键添加模块20包括键值对写入单元21、第一值Mb获取单元22和值Mb更改单元23。
键值对写入单元21,用于用户A以键值对方式向区块链上写入键Kab和与键Kab对应的值Data1,其中,键Kab=数据前缀+用户B的用户地址+用户A的用户地址。
第一值Mb获取单元22,用于用户A在区块链上读取用户B的通信地址,根据用户B的通信地址获取对应的值Mb。
值Mb更改单元23,用于用户A将键Kab添加到值Mb中,更改后的值Mb将写回到区块链上。
优选地,值获取模块30包括第二值Mb获取单元31、键Kab获取单元32和值Data1获取单元33。
第二值Mb获取单元31,用于用户B读取用户B的通信地址,获取值Mb。
键Kab获取单元32,用于用户B从值Mb中获取键Kab。
值Data1获取单元33,用于用户B根据键Kab,获取与键Kab对应的值Data1。
优选地,该区块链上用户通信装置还包括检测提醒模块40,用于基于用户B的通信地址检测到对应的值Mb发生更改,用户B获取与值Mb发生更改相关的提醒信息。
优选地,该区块链上用户通信装置还包括反馈模块50。
反馈键添加模块50,用于用户B在用户A的通信地址对应的值Ma中写入键Kba,键Kba对应的值为与值Data1相对应的值Data2;用户A基于用户A的通信地址对应的值Ma中写入的键Kba获取值Data2。
本实施例所提供的区块链上用户通信装置中,通信地址创建模块10,用于以键值对方式创建区块链上每一用户的通信地址,结合区块链系统以及键值对的性质和特点,为后续区块链上用户信息交互的实现提供基础。键添加模块20,用于用户A在用户B的通信地址对应的值Mb中写入键Kab,键Kab对应的值为Data1,用户A和用户B为区块链上任意选取的两个用户,通过利用键值对的特点将用户A要发送给用户B的值Data1对应的键Kab写入到用户B的通信地址对应的值Mb中,使得Mb中包含有值Data1对应的键Kab,通过以键值对方式创建的通信地址及其对应的值实现了将数据从A用户发送到B用户的功能。值获取模块30,用于用户B基于用户B的通信地址对应的值Mb中写入的键Kab,获取值Data1,用户B通过自身的通信地址以及根据键值对的特点,读取通信地址中包含有用户A发送过来的值Data1对应的键Kab,实现了基于区块链系统本身的区块链上用户通信功能。 本实施例所提供的区块链上用户通信装置用于在区块链系统上虚拟出一条通信通道,实现区块链上任意两个用户之间的数据通信。用户只需要维护与区块链网络的通信,即可实现数据共享存储和所有用户间的数据通信,可以有效地简化应用系统的构建难度,降低系统复杂性,在不增加区块链系统复杂度的前提下,解决了区块链上用户进行通信的问题。
实施例3
本实施例提供一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行时实现实施例1中区块链上用户通信方法,为避免重复,这里不再赘述。或者,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行时实现实施例2中区块链上用户通信装置中各模块/单元的功能,为避免重复,这里不再赘述。
实施例4
图7是本实施例中终端设备的示意图。如图7所示,终端设备70包括处理器71、存储器72以及存储在存储器72中并可在处理器71上运行的计算机可读指令73。处理器71执行计算机可读指令73时实现实施例1中区块链上用户通信方法的各个步骤,例如图1所示的步骤S10、S20和S30。或者,处理器71执行计算机可读指令73时实现实施例2中区块链上用户通信装置各模块/单元的功能,如图6所示通信地址创建模块10、键添加模块20和值获取模块30的功能。
示例性的,计算机可读指令73可以被分割成一个或多个模块/单元,一个或者多个模块/单元被存储在存储器72中,并由处理器71执行,以完成本申请。一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令73的指令段,该指令段用于描述计算机可读指令73在终端设备70中的执行过程。例如,计算机可读指令73可被分割成实施例2中的通信地址创建模块10、键添加模块20和值获取模块30,各模块的具体功能如实施例2所示,为避免重复,此处不一一赘述。
终端设备70可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。终端设备可包括,但不仅限于,处理器71、存储器72。本领域技术人员可以理解,图7仅仅是终端设备70的示例,并不构成对终端设备70的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如终端设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器71可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器72可以是终端设备70的内部存储单元,例如终端设备70的硬盘或内存。存储器72也可以是终端设备70的外部存储设备,例如终端设备70上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器72还可以既包括终端设备70的内部存储单元也包括外部存储设备。存储器72用于存储计算机可读指令73以及终端设备所需的其他程序和数据。存储器72还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令73来指令相关的硬件来完成,所述的计算机可读指令73可存储于一计算机可读存储介质中,该计算机可读指令73在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令73包括计算机可读指令的代码,所述计算机可读指令的代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机可读指令的代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例 对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。
Claims (20)
- 一种区块链上用户通信方法,其特征在于,包括:以键值对方式创建区块链上每一用户的通信地址;用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,所述用户A和所述用户B为区块链上任意选取的两个用户;用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1。
- 根据权利要求1所述的区块链上用户通信方法,其特征在于,所述以键值对方式创建区块链上每一用户的通信地址,包括:以所述键值对方式创建所述区块链上每一用户的用户地址;根据所述用户地址,以所述键值对方式创建所述区块链上每一用户的所述通信地址,其中,所述区块链上每一所述用户的通信地址以键的形式存在,表示为地址前缀+用户地址。
- 根据权利要求1所述的区块链上用户通信方法,其特征在于,所述用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,包括:用户A以所述键值对方式向区块链上写入所述键Kab和与所述键Kab对应的值Data1,其中,所述键Kab=数据前缀+用户B的用户地址+用户A的用户地址;用户A在区块链上读取所述用户B的通信地址,根据所述用户B的通信地址获取对应的所述值Mb;所述用户A将所述键Kab添加到所述值Mb中,更改后的所述值Mb将写回到区块链上。
- 根据权利要求1所述的区块链上用户通信方法,其特征在于,所述用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1,包括:所述用户B读取所述用户B的通信地址,获取所述值Mb;所述用户B从所述值Mb中获取所述键Kab;所述用户B根据所述键Kab,获取与所述键Kab对应的所述值Data1。
- 根据权利要求1所述的区块链上用户通信方法,其特征在于,在所述用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1的步骤之后,所述区块链上用户通信方法还包括:基于所述用户B的通信地址检测到对应的所述值Mb发生更改,用户B获取与所述值 Mb发生更改相关的提醒信息。
- 根据权利要求1所述的区块链上用户通信方法,其特征在于,在所述用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1的步骤之后,所述区块链上用户通信方法还包括:用户B在所述用户A的通信地址对应的值Ma中写入键Kba,所述键Kba对应的值为与所述值Data1相对应的值Data2;用户A基于所述用户A的通信地址对应的值Ma中写入的所述键Kba获取所述值Data2。
- 一种区块链上用户通信装置,其特征在于,包括:通信地址创建模块,用于以键值对方式创建区块链上每一用户的通信地址;键添加模块,用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,所述用户A和所述用户B为区块链上任意选取的两个用户;值获取模块,用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1。
- 根据权利要求7所述的区块链上用户通信装置,其特征在于,所述通信地址创建模块,包括:用户地址创建单元,用于以所述键值对方式创建所述区块链上每一用户的用户地址;通信地址创建单元,用于根据所述用户地址,以所述键值对方式创建所述区块链上每一用户的所述通信地址,其中,所述区块链上每一所述用户的通信地址以键的形式存在,表示为地址前缀+用户地址。
- 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:以键值对方式创建区块链上每一用户的通信地址;用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,所述用户A和所述用户B为区块链上任意选取的两个用户;用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1。
- 根据权利要求9所述的终端设备,其特征在于,所述以键值对方式创建区块链上每一用户的通信地址,包括:以所述键值对方式创建所述区块链上每一用户的用户地址;根据所述用户地址,以所述键值对方式创建所述区块链上每一用户的所述通信地址,其中,所述区块链上每一所述用户的通信地址以键的形式存在,表示为地址前缀+用户地址。
- 根据权利要求9所述的终端设备,其特征在于,所述用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,包括:用户A以所述键值对方式向区块链上写入所述键Kab和与所述键Kab对应的值Data1,其中,所述键Kab=数据前缀+用户B的用户地址+用户A的用户地址;用户A在区块链上读取所述用户B的通信地址,根据所述用户B的通信地址获取对应的所述值Mb;所述用户A将所述键Kab添加到所述值Mb中,更改后的所述值Mb将写回到区块链上。
- 根据权利要求9所述的终端设备,其特征在于,所述用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1,包括:所述用户B读取所述用户B的通信地址,获取所述值Mb;所述用户B从所述值Mb中获取所述键Kab;所述用户B根据所述键Kab,获取与所述键Kab对应的所述值Data1。
- 根据权利要求9所述的终端设备,其特征在于,在所述用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1的步骤之后,所述区块链上用户通信方法还包括:基于所述用户B的通信地址检测到对应的所述值Mb发生更改,用户B获取与所述值Mb发生更改相关的提醒信息。
- 根据权利要求9所述的终端设备,其特征在于,在所述用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1的步骤之后,所述区块链上用户通信方法还包括:用户B在所述用户A的通信地址对应的值Ma中写入键Kba,所述键Kba对应的值为与所述值Data1相对应的值Data2;用户A基于所述用户A的通信地址对应的值Ma中写入的所述键Kba获取所述值Data2。
- 一个或多个存储有计算机可读指令的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:以键值对方式创建区块链上每一用户的通信地址;用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,所述用户A和所述用户B为区块链上任意选取的两个用户;用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1。
- 根据权利要求15所述的非易失性可读存储介质,其特征在于,所述以键值对方式创建区块链上每一用户的通信地址,包括:以所述键值对方式创建所述区块链上每一用户的用户地址;根据所述用户地址,以所述键值对方式创建所述区块链上每一用户的所述通信地址,其中,所述区块链上每一所述用户的通信地址以键的形式存在,表示为地址前缀+用户地址。
- 根据权利要求15所述的非易失性可读存储介质,其特征在于,所述用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1,包括:用户A以所述键值对方式向区块链上写入所述键Kab和与所述键Kab对应的值Data1,其中,所述键Kab=数据前缀+用户B的用户地址+用户A的用户地址;用户A在区块链上读取所述用户B的通信地址,根据所述用户B的通信地址获取对应的所述值Mb;所述用户A将所述键Kab添加到所述值Mb中,更改后的所述值Mb将写回到区块链上。
- 根据权利要求15所述的非易失性可读存储介质,其特征在于,所述用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1,包括:所述用户B读取所述用户B的通信地址,获取所述值Mb;所述用户B从所述值Mb中获取所述键Kab;所述用户B根据所述键Kab,获取与所述键Kab对应的所述值Data1。
- 根据权利要求15所述的非易失性可读存储介质,其特征在于,在所述用户A在用户B的通信地址对应的值Mb中写入键Kab,所述键Kab对应的值为Data1的步骤之后,所述区块链上用户通信方法还包括:基于所述用户B的通信地址检测到对应的所述值Mb发生更改,用户B获取与所述值Mb发生更改相关的提醒信息。
- 根据权利要求15所述的非易失性可读存储介质,其特征在于,在所述用户B基于所述用户B的通信地址对应的值Mb中写入的所述键Kab,获取所述值Data1的步骤之后,所述区块链上用户通信方法还包括:用户B在所述用户A的通信地址对应的值Ma中写入键Kba,所述键Kba对应的值为与所述值Data1相对应的值Data2;用户A基于所述用户A的通信地址对应的值Ma中写入的所述键Kba获取所述值Data2。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810437767.9A CN108647101A (zh) | 2018-05-09 | 2018-05-09 | 区块链上用户通信方法、装置、终端设备及存储介质 |
| CN201810437767.9 | 2018-05-09 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019214067A1 true WO2019214067A1 (zh) | 2019-11-14 |
Family
ID=63754104
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/095902 Ceased WO2019214067A1 (zh) | 2018-05-09 | 2018-07-17 | 区块链上用户通信方法、装置、终端设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN108647101A (zh) |
| WO (1) | WO2019214067A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110163754B (zh) * | 2019-04-26 | 2021-07-27 | 华中科技大学 | Fabric区块链中实现铸币交易的方法、客户端、区块链及系统 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170255950A1 (en) * | 2016-03-04 | 2017-09-07 | Forecast Foundation Ou | Systems and methods for providing block chain state proofs for prediction market resolution |
| CN107666484A (zh) * | 2017-09-19 | 2018-02-06 | 上海交通大学 | 一种基于区块链的cdn共享方法及系统 |
| CN107748649A (zh) * | 2017-09-18 | 2018-03-02 | 北京京东尚科信息技术有限公司 | 一种缓存数据的方法和装置 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5524144B2 (ja) * | 2011-08-08 | 2014-06-18 | 株式会社東芝 | key−valueストア方式を有するメモリシステム |
| CN107273455B (zh) * | 2017-05-31 | 2020-12-18 | 深圳前海微众银行股份有限公司 | 区块链数据访问方法和装置 |
| CN107562775B (zh) * | 2017-07-14 | 2020-04-24 | 创新先进技术有限公司 | 一种基于区块链的数据处理方法及设备 |
-
2018
- 2018-05-09 CN CN201810437767.9A patent/CN108647101A/zh active Pending
- 2018-07-17 WO PCT/CN2018/095902 patent/WO2019214067A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170255950A1 (en) * | 2016-03-04 | 2017-09-07 | Forecast Foundation Ou | Systems and methods for providing block chain state proofs for prediction market resolution |
| CN107748649A (zh) * | 2017-09-18 | 2018-03-02 | 北京京东尚科信息技术有限公司 | 一种缓存数据的方法和装置 |
| CN107666484A (zh) * | 2017-09-19 | 2018-02-06 | 上海交通大学 | 一种基于区块链的cdn共享方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108647101A (zh) | 2018-10-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11501533B2 (en) | Media authentication using distributed ledger | |
| US9934138B1 (en) | Application testing on a blockchain | |
| CN110163006B (zh) | 一种块链式账本中的签名验证方法、系统、装置及设备 | |
| WO2020042586A1 (zh) | 智能合约地址生成方法、装置、计算机设备及可读存储介质 | |
| CN110442652A (zh) | 一种基于区块链的跨链数据处理方法及装置 | |
| CN116049626A (zh) | 一种数据统计方法、装置、设备以及存储介质 | |
| WO2020220536A1 (zh) | 一种数据备份的方法、装置及计算机可读存储介质 | |
| WO2021031473A1 (zh) | 基于多资产模型的区块链资产处理方法及相关设备 | |
| TWI714414B (zh) | 區塊鏈資料的分次獲取方法和裝置 | |
| KR20200085095A (ko) | 블록체인 기반으로 데이터를 관리하는 전자 장치 및 데이터 관리 방법 | |
| CN113051622B (zh) | 索引构建方法、装置、设备和存储介质 | |
| CN112202779B (zh) | 基于区块链的信息加密方法、装置、设备及介质 | |
| WO2020233051A1 (zh) | 跨网段互连的区块链网络实现方法、装置、系统及介质 | |
| WO2020215685A1 (zh) | 基于区块链的信息处理、获取方法、装置、设备及介质 | |
| WO2023011022A1 (zh) | 基于区块链的数据处理方法、设备及计算机可读存储介质 | |
| US20200213100A1 (en) | Multi-chain information management method, storage medium and blockchain identity parser | |
| CN110474775B (zh) | 一种块链式账本中的用户创建方法、装置及设备 | |
| CN110442601A (zh) | 一种Openstack镜像数据并行加速的方法和装置 | |
| CN107395772B (zh) | 一种重复数据的管理方法及管理系统 | |
| WO2019214067A1 (zh) | 区块链上用户通信方法、装置、终端设备及存储介质 | |
| WO2019214071A1 (zh) | 区块链上用户通信方法、装置、终端设备及存储介质 | |
| CN115292166A (zh) | 一种多人协同的测试用例管理方法、装置、设备及介质 | |
| CN116016134B (zh) | 跨集群通信部署方法、装置和计算机设备 | |
| CN111130788B (zh) | 数据处理方法和系统、数据读取方法和iSCSI服务器 | |
| WO2019205281A1 (zh) | 基于云计算网络的数字资产管理方法、装置和存储设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18918003 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 260321) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18918003 Country of ref document: EP Kind code of ref document: A1 |