CN111309808A - Page access method, device, equipment and storage medium for decentralized application - Google Patents

Page access method, device, equipment and storage medium for decentralized application Download PDF

Info

Publication number
CN111309808A
CN111309808A CN202010100327.1A CN202010100327A CN111309808A CN 111309808 A CN111309808 A CN 111309808A CN 202010100327 A CN202010100327 A CN 202010100327A CN 111309808 A CN111309808 A CN 111309808A
Authority
CN
China
Prior art keywords
block chain
user node
page
target page
chain 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.)
Granted
Application number
CN202010100327.1A
Other languages
Chinese (zh)
Other versions
CN111309808B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010100327.1A priority Critical patent/CN111309808B/en
Publication of CN111309808A publication Critical patent/CN111309808A/en
Application granted granted Critical
Publication of CN111309808B publication Critical patent/CN111309808B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9554Retrieval from the web using information identifiers, e.g. uniform resource locators [URL] by using bar codes
    • 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/602Providing cryptographic facilities or services
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the application discloses a page access method, a device, equipment and a storage medium for decentralized application, wherein the method comprises the following steps: the method comprises the steps that a decentralized application receives a target page sharing request sent by a first user node; the decentralized application sends a target page sharing request to a consensus node in the block chain, so that the consensus node determines whether the first user node has the sharing authority of the target page; when the first user node has the sharing right, the decentralized application determines a block chain address of the page information of the target page according to the page identifier and sends the block chain address to the first user node to obtain an encrypted block chain address; and the decentralized application acquires the encryption block chain address, generates a two-dimensional code according to the encryption block chain address, and broadcasts the two-dimensional code in the block chain so that a second user node accesses the target page according to the two-dimensional code. By adopting the embodiment of the application, the target page of the decentralized application can be quickly accessed through the two-dimensional code, and the applicability is high.

Description

