Methods, devices, and electronic equipment for accessing shared data in consortium blockchains
By sharing data on the consortium blockchain and performing legality verification and encryption, the problem of secure access to shared data in the consortium blockchain is solved, and secure storage and access of data are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUZHOU QIYUAN INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2022-10-10
- Publication Date
- 2026-07-17
Smart Images

Figure CN115618411B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of consortium blockchain technology, and in particular to a method, apparatus and electronic device for accessing shared data in a consortium blockchain. Background Technology
[0002] Consortium blockchain technology lacks a single authoritative central node for unified management of data within the system. Each node in a consortium blockchain stores a copy of its data on its disk. This necessitates a consensus mechanism that coordinates the actions of each node to reach an agreement on blocks, thereby ensuring data consistency across all nodes.
[0003] However, consortium blockchains will have shared data among themselves, and since consortium blockchains are essentially based on the Internet, ensuring secure access to shared data has become a pressing technical problem. Summary of the Invention
[0004] To address the aforementioned issues, this application provides a method, apparatus, and electronic device for accessing shared data in a consortium blockchain.
[0005] The embodiments of this application disclose the following technical solutions:
[0006] According to a first aspect of the embodiments of this application, a method for accessing shared data in a consortium blockchain is provided, including:
[0007] Shared data that needs to be shared within the consortium blockchain and among the consortium blockchain nodes will be uploaded to the consortium blockchain.
[0008] Obtain shared data access requests generated in the consortium blockchain and verify the legitimacy of the shared data access requests;
[0009] In response to the shared data access request passing the legitimacy verification, a shared data verification message is created;
[0010] Based on the shared data verification message, verify whether the shared data access request is accessible;
[0011] In response to the shared data being accessible as indicated by the shared data access request, the public key configured for the shared data access node that initiated the shared data access request is retrieved, and the shared data indicated by the shared data access request is encrypted to obtain the shared ciphertext data sent to the shared data access node.
[0012] Optionally, the legitimacy of the shared data access request is verified, including: the legitimacy authentication node obtains the key pair of the shared data access node that initiated the shared data access request and the identity information corresponding to that node; and the corresponding shared data access node performs legitimacy authentication based on the key pair of the shared data access node that initiated the shared data access request and the identity information corresponding to that node.
[0013] Optionally, in response to the shared data access request passing the validity verification, a shared data verification message is created, including: in response to the shared data access request passing the validity verification, loading the identity of the shared data access node that initiated the shared data access request, the access type, the hash value of the shared data access request, and the contract address of the shared data pointed to by the shared data access request into a four-element array, and using the four-element array as the shared data verification message.
[0014] Optionally, based on the shared data verification message, verify whether the shared data pointed to by the shared data access request is accessible, including: based on the shared data verification message, parsing the circulation description certificate of the shared data pointed to by the shared data access request to obtain the field value representing whether sharing is allowed, and determining whether the shared data is accessible based on the field value.
[0015] Optionally, shared data that needs to be shared in the consortium blockchain and among the consortium blockchain nodes can be uploaded to the consortium blockchain. This includes: obtaining the shared data to be stored in the consortium blockchain and shared among the consortium blockchain nodes; dividing the shared data into multiple data blocks of the same size according to a set data slicing model; generating a data digest for each data block and constructing an entity object for each data block; and uploading the shared data to the consortium blockchain based on the multiple data blocks and the corresponding entity objects.
[0016] Optionally, based on multiple data blocks and their corresponding entity objects, the shared data is uploaded to the consortium blockchain, including: assigning a unique identifier to each entity object and performing a hash operation on the unique identifier of each entity object to convert the unique identifier corresponding to each entity object into a first pseudo-random number; and uploading the shared data to the consortium blockchain based on the first pseudo-random number corresponding to the unique identifier of the multiple data blocks and their corresponding entity objects.
[0017] Optionally, based on multiple data blocks and the first pseudo-random number corresponding to the unique identifier of the corresponding entity object, the shared data is uploaded to the consortium blockchain, including: retrieving a predefined array with expandable data structure elements to load the data digest corresponding to each data block, the unique identifier of the corresponding entity object, and the corresponding first pseudo-random number into a data structure element in the array respectively; and uploading all arrays containing the data digests, unique identifiers of the corresponding entity objects, and the corresponding first pseudo-random numbers of all data blocks to the consortium blockchain for sharing among the consortium blockchain nodes.
[0018] Optionally, based on the set data segmentation model, the shared data is segmented to obtain multiple data blocks of the same size, including: performing cyclic stacking based on the set data segmentation iterator to segment the shared data to obtain multiple data blocks of the same size.
[0019] Optionally, for each data block, a data digest is generated, including: extracting fingerprint features of each data block according to a set data sliding window, assigning corresponding fingerprint feature indices to the extracted fingerprint features, and assembling all the extracted fingerprint features in the order of the fingerprint feature indices to generate a data digest.
[0020] Optionally, a unique identifier is assigned to each entity object, including: constructing an entity object for each data block, and generating a random number for each entity object and assigning it to the corresponding entity object as the corresponding unique identifier.
[0021] Optionally, an entity object is constructed for each data block, and a random number is generated for each entity object and assigned to the corresponding entity object as a unique identifier. This includes: constructing an entity object for each data block, generating a random number for each entity object according to the logical order between data blocks, and assigning the assigned random number to the corresponding entity object as a unique identifier.
[0022] Optionally, a hash operation is performed on the unique identifier of each entity object to convert the unique identifier corresponding to each entity object into a first pseudo-random number, including: performing a hash operation on the unique identifier of the current entity object to generate a random number, and performing a linear transformation on the random number to obtain the random number corresponding to the unique identifier of the next entity object.
[0023] According to a second aspect of the embodiments of this application, an access device for shared data in a consortium blockchain is provided, comprising:
[0024] The first program unit is used to upload shared data that needs to be shared in the consortium blockchain and among the consortium blockchain nodes to the consortium blockchain.
[0025] The second program unit is used to obtain shared data access requests generated in the consortium blockchain and to verify the legitimacy of the shared data access requests.
[0026] The third program unit is used to create a shared data verification message in response to the shared data access request passing the legality verification.
[0027] The fourth program unit is used to check whether the shared data access request is accessible based on the shared data verification message.
[0028] The fifth program unit is used to respond to the shared data being accessible in the shared data access request, retrieve the encryption public key configured for the shared data access node that initiated the shared data access request, encrypt the shared data being accessed in the shared data access request, and obtain the shared ciphertext data to be sent to the shared data access node.
[0029] Optionally, the second program unit is further configured to: obtain the key pair of the shared data access node that initiated the shared data access request and the identity information corresponding to that node; and perform legitimacy authentication on the corresponding shared data access node based on the key pair of the shared data access node that initiated the shared data access request and the identity information corresponding to that node.
[0030] Optionally, the third program unit is further configured to: in response to the shared data access request passing the legality verification, load the identity identifier of the shared data access node that initiated the shared data access request, the access type, the hash value of the shared data access request, and the contract address of the shared data pointed to by the shared data access request into a quadruple array, and use the quadruple array as a shared data verification message.
[0031] Optionally, the fourth program unit is further configured to: based on the shared data verification message, parse the circulation description proof of the shared data pointed to by the shared data access request to obtain the field value representing whether sharing is allowed, and determine whether the shared data is accessible based on the field value.
[0032] Optionally, the first program unit is further configured to: acquire shared data to be stored in the consortium blockchain and shared among the consortium blockchain nodes; divide the shared data into multiple data blocks of the same size according to the set data slicing model; generate a data digest for each data block and construct an entity object for each data block; and upload the shared data to the consortium blockchain according to the multiple data blocks and the corresponding entity objects.
[0033] Optionally, the first program unit is further configured to: assign a unique identifier to each entity object, and perform a hash operation on the unique identifier of each entity object to convert the unique identifier corresponding to each entity object into a first pseudo-random number; and upload the shared data to the consortium blockchain based on multiple data blocks and the first pseudo-random number corresponding to the unique identifier of the corresponding entity object.
[0034] Optionally, the first program unit is further configured to: retrieve a predefined, expandable array with data structure elements, and load the data digest corresponding to each data block, the unique identifier of the corresponding entity object, and the corresponding first pseudo-random number into a data structure element in the array respectively; and upload all arrays containing the data digests corresponding to all data blocks, the unique identifiers of the corresponding entity objects, and the corresponding first pseudo-random numbers to the consortium blockchain for sharing among the consortium blockchain nodes.
[0035] Optionally, the first program unit is further configured to: perform cyclic stacking according to a set data segmentation iterator to segment the shared data into multiple data blocks of the same size.
[0036] Optionally, the first program unit is further configured to: extract fingerprint features of each data block according to a set data sliding window, assign corresponding fingerprint feature indices to the extracted fingerprint features, and assemble all the extracted fingerprint features in the order of the fingerprint feature indices to generate a data digest.
[0037] Optionally, the first program unit is further configured to: construct an entity object for each data block, and generate a random number for each entity object and assign it to the corresponding entity object as a unique identifier.
[0038] Optionally, the first program unit is further configured to: construct an entity object for each data block, generate a random number for each entity object according to the logical order between the data blocks, and assign the random number to the corresponding entity object as a unique identifier.
[0039] Optionally, the first program unit is further configured to: perform a hash operation on the unique identifier of the current entity object to generate a random number, and perform a linear transformation on the random number to obtain a random number corresponding to the unique identifier of the next entity object.
[0040] According to a third aspect of the embodiments of this application, an electronic device is provided, including a memory and a processor. The memory stores an executable program, and when the processor runs the executable program, it performs the following steps:
[0041] Shared data that needs to be shared within the consortium blockchain and among the consortium blockchain nodes will be uploaded to the consortium blockchain.
[0042] Obtain shared data access requests generated in the consortium blockchain and verify the legitimacy of the shared data access requests;
[0043] In response to the shared data access request passing the legitimacy verification, a shared data verification message is created;
[0044] Based on the shared data verification message, verify whether the shared data access request is accessible;
[0045] In response to the shared data being accessible as indicated by the shared data access request, the public key configured for the shared data access node that initiated the shared data access request is retrieved, and the shared data indicated by the shared data access request is encrypted to obtain the shared ciphertext data sent to the shared data access node.
[0046] In the technical solution of this application embodiment, shared data that needs to be shared in the consortium blockchain and among the consortium blockchain nodes is uploaded to the consortium blockchain; shared data access requests generated in the consortium blockchain are obtained and their legality is verified; in response to the shared data access request passing the legality verification, a shared data verification message is created; based on the shared data verification message, it is verified whether the shared data pointed to by the shared data access request is accessible; in response to the shared data pointed to by the shared data access request being in an accessible state, the encryption public key configured for the shared data access node that initiated the shared data access request is retrieved, and the shared data pointed to by the shared data access request is encrypted to obtain shared ciphertext data sent to the shared data access node, thereby achieving secure access to shared data. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating a method for accessing shared data in a consortium blockchain according to an embodiment of this application.
[0049] Figure 2 This is a schematic diagram of the structure of an access device for shared data in a consortium blockchain according to an embodiment of this application;
[0050] Figure 3 This is a schematic diagram of the structure of the electronic device in the embodiments of this application;
[0051] Figure 4 This is a schematic diagram of the hardware structure of the electronic device in the embodiments of this application. Detailed Implementation
[0052] Implementing any technical solution of the embodiments of this application does not necessarily require achieving all of the above advantages at the same time.
[0053] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] In the technical solution of this application embodiment, shared data that needs to be shared in the consortium blockchain and among the consortium blockchain nodes is uploaded to the consortium blockchain; a shared data access request generated in the consortium blockchain is obtained, and the legality of the shared data access request is verified; in response to the shared data access request passing the legality verification, a shared data verification message is created; according to the shared data verification message, it is verified whether the shared data pointed to by the shared data access request is accessible; in response to the shared data pointed to by the shared data access request being in an accessible state, the encryption public key configured for the shared data access node that initiated the shared data access request is retrieved, and the shared data pointed to by the shared data access request is encrypted to obtain the shared ciphertext data sent to the shared data access node, thereby realizing secure access to the shared data.
[0055] Figure 1 This is a flowchart illustrating a method for accessing shared data in a consortium blockchain, as described in an embodiment of this application. Figure 1 As shown, it includes:
[0056] S101. Upload the shared data that needs to be shared in the consortium blockchain and among the consortium blockchain nodes to the consortium blockchain.
[0057] S102. Obtain the shared data access request generated in the consortium blockchain and verify the legality of the shared data access request;
[0058] S103. In response to the shared data access request passing the legality verification, a shared data verification message is created;
[0059] S104. Based on the shared data verification message, verify whether the shared data pointed to by the shared data access request is accessible;
[0060] S105. In response to the shared data pointed to by the shared data access request being in an accessible state, the encryption public key configured for the shared data access node that initiated the shared data access request is retrieved, and the shared data pointed to by the shared data access request is encrypted to obtain the shared ciphertext data sent to the shared data access node.
[0061] Optionally, the legitimacy verification of the shared data access request includes:
[0062] The legitimacy authentication node obtains the key pair of the shared data access node that initiated the shared data access request, as well as the identity information corresponding to that node;
[0063] Based on the key pair of the shared data access node in the shared data access request and the identity information corresponding to that node, the corresponding shared data access node performs legitimacy authentication.
[0064] In this embodiment, based on the key pair of the shared data access node in the shared data access request and the identity information corresponding to the node, dual authentication of the shared data access node can be achieved, ensuring the strength of the authentication.
[0065] Optionally, the step of creating a shared data verification message in response to the shared data access request passing the legitimacy verification includes: loading the identity identifier of the shared data access node that initiated the shared data access request, the access type, the hash value of the shared data access request, and the contract address of the shared data pointed to by the shared data access request into a four-element array, and using the four-element array as the shared data verification message.
[0066] In this embodiment, the quadruple is used to store the identity identifier of the shared data access node, the access type, the hash value of the shared data access request, and the contract address of the shared data pointed to by the shared data access request. This allows the quadruple to be quickly invoked when needed in subsequent steps, thereby improving the speed of algorithm execution.
[0067] Optionally, the step of verifying whether the shared data pointed to by the shared data access request is accessible based on the shared data verification message includes: parsing the circulation description certificate of the shared data pointed to by the shared data access request based on the shared data verification message to obtain a field value representing whether sharing is allowed, and determining whether the shared data is accessible based on the field value.
[0068] In this embodiment, based on the shared data verification message, the circulation description proof of the shared data pointed to by the shared data access request is parsed, and then the circulation description proof of the shared data pointed to by the shared data access request is further analyzed to obtain the field value representing whether sharing is allowed, so as to accurately determine whether the shared data is accessible.
[0069] Optionally, the step of uploading shared data that needs to be stored in the consortium blockchain and shared among the consortium blockchain nodes to the consortium blockchain includes: obtaining the shared data to be stored in the consortium blockchain and shared among the consortium blockchain nodes; dividing the shared data into multiple data blocks of the same size according to a set data slicing model; generating a data digest for each data block and constructing an entity object for each data block; and uploading the shared data to the consortium blockchain based on the multiple data blocks and the corresponding entity objects.
[0070] In this embodiment, by dividing the shared data into data blocks, it is convenient to construct entity objects for each data block, thereby realizing implicit processing of the data blocks and ensuring the security of the data blocks.
[0071] Optionally, the step of uploading the shared data to the consortium blockchain based on the multiple data blocks and their corresponding entity objects includes: assigning a unique identifier to each entity object and performing a hash operation on the unique identifier of each entity object to convert the unique identifier corresponding to each entity object into a first pseudo-random number; and uploading the shared data to the consortium blockchain based on the first pseudo-random number corresponding to the unique identifier of the multiple data blocks and their corresponding entity objects.
[0072] In this embodiment, instead of assigning unique identifiers to data blocks, unique identifiers are assigned to corresponding entity objects. Then, the shared data is uploaded to the consortium blockchain based on a first pseudo-random number obtained by hashing the unique identifier of each entity object. This ensures that the data blocks are not directly exposed and achieves secure storage of shared data.
[0073] Optionally, the step of uploading the shared data to the consortium blockchain based on the first pseudo-random number corresponding to the unique identifier of the corresponding entity object and the multiple data blocks includes: retrieving a predefined array with expandable data structure elements to load the data digest corresponding to each data block, the unique identifier of the corresponding entity object, and the corresponding first pseudo-random number into a data structure element in the array; and uploading all arrays containing the data digests, unique identifiers of the corresponding entity objects, and first pseudo-random numbers of all data blocks to the consortium blockchain for sharing among the consortium blockchain nodes.
[0074] In this embodiment, based on an array with expandable data structure elements, on the one hand, it can load all arrays of data digests corresponding to all data blocks, unique identifiers of the corresponding entity objects, and the corresponding first pseudo-random numbers; on the other hand, when the data volume needs to be expanded, it can be expanded directly, improving the flexibility of algorithm execution.
[0075] Optionally, the step of dividing the shared data into multiple data blocks of the same size according to the set data segmentation model includes: performing cyclic superposition according to the set data segmentation iterator to divide the shared data into multiple data blocks of the same size.
[0076] In this embodiment, the data segmentation iterator can be cyclically superimposed to quickly segment several blocks while ensuring that the size of the segmented data blocks is the same.
[0077] Optionally, generating a data digest for each data block includes: extracting fingerprint features of each data block according to a set data sliding window, assigning corresponding fingerprint feature indices to the extracted fingerprint features, and assembling all the extracted fingerprint features in the order of the fingerprint feature indices to generate a data digest.
[0078] In this embodiment, the fingerprint feature index is obtained through the fingerprint features of the data block, which can quickly and orderly assemble the fingerprint features to obtain the corresponding data digest, thereby ensuring the security of the data block.
[0079] Optionally, assigning a unique identifier to each entity object includes: constructing an entity object for each data block, and generating a random number for each entity object and assigning it to the corresponding entity object as a unique identifier.
[0080] Optionally, the step of constructing an entity object for each data block and generating a random number for each entity object and assigning it to the corresponding entity object as a unique identifier includes: constructing an entity object for each data block, generating a random number for each entity object according to the logical order between the data blocks and assigning it to the corresponding entity object as a unique identifier.
[0081] In this embodiment, according to the logical order between the data blocks, a random number is generated for each entity object and assigned to the corresponding entity object as a unique identifier. This ensures that the unique identifier itself has a temporal sequence, and at the same time, the security of the unique representation is guaranteed by the participation of random numbers.
[0082] Optionally, the step of performing a hash operation on the unique identifier of each entity object to convert the unique identifier corresponding to each entity object into a first pseudo-random number includes: performing a hash operation on the unique identifier of the current entity object to generate a random number, and performing a linear transformation on the random number to obtain a random number corresponding to the unique identifier of the next entity object.
[0083] Figure 2 This is a schematic diagram of the structure of an access device for shared data in a consortium blockchain, according to an embodiment of this application; Figure 2 As shown, it includes:
[0084] The first program unit 201 is used to upload shared data that needs to be shared in the consortium blockchain and among the consortium blockchain nodes to the consortium blockchain.
[0085] The second program unit 202 is used to obtain shared data access requests generated in the consortium blockchain and to verify the legality of the shared data access requests.
[0086] The third program unit 203 is used to create a shared data verification message in response to the shared data access request passing the legality verification.
[0087] The fourth program unit 204 is used to check whether the shared data pointed to by the shared data access request is accessible based on the shared data verification message;
[0088] The fifth program unit 205 is used to, in response to the shared data pointed to by the shared data access request being in an accessible state, retrieve the encryption public key configured for the shared data access node that initiated the shared data access request, encrypt the shared data pointed to by the shared data access request to obtain the shared ciphertext data sent to the shared data access node.
[0089] Optionally, the second program unit 202 is further configured to: obtain the key pair of the shared data access node that initiated the shared data access request and the identity information corresponding to the node; and perform legitimacy authentication on the corresponding shared data access node based on the key pair of the shared data access node that initiated the shared data access request and the identity information corresponding to the node.
[0090] Optionally, the third program unit 203 is further configured to: in response to the shared data access request passing the legality verification, load the identity identifier of the shared data access node that initiated the shared data access request, the access type, the hash value of the shared data access request, and the contract address of the shared data pointed to by the shared data access request into a quadruple array, and use the quadruple array as the shared data verification message.
[0091] Optionally, the fourth program unit 204 is further configured to: based on the shared data verification message, parse the circulation description certificate of the shared data pointed to by the shared data access request to obtain a field value representing whether sharing is allowed, and determine whether the shared data is accessible based on the field value.
[0092] Optionally, the first program unit 201 is further configured to: acquire the shared data to be stored in the consortium blockchain and shared among the consortium blockchain nodes; divide the shared data into multiple data blocks of the same size according to a set data slicing model; generate a data digest for each data block and construct an entity object for each data block; and upload the shared data to the consortium blockchain according to the multiple data blocks and the corresponding entity objects.
[0093] Optionally, the first program unit 201 is further configured to: assign a unique identifier to each entity object, and perform a hash operation on the unique identifier of each entity object to convert the unique identifier corresponding to each entity object into a first pseudo-random number; and upload the shared data to the consortium blockchain according to the multiple data blocks and the first pseudo-random number corresponding to the unique identifier of the corresponding entity object.
[0094] Optionally, the first program unit 201 is further configured to: retrieve a predefined array with expandable data structure elements, and load the data digest corresponding to each data block, the unique identifier of the corresponding entity object, and the corresponding first pseudo-random number into a data structure element in the array respectively; and upload all arrays containing the data digests corresponding to all data blocks, the unique identifiers of the corresponding entity objects, and the corresponding first pseudo-random numbers to the consortium blockchain for sharing among the consortium blockchain nodes.
[0095] Optionally, the first program unit 201 is further configured to: perform cyclic superposition according to a set data segmentation iterator to segment the shared data into multiple data blocks of the same size.
[0096] Optionally, the first program unit 201 is further configured to: extract fingerprint features of each data block according to a set data sliding window, assign corresponding fingerprint feature indexes to the extracted fingerprint features, and assemble all the extracted fingerprint features in the order of the fingerprint feature indexes to generate a data digest.
[0097] Optionally, the first program unit 201 is further configured to: construct an entity object for each data block, and generate a random number for each entity object by means of random number generation and assign it to the corresponding entity object as a unique identifier.
[0098] Optionally, the first program unit 201 is further configured to: construct an entity object for each data block, generate a random number for each entity object according to the logical order between the data blocks, and assign it to the corresponding entity object as a unique identifier.
[0099] Optionally, the first program unit 201 is further configured to: perform a hash operation on the unique identifier of the current entity object to generate a random number, and perform a linear transformation on the random number to obtain a random number corresponding to the unique identifier of the next entity object.
[0100] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application; as shown Figure 3 As shown, it includes a memory 301 and a processor 302. The memory stores an executable program, and when the processor runs the executable program, it performs the following steps:
[0101] Shared data that needs to be shared in the consortium blockchain and among the consortium blockchain nodes will be uploaded to the consortium blockchain.
[0102] Obtain shared data access requests generated in the consortium blockchain and verify the legitimacy of the shared data access requests;
[0103] In response to the shared data access request passing the legitimacy verification, a shared data verification message is created;
[0104] Based on the shared data verification message, verify whether the shared data pointed to by the shared data access request is accessible;
[0105] In response to the shared data being accessible as indicated by the shared data access request, the encryption public key configured for the shared data access node that initiated the shared data access request is retrieved, and the shared data is encrypted to obtain the shared ciphertext data sent to the shared data access node.
[0106] Figure 4 This is a schematic diagram of the hardware structure of the electronic device in the embodiments of this application; as shown Figure 4 As shown, the hardware structure of this electronic device may include: Electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 402 or a computer program loaded from storage unit 406 into random access memory (RAM) 403. The RAM 403 may also store various programs and data required for the operation of device 400. The computing unit 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.
[0107] Multiple components in electronic device 400 are connected to I / O interface 405, including: input unit 406, output unit 407, storage unit 408, and communication unit 409. Input unit 406 can be any type of device capable of inputting information to electronic device 400. Input unit 406 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 407 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 404 may include, but is not limited to, disks and optical discs. Communication unit 409 allows electronic device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0108] The computing unit 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above. For example, in some embodiments, the above steps can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 40*. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 400 via ROM 402 and / or communication unit 409. In some embodiments, the computing unit 401 can be configured to perform the above steps by any other suitable means (e.g., by means of firmware).
[0109] The electronic devices in this application embodiments exist in various forms, including but not limited to:
[0110] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include: smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones, etc.
[0111] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.
[0112] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes audio and video players (such as iPods), handheld game consoles, e-book readers, as well as smart toys and portable car navigation devices.
[0113] (4) Server: A device that provides computing services. The components of a server include a processor 410, hard disk, memory, system bus, etc. Servers are similar to general computer architectures, but because they need to provide highly reliable services, they have higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0114] (5) Other electronic devices with data interaction functions.
[0115] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components indicated as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0116] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for accessing shared data in a consortium blockchain, characterized in that, include: Obtain the shared data to be stored in the consortium blockchain and shared among the consortium blockchain nodes; According to the established data segmentation model, the shared data is segmented into multiple data blocks of the same size; for each data block, a data digest is generated, and an entity object is constructed for each data block; for each data block, an entity object is constructed, and for each entity object, a random number is generated and assigned to the corresponding entity object as a unique identifier; and a hash operation is performed on the unique identifier of each entity object to convert the unique identifier corresponding to each entity object into a first pseudo-random number; A predefined, expandable array with data structure elements is retrieved to load the data digest corresponding to each data block, the unique identifier of the corresponding entity object, and the corresponding first pseudo-random number into a data structure element in the array; all arrays containing the data digests, unique identifiers of the corresponding entity objects, and the corresponding first pseudo-random numbers of all data blocks are uploaded to the consortium blockchain for sharing among the consortium blockchain nodes. The system obtains shared data access requests generated in the consortium blockchain and verifies the legitimacy of these requests. The legitimacy verification includes: the legitimacy authentication node obtaining the key pair of the shared data access node that initiated the shared data access request and the identity information corresponding to that node; and the corresponding shared data access node performing legitimacy authentication based on the key pair of the shared data access node that initiated the shared data access request and the identity information corresponding to that node. In response to the shared data access request passing the legality verification, the identity identifier of the shared data access node that initiated the shared data access request, the access type, the hash value of the shared data access request, and the contract address of the shared data pointed to by the shared data access request are loaded into a four-element array, and the four-element array is used as the shared data verification message; Based on the shared data verification message, the circulation description certificate of the shared data pointed to by the shared data access request is parsed to obtain the field value representing whether sharing is allowed, and the shared data is determined to be accessible based on the field value. In response to the shared data being accessible as indicated by the shared data access request, the public key configured for the shared data access node that initiated the shared data access request is retrieved, and the shared data is encrypted to obtain shared ciphertext data to be sent to the shared data access node.
2. The method for accessing shared data in a consortium blockchain according to claim 1, characterized in that, The step of dividing the shared data into multiple data blocks of the same size according to the set data segmentation model includes: performing cyclic superposition according to the set data segmentation iterator to divide the shared data into multiple data blocks of the same size.
3. The method for accessing shared data in a consortium blockchain according to claim 1, characterized in that, The step of generating a data digest for each data block includes: extracting fingerprint features of each data block according to a set data sliding window, assigning corresponding fingerprint feature indices to the extracted fingerprint features, and assembling all the extracted fingerprint features in the order of the fingerprint feature indices to generate a data digest.