CN114329375A - Data access method and device based on block chain and computer equipment - Google Patents

Data access method and device based on block chain and computer equipment Download PDF

Info

Publication number
CN114329375A
CN114329375A CN202111442363.7A CN202111442363A CN114329375A CN 114329375 A CN114329375 A CN 114329375A CN 202111442363 A CN202111442363 A CN 202111442363A CN 114329375 A CN114329375 A CN 114329375A
Authority
CN
China
Prior art keywords
collector
user
preset
information
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111442363.7A
Other languages
Chinese (zh)
Inventor
谢红超
潘芷晴
肖黎明
岳光
周兴超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Grid Information Technology Co ltd
Original Assignee
Shenzhen Grid Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Grid Information Technology Co ltd filed Critical Shenzhen Grid Information Technology Co ltd
Priority to CN202111442363.7A priority Critical patent/CN114329375A/en
Publication of CN114329375A publication Critical patent/CN114329375A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application belongs to a block chain technology and relates to a data access method, a device and computer equipment based on a block chain, wherein the method comprises the steps of obtaining a data access authority query request; judging whether the accessed collector is a legal collector or not according to the accessed collector number and the accessed collector signature based on a preset collector block linked list; if the two-dimensional code generation user is a legal collector, judging whether the two-dimensional code generation user is a preset administrator or not according to the user name of the two-dimensional code generation user and the user signature of the two-dimensional code generation user; if the two-dimension code weight block is the preset administrator, searching two-dimension code weight information corresponding to the two-dimension code weight block number in a preset two-dimension code weight block linked list according to the two-dimension code weight block number; judging whether the access user is an accessible legal user or not according to the two-dimensional code authority information and a preset user information block linked list; if the user is an accessible legal user, the access permission information is returned to the accessed collector. The application improves the safety and convenience of data access.

Description