Page access method, device, equipment and storage medium for decentralized application
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for page access of decentralized application.
Background
With the development of the blockchain technology, a number of Dapp (Decentralized Application) applications for blockchain networks are appearing on the network. For example, a game class Dapp, a shopping class Dapp, and so forth.
However, as the types of decentralized applications increase, the traditional decentralized application opening manner is complicated, and a user needs to trigger and start the decentralized application to access the decentralized application. On the other hand, when a user shares a certain page of the decentralized application with another user, the decentralized application runs on the blockchain network, and therefore the shared user needs to perform the steps of installation, starting, access to a specified page and the like of the decentralized application to access the page shared by the sharing user. Therefore, how to realize the quick access to the specified page of the decentralized application becomes a problem which needs to be solved urgently.
Disclosure of Invention
The embodiment of the application provides a page access method, a page access device, page access equipment and a storage medium for decentralized application, a target page of the decentralized application can be quickly accessed through a two-dimensional code, and the applicability is high.
In a first aspect, an embodiment of the present application provides a page access method for a decentralized application, where the method includes:
receiving a target page sharing request sent by a first user node by a decentralized application, wherein the target page sharing request carries a page identifier of a target page;
the decentralized application sends the target page sharing request to a consensus node in a block chain, so that the consensus node determines whether the first user node has the sharing authority of the target page;
when the first user node has the sharing right, the decentralized application determines a block chain address of the page information of the target page in the block chain according to the page identifier, and sends the block chain address to the first user node so that the first user node signs the block chain address according to a private key of the first user node to obtain an encrypted block chain address;
and the decentralized application acquires the encryption block chain address, generates a two-dimensional code according to the encryption block chain address, and broadcasts the two-dimensional code in the block chain so that a second user node accesses the target page according to the two-dimensional code.
With reference to the first aspect, in one possible implementation, the method further includes:
when receiving an access request triggered by a second user node when identifying the two-dimensional code, the decentralized application acquires a public key of the first user node, and decrypts the encrypted block chain address according to the public key of the first user node to obtain the block chain address;
and the decentralized application sends the block chain address to the second user node, so that the second user node obtains the page information of the target page according to the block chain address and accesses the target page according to the page information.
With reference to the first aspect, in a possible implementation manner, the page information includes page configuration data and a target intelligent contract; the method further comprises the following steps:
the decentralized application acquires the page configuration data and the target intelligent contract according to the block chain address;
the decentralized application generates the target page according to the page configuration data and executes the target intelligent contract to determine whether the target intelligent contract is matched with the target page;
if the target intelligent contract is matched with the target page, the decentralized application sends an access permission notice to the second user node so that the second user node can access the target page according to the page configuration data.
With reference to the first aspect, in one possible implementation, the method further includes:
the decentralized application sends access event information to the first user node so that the first user node sends a data volume receiving address and node information of the first user node, wherein the access event information is used for explaining that the second user node accesses the target page according to the two-dimensional code;
the decentralized application determines a transfer data volume corresponding to the first user node according to the node information, and sends the transfer data volume to the data volume receiving address.
With reference to the first aspect, in a possible implementation manner, the generating a two-dimensional code according to the encrypted block chain address includes:
the de-centralization application determines an index value of each character of the encryption block chain address and determines a data code of the encryption block chain address according to the index value of each character;
the decentralized application determines an error correction level corresponding to the decentralized application, and determines error correction codes of the data codes according to the error correction level;
the de-centering application generates a two-dimensional code based on the data code and the error correction code.
With reference to the first aspect, in a possible implementation manner, the determining the data encoding of the encryption block chain address according to the index value of each character includes:
the de-centralization application determines the character code of the encryption block chain address according to the index value of each character;
the de-centralization application determines the end character and the filling character of the character code;
the de-centralizing application concatenates the character code, the end code, and the padding code in sequence to obtain the data code of the encrypted block chain address.
With reference to the first aspect, in a possible implementation manner, the broadcasting the two-dimensional code in the block chain so that a second user node accesses the target page according to the two-dimensional code includes:
the centralized application sends the two-dimensional code and the public key of the first user node to the consensus node so that the consensus node determines whether the two-dimensional code is matched with the block chain address according to the public key;
and if the two-dimensional code is matched with the block chain address, the decentralized application broadcasts the two-dimensional code in the block chain so that a second user node can access the target page according to the two-dimensional code.
In a second aspect, an embodiment of the present application provides a page access apparatus for a decentralized application, where the apparatus includes:
the receiving module is used for receiving a target page sharing request sent by a first user node, wherein the target page sharing request carries a page identifier of a target page;
a verification module, configured to send the target page sharing request to a consensus node in a block chain, so that the consensus node determines whether the first user node has a sharing right of the target page;
a first determining module, configured to determine, according to the page identifier, a block chain address of the page information of the target page in the block chain when the first user node has the sharing right, and send the block chain address to the first user node, so that the first user node signs the block chain address according to a private key of the first user node to obtain an encrypted block chain address;
and the first generating module is used for acquiring the encryption block chain address, generating a two-dimensional code according to the encryption block chain address, and broadcasting the two-dimensional code in the block chain so that a second user node accesses the target page according to the two-dimensional code.
With reference to the second aspect, in a possible implementation manner, the apparatus further includes:
the first obtaining module is further configured to obtain a public key of the first user node when receiving an access request triggered by a second user node when the second user node identifies the two-dimensional code, and decrypt the encrypted block chain address according to the public key of the first user node to obtain the block chain address;
the first sending module is further configured to send the block chain address to the second user node, so that the second user node obtains page information of the target page according to the block chain address and accesses the target page according to the page information.
With reference to the second aspect, in a possible implementation manner, the page information includes page configuration data and a target smart contract; the above-mentioned device still includes:
the second obtaining module is further configured to obtain the page configuration data and the target intelligent contract according to the block chain address;
the second generation module is further used for generating the target page according to the page configuration data and executing the target intelligent contract to determine whether the target intelligent contract is matched with the target page;
and the second sending module is further configured to send an access permission notification to the second user node if the target intelligent contract is matched with the target page, so that the second user node accesses the target page according to the page configuration data.
With reference to the second aspect, in a possible implementation manner, the apparatus further includes:
a third sending module, configured to send access event information to the first user node, so that the first user node sends a data volume receiving address and node information of the first user node, where the access event information is used to explain that the second user node accesses the target page according to the two-dimensional code;
and the second determining module is further configured to determine a transfer data size corresponding to the first user node according to the node information, and send the transfer data size to the data size receiving address.
With reference to the second aspect, in one possible implementation, the first generating module includes:
a first determining unit, configured to determine an index value of each character of the encryption block chain address, and determine a data code of the encryption block chain address according to the index value of each character;
a second determining unit, configured to determine an error correction level corresponding to the decentralized application, and determine an error correction code of the data code according to the error correction level;
and the generating unit is used for generating the two-dimensional code according to the data code and the error correction code.
With reference to the second aspect, in one possible implementation, the first determining unit includes:
a first determining subunit, configured to determine, according to the index value of each character, a character code of the encryption block chain address;
a second determining subunit, configured to determine an end symbol and a padding symbol of the character code;
and a third determining subunit, configured to serially connect the character code, the end symbol, and the padding symbol in sequence to obtain a data code of the encryption block chain address.
With reference to the second aspect, in one possible implementation, the first generating module includes:
a sending unit, configured to send the two-dimensional code and the public key of the first user node to the consensus node, so that the consensus node determines whether the two-dimensional code matches the blockchain address according to the public key;
and the broadcasting unit is used for broadcasting the two-dimensional code in the block chain to enable a second user node to access the target page according to the two-dimensional code if the two-dimensional code is matched with the block chain address.
In a third aspect, an embodiment of the present application provides an apparatus, which includes a processor and a memory, where the processor and the memory are connected to each other. The memory is configured to store a computer program that supports the terminal device to execute the method provided by the first aspect and/or any one of the possible implementation manners of the first aspect, where the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method provided by the first aspect and/or any one of the possible implementation manners of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, where the computer program is executed by a processor to implement the method provided by the first aspect and/or any one of the possible implementation manners of the first aspect.
In the embodiment of the application, the decentralized application can generate the two-dimensional code according to the target page sharing request of the first user node, so that other user nodes can access the target page of the decentralized application according to the two-dimensional code, and the access efficiency of the decentralized application is improved. On the other hand, the decentralized application can send the target page sharing request of the first user node to the consensus node to verify the sharing authority of the first user node, and the application safety of the decentralized application is improved to a certain extent. In addition, the decentralized application encrypts the block chain address of the page information of the target page in the block chain through the private key of the first user node, so that on one hand, the two-dimensional code is shared by the first user node, on the other hand, the safety of the block chain address can be improved, and the applicability is higher.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a page access method of a decentralized application according to an embodiment of the present application;
FIG. 2 is a flowchart of a page access method for a decentralized application according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a scenario for determining a chain address of an encrypted block according to an embodiment of the present application;
fig. 4 is a schematic view of a scenario in which hash calculation is performed on a blockchain address according to an embodiment of the present application;
fig. 5 is a schematic flowchart of generating a two-dimensional code according to an embodiment of the present application;
fig. 6 is a schematic view of a scene of a method for determining character encoding according to an embodiment of the present application;
FIG. 7 is another schematic flowchart of a page access method of a decentralized application according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a page access device of a decentralized application according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an apparatus provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a page access method of a decentralized application according to an embodiment of the present application. Decentralized Application (DAPP) refers to an Application that runs on a distributed network (block chain) and performs Decentralized operations through nodes in the block chain. In fig. 1, the decentralized application 10 runs on the blockchain 20, wherein the node 20a, the node 20b, the node 20c and the node 20d are respectively partial nodes in the blockchain 20, and any one of the node 20a, the node b, the node 20c and the node 20d can access or perform other operations on the decentralized application 10. The node 20a, the node b, the node 20c, and the node 20d may be devices accessing the blockchain 20, including but not limited to a mobile terminal, a notebook computer, a tablet computer, a wearable portable device, and the like. The nodes 20a, 20c, 20d may also be users accessing the block chain 20 through the above device, and may be determined specifically according to an actual application scenario, and are not limited herein. When the node 20a is a first user node that logs in the decentralized application 10, and the node 20 needs to share a target page, the decentralized application 10 may receive a target page sharing request sent by the node 20a, where the target page may be any page of the decentralized application 10, such as a top page, a setting page, and the like of the decentralized application 10, and may be specifically determined according to an actual application scenario, which is not limited herein. After receiving the target page sharing request, the decentralized application 10 may send the target page sharing request to the consensus node in the block chain 20, so that the consensus node determines whether the node 20a has the sharing right of the target page. The common node in the block chain 20 may be a node 20b, a node 20c, etc. in fig. 1, and may also be determined according to an actual application scenario, which is not limited herein.
When the consensus node of the block chain 20 determines that the node 20a has the sharing right of the target page, the decentralized application 10 may determine, according to the page identifier of the target page carried in the target page sharing request sent by the node 20a, a block chain address of the page information of the target page in the block chain 20, and send the block chain address to the node 20a, so that the node 20a signs the block chain address according to its private key to obtain an encrypted block chain address. Further, the decentralized application 10 may obtain the encrypted blockchain address sent by the node 20a, and generate a two-dimensional code according to the encrypted blockchain address to broadcast the two-dimensional code in the blockchain 20, so that other user nodes in the blockchain 20, such as the node 20b, access the target page of the decentralized application 10 according to the two-dimensional code.
Referring to fig. 2, fig. 2 is a flowchart of a page access method of a decentralized application according to an embodiment of the present application. The page access method of the decentralized application shown in fig. 2 may include the following steps S201 to S204.
S201, the decentralized application receives a target page sharing request sent by a first user node.
In some possible embodiments, the first user node may be any terminal device accessing the block chain, such as a notebook computer, a mobile terminal, a portable device, and the like, or may be a user accessing the decentralized application according to the above device, and may be determined according to an actual application scenario, which is not limited herein. The target page may be any page of the decentralized application, such as a commodity detail page of the shopping application or a video playing page of the video application, and may be determined according to an actual application scenario, which is not limited herein. When the first user node needs to share the target page of the decentralized application to enable other nodes to access the target page, the first user node can send a target page sharing request to the decentralized application, and at the moment, the decentralized application can receive the target page sharing request sent by the first user node to enable other nodes to access the target page. The decentralized application runs in the blockchain, so that the first user node needs to carry the page identifier of the target page or the application identifier of the decentralized application when sending the target page sharing request to the blockchain, so that the decentralized application running in the blockchain can identify the target page sharing request sent by the first user node.
S202, the decentralized application sends the target page sharing request to the consensus node in the block chain, so that the consensus node determines whether the first user node has the sharing authority of the target page.
In some possible embodiments, after receiving the target page sharing request sent by the first user node, the decentralized application may further determine whether the first user node has the sharing authority of the target page, so as to improve the application security of the decentralized application. Specifically, the decentralized application may send the target page sharing request to the consensus nodes in the block chain, so that each consensus node in the block chain verifies whether the first user node has the sharing authority of the target page. Each common identification node can obtain node information of the first user node and a page identifier carried by a target page sharing request, determine the authority level of the target page according to the page identifier, determine the authority level of the first user node according to the node information of the first user node, and determine that the first user node has the sharing authority of the target page when the authority level of the first user node is not lower than the authority level corresponding to the target page. Optionally, the consensus node may determine, according to the page identifier, an authority node list corresponding to the target page, and further determine, according to the node information of the first user node, whether the first user node is in the authority node list corresponding to the target page, and when the first user node is in the authority node list corresponding to the target page, the consensus node may determine that the first user node has the sharing authority of the target page. Optionally, the consensus node may further verify whether the first user node is a preset node (e.g., an administrator node, an application maintenance node, etc.) according to the node information of the first user node, and determine that the first user node has the sharing right of the target page when the first user node is the preset node. It should be particularly noted that, a specific implementation manner of determining whether the first user node has the sharing authority of the target page by the formula node may be determined according to an actual application scenario, and is not limited herein.
In some possible embodiments, after sending the target page sharing request to the consensus nodes, the decentralized application further determines the number of consensus nodes for which it is determined that the first user node has the sharing right, and when the number of consensus nodes for which it is determined that the first user node has the sharing right exceeds a certain data amount (e.g., more than half) of the number of all user nodes in the block chain, the decentralized application may determine that the first user node has the sharing right of the target page. Optionally, the decentralized application may determine whether a preset consensus node among all the consensus nodes determines that the first user node has the sharing right of the target page, and when the preset consensus node has the sharing right of the target application, the decentralized application may determine that the first user node has the sharing right of the target application.
S203, when the first user node has the sharing right, the decentralized application determines the block chain address of the page information of the target page in the block chain according to the page identification, and sends the block chain address to the first user node so that the first user node signs the block chain address according to the private key of the first user node to obtain the encrypted block chain address.
In some feasible embodiments, when the first user node has the sharing right of the target page, the decentralized application may determine, according to the page identifier carried in the target page sharing request, a block chain address of the page information of the target page in the block chain. Specifically, the decentralized application may determine a target block marked by the page identifier from the block chain, or the decentralized application may determine a target block height corresponding to the page identifier and determine a block corresponding to the target block height as the target block, and further, the decentralized application may determine the target block height of the target block as the block chain address of the page information. Optionally, the decentralized application may invoke an intelligent contract corresponding to the page identifier, and then determine the block chain address of the page information of the target page by executing the intelligent contract. It should be particularly noted that the block chain address may further include, in addition to the height of the target block, a specific storage location of the page information of the target page in the target block corresponding to the height of the target block, which may be determined according to an actual application scenario, and is not limited herein.
In some possible embodiments, to further improve the security of the decentralized application, after the decentralized application determines the blockchain address of the page information of the target page in the blockchain, the blockchain address may be sent to the first user node, so that the first user node signs the blockchain address according to a private key of the first user node to obtain an encrypted blockchain address. Specifically, the decentralized application sends the block chain address to the first user node, so that the first user node further signs the block chain address with a private key of the first user node to obtain an encrypted block chain address. Optionally, the decentralized application may also directly obtain a private key of the first user node, and after the block chain address of the page information in the block chain is determined, the block chain address is further signed according to the private key of the first user node to obtain a final encrypted block chain address.
Optionally, in order to further improve the security of the blockchain address, the decentralized application may further perform hash calculation on the blockchain address to obtain a digest of the blockchain address, and obtain a digital signature of the blockchain address after signing the digest with a private key of the first user node, so that the blockchain address and the digital signature of the blockchain address are regarded as corresponding encrypted blockchain addresses. Referring to fig. 3, fig. 3 is a schematic view of a scenario for determining a chain address of an encryption block according to an embodiment of the present application. In fig. 3, it is assumed that the digest of the blockchain address obtained by the decentralized application performing hash calculation on the blockchain address is 1000100, and the decentralized application signs the digest 1000100 with the private key of the first user node to obtain 0010101. Assuming that the blockchain address of the zone is abcd, the decentralized application may regard abcd and 0010101 as the corresponding encrypted blockchain address.
The decentralized application can be performed by using an information digest algorithm when performing hash calculation on the block chain address. The above information summarization Algorithm includes, but is not limited to, Cyclic Redundancy Check-8 (Cyclic Redundancy Check-8, CRC8), Cyclic Redundancy Check-16 (Cyclic Redundancy Check-16, CRC16), Cyclic Redundancy Check-32 (Cyclic Redundancy Check-32, CRC32), information summarization Algorithm version 2(Message-Digest Algorithm2, MD2), information summarization Algorithm version 4(Message-Digest Algorithm 4, MD4), information summarization Algorithm version 5(Message-Digest Algorithm 5, MD5), Secure Hash Algorithm 1(Secure Hash Algorithm 1, SHA1), Secure Hash Algorithm 256(Secure Hash Algorithm 256, SHA256), Secure Hash 384(Secure Hash Algorithm 384, SHA384), Secure Hash Algorithm 512(Secure Hash Algorithm 512), Secure Hash Algorithm 512, and original Hash Algorithm 512(Secure Hash Algorithm 512, and original Hash Algorithm 512, The PANAMA, TIGER, Adler-3 algorithms, etc. may be determined based on the actual application scenario, and are not limited herein. The length and the expression form of the abstracts obtained by different information abstraction algorithms are different. For example, a hash value represented by an 8-bit hexadecimal number is obtained based on CRC32, a hash value represented by a 32-bit hexadecimal number is obtained based on MD5, and a hash value having a length of 32 bytes (256 bits) is obtained based on SHA 256.
For example, referring to fig. 4, fig. 4 is a schematic view of a scenario in which hash calculation is performed on a blockchain address according to an embodiment of the present disclosure. As shown in fig. 4, the blockchain address determined by the decentralization application is A1zP1eP5QGefi2 dmptfttl 5SLmv7DivfNa, and at this time, if the decentralization application performs hash calculation on the blockchain address based on MD5, the obtained corresponding digest is d33d49bc2379e65ac7e7c9edd0a80a 48.
S204, the decentralized application acquires the encryption block chain address, a two-dimensional code is generated according to the encryption block chain address, and the two-dimensional code is broadcasted in the block chain so that a second user node can access the target page according to the two-dimensional code.
In the embodiment of the application, after the first user node signs the block chain address to obtain the encrypted block chain address, the decentralized application obtains the encrypted block chain address sent by the first user node and generates the two-dimensional code according to the encrypted block chain address, and the decentralized application can broadcast the two-dimensional code in the block chain to enable the second user node to access the target page according to the two-dimensional code. The specific method for generating the two-dimensional code by the decentralized application according to the encryption block chain address can be seen in fig. 5. Fig. 5 is a schematic flowchart of generating a two-dimensional code according to an embodiment of the present application. The method for generating a two-dimensional code provided in fig. 5 may include the following steps S2041 to S2043.
S2041, determining the index value of each character of the encryption block chain address by the decentralized application, and determining the data code of the encryption block chain address according to the index value of each character.
In the embodiment of the present application, for the encryption block chain address, each character in the encryption block chain address corresponds to a fixed index value, wherein for the numbers 0-9, the index value corresponding to each character is 0-9, for the english letters a-Z, the index value corresponding to each character is 10-35, the index value corresponding to "¥" is 37, the index value corresponding to "%" is 38, the index value corresponding to "+" is 39, the index value corresponding to "+" is 40, and the index value corresponding to "-" is 41, when the encryption block chain address is encoded, each character of the encryption block chain address is first converted into the corresponding index value, each two characters are divided into one group and then converted into the binary result of 11bits, for one character of the falling list, the decentralized application can convert the character into the binary result of 6 s, wherein, since the encryption block chain address is encoded, the binary result of the character required number 0010 is the binary code, the version of the binary code is obtained by converting the corresponding character into the binary result of 6 s, and the corresponding version of the two-dimensional code is generated according to the three-dimensional code version 26, wherein the version of the two-dimensional code is obtained by converting the corresponding two-dimensional code string 26, and the corresponding two-dimensional code version of the corresponding two-dimensional code string 26.
Referring to fig. 6, fig. 6 is a scene schematic diagram of a character encoding determination method provided in the embodiment of the present application. In fig. 6, it is assumed that the preset two-dimensional code version is 1, the encryption block chain address is AE-86, and the index values corresponding to the encryption block chain address are (10,14,41,8,6), respectively. Further, the de-centering application may group the resulting 5 characters two by two, resulting in (10,14), (41,8), (6), and then convert each group of characters into a binary of 11 bits. Wherein (10,14) can be converted into 45-bit system to obtain 464, and then the 464 is converted into 11-bit binary system: 00111010000, (41,8) is converted into 45-bit system to get 1853, and 1853 is converted into 11-bit binary system: 11100111101. for (6), the corresponding 45-bit system is still 6, and then converted into a 6-bit binary system: 000110. the three binary results may then be concatenated to obtain 0011101000011100111101000110. Further, when the two-dimensional code version is 1, the number of characters 5 of the encryption block chain address needs to be converted into a 9-bit binary system: 000000101, since the character encoding flag corresponding to the encryption block chain address is 0010, the character encoding flag and the 9bits binary system are added before 0011101000011100111101000110, so as to obtain the character encoding of the encryption block chain address: 00100000001010011101000011100111101000110.
further, after obtaining the character encoding of the encryption block chain address, an end character (4 consecutive 0 values) needs to be added to the end of the character encoding. Wherein if the number of character encoding bits is not a multiple of 8 in addition, sufficient 0 values need to be added after character encoding until a multiple of 8 is reached. On the other hand, different two-dimensional codes have different error correction levels, each error correction level corresponds to different maximum bit limits under different versions, so when character coding plus an end symbol still does not reach the maximum bit number limit corresponding to the corresponding error correction level, a padding symbol needs to be added at the end of the coding. Wherein, the content of the filling character is continuously repeated by two bytes: 11101100 and 00010001. Taking character code 00100000011010100010110100111011001010010111100101001000101011011110100000110110000 as an example, there are a total of 83bits, so there are two bits different from the multiple of 8, so 5 0's (end symbols) are added at the end to get 0010000001101010001011010011101100101001011110010100100010101101111010000011011000000000. For the H error correction level of the two-dimensional code version 1, a total of 26 codewords, i.e., 104bits, are required. Now with the terminator filled with 0, there are already 88bits, so 16bits need to be filled. The completed code is: 00100000011010100010110100111011001010010111100101001000101011011110100000110110000000001110110000010001. namely the completed code is the data code of the encryption block chain address.
S2042, the decentralized application determines the error correction level corresponding to the decentralized application, and error correction coding of the data coding is determined according to the error correction level.
In the embodiment of the present application, the two-dimensional code has a total of four error correction levels, wherein the error correction level L may be corrected by% 7 codewords, the error correction level M may be corrected by 15% codewords, the error correction level Q may be corrected by 25% codewords, and the error correction level H may be corrected by 30% codewords. Specifically, the number of error correction blocks and the number of error correction block codewords of the data code may be determined according to the two-dimensional code version and the error correction level corresponding to the decentralized application, where the number of error correction blocks indicates the number of error correction blocks that need to be divided, and the number of error correction block codewords indicates the number of codewords in each block, that is, how many bytes there are.
Taking the two-dimensional code version 5 and the error correction level as an example, the corresponding two-dimensional code needs four blocks (each of the upper and lower rows is a group, and each group has two blocks), where the number of the error correction blocks in the first group is 2, each block in the group has 33 code words, 11 data codes, 11 × 2 ═ 22 error correction codes, the number of the error correction blocks in the first group is 2, each block in the group has 34 code words, and 12 data codes, 11 × 2 ═ 22 error correction codes. The use of binary would make the table too large, and so would translate to a decimal scale in the range 0-255. Wherein each block of set 1 has 11 data codes and 22 error correcting codes; each block of group 2 has 12 data codes and 22 error correction codes. The error correcting code for data encoding is mainly implemented by a reed-solomon error correction algorithm, which is not described herein. Based on the reed-solomon error correction algorithm, for the data 678570134873885194119506 of the first block of the first set, the error correction code corresponding to that block is 19911451152472412232292481541172363865017723621387148235.
And S2043, generating the two-dimensional code according to the data coding and the error correction coding by the decentralized application.
In some possible embodiments, the de-centering application needs to draw a positioning pattern on three corners of the two-dimensional code and further draw the pattern when generating the two-dimensional code. The positioning pattern is independent of the two-dimensional code version, the positioning pattern is a 7 × 7 matrix, and the pattern is a5 × 5 matrix, and the specific drawing method can be determined according to the actual application scene, which is not limited herein. Further, the decentralized application needs to draw a time sequence pattern of the two-dimensional code, wherein the time sequence pattern is two lines connecting three positioning patterns, and format information is added around the positioning patterns. Because the number of the positioning patterns is fixed to be 3, and the size is fixed, the format information is also fixed 15bits information, and the data in 5bits is arranged according to the sequence of 5bits data and 10bits error correction bits; the data bits occupy 5 bits: wherein 2bits is used to indicate the level of error correction used and 3bits is used to indicate the Mask (Mask) class used; the error correction bits account for 10 bits: mainly by BCH Code calculation. In order to reduce the difficulty of image recognition after scanning, the 15bits and 101010000010010 are finally subjected to exclusive OR (XOR) operation. Since there may be too many 0 values (e.g., an error correction level of 00 and a Mask of 000) in the original format information, so that the format information is all white, which will increase the difficulty of analyzing the image. Further, the region centering application may fill the obtained data code and error correction code into the remaining portion of the two-dimensional code, and the specific filling manner may be determined according to an actual application scenario, which is not limited herein. For example, for a conventional block in a two-dimensional code, the regular block (i.e., 8bits of data in two columns) should be arranged from right to left regardless of whether the filling direction of the data (data encoding and error correcting codes) is up or down. Optionally, the most significant bit (i.e., the 7 th bit) of each codeword should be placed in the first available bit. For the direction of fill up, the most significant bit should occupy the lower right corner of the module; the direction of the fill down, the most significant bit occupies the upper right of the module. If the previous module ends inside the column of modules on the right, then this module becomes an irregular module, and compared to the conventional module, when the original filling direction is upward, the highest position should be in the upper right corner, and at this time, it becomes the lower left corner. Alternatively, when two columns of a module simultaneously encounter a horizontal boundary of an alignment pattern or timing pattern, it will continue above or below the pattern. Optionally, when the module reaches the upper and lower boundaries of the region (including the upper and lower boundaries of the two-dimensional code, the format information, the version information, or the delimiter), any remaining bits in the codeword will be filled in the next column on the left with the filling direction reversed. Optionally, when the right column of the module encounters the alignment pattern or the area occupied by the version information, the data bits continue to fill along a column next to the alignment pattern or the version information, and an irregular module is formed. If both of the next two columns are available before the end of the current block fill, the most significant bit of the next codeword should be placed in a single column.
In some possible embodiments, after the decentralized application generates the two-dimensional code according to the encrypted blockchain address, the decentralized application may send the two-dimensional code and the public key of the first user node to the consensus nodes, so that each consensus node verifies whether the two-dimensional code matches the blockchain address obtained by the decentralized application, and determines whether other nodes can access the target page through the two-dimensional code. Specifically, each common identification node can identify the two-dimensional code to obtain an encrypted block chain address, decrypt the encrypted block chain address by using a public key to obtain an unencrypted block chain address and match the unencrypted block chain address with the original block chain address, if the unencrypted block chain address and the original block chain address are consistent, the block chain address obtained according to the two-dimensional code is the block chain address corresponding to the page information of the target page, and at the moment, the two-dimensional code can be broadcast in the block chain by the de-centralization application, so that a second user node or other user nodes can access the target page according to the two-dimensional code.
Referring to fig. 7, fig. 7 is another schematic flowchart of a page access method of a decentralized application according to an embodiment of the present application. The page access method of the decentralized application shown in fig. 7 may include the following steps S701 to S706.
S701, the decentralized application receives a target page sharing request sent by a first user node.
S702, the decentralized application sends the target page sharing request to a consensus node in the block chain, so that the consensus node determines whether the first user node has the sharing authority of the target page.
S703, when the first user node has the sharing right, the decentralized application determines the block chain address of the page information of the target page in the block chain according to the page identifier, and sends the block chain address to the first user node so that the first user node signs the block chain address according to the private key of the first user node to obtain the encrypted block chain address.
S704, the decentralized application obtains the encryption block chain address, a two-dimensional code is generated according to the encryption block chain address, and the two-dimensional code is broadcasted in the block chain so that a second user node can access the target page according to the two-dimensional code.
In some possible embodiments, specific implementations of the steps S701 to S704 may refer to the implementations shown in the steps S201 to S202 in fig. 2, and are not described herein again.
S705, when an access request triggered by the second user node in the process of identifying the two-dimensional code is received, the decentralized application obtains the public key of the first user node, and the encrypted block chain address is decrypted according to the public key of the first user node to obtain the block chain address.
In some possible embodiments, the second user node may access the decentralized application by identifying the two-dimensional code after acquiring the two-dimensional code broadcast in the blockchain. The second user node may directly acquire the two-dimensional code from the block chain, or may directly identify the two-dimensional code from other nodes that have acquired the two-dimensional code, for example, directly identify the two-dimensional code displayed by the device B through the device a, or directly identify the two-dimensional code stored in the device through the device a, and a specific implementation manner may be determined according to an actual application scenario, which is not limited herein. The two-dimensional code is obtained by the decentralized application according to the encrypted block chain address, so that the second user node can only obtain the encrypted block chain address when identifying the two-dimensional code, and cannot obtain the unencrypted block chain address through the encrypted block chain address to access the target page through the unencrypted block chain address. The second user node therefore needs to send an access request to the decentralized application when identifying the two-dimensional code in order for the decentralized application to send the unencrypted blockchain address to the second user node. Specifically, the decentralized application may obtain the public key of the first user node to decrypt the encrypted blockchain address to obtain the unencrypted blockchain address when receiving the access request sent by the second user node.
S706, the decentralized application sends the block chain address to the second user node, so that the second user node obtains page information of the target page according to the block chain address and accesses the target page according to the page information.
In some possible embodiments, after obtaining the unencrypted blockchain address, the decentralized application may send the blockchain address to the second user node, so that the second user node may obtain the page information of the target page of the decentralized application from the blockchain address by calling an intelligent contract. Further, the second user node may construct a target page according to the page information of the target page, thereby implementing access to the target page of the decentralized application. Optionally, the decentralized application may also directly obtain page information of the target page according to the block chain address, and send the page information to the second user node, so that the second user node directly constructs the target page according to the page information, and a specific implementation manner may be determined according to an actual application scenario, which is not limited herein.
In some possible embodiments, the page information of the target page may include page configuration data of the target page and a target intelligent contract corresponding to the target page, where a user of the target intelligent contract implements various page functions of the target page (such as uploading information, sending a message, and the like, which may be specifically determined according to an actual application scenario, and is not limited herein). When the decentralized application receives an access request triggered by the second user node and determines the block chain address according to the public key of the first user node, the decentralized page can respectively obtain page configuration data and a target intelligent contract from the block chain according to the block chain address. At this time, the decentralized application may configure a target page according to the page configuration data, and re-execute the target intelligent contract to determine whether the target intelligent contract is matched with the target page, that is, verify whether the page function represented by the target intelligent contract is the page function corresponding to the target page. And if the target intelligent contract is matched with the target page, namely the page function carried by the target intelligent contract is the page function corresponding to the target page, the decentralized application sends an access permission notice to the second user node, so that the second user constructs the target page according to the page configuration data to realize the access to the target page.
In some possible embodiments, since the two-dimensional code is generated from an encrypted blockchain address and the encrypted blockchain address is obtained by encrypting with a private key of the first user node, after the second user node accesses the target page according to the two-dimensional code, the decentralized application may send access event information to the first user node to inform the second user that the two-dimensional code obtained through the page sharing request of the second user accesses the target page. On the other hand, after receiving the access event information sent by the decentralized application, the first user node may send a data volume receiving address (e.g., an account, a wallet address, etc.) corresponding to the first user node and node information of the first user node to the decentralized application, so that the decentralized application may determine, according to the node information of the first user node, a preset data volume determining manner that the first user node satisfies to determine a transferred data volume that the first user node should receive, and send the transferred data volume to the data volume receiving address. In short, after the user b accesses a certain page of the decentralized application through the two-dimensional code correspondingly generated by the target page sharing request of the user a, the decentralized application can award the user a to encourage the user a to share the decentralized application or the certain page of the decentralized application to other users for many times.
In the embodiment of the application, the decentralized application can generate the two-dimensional code according to the target page sharing request of the first user node, so that other user nodes can access the target page of the decentralized application according to the two-dimensional code, and the access efficiency of the decentralized application is improved. On the other hand, the decentralized application can send the target page sharing request of the first user node to the consensus node to verify the sharing authority of the first user node, and the application safety of the decentralized application is improved to a certain extent. In addition, the decentralized application encrypts the block chain address of the page information of the target page in the block chain through the private key of the first user node, so that on one hand, the two-dimensional code is shared by the first user node, on the other hand, the safety of the block chain address can be improved, and the applicability is higher.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a page access device of a decentralized application according to an embodiment of the present application. The device 1 provided by the embodiment of the application comprises:
the receiving module 10 is configured to receive a target page sharing request sent by a first user node, where the target page sharing request carries a page identifier of a target page;
a verification module 11, configured to send the target page sharing request to a consensus node in a block chain, so that the consensus node determines whether the first user node has a sharing right of the target page;
a first determining module 12, configured to determine, according to the page identifier, a block chain address of the page information of the target page in the block chain when the first user node has the sharing right, and send the block chain address to the first user node, so that the first user node signs the block chain address according to a private key of the first user node to obtain an encrypted block chain address;
and the first generating module 13 is configured to obtain the encrypted block chain address, generate a two-dimensional code according to the encrypted block chain address, and broadcast the two-dimensional code in the block chain, so that a second user node accesses the target page according to the two-dimensional code.
In some possible embodiments, the above-mentioned device 1 further comprises:
the first obtaining module 14 is further configured to, when receiving an access request triggered by a second user node when the second user node identifies the two-dimensional code, obtain a public key of the first user node, and decrypt the encrypted blockchain address according to the public key of the first user node to obtain the blockchain address;
the first sending module 15 is further configured to send the block chain address to the second user node, so that the second user node obtains page information of the target page according to the block chain address and accesses the target page according to the page information.
In some possible embodiments, the page information includes page configuration data and a target intelligent contract; the above apparatus 1 further comprises:
the second obtaining module 16 is further configured to obtain the page configuration data and the target intelligent contract according to the block chain address;
the second generating module 17 is further configured to generate the target page according to the page configuration data, and execute the target intelligent contract to determine whether the target intelligent contract is matched with the target page;
the second sending module 18 is further configured to send an access permission notification to the second user node if the target smart contract matches the target page, so that the second user node accesses the target page according to the page configuration data.
In some possible embodiments, the above-mentioned device 1 further comprises:
a third sending module 19, further configured to send access event information to the first user node, so that the first user node sends a data volume receiving address and node information of the first user node, where the access event information is used to explain that the second user node accesses the target page according to the two-dimensional code;
the second determining module 20 is further configured to determine a transfer data size corresponding to the first user node according to the node information, and send the transfer data size to the data size receiving address.
In some possible embodiments, the first generating module 13 includes:
a first determining unit 131, configured to determine an index value of each character of the encryption block chain address, and determine a data code of the encryption block chain address according to the index value of each character;
a second determining unit 132, configured to determine an error correction level corresponding to the decentralized application, and determine an error correction code of the data code according to the error correction level;
a generating unit 133, configured to generate a two-dimensional code according to the data coding and the error correction coding.
In some possible embodiments, the first determining unit 131 includes:
a first determining subunit 1311, configured to determine a character code of the encryption block chain address according to the index value of each character;
a second determining subunit 1312 configured to determine an end character and a padding character of the character code;
a third determining subunit 1313, configured to serially connect the character code, the end symbol, and the padding symbol in sequence to obtain a data code of the encryption block chain address.
In some possible embodiments, the first generating module 13 includes:
a sending unit 134, configured to send the two-dimensional code and the public key of the first user node to the consensus node, so that the consensus node determines whether the two-dimensional code matches the blockchain address according to the public key;
a broadcasting unit 135, configured to broadcast the two-dimensional code in the block chain if the two-dimensional code matches the block chain address, so that a second user node accesses the target page according to the two-dimensional code.
In a specific implementation, the apparatus 1 may execute, through each built-in functional module thereof, the implementation manners provided in each step in fig. 2, fig. 5, and/or fig. 7, which may specifically refer to the implementation manners provided in each step, and are not described herein again.
In the embodiment of the application, the decentralized application can generate the two-dimensional code according to the target page sharing request of the first user node, so that other user nodes can access the target page of the decentralized application according to the two-dimensional code, and the access efficiency of the decentralized application is improved. On the other hand, the decentralized application can send the target page sharing request of the first user node to the consensus node to verify the sharing authority of the first user node, and the application safety of the decentralized application is improved to a certain extent. In addition, the decentralized application encrypts the block chain address of the page information of the target page in the block chain through the private key of the first user node, so that on one hand, the two-dimensional code is shared by the first user node, on the other hand, the safety of the block chain address can be improved, and the applicability is higher.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an apparatus provided in an embodiment of the present application. As shown in fig. 9, the apparatus 1000 in the present embodiment may include: the processor 1001, the network interface 1004, and the memory 1005, and the apparatus 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 9, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the device 1000 shown in fig. 9, the network interface 1004 may provide network communication functions; the user interface 1003 is an interface for providing a user with input; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
receiving a target page sharing request sent by a first user node, wherein the target page sharing request carries a page identifier of a target page;
sending the target page sharing request to a consensus node in a block chain so that the consensus node determines whether the first user node has the sharing authority of the target page;
when the first user node has the sharing right, determining a block chain address of the page information of the target page in the block chain according to the page identifier, and sending the block chain address to the first user node so that the first user node signs the block chain address according to a private key of the first user node to obtain an encrypted block chain address;
and acquiring the encryption block chain address, generating a two-dimensional code according to the encryption block chain address, and broadcasting the two-dimensional code in the block chain so that a second user node accesses the target page according to the two-dimensional code.
In some possible embodiments, the processor 1001 is further configured to:
when an access request triggered by a second user node when the two-dimensional code is identified is received, acquiring a public key of the first user node, and decrypting the encrypted block chain address according to the public key of the first user node to obtain the block chain address;
and sending the block chain address to the second user node so that the second user node acquires the page information of the target page according to the block chain address and accesses the target page according to the page information.
In some possible embodiments, the page information includes page configuration data and a target intelligent contract; the processor 1001 is further configured to:
acquiring the page configuration data and the target intelligent contract according to the block chain address;
generating the target page according to the page configuration data, and executing the target intelligent contract to determine whether the target intelligent contract is matched with the target page;
and if the target intelligent contract is matched with the target page, sending an access permission notice to the second user node so that the second user node accesses the target page according to the page configuration data.
In some possible embodiments, the processor 1001 is further configured to:
sending access event information to the first user node to enable the first user node to send a data volume receiving address and node information of the first user node, wherein the access event information is used for explaining that the second user node accesses the target page according to the two-dimensional code;
and determining the transfer data volume corresponding to the first user node according to the node information, and sending the transfer data volume to the data volume receiving address.
In some possible embodiments, the processor 1001 is configured to:
determining an index value of each character of the encryption block chain address, and determining a data code of the encryption block chain address according to the index value of each character;
determining an error correction level corresponding to the decentralized application, and determining an error correction code of the data code according to the error correction level;
and generating a two-dimensional code according to the data code and the error correction code.
In some possible embodiments, the processor 1001 is configured to:
determining the character code of the encryption block chain address according to the index value of each character;
determining the ending character and the filling character of the character codes;
and sequentially connecting the character codes, the end symbols and the padding symbols in series to obtain the data codes of the encryption block chain addresses.
In some possible embodiments, the processor 1001 is configured to:
sending the two-dimension code and the public key of the first user node to the consensus node so that the consensus node determines whether the two-dimension code is matched with the block chain address according to the public key;
and if the two-dimensional code is matched with the block chain address, broadcasting the two-dimensional code in the block chain so that a second user node accesses the target page according to the two-dimensional code.
It should be understood that in some possible embodiments, the processor 1001 may be a Central Processing Unit (CPU), and the processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The memory may include both read-only memory and random access memory, and provides instructions and data to the processor. The portion of memory may also include non-volatile random access memory. For example, the memory may also store device type information.
In a specific implementation, the device 1000 may execute, through each built-in functional module thereof, the implementation manners provided in each step in fig. 2, fig. 5, and/or fig. 7, which may specifically refer to the implementation manners provided in each step, and are not described herein again.
In the embodiment of the application, the decentralized application can generate the two-dimensional code according to the target page sharing request of the first user node, so that other user nodes can access the target page of the decentralized application according to the two-dimensional code, and the access efficiency of the decentralized application is improved. On the other hand, the decentralized application can send the target page sharing request of the first user node to the consensus node to verify the sharing authority of the first user node, and the application safety of the decentralized application is improved to a certain extent. In addition, the decentralized application encrypts the block chain address of the page information of the target page in the block chain through the private key of the first user node, so that on one hand, the two-dimensional code is shared by the first user node, on the other hand, the safety of the block chain address can be improved, and the applicability is higher.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and is executed by a processor to implement the method provided in each step in fig. 2, fig. 5, and/or fig. 7, which may specifically refer to implementation manners provided in each step, and are not described herein again.
The computer readable storage medium may be an internal storage unit of the task processing device provided in any of the foregoing embodiments, for example, a hard disk or a memory of an electronic device. The computer readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, a flash card (flash card), and the like, which are provided on the electronic device. The computer readable storage medium may further include a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), and the like. Further, the computer readable storage medium may also include both an internal storage unit and an external storage device of the electronic device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the electronic device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
The terms "first", "second", and the like in the claims and in the description and drawings of the present application are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments. The term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (10)

