Data access method, device, computer equipment and storage medium
By publishing open data archives and data access applications in the blockchain network, it solves the problem that the data authorization application method in the existing technology cannot meet personalized needs, and realizes flexible selection and efficient response of data users.
Patent Information
- Application Number
- CN202010739829.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-28
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-07-28
AI Technical Summary
Existing data authorization application methods cannot meet the personalized needs of data users, and traditional data capability open platforms have low response efficiency when requirements change.
In the blockchain network, the data provider publishes open data files in advance, the data user selects and generates a data access application based on needs, and the data provider obtains and sends the target data from the database after approval and authorization.
It enables data users to independently select data that meets their individual needs, improving flexibility and efficiency in the data use process.
Smart Images

Figure CN111858611B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of blockchain technology, and specifically, to a data access method, apparatus, computer equipment, and storage medium. Background Art
[0002] Usually, data users need to apply for authorization from the data provider before accessing data resources, and can only obtain or use the required data after the application is approved.
[0003] At present, the commonly used data authorization application method is: the data provider provides data in a fixed format and fixed range, and provides a fixed data authorization application interface and data acquisition interface. The data user obtains and uses the data after completing the relevant permission application. However, the type and content of data that can be provided by this method are relatively fixed, and cannot meet the personalized data needs of data users. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a data access method, apparatus, computer equipment and storage medium to solve the problem that the existing data authorization application method cannot meet the personalized needs of data users.
[0005] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a data access method, which is applied to a first node in a blockchain network, wherein the first node communicates with a database, and the method includes:
[0007] Receiving a data access application sent by a second node in the blockchain network, wherein the data access application is generated by the second node based on an open data archive published in the blockchain network, and the open data archive is used to characterize basic information of open data resources in the database;
[0008] When the data access application is approved and authorized, obtaining target data corresponding to the data access application from the database, wherein the open data resource includes the target data;
[0009] The target data is sent to the second node.
[0010] In a second aspect, an embodiment of the present application further provides a data access method, which is applied to a second node in a blockchain network, wherein an open data archive is published in the blockchain network, and the open data archive is used to characterize basic information of open data resources in a database communicating with a first node in the blockchain network; the method comprises:
[0011] generating a data access application based on the open data archive;
[0012] Broadcasting the data access application to the blockchain network so that each node in the blockchain network receives the data access application;
[0013] Obtain target data sent by the first node, wherein the target data is data corresponding to the data access application obtained by the first node from the database after the data access application is approved and authorized, and the open data resource includes the target data.
[0014] In a third aspect, an embodiment of the present application further provides a data access device, which is applied to a first node in a blockchain network, wherein the first node communicates with a database, and the device includes:
[0015] A first receiving module is configured to receive a data access application sent by a second node in the blockchain network, wherein the data access application is generated by the second node based on an open data archive published in the blockchain network, and the open data archive is used to characterize basic information of open data resources in the database;
[0016] A first execution module, configured to obtain target data corresponding to the data access application from the database when the data access application is approved and authorized, wherein the open data resource includes the target data;
[0017] The second execution module is used to send the target data to the second node.
[0018] In a fourth aspect, an embodiment of the present application further provides a data access device, which is applied to a second node in a blockchain network, wherein an open data archive is published in the blockchain network, and the open data archive is used to characterize basic information of open data resources in a database communicating with a first node in the blockchain network; the device comprises:
[0019] An application generation module, used to generate a data access application based on the open data archive;
[0020] A first processing module, configured to broadcast the data access application to the blockchain network, so that each node in the blockchain network receives the data access application;
[0021] The second processing module is used to obtain target data sent by the first node, wherein the target data is data corresponding to the data access application obtained by the first node from the database after the data access application is approved and authorized, and the open data resource includes the target data.
[0022] In the fifth aspect, an embodiment of the present application also provides a computer device, comprising: one or more processors; a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned data access method applied to the first node in the blockchain network, or the data access method applied to the second node in the blockchain network.
[0023] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned data access method applied to the first node in the blockchain network, or the data access method applied to the second node in the blockchain network.
[0024] Compared with the prior art, the present application provides a data access method, device, computer equipment and storage medium, which introduce blockchain technology to solve the problem that the existing data authorization application method cannot meet the personalized needs of data users, wherein the first node in the blockchain network is the data provider and the second node is the data user; the data provider publishes the open data archive that can represent the basic information of the open data resource in the blockchain network in advance and opens it to the data user. The open data resource refers to the data resource that can be openly provided; the data user selects the required open data archive according to its own needs, and sends a data access application in the blockchain network based on the open data archive; after receiving the data access application and approving the authorization, the data provider obtains the target data corresponding to the data access application from the open data resource and sends it to the data user, so that the data received by the data user is the data that can meet its own personalized needs; thereby meeting the diversity of data users' needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A schematic diagram of the architecture of the blockchain network provided in an embodiment of the present application is shown.
[0026] Figure 2 A flow chart of a data access method applied to a first node provided in an embodiment of the present application is shown.
[0027] Figure 3 An example diagram of an open data archive provided by an embodiment of the present application is shown.
[0028] Figure 4 for Figure 2 The flowchart of step S102 in the data access method is shown.
[0029] Figure 5 for Figure 2 The flowchart of step S103 in the data access method is shown.
[0030] Figure 6 Another flow chart of a data access method applied to a first node provided in an embodiment of the present application is shown.
[0031] Figure 7 for Figure 6 The flowchart of step S120 in the data access method is shown.
[0032] Figure 8 A flow chart of a data access method applied to a second node provided in an embodiment of the present application is shown.
[0033] Fig. 9 for Figure 8 The flowchart of step S201 in the data access method is shown.
[0034] Fig.10 for Figure 8 The flowchart of step S203 in the data access method is shown.
[0035] Fig.11 A block diagram of a data access device applied to a first node provided in an embodiment of the present application is shown.
[0036] Fig.12 A block diagram of a data access device applied to a second node provided in an embodiment of the present application is shown.
[0037] Fig.13 A block diagram of a computer device provided in an embodiment of the present application is shown.
[0038] Icons: 10 - computer equipment; 11 - processor; 12 - memory; 13 - bus; 100, 200 - data access device; 110 - application receiving module; 120 - first execution module; 130 - second execution module; 140 - third execution module; 150 - fourth execution module; 210 - application generating module; 220 - first processing module; 230 - second processing module. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present application.
[0040] With the development of information technology, data has become an important resource element in market economic activities. Before accessing data resources, data users need to apply for authorization from data providers, and can only obtain or use the required data after the application is approved.
[0041] There are two main ways to apply for data authorization:
[0042] The first is that the data provider provides data in a fixed format and fixed range, and provides a fixed data authorization application interface and data acquisition interface. The data user obtains and uses the data after completing the relevant permission application. The type and content of data provided by this method are relatively fixed and cannot meet the personalized data needs of the data user.
[0043] The second is that the data provider builds a data capability open platform, which refers to a data development and testing platform built in the data provider's network environment. Data users need to develop and test data processing tools on the data capability open platform and use the data processing tools in the production environment after development and testing. This method has a relatively rigid process, cannot respond quickly to changes in data processing requirements, and has low efficiency.
[0044] Based on this, the embodiment of the present application introduces blockchain technology to solve the problem that the first method mentioned above cannot meet the personalized data needs of data users, and the second method cannot quickly respond to the needs during data use, resulting in low efficiency. The following is a detailed introduction.
[0045] Please refer to Figure 1 , Figure 1 The schematic diagram of the architecture of the blockchain network provided by the embodiment of the present application is shown, and the blockchain network includes multiple nodes, for example, node a, node b, node c, etc., and runs a decentralized application. Each node in the blockchain network can have its own database and communicate with its own database.
[0046] Decentralized Application (DAPP) refers to an application that runs on the blockchain and performs decentralized operations through nodes in the blockchain network. DAPP is an Internet application. The biggest difference between it and traditional applications is that DAPP runs in the blockchain network, which is a decentralized network. There is no centralized node that can completely control DAPP; while traditional applications are centralized and need to request a server to obtain data, process data, etc. The blockchain network is the underlying environment for the operation of DAPP.
[0047] exist Figure 1 In the blockchain network, any node, for example, node a, node b, node c, etc., can access DAPP or perform other operations through DAPP.
[0048] Among them, node a, node b, node c, etc. can be computer devices connected to the blockchain network, including but not limited to smart phones, tablet computers, personal computers, servers, private clouds, public clouds, etc. Node a, node b, node c, etc. can also be users who access the blockchain network through the above-mentioned computer devices, etc., which can be determined according to the actual application scenario and are not limited here.
[0049] The first node can be any node in the blockchain network, for example, node a; the second node can be any node in the blockchain network except the first node, for example, node b. The first node can be a data provider or a data user, and the second node can also be a data provider or a data user, which can also be determined according to the actual application scenario and is not limited here. The following embodiments are described by taking the first node as a data provider and the second node as a data user as an example.
[0050] Please refer to Figure 2 , Figure 2 A schematic flow chart of a data access method applied to a first node provided in an embodiment of the present application is shown. The data access method may include the following steps:
[0051] S101, receiving a data access application sent by a second node in a blockchain network, wherein the data access application is generated by the second node based on an open data archive published in the blockchain network, and the open data archive is used to characterize basic information of open data resources in a database.
[0052] The first node communicates with the database, which is used to store data. For example, the first node is a device for an enterprise to access the blockchain network, and the database is the enterprise's database of current employees, database of former employees, etc. The following is an example of the current employee database.
[0053] As a data provider, the first node can determine the open data resources from the database in advance, and establish an open data archive of the open data resources and publish it to the blockchain network.
[0054] Open data resources refer to data resources that can be openly provided and stored in the database. For example, the database is an employee database, which is used to store various information tables of employees, such as the employee basic information table, which contains basic information such as name, age, gender, education, ID number, home address, and personal ID photo; the employee salary table, which contains basic salary, bonus, salary card number, social security account number, provident fund account number, etc. Open data resources refer to information tables that can be openly provided in the employee database, such as the employee basic information table.
[0055] An open data resource can have at least one open data file, which is used to characterize the basic information of the open data resource. The basic information may include the identification information, data format, field identifier, size, supported data filtering methods, etc. of the open data resource. For example, if the open data resource is a basic information table of employees, the open data file may include, but is not limited to, the following information: table name, fields in the table (such as name, age, gender, education, ID number, home address, personal ID photo, etc.), data formats in the table (for example, numbers, text, etc.), filtering methods supported by the data in the table (for example, age filtering, gender filtering, etc.), etc.
[0056] Since the blockchain network includes multiple nodes, each node may be a data provider and can publish open data archives of open data resources to the blockchain network. Therefore, multiple open data archives will be published in the blockchain network, and these open data archives are open to all nodes in the blockchain network.
[0057] As a data user, the second node can retrieve all open data archives published in the blockchain network and select what it needs. For example, if a data user needs a face image training model, he can choose an open data archive containing information related to face images, such as an open data archive of the employee basic information table.
[0058] After that, the second node obtains the required open data archive from the blockchain network, selects the data information to be accessed according to the information in the open data archive, and submits the data access application to the blockchain network. For example, please refer to Figure 3 , select age, gender, and personal ID photo from the open data archive of the employee basic information table; accordingly, the data access application includes the table name, age, gender, and personal ID photo of the employee basic information table.
[0059] S102, when the data access application is approved and authorized, the target data corresponding to the data access application is obtained from the database, wherein the open data resources include the target data.
[0060] The data access application submitted by the second node to the blockchain network can be received by each node in the blockchain network. After receiving it, each node will first determine whether the data requested for access is the data resource it provides openly. If not, it can be ignored. If it is, it can approve and authorize the second node.
[0061] If the first node passes the approval authorization of the second node, it can obtain the data requested for access from its own database, such as the age, gender and personal ID photo data in the employee basic information table. The target data refers to the data requested for access in the data access application.
[0062] S103, sending the target data to the second node.
[0063] In one embodiment, a data access application includes target identification information and a target field identification. The target information identification is the identification of the open data resource to which access is requested, for example, the table name of the employee basic information table; the target field identification is the identification of the field in the open data resource to which access is requested, for example, the field names such as age, gender, and personal ID photo in the employee basic information table.
[0064] Therefore, in Figure 2 Based on Figure 4 , step S102 may include the following sub-steps:
[0065] S1021, based on the target identification information, determine from a database an open data resource that matches the target identification information.
[0066] S1022: Determine a target field from at least one field of the open data resource according to the target field identifier.
[0067] S1023, acquiring data corresponding to the target field of the open data resource from the database to obtain target data.
[0068] The data in the database have their own identification information. Accordingly, the open data resources also have corresponding identification information. The identification information can be information that uniquely represents the open data resource, such as table name, storage address, etc. At the same time, the open data resource includes at least one field, for example, including name, age, gender, education, ID number, home address, personal ID photo, etc.
[0069] For example, if the target identification information is the table name of the employee basic information table, the employee basic information table is determined from the employee database; if the target field identification is age, gender, and personal ID photo, the age, gender, and personal ID photo fields are determined from the name, age, gender, education, ID number, home address, personal ID photo, etc. in the employee basic information table. Accordingly, all data corresponding to the age, gender, and personal ID photo fields are obtained from the employee basic information table to obtain the target data.
[0070] In one embodiment, the first node may encrypt the target data and send the encrypted data to the second node. Figure 2 Based on Figure 5 , step S103 may include the following sub-steps:
[0071] S1031, package and encrypt the target data to generate an encrypted data file.
[0072] S1032, sending the encrypted data file to the second node, so that after receiving the encrypted data file, the second node uses the decentralized application to decrypt the encrypted data file to obtain the target data.
[0073] Each node in the blockchain network can provide on-chain services through DAPP. For example, after receiving the encrypted data file sent by the first node, the second node can decrypt the encrypted data file to obtain the target data.
[0074] It should be pointed out that all processing of the second node provided in this embodiment, such as obtaining open data archives, generating data access applications, decrypting encrypted data files, etc., can be implemented through DAPP. DAPP can ensure that open data resources are not leaked and improve data security.
[0075] In one possible scenario, after receiving the data access application from the second node, the first node needs to approve and authorize the data access application, and needs to store the relevant records of the approval and authorization on the chain. The relevant records of the approval and authorization include the records of those that have passed the approval and authorization and the records of those that have not passed the authorization and approval, so as to facilitate subsequent verification. Figure 2 Based on Figure 6 , after step S101, the data access method may further include step S140.
[0076] S140: Approve and authorize the data access application, and store the relevant records of the approval and authorization on the chain.
[0077] The following is an introduction to the process of the first node publishing an open data archive in the blockchain network. Figure 6 Before step S101, the data access method may further include steps S110 to S130.
[0078] S110, determining open data resources in the database.
[0079] Open data resources refer to data resources in the database that can be open to data users, for example, the basic information table of employees in the employee database.
[0080] S120, establish an open data archive of open data resources.
[0081] Open data archives are used to characterize the basic information of open data resources. The basic information may include identification information and metadata corresponding to the open data resources. The metadata includes data field definition, data format definition, data acquisition method and data screening method.
[0082] S130, publishing the open data archive to the blockchain network.
[0083] exist Figure 6 Based on Figure 7 , step S120 may include the following sub-steps:
[0084] S1201, obtaining identification information, field identification and data format corresponding to the open data resource.
[0085] Identification information refers to information that can uniquely refer to an open data resource, such as a table header, storage address, etc. Field identification refers to information that can uniquely refer to each field in an open data resource, such as a field name, etc. Data format can be the format of each field in an open data resource, for example, the format of the age field is numeric, the format of the name field is text, etc.
[0086] S1202, generating a data field definition, where the data field definition includes a field identifier.
[0087] The data field definition can represent all fields in the open data resource, and the data field definition can be the field identifier obtained in sub-step S1201, or can be the content after the field identifier obtained in sub-step S1201 is classified and sorted. For example, the field identifier is divided into sensitive field identifier and non-sensitive field identifier, and the data of the field corresponding to the sensitive field identifier needs to be desensitized later.
[0088] S1203, generating a data format definition, where the data format definition includes a data format.
[0089] The data format definition can represent the data format of all fields in the open data resource, and the data format definition can be the data format obtained in sub-step S1201, or can be the content after the data format obtained in sub-step S1201 is classified and sorted. For example, the same data formats are put together.
[0090] S1204, obtaining a preset data acquisition method and data screening method to obtain an open data archive, wherein the open data archive includes identification information and metadata corresponding to the open data resources, and the metadata includes data field definition, data format definition, data acquisition method and data screening method.
[0091] Data acquisition methods refer to all methods of acquiring open data resources, such as API interfaces, download links, etc. Data screening methods refer to all screening methods supported by open data resources. For example, if the open data resource is a basic employee information table, the screening methods include screening by age, screening by gender, etc. At the same time, data acquisition methods and data screening methods are pre-defined by the data provider according to actual conditions.
[0092] Please refer to Figure 8 , Figure 8A flow chart of a data access method applied to a second node provided in an embodiment of the present application is shown. The data access method may include the following steps:
[0093] S201, generating a data access application based on an open data archive.
[0094] The data access application is used to represent the open data resource to which access is requested, and the field in the open data resource to which access is requested. The data access application is generated based on the user's selection operation on the open data archive. For example, if a user selects one of the multiple open data archives published in the blockchain network and selects the content in the open data archive, a data access application is generated based on the user's selection, and the data access application includes the open data archive selected by the user and the content selected by the user in the open data archive.
[0095] S202, broadcasting the data access application to the blockchain network so that each node in the blockchain network receives the data access application.
[0096] S203, obtaining target data sent by the first node, wherein the target data is data corresponding to the data access application obtained by the first node from the database after the data access application is approved and authorized, and the open data resources include the target data.
[0097] exist Figure 8 Based on Fig. 9 , step S201 may include the following sub-steps:
[0098] S2011, in response to the first selection operation, an open data archive is selected.
[0099] The first selection operation may be a selection operation of a certain open data file by the user of the second node according to his own needs, for example, a selection operation of the open data file of the employee basic information table. In response to the selection operation, the open data file of the employee basic information table is selected.
[0100] S2012, in response to the second selection operation, select data field definition, data format definition, data acquisition method and data screening method in the open data archive to obtain a selected field identifier.
[0101] The second selection operation can be a selection operation of the second node user on the contents of the selected open data archive according to his own needs, which is mainly a selection operation on the data field definition. The data format definition, data acquisition method and data screening method are mainly to facilitate users to judge whether the open data resources can meet their own needs. For example, the data acquisition method is an API interface. If the user does not want to obtain data through the API interface, he can re-select an open data archive that meets his own needs.
[0102] S2013, using the identification information corresponding to the open data archive as the target identification information, and using the selected field identification as the target field identification, to obtain a data access application, wherein the data access application includes the target identification information and the target field identification.
[0103] exist Figure 8 Based on Fig.10 , step S203 may include the following sub-steps:
[0104] S2031, receiving an encrypted data file sent by the first node, wherein the encrypted data file is generated by the first node by packaging and encrypting target data.
[0105] S2032, using a decentralized application to decrypt the encrypted data file to obtain target data.
[0106] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0107] First, compared with the existing first data authorization application method, the embodiment of the present application can obtain target data that meets its own needs by independently selecting open data archives and the content in the open data archives, thereby meeting the diverse needs of data users;
[0108] Secondly, compared with the existing second data authorization application method, the embodiment of the present application can change data processing requirements at any time during data use, and quickly obtain data that meets its own needs, thereby effectively improving the efficiency of development and testing work.
[0109] In order to execute the corresponding steps in the above data access method embodiment and each possible implementation method, an implementation method of a data access device applied to a first node and an implementation method of a data access device applied to a second node are provided below.
[0110] Please refer to Fig.11 , Fig.11 The block diagram of the data access device 100 provided by the embodiment of the present application is shown. The data access device 100 is applied to a first node, and includes: an application receiving module 110, a first execution module 120 and a second execution module 130.
[0111] The application receiving module 110 is used to receive a data access application sent by a second node in the blockchain network, wherein the data access application is generated by the second node based on an open data archive published in the blockchain network, and the open data archive is used to characterize the basic information of the open data resources in the database.
[0112] The first execution module 120 is used to obtain target data corresponding to the data access application from the database when the data access application is approved and authorized, wherein the open data resources include the target data.
[0113] The second execution module 130 is configured to send the target data to the second node.
[0114] Optionally, the data access application includes target identification information and target field identification; the open data resource has corresponding identification information and includes at least one field;
[0115] The first execution module 120 is specifically used to: determine the open data resource matching the target identification information from the database according to the target identification information; determine the target field from at least one field of the open data resource according to the target field identification; obtain the data corresponding to the target field of the open data resource from the database to obtain the target data.
[0116] Optionally, the second execution module 130 is specifically used to: package and encrypt the target data to generate an encrypted data file; send the encrypted data file to the second node, so that after receiving the encrypted data file, the second node uses a decentralized application to decrypt the encrypted data file to obtain the target data.
[0117] Optionally, the data access device 100 further includes a third execution module 140 and a fourth execution module 150 .
[0118] The third execution module 140 is used to approve and authorize the data access application, and to store the relevant records of the approval and authorization on the chain.
[0119] The fourth execution module 150 is used to determine the open data resources in the database; establish an open data archive of the open data resources; and publish the open data archive to the blockchain network.
[0120] Optionally, the fourth execution module 150 executes a method for establishing an open data archive of open data resources, including: obtaining identification information, field identification and data format corresponding to the open data resources; generating a data field definition, the data field definition including the field identification; generating a data format definition, the data format definition including the data format; obtaining a preset data acquisition method and data screening method to obtain an open data archive, wherein the open data archive includes identification information and metadata corresponding to the open data resources, and the metadata includes data field definition, data format definition, data acquisition method and data screening method.
[0121] Please refer to Fig.12 , Fig.12The block diagram of the data access device 200 provided by the embodiment of the present application is shown. The data access device 200 is applied to the second node, and includes: an application generation module 210, a first processing module 220 and a second processing module 230.
[0122] The application generation module 210 is used to generate a data access application based on the open data archive.
[0123] The first processing module 220 is used to broadcast the data access application to the blockchain network so that each node in the blockchain network receives the data access application.
[0124] The second processing module 230 is used to obtain target data sent by the first node, wherein the target data is data corresponding to the data access application obtained from the database by the first node after the data access application is approved and authorized, and the open data resources include the target data.
[0125] Optionally, the open data archive includes identification information and metadata corresponding to the open data resource;
[0126] Metadata includes data field definitions, data format definitions, data acquisition methods, and data screening methods of open data resources. Data field definitions include field identifiers of open data resources.
[0127] The application generation module 210 is specifically used to: respond to a first selection operation to select an open data archive; respond to a second selection operation to select a data field definition, a data format definition, a data acquisition method, and a data screening method in the open data archive to obtain a selected field identifier; use the identification information corresponding to the open data archive as target identification information, and use the selected field identifier as the target field identifier to obtain a data access application, wherein the data access application includes the target identification information and the target field identifier.
[0128] Optionally, the second processing module 230 is specifically used to: receive an encrypted data file sent by the first node, wherein the encrypted data file is generated by the first node packaging and encrypting the target data; and decrypt the encrypted data file using a decentralized application to obtain the target data.
[0129] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the data access device 100 and the data access device 200 described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0130] Please refer to Fig.13 , Fig.13The block diagram of the computer device 10 provided in the embodiment of the present application is shown. The computer device 10 can be a first node or a second node. The computer device 10 includes a processor 11, a memory 12 and a bus 13, and the processor 11 is connected to the memory 12 via the bus 13.
[0131] The memory 12 is used to store programs, such as Fig.11 The data access device 100 shown, or Fig.12 The data access device 200 shown. Taking the data access device 100 as an example, the data access device 100 includes at least one software function module that can be stored in the memory 12 in the form of software or firmware. After receiving the execution instruction, the processor 11 executes the program to implement the data access method applied to the first node disclosed in the above embodiment.
[0132] The memory 12 may include a high-speed random access memory (RAM) and may also include a non-volatile memory (NVM).
[0133] The processor 11 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 11 or by instructions in the form of software. The above processor 11 may be a general-purpose processor, including a central processing unit (CPU), a microcontroller unit (MCU), a complex programmable logic device (CPLD), a field programmable gate array (FPGA), an embedded ARM and other chips.
[0134] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 11, the data access method applied to the first node or the data access method applied to the second node disclosed in the above embodiment is implemented.
[0135] In summary, the data access method, device, computer equipment and storage medium provided by the embodiment of the present application, the data provider pre-publishes the open data archive that can represent the basic information of the open data resource in the blockchain network, and opens it to the data user. The open data resource refers to the data resource that can be openly provided; the data user selects the required open data archive according to its own needs, and sends a data access application in the blockchain network based on the open data archive; after receiving the data access application and approving the authorization, the data provider obtains the target data corresponding to the data access application from the open data resource and sends it to the data user. On the one hand, it can obtain the target data that meets its own needs by independently selecting the open data archive and the content in the open data archive, so as to meet the diversity of the needs of the data user; on the other hand, it can change the data processing requirements at any time during the data use process, and can quickly obtain the data that meets its own needs, thereby effectively improving the efficiency of development and testing work.
[0136] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A data access method, characterized in that: Applied to a first node in a blockchain network, the first node communicates with a database, the first node is a data provider, and the method includes: Receive a data access application sent by a second node in the blockchain network, wherein the second node is a data user, and the data access application is generated by the second node selecting an open data archive published in the blockchain network according to its own needs, and selecting data information to be accessed from the selected open data archive, and the open data archive is used to characterize basic information of open data resources in the database; the data access application includes target identification information and target field identification, the target identification information is the identification of the open data resource to be accessed, and the target field identification is the identification of the field in the open data resource to be accessed; When the data access application is approved and authorized, obtaining target data corresponding to the data access application from the database, wherein the open data resource includes the target data; The target data is sent to the second node.
2. The method according to claim 1, characterized in that The open data resource has corresponding identification information and includes at least one field; The step of acquiring the target data corresponding to the data access application from the database includes: According to the target identification information, determining the open data resource matching the target identification information from the database; Determining a target field from at least one field of the open data resource according to the target field identifier; The data corresponding to the target field of the open data resource is acquired from the database to obtain the target data.
3. The method according to claim 2, characterized in that The second node runs a decentralized application; The step of sending the target data to the second node comprises: Packaging and encrypting the target data to generate an encrypted data file; The encrypted data file is sent to the second node, so that after receiving the encrypted data file, the second node uses the decentralized application to decrypt the encrypted data file to obtain the target data.
4. The method according to claim 1, characterized in that Before the step of receiving the data access application sent by the second node in the blockchain network, the method further includes: identifying open data resources in the database; Establishing an open data archive of the open data resource; Publishing the open data archive to the blockchain network.
5. The method according to claim 4, characterized in that The step of establishing an open data archive of the open data resource comprises: Obtaining identification information, field identification and data format corresponding to the open data resource; Generate a data field definition, the data field definition including the field identifier; generating a data format definition, the data format definition including the data format; Obtain a preset data acquisition method and a data screening method to obtain the open data archive, wherein the open data archive includes identification information and metadata corresponding to the open data resource, and the metadata includes the data field definition, the data format definition, the data acquisition method and the data screening method.
6. The method according to claim 1, characterized in that After the step of receiving the data access application sent by the second node in the blockchain network, the method further includes: The data access application is approved and authorized, and the relevant records of the approval and authorization are stored on the chain.
7. A data access method, characterized in that: Applied to a second node in a blockchain network, the second node is a data user, an open data archive is published in the blockchain network, the open data archive is used to represent basic information of open data resources in a database communicating with a first node in the blockchain network, and the first node is a data provider; The method comprises: Select the open data archive according to its own needs, and select the data information to be accessed from the selected open data archive to generate a data access application; the data access application includes target identification information and target field identification, the target identification information is the identification of the open data resource to be accessed, and the target field identification is the identification of the field in the open data resource to be accessed; Broadcasting the data access application to the blockchain network so that each node in the blockchain network receives the data access application; Obtain target data sent by the first node, wherein the target data is data corresponding to the data access application obtained by the first node from the database after the data access application is approved and authorized, and the open data resource includes the target data.
8. The method according to claim 7, characterized in that The open data archive includes identification information and metadata corresponding to the open data resource; The metadata includes data field definition, data format definition, data acquisition method and data screening method of the open data resource, and the data field definition includes field identification of the open data resource; The step of selecting an open data archive according to one's own needs, and selecting data information to be accessed from the selected open data archive to generate a data access application includes: In response to a first selection operation, selecting the open data archive; In response to a second selection operation, the data field definition, the data format definition, the data acquisition method and the data screening method in the open data archive are selected to obtain a selected field identifier; The data access application is obtained by using the identification information corresponding to the open data archive as target identification information and the selected field identification as target field identification.
9. The method according to claim 8, characterized in that The second node runs a decentralized application; The step of obtaining the target data sent by the first node includes: Receiving an encrypted data file sent by the first node, wherein the encrypted data file is generated by the first node packaging and encrypting the target data; The encrypted data file is decrypted using the decentralized application to obtain the target data.
10. A data access device, characterized in that: Applied to a first node in a blockchain network, the first node communicates with a database, the first node is a data provider, and the device includes: An application receiving module, used to receive a data access application sent by a second node in the blockchain network, wherein the second node is a data user, and the data access application is generated by the second node selecting an open data archive published in the blockchain network according to its own needs, and selecting data information to be accessed from the selected open data archive, and the open data archive is used to characterize the basic information of the open data resources in the database; the data access application includes target identification information and target field identification, the target identification information is the identification of the open data resource to be accessed, and the target field identification is the identification of the field in the open data resource to be accessed; A first execution module, configured to obtain target data corresponding to the data access application from the database when the data access application is approved and authorized, wherein the open data resource includes the target data; The second execution module is used to send the target data to the second node.
11. A data access device, characterized in that: Applied to a second node in a blockchain network, the second node is a data user, an open data archive is published in the blockchain network, the open data archive is used to represent basic information of open data resources in a database communicating with a first node in the blockchain network, and the first node is a data provider; The device comprises: An application generation module, used to select the open data archive according to its own needs, and select the data information to be accessed from the selected open data archive to generate a data access application; the data access application includes target identification information and target field identification, the target identification information is the identification of the open data resource to be accessed, and the target field identification is the identification of the field in the open data resource to be accessed; A first processing module, configured to broadcast the data access application to the blockchain network, so that each node in the blockchain network receives the data access application; The second processing module is used to obtain target data sent by the first node, wherein the target data is data corresponding to the data access application obtained by the first node from the database after the data access application is approved and authorized, and the open data resource includes the target data.
12. A computer device, characterized in that: The computer device comprises: one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the data access method as described in any one of claims 1-6, or the data access method as described in any one of claims 7-9.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the data access method as described in any one of claims 1 to 6, or the data access method as described in any one of claims 7 to 9.