Data access method and device based on block chain and computer equipment
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method and an apparatus for accessing data based on blockchain, and a computer device
Background
In a dynamic environment monitoring system, whether a collector can trust an accessor is always a problem to be solved when inquiring data. The existing solution is to obtain access right through CA authentication, however, CA authentication has the problems that a third-party trust mechanism is needed to independently judge whether trust can be achieved, data storage is centralized, and data is easy to be tampered. And the current data query steps are complicated and need to be accessed through a computer terminal login interface. It can be seen that the existing data access method has the problems of low security and low convenience.
Disclosure of Invention
An embodiment of the application aims to provide a data access method and device based on a block chain and a computer device, so as to solve the problems of low security and low convenience of the existing data access method.
In order to solve the above technical problem, an embodiment of the present application provides a data access method based on a block chain, which adopts the following technical solutions:
acquiring a data access authority query request, wherein the data access authority query request is sent by an accessed collector when an accessor verifies that the accessed collector is a legal collector after scanning two-dimensional code information obtained by a target two-dimensional code based on an accessing user; the data access query request comprises the number of an accessed collector, the signature of the accessed collector and the two-dimension code information; the two-dimension code information comprises a two-dimension code authority chain block number, a collector number, a user name of a two-dimension code generating user and a user signature of the two-dimension code generating user;
judging whether the accessed collector is a legal collector or not according to the accessed collector number and the accessed collector signature based on a preset collector block linked list;
if the accessed collector is a legal collector, judging whether the two-dimension code generating user is a preset administrator or not according to the user name of the two-dimension code generating user and the user signature of the two-dimension code generating user;
if the two-dimensional code generation user is a preset administrator, searching two-dimensional code authority information corresponding to the two-dimensional code authority chain block number in a preset two-dimensional code authority block linked list according to the two-dimensional code authority chain block number;
judging whether the access user is an accessible legal user or not according to the two-dimensional code authority information and a preset user information block linked list;
if the access user is an accessible legal user, returning access permission information to the accessed collector;
the preset collector block linked list, the preset user information block linked list and the preset two-dimensional code weight block linked list are all stored in a preset alliance block chain.
In order to solve the foregoing technical problem, an embodiment of the present application further provides a data access apparatus based on a block chain, including:
the first acquisition module is used for acquiring a data access authority query request; the data access authority inquiry request is sent by an accessed collector when the accessed collector is verified to be a legal collector by the visitor based on two-dimension code information obtained by scanning a target two-dimension code by an access user; the data access query request comprises the number of an accessed collector, the signature of the accessed collector and the two-dimension code information; the two-dimension code information comprises a two-dimension code authority chain block number, a collector number, a user name of a two-dimension code generating user and a user signature of the two-dimension code generating user;
the first judgment module is used for judging whether the accessed collector is a legal collector or not according to the accessed collector number and the accessed collector signature based on a preset collector block linked list;
the second judgment module is used for judging whether the two-dimension code generating user is a preset administrator or not according to the user name of the two-dimension code generating user and the user signature of the two-dimension code generating user if the accessed collector is a legal collector;
the searching module is used for searching two-dimensional code authority information corresponding to the two-dimensional code authority chain block number in a preset two-dimensional code authority block linked list according to the two-dimensional code authority chain block number if the two-dimensional code generating user is a preset administrator;
the third judging module is used for judging whether the access user is an accessible legal user or not according to the two-dimensional code authority information and a preset user information block linked list;
the first returning module is used for returning the access permission information to the accessed collector if the access user is an accessible legal user;
the preset collector block linked list, the preset user information block linked list and the preset two-dimensional code weight block linked list are all stored in a preset alliance block chain.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, where the memory stores computer readable instructions, and the processor implements the steps of the data access method based on the blockchain when executing the computer readable instructions.
In order to solve the technical problem, an embodiment of the present application further provides a computer-readable storage medium, where computer-readable instructions are stored on the computer-readable storage medium, and when executed by a processor, the computer-readable instructions implement the steps of the block chain-based data access method according to the embodiment.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects: acquiring a data access authority query request, wherein the data access authority query request is sent by an accessed collector when an accessor verifies that the accessed collector is a legal collector after scanning two-dimensional code information obtained by a target two-dimensional code based on an accessing user; the data access query request comprises the number of an accessed collector, the signature of the accessed collector and the two-dimension code information; the two-dimension code information comprises a two-dimension code authority chain block number, a collector number, a user name of a two-dimension code generating user and a user signature of the two-dimension code generating user; judging whether the accessed collector is a legal collector or not according to the accessed collector number and the accessed collector signature based on a preset collector block linked list; if the accessed collector is a legal collector, judging whether the two-dimension code generating user is a preset administrator or not according to the user name of the two-dimension code generating user and the user signature of the two-dimension code generating user; if the two-dimensional code generation user is a preset administrator, searching two-dimensional code authority information corresponding to the two-dimensional code authority chain block number in a preset two-dimensional code authority block linked list according to the two-dimensional code authority chain block number; judging whether the access user is an accessible legal user or not according to the two-dimensional code authority information and a preset user information block linked list; if the access user is an accessible legal user, returning access permission information to the accessed collector; the preset collector block linked list, the preset user information block linked list and the preset two-dimensional code weight block linked list are all stored in a preset alliance block chain.
Therefore, the user information, the collector information and the two-dimension code authority information can be stored and judged based on the block chain, so that the user information, the collector information and the two-dimension code authority information have the property of being not falsified, the data decentralization is realized, the safety of data access is improved, meanwhile, the data access is checked in a two-dimension code mode, and the convenience of the data access is improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a block chain based data access method according to the present application;
fig. 3 is a schematic structural diagram of a preset collector block linked list provided in the present application;
fig. 4 is a schematic structural diagram of a preset two-dimensional code weight block linked list provided in the present application;
fig. 5 is a schematic structural diagram of a preset user information block linked list provided in the present application;
FIG. 6 is a flow chart of one embodiment before step S201 in FIG. 2;
FIG. 7 is a flow diagram for one embodiment prior to step 204 in FIG. 2;
FIG. 8 is a flow diagram for one embodiment after step 303 of FIG. 3;
FIG. 9 is a flow diagram for one embodiment after step 306 in FIG. 3;
FIG. 10 is a block chain based data access device in accordance with an embodiment of the present application;
FIG. 11 is a schematic block diagram of an embodiment of the first acquisition module of FIG. 10;
FIG. 12 is a block diagram illustrating one embodiment of the lookup module of FIG. 10;
FIG. 13 is a schematic block diagram of one embodiment after the first generation module of FIG. 11;
FIG. 14 is a schematic structural diagram of one embodiment of FIG. 11 after the chain table generation module;
FIG. 15 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
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.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include a preset federation block chain 101, a management server 102, a two-dimensional code 103, a terminal device 104, and a collector 105. The management server 102, the terminal device 104, and the collector 105 may communicate with the preset federation blockchain 101 through a network. The terminal device 104 and the collector 105 may communicate with each other via a network. The management server 102 can generate the two-dimensional code 103. The terminal device 104 can obtain two-dimensional code information by scanning the two-dimensional code 103, and the two-dimensional code information includes: the two-dimension code authority chain block number, the collector number, the user name of the two-dimension code generating user and the user signature of the two-dimension code generating user. The network may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
An administrator may interact with the pre-defined federation blockchain 101 through the administration server 102 and the network to receive or send messages and the like. A general user may interact with the preset federation blockchain 101 through the terminal device 104 and the network to receive or send messages and the like. The end-point device 104 may have installed thereon various communication client applications, such as a web browser application, a shopping-type application, a search-type application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal device 104 may be various electronic devices having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III, mpeg compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), a laptop portable computer, a desktop computer, and the like.
The preset federation block chain 101 includes a plurality of nodes, which may specifically be based on 5 or more nodes, so that the nodes on the preset federation block chain 101 may implement a byzantine fault-tolerant consensus mechanism.
The management server 102 is used for modifying the collector information and the user information and generating the two-dimensional code 103.
Collector 105 may be a device for collecting various data.
It should be noted that the block chain based data access method provided in the embodiment of the present application is generally executed by the preset federation block chain 101, and accordingly, the block chain based data access apparatus is generally disposed in the preset federation block chain 101.
It should be understood that the numbers of the preset federation block chain 101, the management server 102, the two-dimensional code 103, the terminal device 104, and the collector 105 in fig. 1 are merely illustrative. There may be any number of preset federation block chains 101, management servers 102, two-dimensional codes 103, terminal devices 104, and collectors 105, as desired for implementation.
With continued reference to FIG. 2, a flow diagram of one embodiment of a block chain based data access method in accordance with the present application is shown. The data access method based on the block chain comprises the following steps:
step S201, a data access authority query request is obtained, wherein the data access authority query request is sent by an accessed collector, and after two-dimension code information obtained by scanning a target two-dimension code based on an access user, an accessor verifies that the accessed collector is a legal collector; the data access query request comprises the number of the accessed collector, the signature of the accessed collector and the two-dimension code information; the two-dimension code information comprises a two-dimension code authority chain block number, a collector number, a user name of a two-dimension code generating user and a user signature of the two-dimension code generating user.
In this embodiment, the electronic device (for example, the preset federation blockchain shown in fig. 1) on which the blockchain-based data access method operates may receive the data access permission query request through a wired connection manner or a wireless connection manner. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
The collector is a device for collecting data or providing data. The accessed collector is a collector which the accessing user needs to access. The accessed collector signature comprises a private key of the accessed collector, wherein the private key of the accessed collector and the public key of the accessed collector have a mapping relation. The public key and the private key of each collector are unique. The two-dimensional code generation user is a user for generating a two-dimensional code, the two-dimensional code generation user is a specific management user under normal conditions, the user name of the two-dimensional code generation user is the user name of the user for generating the two-dimensional code, and the user signature of the two-dimensional code generation user is also corresponding to the signature of the user for generating the two-dimensional code. Certainly, the two-dimensional code generation user also has a public key and a private key of the two-dimensional code generation user, and the user signature of the two-dimensional code generation user includes the corresponding private key.
Specifically, when a user needs to access data of a certain collector, the user may scan a target two-dimensional code corresponding to the collector through a scanning device to obtain corresponding two-dimensional code information (a two-dimensional code weight chain block number, a collector number, a user name of a two-dimensional code generation user, and a user signature of the two-dimensional code generation user). The user firstly verifies whether the number of the collector is legal or not, and if the number of the collector is legal, the user sends a data access request to the collector based on the two-dimensional code information. And if the number of the collector is not proper, stopping the access.
And if the collector number is legal, the user uses the two-dimensional code information obtained by scanning the code, attaches the user name and the signature of the user and packs the user name and the signature to generate a data access request of the user, and sends the data access request to the collector according to the legal collector number. After receiving the data access request, the collector firstly verifies whether the user is legal, and if the user is legal, the collector sends a request (with the number and signature of the collector) for inquiring the data access authority to the preset alliance block chain.
Step S202, based on the preset collector block linked list, according to the accessed collector number and the accessed collector signature, judging whether the accessed collector is a legal collector.
In this embodiment, as shown in fig. 3, the preset collector block chain table follows the storage manner of the preset federation block chain and is stored in the preset federation block chain. The preset collector block linked list comprises a plurality of collector chain blocks, and each collector chain block records a group of collector information. Each collector chain block comprises a collector chain block head and collector chain block information. The collector chain block head comprises the hash value of the previous collector chain block, the current timestamp and the hash value of the collector chain block, so that the follow-up hash values can be changed after the data in front of the preset collector block chain table is tampered, and the preset collector block chain table can be quickly found to be tampered and give an alarm. The collector chain block information comprises a collector number, a public key of a collector and a collector state. The default collector block linked list includes all collector information (collector status can be set: in use and out of use).
The legal collector is a collector which has records in a preset collector block linked list and is in a normal use state. And if no record is recorded in the preset collector block linked list and the collector state is an abnormal state or a stop state, the collector is an illegal collector.
Specifically, after receiving a data access permission query request from an accessed collector, the preset federation block chain first determines whether the collector sending the request is a legal collector (according to the number of the accessed collector, the signature of the accessed collector, and the collector number and the public key recorded in the preset collector block chain table). If the collector number which is the same as the number of the accessed collector in the data access permission query request is found in the preset collector block linked list, and the public key and the private key under the same collector number have a mapping relation, the accessed collector can be judged to be a legal collector. If the collector number identical to the accessed collector number in the data access permission query request is not found in the preset collector block linked list, the accessed collector can be directly judged to be not a legal collector (illegal collector).
Step S203, if the accessed collector is a legal collector, judging whether the two-dimensional code generating user is a preset administrator or not according to the user name of the two-dimensional code generating user and the user signature of the two-dimensional code generating user.
In this embodiment, the preset administrator may be a master administrator user built in the system, and the master administrator user may modify the use condition of the collector (the wrong collector state is set to stop use, and the collector is no longer a legal collector), modify the permissions of other users (a common user may be set as a slave administrator, the permissions of the slave administrator may be revoked, and the common user may be changed to a common user again, or a user may be set as an illegal user, and the user is prohibited from accessing the system again).
Specifically, if the accessed collector is a legal collector, the user name of the two-dimensional code generation user obtained by scanning the target two-dimensional code can be compared with the user name of the administrator recorded in the preset user information block linked list, if the user names of the two are the same, whether the signatures of the two are the same is judged, and if the signatures of the two are the same, the two-dimensional code generation user can be judged to be the preset administrator; and if the user names and the signatures of the two users are different, judging that the two-dimensional code generation user is not a preset administrator (possibly a malicious user). If the user names or the signatures of the two users are the same, the two-dimensional code generation user is judged not to be a preset administrator (possibly a malicious user)
Step S204, if the two-dimensional code generation user is a preset administrator, searching the two-dimensional code weight information corresponding to the two-dimensional code weight chain block number in a preset two-dimensional code weight block linked list according to the two-dimensional code weight chain block number.
In this embodiment, as shown in fig. 4, the preset two-dimensional code weight block chain table follows a storage manner of a preset federation block chain and is stored in the preset federation block chain. The preset two-dimensional code authority block linked list comprises a plurality of two-dimensional code authority linked blocks, and each two-dimensional code authority linked block represents a group of two-dimensional code authority information. Each two-dimension code authority chain block comprises a two-dimension code authority chain block head and two-dimension code authority chain block information. Each two-dimensional code permission chain block comprises the hash value of the last two-dimensional code permission chain block, the current timestamp and the hash value of the two-dimensional code permission chain block, so that after data in the front of the preset two-dimensional code permission block chain table is tampered, all the follow-up hash values can be changed along with the data, and the fact that the preset two-dimensional code permission block chain table is tampered and an alarm can be rapidly found. The two-dimension code authority chain block information comprises an administrator user name, a collector number, a two-dimension code authority chain block number and a common user list which can access collector data through the two-dimension code.
The two-dimensional code authority information is the two-dimensional code authority information of the two-dimensional code authority chain block recorded under the two-dimensional code authority chain block number in the preset two-dimensional code authority block chain table. The two-dimension code authority information comprises a preset administrator user name, a preset administrator signature, a viewable legal collector number corresponding to the two-dimension code and an accessible legal user name list.
Specifically, after it is determined that the two-dimensional code generation user is a preset administrator, the two-dimensional code authority block number is compared with the two-dimensional code authority block number and the reverse row recorded in the preset two-dimensional code authority block linked list, and if the same two-dimensional code authority block number is found in the preset two-dimensional code authority block linked list, the two-dimensional code authority information under the same two-dimensional code authority block number is acquired.
Step S205, determining whether the access user is an accessible legal user according to the two-dimensional code authority information and the preset user information block linked list.
In this embodiment, as shown in fig. 5, the preset user information block chain table follows the storage manner of the preset federation block chain and is stored in the preset federation block chain. The preset user information block linked list comprises a plurality of user information linked blocks, and each user information linked block records information of one user. The preset user information block linked list contains information of all users, i.e., user authorities (administrator users, common users, illegal users). Each of the user information chain blocks includes a user information chain block header and user information chain block information. Each user information chain block comprises the hash value of the previous user information chain block, the current timestamp and the hash value of the user information chain block, so that the situation that all subsequent hash values are changed along with the falsification of data in front of the preset user information block chain table can be ensured, and the fact that the preset user information block chain table is falsified can be quickly found and an alarm is given. The user information chain block information comprises a user name, a public key of the user and user authority.
Specifically, the user name and the signature of the access user are compared with the user name and the signature in the accessible legal user name list of the two-dimensional code authority information, and if the consistent legal user name and the corresponding signature are found in the accessible legal user name list and the corresponding user name and signature can also be found in the preset user information block linked list, the access user is considered to be an accessible legal user. Otherwise, the access user is considered as an inaccessible illegal user.
And step S206, if the access user is an accessible legal user, returning the access permission information to the accessed collector.
In this embodiment, the access permission information may include determination information of permission of access, such as information of permission, approval, or permission. And if the access user is an inaccessible illegal user, returning information which is not allowed to be accessed, such as no, disapproval or disallowance and the like.
According to the method, a data access authority query request is acquired, wherein the data access authority query request is sent by an accessed collector, and an accessor verifies that the accessed collector is a legal collector after scanning two-dimensional code information obtained by a target two-dimensional code based on an accessing user; the data access query request comprises the number of the accessed collector, the signature of the accessed collector and the two-dimension code information; the two-dimension code information comprises a two-dimension code authority chain block number, a collector number, a user name of a two-dimension code generating user and a user signature of the two-dimension code generating user; judging whether the accessed collector is a legal collector or not according to the accessed collector number and the accessed collector signature based on a preset collector block linked list; if the accessed collector is a legal collector, judging whether the two-dimensional code generating user is a preset administrator or not according to the user name of the two-dimensional code generating user and the user signature of the two-dimensional code generating user; if the two-dimensional code generation user is a preset administrator, searching two-dimensional code weight information corresponding to the two-dimensional code weight chain block number in a preset two-dimensional code weight block linked list according to the two-dimensional code weight chain block number; judging whether the access user is an accessible legal user or not according to the two-dimensional code authority information and a preset user information block linked list; if the access user is an accessible legal user, returning the access permission information to the accessed collector; the preset collector block linked list, the preset user information block linked list and the preset two-dimensional code authority block linked list are all stored in the preset alliance block chain.
Therefore, user information, collector information and two-dimension code authority information can be stored and judged based on the block chain, so that the user information, the collector information and the two-dimension code authority information have the property of being not falsified, data decentralization is realized, the safety and reliability of data in the power environment monitoring system are improved, meanwhile, data access and checking are realized in a two-dimension code mode, and the data access is convenient and fast.
In some optional implementation manners of this embodiment, as shown in fig. 6, before acquiring the data access right query request in step 201, the electronic device may further perform the following steps:
step S301, a first registration request sent by a registration collector and a second registration request sent by a registered user are obtained, wherein the first registration request comprises a registration collector number, and the second registration request comprises a registration user name;
step S302, registering in a preset alliance block chain according to the first registration request and the second registration request, respectively generating a collector public key and a collector private key corresponding to the registration collector and returning the collector public key and the collector private key to the registration collector, and returning a user public key and a user private key corresponding to the registered user.
Step S303, generating a collector block linked list based on the registered collector number and the collector public key to obtain a preset collector block linked list, and generating a user information block linked list based on the registered user name and the user public key to obtain a preset user information block linked list.
In this embodiment, the collector public key is used to generate a collector block linked list, and the collector private key is used to verify the collector signature. The user public key is used for generating a user information block linked list, and the user private key is used for verifying the user signature.
When the collector needs to register, the collector can use its own number to generate a registration request to register to the preset alliance block chain. The preset alliance block chain can generate a unique collector public key and a collector private key, and then the corresponding collector public key and the corresponding collector private key are returned to the corresponding collector. And the preset alliance block chain generates a collector block chain table by registering the collector number and the collector public key, and then the preset collector block chain table is obtained.
When a user needs to register, a user name of the user can be used for generating a registration request to register to a preset alliance block chain. The preset alliance block chain can generate a unique user public key and a unique user private key, and then the corresponding user public key and the corresponding user private key are returned to the corresponding user. The preset alliance block chain generates a user information block chain table through a registered user name and a user public key, and then the preset user information device block chain table is obtained.
Therefore, the collector and the user can register to the preset alliance block chain to obtain the block chain table belonging to the collector and the user to be stored in the block chain, and the information safety of the collector and the user is improved.
In an embodiment of the application, when a collector or a user is newly added, a collector number or a user name is sent to a preset federation block chain, the preset federation block chain returns a public key and a private key unique to the collector number or the user name after verifying that the collector number or the user name is not repeated, and the collector number and the collector public key or the user name and the user public key are put into corresponding linked lists. When the collector is newly added, the state of the collector is initialized to be in use. When a user is newly added, the user authority is initialized to be a common user.
According to the method and the device, the identity information of the collector and the user is authenticated through the preset collector block linked list and the preset user information block linked list which are obtained through registration, and therefore the safety of data access between the collector and the user is improved.
In some optional implementation manners, as shown in fig. 7, in step 204, before searching the two-dimensional code permission information corresponding to the two-dimensional code permission link block number in the preset two-dimensional code permission block linked list according to the two-dimensional code permission link block number if the two-dimensional code generation user is a preset administrator, the electronic device may perform the following steps:
step S401, acquiring two-dimensional code authority information sent by a preset administrator, wherein the two-dimensional code authority information comprises a preset administrator user name, a preset administrator signature, a viewable legal acquirer number corresponding to the two-dimensional code and an accessible legal user name list.
Step S402, verifying whether the preset administrator is a legal administrator according to the preset administrator user name and the preset administrator signature.
Step S403, if the preset administrator is a legal administrator, generating a two-dimensional code authority chain block according to a viewable legal acquirer number corresponding to the two-dimensional code in the two-dimensional code authority information and an accessible legal user name list, and generating a two-dimensional code authority block chain table according to the two-dimensional code authority chain block to obtain a preset two-dimensional code authority block chain table, where the two-dimensional code authority chain block includes a two-dimensional code authority chain block number corresponding to the viewable legal acquirer number corresponding to the two-dimensional code.
In this embodiment, the viewable legal collector number corresponding to the two-dimensional code is a collector number that can be viewed through the two-dimensional code. The accessible legal user name list can be a list corresponding to the user name of the legal user who accesses the accessed collector through the two-dimensional code. The accessible list of legitimate usernames includes usernames for a plurality of legitimate users. For example, if the accessible valid user name list includes user name a, user name B, and user name C, it may be indicated that user name a, user name B, and user name C are all accessible valid users, and at this time, user name a, user name B, and user name C may all access data in the accessed collector.
Specifically, when the administrator generates the two-dimensional code, only a legal collector in the system (i.e., a collector whose device state is in use in the preset collector block linked list) can be selected, and at the same time, only a legal user in the system (i.e., an administrator user and a normal user, an illegal user cannot be selected) can be selected. The administrator presets the alliance block chain to issue two-dimensional code authority information: presetting an administrator user name, presetting an administrator signature, a viewable legal collector number corresponding to the two-dimensional code and an accessible legal user name list. After receiving a request of an administrator, after verifying the identity and signature of the administrator and determining that the administrator is a legal administrator, generating a two-dimensional code authority chain block by using a viewable legal collector number and an accessible legal user name list in the two-dimensional code authority information, and issuing the two-dimensional code authority chain block to the two-dimensional code authority block chain table to obtain a preset two-dimensional code authority block chain table. Therefore, the preset two-dimension code authority block linked list can be generated to be used for judging the authority of the two-dimension code, the authority of the access collector and the authority of the access user, and the reliability of the data of the access collector of the user through the two-dimension code is improved.
In some optional implementation manners, after generating the preset two-dimensional code weight block linked list according to the two-dimensional code weight information in step 403, the electronic device may perform the following steps:
and returning the serial number of the two-dimension code chain block to a preset administrator to generate a target two-dimension code by using the viewable legal collector serial number corresponding to the preset administrator user name, the preset administrator signature and the two-dimension code.
In this embodiment, after the preset two-dimensional code permission block linked list is generated, the number of the generated two-dimensional code permission linked list is returned. After receiving the returned two-dimensional code weight chain block number, the administrator can use the two-dimensional code chain table block number, the viewable legal collector number corresponding to the two-dimensional code, the user name and the signature of the administrator to generate the two-dimensional code, and obtain the target two-dimensional code. Therefore, the user can access the collector through the target two-dimensional code number. The convenience of the user for accessing the data of the collector is improved.
In some optional implementation manners, as shown in fig. 8, after generating a collector block linked list based on the registered collector number and the collector public key in step 303 to obtain a preset collector block linked list, the electronic device may perform the following steps:
step S501, an information modification request of a preset administrator is obtained, wherein the information modification request comprises a preset administrator signature, a preset administrator user name, a to-be-modified collector number corresponding to the to-be-modified collector and a collector target state.
Step S502, verifying the administrator identity information of the preset administrator according to the preset administrator signature and the preset administrator user name.
In step S503, if the administrator successfully verifies the identity information, the identity information of the collector to be modified is verified according to the collector number to be modified and the preset collector block linked list.
Step S504, if the identity information of the collector to be modified is successfully verified, modifying the collector chain block information corresponding to the collector to be modified in the preset collector block chain table based on the collector target state.
And step S505, if the identity information of the collector to be modified fails to be verified, returning failure information.
In this embodiment, the information modification request may include a collector state modification request. The collector to be modified needs to be modified in use. The collector target state may be a modified collector state condition. For example, the wrong collector status is set to out of service and the collector is no longer a legitimate collector.
Specifically, when the administrator needs to change the state of the collector, the administrator may send a request for modifying the state of the collector (including the collector number, the target state of the collector, the name of the administrator, and the signature of the administrator) to the preset federation block chain, after the preset federation block chain verifies the identity and the signature of the administrator and determines that the administrator is a legal administrator (an administrator with successful identity information verification), the preset federation block chain confirms that the collector number exists in the preset collector block chain table, generates a new collector chain block according to a new state set by the administrator, and updates the state of the collector. Therefore, a legal administrator can modify the state of the collector, namely the state of the collector is set to stop using after the collector is found to be wrong, a user does not access the collector any more, or the state of stopping using the collector is modified to be the using state, and the user can continue to access the collector. The illegal administrator (administrator who failed in the authentication of the identity information) cannot modify the collector body and returns failure information (no). Therefore, the user can access the effective data of the collector, and the safety of the data of the collector is further improved.
In some optional implementations, as shown in fig. 9, the information modification request further includes a user name of the user to be modified and a target identity state, and after the administrator identity information of the preset administrator is verified according to the preset administrator signature and the preset administrator user name in step 502, the electronic device may perform the following steps:
step S601, if the administrator identity information is successfully verified, verifying the identity information of the user to be modified according to the user name of the user to be modified and the preset user information block linked list.
Step S602, if the identity information of the user to be modified is successfully verified, modifying the user information chain block information corresponding to the user name of the user to be modified based on the target identity state.
Step S603, if the authentication of the identity information of the user to be modified fails, returning failure information.
In this embodiment, the information modification request may include a user identity state modification request. The user to be modified refers to a user whose identity state needs to be modified.
Specifically, when the administrator needs to change the identity state of the user, if the administrator can send a request for modifying the user identity state to the preset federation block chain (the user name, the target identity state of the user to be modified, the administrator user name, and the administrator signature), the preset federation block chain verifies whether the administrator is a legal administrator after receiving the request. And if the administrator is a legal administrator, inquiring whether a corresponding user exists in the preset user information block linked list. And if the corresponding user exists, regenerating a new user information chain block and updating the identity state of the user. For example, the administrator may set a common user as an administrator user, so that the administrator user can generate the two-dimensional code; or setting other administrator users as ordinary users, and stopping generating the authority of the two-dimensional code to access the collector; or the user is set as an illegal user, and the user is not allowed to access the system any more. Therefore, a legal administrator (an administrator with successful authentication of the identity information) can modify the user identity state of a legal user (a user with successful authentication of the identity information). The user identity status of a legitimate user or an illegitimate user (a user whose authentication has failed) cannot be modified by an illegitimate administrator (an administrator whose authentication has failed). The data of the collector can be accessed by a legal user, and the safety of the data of the collector is further improved.
In some optional implementation manners, in step 303, a collector block linked list is generated based on the registered collector number and the collector public key to obtain a preset collector block linked list; and step 306, after generating the user information block linked list based on the registered user name and the user public key to obtain the preset user information block linked list, the electronic device may perform the following steps:
synchronizing the preset user information block linked list to the local of the registered collector, synchronizing the preset collector block linked list to the local of the registered user, and synchronizing the preset user information block linked list and the preset collector block linked list to the local of the preset administrator.
In this embodiment, after the block chain table of the preset user information and the block chain table of the preset collector are generated by registration, all the collectors that have registered may synchronize the block chain table of the preset user information, so that when a request from a user is received, it is verified whether the request and the authentication identity information are sent by a registered legal collector. Meanwhile, all registered users can synchronize the preset collector block linked list so as to verify whether the request and the identity information are sent by the registered legal users when the request from the collector is received. Certainly, the preset administrator also needs to verify the requests and the identity information of the collector and the user through the preset user information block linked list and the preset collector block linked list, so as to improve the security of accessing the data of the collector.
The preset block chain of the alliance is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 10, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a data access apparatus based on a block chain, where the embodiment of the data access apparatus based on a block chain corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be applied to various electronic devices.
As shown in fig. 10, the data access apparatus 700 based on block chain of the present embodiment includes: a first obtaining module 701, a first judging module 702, a second judging module 703, a searching module 704, a third judging module 705 and a first returning module 706. Wherein:
a first obtaining module 701, configured to obtain a data access permission query request; the data access authority inquiry request is sent by an accessed collector, and is sent by an accessor when the accessed collector is verified to be a legal collector based on two-dimension code information obtained by scanning a target two-dimension code by an accessing user; the data access query request comprises the number of the accessed collector, the signature of the accessed collector and the two-dimension code information; the two-dimension code information comprises a two-dimension code authority chain block number, a collector number, a user name of a two-dimension code generating user and a user signature of the two-dimension code generating user;
a first judging module 702, configured to judge, based on a preset collector block linked list, whether an accessed collector is a legal collector according to an accessed collector number and an accessed collector signature;
a second judging module 703, configured to, if the accessed collector is a legal collector, judge whether the two-dimensional code generating user is a preset administrator according to the user name of the two-dimensional code generating user and the user signature of the two-dimensional code generating user;
a searching module 704, configured to search, if the two-dimensional code generation user is a preset administrator, two-dimensional code weight information corresponding to the two-dimensional code weight block number in a preset two-dimensional code weight block linked list according to the two-dimensional code weight block number;
a third determining module 705, configured to determine whether the access user is an accessible legal user according to the two-dimensional code authority information and a preset user information block linked list;
a first returning module 706, configured to return the access permission information to the accessed collector if the access user is an accessible legal user;
the preset collector block linked list, the preset user information block linked list and the preset two-dimensional code authority block linked list are all stored in the preset alliance block chain.
In some optional implementations of this embodiment, as shown in fig. 11, before the first obtaining module 701, the method further includes:
a second obtaining module 707, configured to obtain a first registration request sent by a registration collector and a second registration request sent by a registered user, where the first registration request includes a registration collector number, and the second registration request includes a registration user name;
the registration module 708 is configured to register in the preset federation blockchain according to the first registration request and the second registration request, generate an acquirer public key and an acquirer private key corresponding to the registration acquirer and return the acquirer public key and the acquirer private key to the registration acquirer, and return a user public key and a user private key corresponding to the registered user;
a first generating module 709, configured to generate a collector block linked list based on the registered collector number and the collector public key to obtain a preset collector block linked list, and generate a user information block linked list based on the registered user name and the user public key to obtain a preset user information block linked list.
In some optional implementations of this embodiment, as shown in fig. 12, before the searching module 704, the method further includes:
a third obtaining module 710, configured to obtain two-dimensional code authority information sent by a preset administrator, where the two-dimensional code authority information includes a preset administrator user name, a preset administrator signature, a viewable legal acquirer number corresponding to a two-dimensional code, and an accessible legal user name list;
the first verification module 711 is configured to verify whether the preset administrator is a legal administrator according to the preset administrator user name and the preset administrator signature;
a second generating module 712, configured to, if the preset administrator is a legal administrator, generate a two-dimensional code authority chain block according to a viewable legal acquirer number corresponding to the two-dimensional code in the two-dimensional code authority information and an accessible legal user name list, and generate a two-dimensional code authority block linked list according to the two-dimensional code authority chain block to obtain the preset two-dimensional code authority block linked list, where the two-dimensional code authority chain block includes a two-dimensional code authority chain block number corresponding to the viewable legal acquirer number corresponding to the two-dimensional code.
In some optional implementations of this embodiment, after the second generating module 712, the method further includes:
and the second returning module is used for returning the serial number of the two-dimension code chain block to a preset administrator so as to generate a target two-dimension code by using a viewable legal collector number corresponding to a preset administrator user name, a preset administrator signature and the two-dimension code.
In some optional implementations of this embodiment, as shown in fig. 13, after the first generating module 709, the method further includes:
a fourth obtaining module 713, configured to obtain an information modification request of a preset administrator, where the information modification request includes a preset administrator signature, a preset administrator user name, a to-be-modified collector number corresponding to a to-be-modified collector, and a collector target state;
the second verification module 714 is configured to verify the administrator identity information of the preset administrator according to the preset administrator signature and the preset administrator user name;
a third verification module 715, configured to verify, if the administrator identity information is successfully verified, the identity information of the collector to be modified according to the collector number to be modified and the preset collector block linked list;
a first modifying module 716, configured to modify, based on the collector target state, collector chain block information corresponding to the collector to be modified in the preset collector block chain table if the identity information of the collector to be modified is successfully verified;
and the first modification-free module 717 is used for returning failure information if the identity information verification of the collector to be modified fails.
In some optional implementations of this embodiment, as shown in fig. 14, the information modification request further includes a user name and a target identity state of the user to be modified, and further includes, after the second verification module 714:
a fourth verification module 718, configured to verify, if the administrator identity information is successfully verified, the identity information of the user to be modified according to the user name of the user to be modified and the preset user information block linked list;
a second modifying module 719, configured to modify, based on the target identity state, the user information chain block information corresponding to the user name of the user to be modified if the identity information of the user to be modified is successfully verified;
and a second modification-free module 720, configured to return failure information if the authentication of the identity information of the user to be modified fails.
In some optional implementations of the present embodiment, after the first generating module 709, the method further includes:
and the synchronization module is used for synchronizing the preset user information block linked list to the local of the registered collector, synchronizing the preset collector block linked list to the local of the registered user and synchronizing the preset user information block linked list and the preset collector block linked list to the local of a preset administrator.
The data access device 700 based on the block chain provided in the embodiment of the present application can implement each process implemented by the data access method based on the block chain in the above method embodiments, and can achieve the same beneficial effects. To avoid repetition, further description is omitted here.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 15, fig. 15 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 8 includes a memory 81, a processor 82, and a network interface 83 communicatively connected to each other via a system bus. It is noted that only computer device 8 having components 81-83 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 81 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 81 may be an internal storage unit of the computer device 8, such as a hard disk or a memory of the computer device 8. In other embodiments, the memory 81 may be an external storage device of the computer device 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the computer device 8. Of course, the memory 81 may also include both internal and external storage devices of the computer device 8. In this embodiment, the memory 81 is generally used for storing an operating system installed in the computer device 8 and various types of application software, such as computer readable instructions of a data access method based on a block chain. Further, the memory 81 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 82 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 82 is typically used to control the overall operation of the computer device 8. In this embodiment, the processor 82 is configured to execute computer readable instructions stored in the memory 81 or to process data, such as executing a blockchain-based data access method.
The network interface 83 may include a wireless network interface or a wired network interface, and the network interface 83 is generally used to establish communication connections between the computer device 8 and other electronic devices.
The computer device 800 provided in the embodiment of the present application can implement each process implemented by the data access method based on the block chain in the foregoing method embodiments, and can achieve the same beneficial effects. To avoid repetition, further description is omitted here.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the block chain based data access method as described above.
In this embodiment, when being executed by a processor, the computer program implements each process of the block chain-based data access method provided in the embodiment of the present application, and can achieve the same technical effect, and is not described herein again to avoid repetition.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A block chain based data access method, comprising the steps of:
acquiring a data access authority query request, wherein the data access authority query request is sent by an accessed collector when an accessor verifies that the accessed collector is a legal collector after scanning two-dimensional code information obtained by a target two-dimensional code based on an accessing user; the data access query request comprises the number of an accessed collector, the signature of the accessed collector and the two-dimension code information; the two-dimension code information comprises a two-dimension code authority chain block number, a collector number, a user name of a two-dimension code generating user and a user signature of the two-dimension code generating user;
judging whether the accessed collector is a legal collector or not according to the accessed collector number and the accessed collector signature based on a preset collector block linked list;
if the accessed collector is a legal collector, judging whether the two-dimension code generating user is a preset administrator or not according to the user name of the two-dimension code generating user and the user signature of the two-dimension code generating user;
if the two-dimensional code generation user is a preset administrator, searching two-dimensional code authority information corresponding to the two-dimensional code authority chain block number in a preset two-dimensional code authority block linked list according to the two-dimensional code authority chain block number;
judging whether the access user is an accessible legal user or not according to the two-dimensional code authority information and a preset user information block linked list;
if the access user is an accessible legal user, returning access permission information to the accessed collector;
the preset collector block linked list, the preset user information block linked list and the preset two-dimensional code weight block linked list are all stored in a preset alliance block chain.
2. The blockchain-based data access method according to claim 1, further comprising, before the step of obtaining the data access permission query request:
acquiring a first registration request sent by a registration collector and a second registration request sent by a registered user, wherein the first registration request comprises a registration collector number, and the second registration request comprises a registration user name;
registering in a preset alliance block chain according to the first registration request and the second registration request, respectively generating an collector public key and a collector private key corresponding to the registration collector and returning the collector public key and the collector private key to the registration collector, and returning a user public key and a user private key corresponding to the registered user;
and generating a user information block linked list based on the registration user name and the user public key to obtain the preset user information block linked list.
3. The block chain-based data access method according to claim 1, wherein before the step of searching for the two-dimensional code permission information corresponding to the two-dimensional code permission chain block number in a preset two-dimensional code permission block linked list according to the two-dimensional code permission chain block number if the two-dimensional code generating user is a preset administrator, the method further comprises:
acquiring two-dimensional code authority information sent by a preset administrator, wherein the two-dimensional code authority information comprises a preset administrator user name, a preset administrator signature, a viewable legal collector number corresponding to a two-dimensional code and an accessible legal user name list;
verifying whether the preset administrator is a legal administrator or not according to the preset administrator user name and the preset administrator signature;
and if the preset administrator is a legal administrator, generating a two-dimensional code authority chain block according to a viewable legal collector number corresponding to the two-dimensional code in the two-dimensional code authority information and an accessible legal user name list, and generating a two-dimensional code authority block linked list according to the two-dimensional code authority chain block to obtain the preset two-dimensional code authority block linked list, wherein the two-dimensional code authority chain block comprises a two-dimensional code authority chain block number corresponding to the viewable legal collector number corresponding to the two-dimensional code.
4. The block chain-based data access method according to claim 3, wherein after the step of generating the preset two-dimensional code weight block chain table according to the two-dimensional code weight information, the method further comprises:
and returning the serial number of the two-dimension code chain table block to the preset administrator to generate a target two-dimension code by using the preset administrator user name, the preset administrator signature and the viewable legal collector serial number corresponding to the two-dimension code.
5. The block chain-based data access method according to claim 2, wherein the step of generating a collector block chain table based on the registered collector number and the collector public key to obtain the preset collector block chain table further comprises:
acquiring an information modification request of a preset administrator, wherein the information modification request comprises a preset administrator signature, a preset administrator user name, a number of a collector to be modified corresponding to the collector to be modified and a collector target state;
verifying the administrator identity information of the preset administrator according to the preset administrator signature and the preset administrator user name;
if the administrator identity information is successfully verified, verifying the identity information of the collector to be modified according to the collector number to be modified and a preset collector block linked list;
if the identity information of the collector to be modified is successfully verified, modifying the collector chain block information corresponding to the collector to be modified in the preset collector block chain table based on the collector target state;
and if the identity information verification of the collector to be modified fails, returning failure information.
6. The block chain-based data access method according to claim 5, wherein the information modification request further includes a user name and a target identity state of a user to be modified, and after the step of generating a user information block chain table based on the registered user name and the user public key to obtain the preset user information block chain table, the method further includes:
if the administrator identity information is successfully verified, verifying the identity information of the user to be modified according to the user name of the user to be modified and the preset user information block linked list;
if the identity information of the user to be modified is successfully verified, modifying user information chain block information corresponding to the user name of the user to be modified based on the target identity state;
and if the identity information of the user to be modified fails to be verified, returning failure information.
7. The block chain-based data access method according to claim 2, wherein a collector block chain table is generated based on the registered collector number and the collector public key to obtain the preset collector block chain table; and generating a user information block linked list based on the registered user name and the user public key to obtain the preset user information block linked list, and then:
synchronizing the preset user information block linked list to the local of a registered collector, synchronizing the preset collector block linked list to the local of a registered user, and synchronizing the preset user information block linked list and the preset collector block linked list to the local of a preset administrator.
8. A blockchain-based data access apparatus, comprising:
the first acquisition module is used for acquiring a data access authority query request; the data access authority inquiry request is sent by an accessed collector when the accessed collector is verified to be a legal collector by the visitor based on two-dimension code information obtained by scanning a target two-dimension code by an access user; the data access query request comprises the number of an accessed collector, the signature of the accessed collector and the two-dimension code information; the two-dimension code information comprises a two-dimension code authority chain block number, a collector number, a user name of a two-dimension code generating user and a user signature of the two-dimension code generating user;
the first judgment module is used for judging whether the accessed collector is a legal collector or not according to the accessed collector number and the accessed collector signature based on a preset collector block linked list;
the second judgment module is used for judging whether the two-dimension code generating user is a preset administrator or not according to the user name of the two-dimension code generating user and the user signature of the two-dimension code generating user if the accessed collector is a legal collector;
the searching module is used for searching two-dimensional code authority information corresponding to the two-dimensional code authority chain block number in a preset two-dimensional code authority block linked list according to the two-dimensional code authority chain block number if the two-dimensional code generating user is a preset administrator;
the third judging module is used for judging whether the access user is an accessible legal user or not according to the two-dimensional code authority information and a preset user information block linked list;
the first returning module is used for returning the access permission information to the accessed collector if the access user is an accessible legal user;
the preset collector block linked list, the preset user information block linked list and the preset two-dimensional code weight block linked list are all stored in a preset alliance block chain.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of the blockchain based data access method of any one of claims 1 to 7.
10. A computer readable storage medium having computer readable instructions stored thereon which, when executed by a processor, implement the steps of the blockchain based data access method of any one of claims 1 to 7.
CN202111442363.7A 2021-11-30 2021-11-30 Data access method and device based on block chain and computer equipment Pending CN114329375A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111442363.7A CN114329375A (en) 2021-11-30 2021-11-30 Data access method and device based on block chain and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111442363.7A CN114329375A (en) 2021-11-30 2021-11-30 Data access method and device based on block chain and computer equipment