1. A method for page access for a decentralized application, the method comprising:
receiving a target page sharing request sent by a first user node by a decentralized application, wherein the target page sharing request carries a page identifier of a target page;
the decentralized application sends the target page sharing request to a consensus node in a block chain, so that the consensus node determines whether the first user node has the sharing authority of the target page;
when the first user node has the sharing right, the decentralized application determines a block chain address of the page information of the target page in the block chain according to the page identification, and sends the block chain address to the first user node so that the first user node signs the block chain address according to a private key of the first user node to obtain an encrypted block chain address;
and the decentralized application acquires the encryption block chain address, generates a two-dimensional code according to the encryption block chain address, and broadcasts the two-dimensional code in the block chain so that a second user node accesses the target page according to the two-dimensional code.
2. The method of claim 1, further comprising:
when an access request triggered by a second user node when the two-dimensional code is identified is received, the decentralized application acquires a public key of the first user node, and decrypts the encrypted block chain address according to the public key of the first user node to obtain the block chain address;
and the decentralized application sends the block chain address to the second user node so that the second user node obtains the page information of the target page according to the block chain address and accesses the target page according to the page information.
3. The method of claim 2, wherein the page information includes page configuration data and a target smart contract; the method further comprises the following steps:
the decentralized application acquires the page configuration data and the target intelligent contract according to the block chain address;
the decentralized application generates the target page according to the page configuration data and executes the target intelligent contract to determine whether the target intelligent contract is matched with the target page;
and if the target intelligent contract is matched with the target page, the decentralized application sends an access permission notice to the second user node so that the second user node can access the target page according to the page configuration data.
4. The method of claim 2, further comprising:
the decentralized application sends access event information to the first user node so that the first user node sends a data volume receiving address and node information of the first user node, wherein the access event information is used for explaining that the second user node accesses the target page according to the two-dimensional code;
and the decentralized application determines the transfer data volume corresponding to the first user node according to the node information and sends the transfer data volume to the data volume receiving address.
5. The method of claim 1, wherein the generating the two-dimensional code according to the encrypted block chain address comprises:
the decentralized application determines an index value of each character of the encryption block chain address and determines a data code of the encryption block chain address according to the index value of each character;
the decentralized application determines an error correction level corresponding to the decentralized application, and determines error correction codes of the data codes according to the error correction level;
the de-centralization application generates a two-dimensional code from the data code and the error correction code.
6. The method according to claim 5, wherein the determining the data encoding of the encryption block chain address according to the index value of each character comprises:
the de-centralization application determines the character code of the encryption block chain address according to the index value of each character;
the de-centralization application determines an end character and a filling character of the character code;
and the de-centralization application sequentially connects the character codes, the end characters and the filling characters in series to obtain the data codes of the encryption block chain addresses.
7. The method of claim 1, wherein broadcasting the two-dimensional code in the block chain to enable a second user node to access the target page according to the two-dimensional code comprises:
the centralized application sends the two-dimension code and a public key of the first user node to the consensus node so that the consensus node determines whether the two-dimension code is matched with the block chain address according to the public key;
and if the two-dimension code is matched with the block chain address, the decentralized application broadcasts the two-dimension code in the block chain so that a second user node can access the target page according to the two-dimension code.
8. A page access apparatus for a decentralized application, the apparatus comprising:
the receiving module is used for receiving a target page sharing request sent by a first user node, wherein the target page sharing request carries a page identifier of a target page;
the verification module is used for sending the target page sharing request to a consensus node in a block chain so that the consensus node can determine whether the first user node has the sharing authority of the target page;
the first determining module is used for determining a block chain address of the page information of the target page in the block chain according to the page identifier when the first user node has the sharing right, and sending the block chain address to the first user node so that the first user node signs the block chain address according to a private key of the first user node to obtain an encrypted block chain address;
and the first generating module is used for acquiring the encryption block chain address, generating a two-dimensional code according to the encryption block chain address, and broadcasting the two-dimensional code in the block chain so that a second user node accesses the target page according to the two-dimensional code.
9. A device comprising a processor and a memory, the processor and memory interconnected;
the memory for storing a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method of any one of claims 1 to 7.
CN202010100327.1A 2020-02-18 2020-02-18 Page access method, device and equipment for decentralizing application and storage medium Active CN111309808B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010100327.1A CN111309808B (en) 2020-02-18 2020-02-18 Page access method, device and equipment for decentralizing application and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010100327.1A CN111309808B (en) 2020-02-18 2020-02-18 Page access method, device and equipment for decentralizing application and storage medium

Publications (2)

Publication Number Publication Date
CN111309808A true CN111309808A (en) 2020-06-19
CN111309808B CN111309808B (en) 2024-07-09

Family

ID=71154709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010100327.1A Active CN111309808B (en) 2020-02-18 2020-02-18 Page access method, device and equipment for decentralizing application and storage medium

Country Status (1)

Country Link
CN (1) CN111309808B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111984735A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Data archiving method and device, electronic equipment and storage medium
CN112650954A (en) * 2020-12-30 2021-04-13 杭州趣链科技有限公司 Block chain data sharing method, device, equipment and storage medium
CN112765630A (en) * 2021-01-26 2021-05-07 卓望数码技术(深圳)有限公司 Application sharing method, application activation method, electronic device and storage medium
CN114401100A (en) * 2021-10-02 2022-04-26 杭州荔藤网络科技有限公司 Cross-application platform login method and system for block chain account
CN114422132A (en) * 2022-03-29 2022-04-29 天聚地合(苏州)科技股份有限公司 Account login method and system based on block chain
CN116132166A (en) * 2023-02-03 2023-05-16 网易(杭州)网络有限公司 Communication method, device, equipment and storage medium based on block chain

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140103108A1 (en) * 2012-09-19 2014-04-17 Tencent Technology (Shenzhen) Company Limited Method and device for resource sharing
CN109460515A (en) * 2018-09-26 2019-03-12 百度在线网络技术(北京)有限公司 Search data processing method and device based on block chain
US20190103958A1 (en) * 2017-09-29 2019-04-04 Alibaba Group Holding Limited Data storage method, data query method and apparatuses
US20190236300A1 (en) * 2017-03-30 2019-08-01 Tencent Technology (Shenzhen) Company Limited Service processing method and apparatus, data sharing system, and storage medium
CN110266817A (en) * 2019-07-15 2019-09-20 武汉天喻信息产业股份有限公司 Across channel data sharing model, sharing method and device based on block chain
US20190296915A1 (en) * 2017-08-05 2019-09-26 Proclus Technologies Limited Method and System for Implementing Automatic Transaction Rebroadcasting for Transient Blockchains
CN110336832A (en) * 2019-07-24 2019-10-15 深圳传音控股股份有限公司 A kind of information encryption and decryption method, device, terminal and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140103108A1 (en) * 2012-09-19 2014-04-17 Tencent Technology (Shenzhen) Company Limited Method and device for resource sharing
US20190236300A1 (en) * 2017-03-30 2019-08-01 Tencent Technology (Shenzhen) Company Limited Service processing method and apparatus, data sharing system, and storage medium
US20190296915A1 (en) * 2017-08-05 2019-09-26 Proclus Technologies Limited Method and System for Implementing Automatic Transaction Rebroadcasting for Transient Blockchains
US20190103958A1 (en) * 2017-09-29 2019-04-04 Alibaba Group Holding Limited Data storage method, data query method and apparatuses
CN109460515A (en) * 2018-09-26 2019-03-12 百度在线网络技术(北京)有限公司 Search data processing method and device based on block chain
CN110266817A (en) * 2019-07-15 2019-09-20 武汉天喻信息产业股份有限公司 Across channel data sharing model, sharing method and device based on block chain
CN110336832A (en) * 2019-07-24 2019-10-15 深圳传音控股股份有限公司 A kind of information encryption and decryption method, device, terminal and storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111984735A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Data archiving method and device, electronic equipment and storage medium
CN112650954A (en) * 2020-12-30 2021-04-13 杭州趣链科技有限公司 Block chain data sharing method, device, equipment and storage medium
CN112650954B (en) * 2020-12-30 2023-09-22 杭州趣链科技有限公司 Block chain data sharing method, device, equipment and storage medium
CN112765630A (en) * 2021-01-26 2021-05-07 卓望数码技术(深圳)有限公司 Application sharing method, application activation method, electronic device and storage medium
CN114401100A (en) * 2021-10-02 2022-04-26 杭州荔藤网络科技有限公司 Cross-application platform login method and system for block chain account
CN114422132A (en) * 2022-03-29 2022-04-29 天聚地合(苏州)科技股份有限公司 Account login method and system based on block chain
CN114422132B (en) * 2022-03-29 2022-08-26 天聚地合(苏州)科技股份有限公司 Account login method and system based on block chain
CN116132166A (en) * 2023-02-03 2023-05-16 网易(杭州)网络有限公司 Communication method, device, equipment and storage medium based on block chain

Also Published As

Publication number Publication date
CN111309808B (en) 2024-07-09

Similar Documents

Publication Publication Date Title
CN111309808B (en) Page access method, device and equipment for decentralizing application and storage medium
CN110224999B (en) Information interaction method and device and storage medium
CN108377183B (en) XDR data information encryption method, device, equipment and medium
CN106610995B (en) Method, device and system for creating ciphertext index
JP6713548B2 (en) One-time dynamic position authentication method and system, and one-time dynamic password change method
KR101092696B1 (en) Message authentication code based on error correcting code
CN112035827B (en) Cipher data processing method, device, equipment and readable storage medium
JP6600905B2 (en) Two-dimensional code, multi-valued two-dimensional code, and two-dimensional code generation method
CN114036565A (en) Private information retrieval system and private information retrieval method
CN112235104B (en) Data encryption transmission method, system, terminal and storage medium
KR102421567B1 (en) Internet access management service server capable of providing internet access management service based on terminal grouping and operating method thereof
CN104601332A (en) Enhancement type dynamic two-dimensional code authentication system and authentication method thereof
CN115244524A (en) Method and apparatus for inadvertent transmission using trusted environment
WO2018038445A1 (en) Method for mobile device for managing encoded file and encoded file management system comprising same
CN115603907A (en) Method, device, equipment and storage medium for encrypting storage data
CN107154920B (en) Encryption method and decryption method for security information and receiving device for receiving security information
CN111949996A (en) Generation method, encryption method, system, device and medium of security private key
GB2446420A (en) Error correction of passwords using Galois Field elements
CN111444202A (en) Information processing method, device, equipment and storage medium for decentralized application
CN105553676B (en) With the Beidou serial port communication method of equipment authentication function and transmission, reception device
CN111147461B (en) Data transmission method, device, server and user terminal
CN115935299A (en) Authorization control method, device, computer equipment and storage medium
US20200293733A1 (en) Hybrid two-dimensional barcode reader
KR101632651B1 (en) Method, server and computer program for transmitting binary data
CN113449338B (en) Information encryption storage method and system based on block chain

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
GR01 Patent grant