Publications (1)

Publication Number Publication Date
CN114329375A true CN114329375A (en) 2022-04-12

Family

ID=81048069

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111442363.7A Pending CN114329375A (en) 2021-11-30 2021-11-30 Data access method and device based on block chain and computer equipment

Country Status (1)

Country Link
CN (1) CN114329375A (en)

Similar Documents

Publication Publication Date Title
CN109951489B (en) Digital identity authentication method, equipment, device, system and storage medium
CN109862041B (en) Digital identity authentication method, equipment, device, system and storage medium
CN111783075B (en) Authority management method, device and medium based on secret key and electronic equipment
EP3451222B1 (en) Post-manufacture certificate generation
CN108933667B (en) Management method and management system of public key certificate based on block chain
CN110945549A (en) Method and system for universal storage and access to user-owned credentials for cross-institution digital authentication
CN110177124B (en) Identity authentication method based on block chain and related equipment
US11729175B2 (en) Blockchain folding
CN108335105B (en) Data processing method and related equipment
US20190141048A1 (en) Blockchain identification system
US20230379160A1 (en) Non-fungible token authentication
US9223949B1 (en) Secure transformable password generation
KR20080087917A (en) System for certify one-time password, system for issue a seed, and method for generating one-time password
EP3133791B1 (en) Double authentication system for electronically signed documents
CN112712372A (en) Alliance chain cross-chain system and information calling method
CN111131144B (en) IoT (Internet of things) equipment management method, device, server and storage medium
CN102694776A (en) Authentication system and method based on dependable computing
CN113434882A (en) Communication protection method and device of application program, computer equipment and storage medium
US20230325521A1 (en) Data processing method and apparatus based on blockchain network, device, and storage medium
CN113872986B (en) Power distribution terminal authentication method and device and computer equipment
CN114329375A (en) Data access method and device based on block chain and computer equipment
CN115170355A (en) Evidence obtaining data credibility verification method and device, computer equipment and storage medium
US11343107B2 (en) System for method for secured logging of events
WO2018164673A1 (en) Data message authentication based on a random number
CN114329419A (en) Identity verification method and device based on block chain and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination