Alliance chain data processing method and device, equipment, storage medium and program product
By responding to the data on-chain information in the alliance chain, selecting the target storage node and performing consensus storage, combined with the main chain, side chain, and seed chain models, the problems of low processing efficiency and high storage cost of different types of data are solved, and high efficiency is achieved. , economical data storage.
Patent Information
- Application Number
- CN202410834349.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-10-22
AI Technical Summary
Existing technologies cannot effectively handle different types of data processing scenarios, resulting in low data processing efficiency and high storage costs.
By responding to the data on-chain information in the alliance chain node, determine the data type and select the target storage node, generate the on-chain block for consensus, send the data to the target storage node for storage, use idle nodes and storage space capacity for optimization, and use the main Schemas of chains, sidechains, and seed chains store associated data.
It achieves efficient storage of different types of data, reduces storage costs, improves data processing efficiency, and relieves the storage pressure of the alliance chain.
Smart Images

Figure CN118820239A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a consortium chain data processing method, device, equipment, storage medium and program product. Background Art
[0002] With the vigorous development of the big data era, the amount of data that needs to be stored is also increasing, but the current data storage efficiency is low. Currently, data is stored in all nodes of the alliance chain. For large-capacity data, it will bring huge storage pressure and storage costs to the entire alliance chain. Therefore, it is currently impossible to take into account the multi-node consensus storage in the blockchain and the storage space and cost of the blockchain, and it is impossible to cope with the processing scenarios of different types of data, resulting in low data processing efficiency and high data storage costs. Summary of the invention
[0003] The main purpose of the present invention is to provide a consortium chain data processing method, device, equipment, storage medium and program product, aiming to solve the technical problem that the existing technology cannot cope with processing scenarios of different types of data, resulting in low data processing efficiency and high data storage cost.
[0004] To achieve the above object, the present invention provides a consortium chain data processing method, which is executed by a consortium chain node and includes the following steps:
[0005] In response to the data uplink information, determine the data type of the uplink data according to the data uplink information;
[0006] Determine a target storage node in the alliance chain node according to the data type;
[0007] Generate an on-chain block based on the on-chain data, and publish the on-chain block to the alliance chain for consensus;
[0008] In response to consensus reached by the alliance chain nodes in the alliance chain, the on-chain data is sent to the target storage node so that the target storage node stores the on-chain data.
[0009] Optionally, the on-chain data includes first type data; when the on-chain data is first type data, determining a target storage node in the alliance chain node according to the data type includes:
[0010] Send status inquiries to each alliance chain node to determine the current storage space capacity and current consensus status of each alliance chain node;
[0011] Determine an idle node in the alliance chain node based on the current consensus state;
[0012] The target storage node is selected from the idle nodes according to the current storage space capacity of each alliance chain node and the response information of each alliance chain node to the status inquiry.
[0013] Optionally, the selecting a target storage node from the idle nodes according to the current storage space capacity of each alliance chain node and the response information of each alliance chain node to the status query includes:
[0014] Sort the current storage space capacity of each idle node to obtain the space capacity sorting result;
[0015] Sort the idle nodes according to the response information of each alliance chain node to the status query and the space capacity sorting result to obtain the idle node sorting result;
[0016] The target storage node is selected from the idle nodes based on the preset consensus node quantity corresponding to the first type of data and the idle node sorting result.
[0017] Optionally, the on-chain data also includes a second type of data, which is usage-related data of the first type of data. The second type of data includes associated identification data, user identification data and usage data. The alliance chain includes a main chain, a side chain and a seed chain. The associated identification data is stored in the main chain, the user identification data is stored in the side chain, the usage data is stored in the seed chain, the seed chain is connected to the side chain block in the side chain, and the side chain is connected to the main chain block in the main chain.
[0018] Optionally, when the uplink data is the second type of data, after sending the uplink data to the target storage node, the method further includes:
[0019] In response to receiving the second type of data, determining a target main chain block in the main chain associated with the second type of data based on the associated identification data of the second type of data;
[0020] Determine a target side chain block in the side chain associated with the second type of data based on the user identification data of the second type of data;
[0021] Acquiring data usage information according to the usage data of the second type of data;
[0022] Determine the current block state of the seed chain corresponding to the target side chain block;
[0023] A target seed chain block is generated based on the current block state and the data usage information, and the target seed chain block is mounted on the seed chain corresponding to the target side chain block.
[0024] Optionally, after sending the on-chain data to the target storage node, the method further includes:
[0025] In response to a data offline request, obtaining a data identifier of the data to be offline based on the data offline request;
[0026] Generate an offline block based on the data identifier, and publish the offline block to the alliance chain for consensus;
[0027] In response to consensus reached by the alliance chain nodes in the alliance chain, the first type of data corresponding to the data identifier and the second type of data associated with the first type of data are deleted.
[0028] In addition, to achieve the above-mentioned purpose, the present invention also proposes a consortium chain data processing device, the consortium chain data processing device comprising:
[0029] An uplink response module, configured to respond to the data uplink information and determine the data type of the uplink data according to the data uplink information;
[0030] A node selection module, used to determine a target storage node in the alliance chain node according to the data type;
[0031] An on-chain consensus module, used to generate an on-chain block based on the on-chain data, and publish the on-chain block to the alliance chain for consensus;
[0032] The data processing module is used to send the on-chain data to the target storage node in response to the consensus reached by the alliance chain nodes in the alliance chain, so that the target storage node stores the on-chain data.
[0033] In addition, to achieve the above-mentioned objectives, the present application also proposes a consortium chain data processing device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the consortium chain data processing method as described above.
[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the alliance chain data processing method described above are implemented.
[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the alliance chain data processing method described above.
[0036] The present invention responds to data on-chain information, determines the data type of the on-chain data according to the data on-chain information, determines the target storage node in the alliance chain node according to the data type, generates an on-chain block based on the on-chain data, publishes the on-chain block to the alliance chain for consensus, and in response to the alliance chain nodes in the alliance chain reaching a consensus, sends the on-chain data to the target storage node so that the target storage node stores the on-chain data, thereby adaptively selecting different nodes for storage for different types of data, realizing rapid storage of complete data while achieving storage cost economy, effectively improving data storage efficiency, and reducing data storage costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 It is a structural diagram of a consortium chain data processing device in a hardware operating environment involved in an embodiment of the present invention;
[0040] Figure 2 This is a flow chart of the first embodiment of the alliance chain data processing method of the present invention;
[0041] Figure 3 This is a flow chart of the second embodiment of the alliance chain data processing method of the present invention;
[0042] Figure 4 This is a flow chart of the third embodiment of the alliance chain data processing method of the present invention;
[0043] Figure 5 This is a schematic diagram of storage of the second type of data in the third embodiment of the alliance chain data processing method of the present invention;
[0044] Figure 6 This is a structural block diagram of the first embodiment of the alliance chain data processing device of the present invention.
[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0047] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of the consortium chain data processing device in the hardware operating environment involved in the embodiment of the present invention.
[0048] like Figure 1 As shown, the alliance chain data processing device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0049] Those skilled in the art will understand that Figure 1 The structure shown in does not constitute a limitation on the alliance chain data processing device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0050] like Figure 1 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a consortium chain data processing program.
[0051] exist Figure 1 In the alliance chain data processing device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the alliance chain data processing device of the present invention can be set in the alliance chain data processing device, and the alliance chain data processing device calls the alliance chain data processing program stored in the memory 1005 through the processor 1001, and executes the alliance chain data processing method provided by the embodiment of the present invention.
[0052] The embodiment of the present invention provides a method for processing alliance chain data. Figure 2 , Figure 2 This is a flow chart of the first embodiment of the alliance chain data processing method of the present invention.
[0053] In this embodiment, the alliance chain data processing method is executed by the alliance chain node, and the alliance chain data processing method includes the following steps:
[0054] Step S10: In response to the data uplink information, determine the data type of the uplink data according to the data uplink information.
[0055] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes the alliance chain data processing device (hereinafter referred to as the data processing device) as an example to illustrate this embodiment and the following embodiments.
[0056] It should be noted that the data uplink information may be a data uplink request or uplink instruction, etc. The above data type may be a capacity type of the uplink data, or a data attribute type of the uplink data.
[0057] It can be understood that the data on-chain information can be sent to the alliance chain node in the alliance chain according to the on-chain interface of the alliance chain.
[0058] In some embodiments, the data on the chain may include but is not limited to large-capacity data and small-capacity data, etc. The large-capacity data may be large-capacity data such as large model code and large model training data, and the large-capacity data may be data with GB or TB as storage units and occupying a large space. The small-capacity data may be data of tracking algorithms related to large-capacity data, for example, small-capacity data may be model usage data of large model data, etc. Small-capacity data may be stored in MB as storage units, occupying less space, but with a large number of users and the number of times the same user uses it.
[0059] In some embodiments, the data processing device may establish a consortium chain. The main steps of establishing the consortium chain are as follows:
[0060] Step 1. Alliance members such as various AI large model platforms, users, GPU service providers, etc. apply to join the alliance chain;
[0061] Step 2: The blockchain alliance reviews the application in step 1. If the review fails, the step ends; if the review passes, proceed to step 3;
[0062] Step 3: The alliance chain administrator allocates alliance node-related accounts (including alliance codes) and public and private keys to approved alliance members such as AI large model platforms, users, and GPU service providers on the alliance node management platform;
[0063] Step 4. Each newly joined alliance member, such as the AI large model platform, user, GPU service provider, etc., deploys the alliance node according to the account and code in step 3. If the AI large model platform, user, GPU service provider, etc., is deployed for the first time along with the alliance chain, the data in the alliance chain is empty at this time; if the AI large model platform, user, GPU service provider, etc., joins during the operation of the alliance chain, it will first synchronize the existing data from other nodes. After the data synchronization is completed, it will officially become an alliance chain node, a node with the ability to provide external data on-chain reading and writing capabilities.
[0064] Step S20: Determine the target storage node in the alliance chain node according to the data type.
[0065] It should be noted that this embodiment selects corresponding data storage strategies based on different data types, that is, adaptively selects alliance chain nodes for data storage according to different data types.
[0066] In some embodiments, for large-capacity data, a portion of alliance chain nodes can be selected for data storage. Because large-capacity data occupies a large space and has a high storage cost, selecting a portion of alliance chain nodes to store large-capacity data can effectively save the storage space and storage cost of the entire blockchain.
[0067] In some embodiments, for small-capacity data, all alliance chain nodes can be selected for storage, because small-capacity data occupies less space and has lower storage costs. Therefore, when facing small-capacity data, the target storage node can be all alliance chain nodes in the alliance chain.
[0068] Step S30: Generate an on-chain block based on the on-chain data, and publish the on-chain block to the alliance chain for consensus.
[0069] It should be noted that the data processing device packages the node information of the target storage node into blocks, publishes them to the alliance chain (i.e. blockchain), and achieves full-chain consensus with the support of the consensus algorithm.
[0070] Step S40: In response to the alliance chain nodes in the alliance chain reaching a consensus, the on-chain data is sent to the target storage node, so that the target storage node stores the on-chain data.
[0071] It should be noted that after completing the full-chain consensus, the data processing device will send the on-chain data to the target storage node. After each target storage node completes local storage, it will send storage completion status information to the data processing device. After receiving it, the data processing device can confirm that the data has been successfully uploaded to the chain.
[0072] It can be understood that if a node fails to send storage completion status information to the data processing device within the specified time, it means that there is a problem with the node receiving data. The data processing device sends the corresponding data to the node again. After the node completes local storage, it sends storage completion status information to the data processing device. After receiving it, the data processing device can confirm that the data has been successfully uploaded to the chain.
[0073] This embodiment responds to data on-chain information, determines the data type of the on-chain data according to the data on-chain information, determines the target storage node in the alliance chain node according to the data type, generates an on-chain block based on the on-chain data, publishes the on-chain block to the alliance chain for consensus, and in response to the alliance chain nodes in the alliance chain reaching a consensus, sends the on-chain data to the target storage node so that the target storage node stores the on-chain data, thereby adaptively selecting different nodes for storage for different types of data, achieving rapid storage of complete data while achieving storage cost economy, effectively improving data storage efficiency, and reducing data storage costs.
[0074] refer to Figure 3 , Figure 3 This is a flow chart of the second embodiment of the alliance chain data processing method of the present invention.
[0075] Based on the above first embodiment, in this embodiment, the uplink data includes first type data; when the uplink data is the first type data, the step S20 further includes:
[0076] Step S201: Send a status query to each alliance chain node to determine the current storage space capacity and current consensus status of each alliance chain node.
[0077] It should be noted that the first type of data may be large-capacity data, which may be large-capacity data such as large model code and large model training data, and which may be data that is stored in GB or TB and occupies a large space.
[0078] It should be noted that the current storage space capacity may be the current remaining storage space size of each alliance chain node. The above-mentioned current consensus state may be the state of whether each alliance chain node is currently consensus-based to store other large-capacity data.
[0079] It can be understood that, assuming that the alliance chain node that receives the data on-chain information is node A, this embodiment is explained using node A as an example. After node A receives the on-chain data, it determines that the on-chain data is the first type of data based on the data type of the on-chain data, and stores it locally first, and then selects a backup node in the blockchain for consensus storage.
[0080] The conventional blockchain practice is that each blockchain node reaches consensus and stores data. However, in the scenario described in this article, this will put tremendous pressure on the storage space and cost of the entire blockchain. At the same time, the network bandwidth during the consensus process will basically be occupied, affecting the uploading of other data to the chain.
[0081] Therefore, this embodiment adopts partial node consensus and large-capacity data storage to take into account multi-node consensus storage and save the storage space and cost of the entire blockchain. This embodiment selects some idle nodes to store the first type of data, thereby effectively alleviating the storage pressure of the blockchain and reducing storage costs.
[0082] Step S202: Determine idle nodes in the alliance chain nodes based on the current consensus state.
[0083] It should be noted that the idle node can be a node in the alliance chain node that is not currently participating in the consensus storage of other large-capacity data, that is, a node in the consensus idle state.
[0084] It can be understood that in order to ensure that there is no process conflict in the data storage and consensus process, this embodiment excludes nodes that are participating in the consensus storage of other large-capacity data, that is, these nodes do not participate in the storage and consensus of the data on the chain this time, and selects idle nodes in the consensus idle state for consensus.
[0085] Step S203: Filter out target storage nodes from the idle nodes according to the current storage space capacity of each alliance chain node and the response information of each alliance chain node to the status query.
[0086] It should be noted that the response information may be information reflecting the response performance of the node, such as the response time and response speed of each alliance chain node in responding to the status query when receiving the status query.
[0087] It is understandable that the data processing device may select the target storage node from the idle nodes according to the current remaining storage space capacity of each idle node and the response performance of each idle node.
[0088] In a specific implementation, the data processing device may select a node with sufficient remaining storage space based on the current storage space capacity of each alliance chain node, or may select a node with a fast response speed based on the response information of each alliance node to the status query.
[0089] Furthermore, in order to accurately select nodes with excellent performance for storage, thereby improving data storage efficiency, the above step S203 may include:
[0090] Sort the current storage space capacity of each idle node to obtain the space capacity sorting result;
[0091] Sort the idle nodes according to the response information of each alliance chain node to the status query and the space capacity sorting result to obtain the idle node sorting result;
[0092] The target storage node is selected from the idle nodes based on the preset consensus node quantity corresponding to the first type of data and the idle node sorting result.
[0093] It can be understood that when node A receives the data uplink information of the first type of data, node A can select a node according to the node selection algorithm described in the following steps.
[0094] Step a: Node A inquires about the remaining storage space of each alliance chain node and whether other large-capacity data is currently being stored in consensus;
[0095] Step b: Except for Node A, each node in the blockchain informs Node A of the remaining storage space of the node, whether it is currently storing other large-capacity data in consensus, etc.
[0096] Step c, node A filters out idle nodes that are currently in a consensus idle state from the alliance chain nodes based on the received feedback data within a predetermined time, sorts the remaining storage space size of each idle node, and sorts the response information order of each idle node (the response information can be the feedback reply time that node A receives the feedback message from each idle node, or it can be the network connection speed or connection distance between the idle node and node A).
[0097] Step d, node A obtains a node sequence according to the spatial capacity sorting results and the response information sorting results, and then selects nodes with sufficient storage capacity and excellent response performance from the node sequence as target storage nodes based on the pre-set number of nodes of the first type of consensus data.
[0098] This embodiment determines the current storage space capacity and current consensus status of each alliance chain node by sending a status query to each alliance chain node, determines the idle nodes in the alliance chain node based on the current consensus status, and selects the target storage nodes from the idle nodes according to the current storage space capacity of each alliance chain node and the response information of each alliance chain node to the status query, thereby effectively alleviating the storage pressure of the entire alliance chain, ensuring the complete storage of data, and effectively reducing the storage cost.
[0099] refer to Figure 4 , Figure 4 This is a flow chart of the third embodiment of the alliance chain data processing method of the present invention.
[0100] Based on the above embodiments, in this embodiment, the uplink data further includes second type data. When the uplink data is the second type data, after step S40, the method further includes:
[0101] Step S401: In response to receiving the second type of data, determining a target main chain block in the main chain associated with the second type of data based on the association identification data of the second type of data.
[0102] It should be noted that the on-chain data also includes second-type data, which is usage-related data of the first-type data. The above-mentioned small-capacity data can be data of tracking algorithms related to large-capacity data. For example, small-capacity data can be model usage data of large model data, etc. Small-capacity data can be stored in MB, occupying less space, but with a large number of users and the number of times the same user uses it.
[0103] In some embodiments, the second type of data may be data related to the use of the large model data, or may be various types of data of the tracking algorithm. The second type of data includes but is not limited to the parameter quantity, effect, code address, data address, training time, trainers, data verification and validation, GPU fees, GPU platform and contract / bill of the large model.
[0104] It should be noted that this embodiment can use the mode of main chain, side chain and seed chain to store the second type of data. The second type of data includes association identification data, user identification data and usage data. The association identification data can be the model identification of the large model data, the user identification data can be the user identification of the user who uses the large model, and the usage data can be the usage-related data of the large model data. The large model data (including code and training data) is stored in the main chain, the user data using the corresponding large model data is stored in the side chain, and the user's usage of the large model data at different times and stages is stored in the seed chain.
[0105] It should be understood that referring to Figure 5 , Figure 5The diagram is a storage diagram of the second type of data. The alliance chain includes a main chain, a side chain and a seed chain. The association identification data is stored in the main chain, the user identification data is stored in the side chain, and the usage data is stored in the seed chain. The seed chain is connected to the side chain block in the side chain, and the side chain is connected to the main chain block in the main chain. This achieves effective tracking and efficient storage of the one-to-many-to-many mode of models, users, and usage, and facilitates the recovery of data storage space after the model is offline.
[0106] Step S402: determining a target side chain block in the side chain associated with the second type of data based on the user identification data of the second type of data.
[0107] In some embodiments, the second type of data is recorded usage data of the first type of data. For example, the first type of data is large model data, and the second type of data may be usage-related data of the large model data. For example, the second type of data includes data such as the number of times a certain user uses the large model data and the stage of use.
[0108] It should be noted that the user identification data may be identification information such as a user ID of a user who uses the first type of data.
[0109] It can be understood that the data processing device determines the user of the second type of data according to the user identification data of the second type of data, locates the target side chain block corresponding to the user in the side chain, and then determines the seed chain connected to the target side chain block.
[0110] Step S403: Acquire data usage information according to the usage data of the second type of data.
[0111] It should be noted that the data usage information may be information such as the number of times the data recorded in the second type of data is used and the usage stage.
[0112] Step S404: Determine the current block state of the seed chain corresponding to the target side chain block.
[0113] It should be noted that the current block status may include the existence of the first block in the seed chain and the absence of the first block in the seed chain. If the seed chain corresponding to the target side chain block does not have the first block, it means that the user is using the large model data for the first time.
[0114] Step S405: Generate a target seed chain block based on the current block state and the data usage information, and mount the target seed chain block on the seed chain corresponding to the target side chain block.
[0115] It should be noted that this embodiment uses the user's use of large model data as the second type of data as an example for explanation. The user sends the large model data to a node B of the blockchain according to the blockchain's uplink interface (node B represents any node in the alliance chain, not a specific node). Node B receives the data and finds that it is large model usage data (i.e., second type of data) based on the data type. This type of data requires full-chain consensus and storage. Therefore, node B packages the uplink data into blocks and publishes it to the blockchain. Each node of the blockchain completes the full-chain consensus under the support of the consensus algorithm and begins to build and store the local blockchain. At this time, each node has received the uplink data and begins to build a local blockchain and data storage. The main process is as follows:
[0116] Step a: The node finds the big model data (code and data) used in the on-chain data according to the on-chain data, and finds the corresponding main chain block in the main chain according to the big model data. If it can be found, proceed to step b. If it cannot be found, it means that it is not the big model data that has been agreed upon in the alliance chain, and the data is ignored.
[0117] Step b: At this point, the main chain block has been found, and the user information in the on-chain data is continued to be found in the side chain. If it can be found, the seed chain processing in step c is continued;
[0118] If it cannot be found, it means that this user is using the corresponding large model data for the first time, and the relevant usage data is uploaded to the chain for the first time. At this time, it is necessary to build a side chain block based on the user data and link it to the end of the side chain.
[0119] Continue with the seed chain processing of step c;
[0120] Step c: At this point, the blocks of the main chain and the side chain already exist, and the seed chain is now on the chain. The seed chain is based on a seed key a that can generate an unlimited number of keys b1, b2, ..., which can be generated by the seed key at any time and anywhere according to the same algorithm. The seed chain is to link the data of each user's usage model as b1, b2, ... to the block of the seed key a, refer to Figure 5 shown.
[0121] In some embodiments, if the seed chain is empty, it means that the user is uploading the usage data of the model to the chain for the first time, and a seed chain needs to be built at this time.
[0122] First, build the first block of the seed chain. This block mainly stores an infinite set of secret keys b1, b2, ... generated by the seed key a. The pre-generation mode is used here. For example, the actual user uses it 20 times, but 100 secret keys are pre-generated at this time, namely b1, b2, ... b100. Each secret key is the pre-order hash value of the first block of the seed chain linked to the sub-chain of the chain data in each round during the use of the large model.
[0123] After the first block of the seed chain is built, the first secret key, b1, is taken out to start building the block in the subchain that uses the large model data for the first time. The content of the block is the on-chain data. After construction, the block is mounted after the first block of the seed chain through b1. The data of different stages of each use is mounted in the corresponding use round; the data used for the i-th time is mounted on the first block of the seed chain through the corresponding bi, thus forming a seed chain.
[0124] If the seed chain is not empty, it means that the user has uploaded the usage data of the model to the chain again. According to the number of uses i recorded in the chain data, the corresponding bi is taken out from the first block of the seed chain, and the block of its round is mounted on the first block of the seed chain through bi, thus forming a seed chain.
[0125] In the specific implementation, each alliance chain node encapsulates the local main chain block, side chain block, seed chain data and the corresponding MD5 into a block, and conducts full-chain consensus. If the full-chain consensus is successful, the data is successfully uploaded to the chain.
[0126] Furthermore, in order to achieve effective data recovery and improve data security performance, after the above step S40, the following steps are further included:
[0127] In response to a data offline request, obtaining a data identifier of the data to be offline based on the data offline request;
[0128] Generate an offline block based on the data identifier, and publish the offline block to the alliance chain for consensus;
[0129] In response to consensus reached by the alliance chain nodes in the alliance chain, the first type of data corresponding to the data identifier and the second type of data associated with the first type of data are deleted.
[0130] It should be noted that when the first type of data needs to be offline for recovery, for example, when the large model data (including code and data) is not used externally or stops being used, the blockchain will recover the entire chain data after receiving the corresponding offline interface request.
[0131] It can be understood that the data recovery process is as follows:
[0132] Step 1: A node C of the blockchain (in this embodiment, node C represents any alliance chain node, not a specific node) receives a request to take the big model offline, and parses the offline big model data field, which is not limited to such data: the main chain block ID of the big model data or the ID of the big model data in the blockchain.
[0133] Step 2: Node C encapsulates the large model data to be taken offline into blocks and publishes them to the blockchain. With the support of the consensus algorithm, the entire chain achieves data consensus.
[0134] Step 3: At this point, each interface has obtained the large model data information to be taken offline, and each node begins to execute local blockchain data recovery work.
[0135] If the node stores the large model data locally, the large model data will be deleted locally and the side chain and seed chain data will be recycled.
[0136] If the node does not store large-capacity data of the large model data locally, the data of the local side chain and seed chain will be recycled.
[0137] Step 4: After the recycling is completed, each node mounts a side chain block in the corresponding main chain block locally, indicating that the side chain is no longer in use.
[0138] In response to receiving the second type of data, this embodiment determines the target main chain block associated with the second type of data in the main chain based on the association identification data of the second type of data, determines the target side chain block associated with the second type of data in the side chain based on the user identification data of the second type of data, obtains data usage information according to the usage data of the second type of data, determines the current block state of the seed chain corresponding to the target side chain block, generates a target seed chain block based on the current block state and the data usage information, and mounts the target seed chain block on the seed chain corresponding to the target side chain block, thereby realizing innovative structured storage of data, improving data storage efficiency and storage orderliness, and improving data management efficiency.
[0139] In addition, an embodiment of the present invention also proposes a computer-readable storage medium, on which a consortium chain data processing program is stored. When the consortium chain data processing program is executed by a processor, the steps of the consortium chain data processing method described above are implemented.
[0140] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0141] The above-mentioned computer-readable storage medium may be included in the alliance chain data processing device; or it may exist independently without being assembled into the alliance chain data processing device.
[0142] In addition, an embodiment of the present invention also proposes a computer program product, including a consortium chain data processing program, which implements the steps of the consortium chain data processing method as described above when executed by a processor.
[0143] The specific implementation methods of the computer program product of the present invention are basically the same as the embodiments of the above-mentioned alliance chain data processing method, and will not be repeated here.
[0144] Reference Figure 6 , Figure 6 This is a structural block diagram of the first embodiment of the alliance chain data processing device of the present invention.
[0145] like Figure 6 As shown, the alliance chain data processing device proposed in the embodiment of the present invention includes:
[0146] An uplink response module 10, configured to respond to the data uplink information and determine the data type of the uplink data according to the data uplink information;
[0147] A node selection module 20, used to determine a target storage node in the alliance chain node according to the data type;
[0148] The on-chain consensus module 30 is used to generate an on-chain block based on the on-chain data, and publish the on-chain block to the alliance chain for consensus;
[0149] The data processing module 40 is used to send the on-chain data to the target storage node in response to the consensus reached by the alliance chain nodes in the alliance chain, so that the target storage node stores the on-chain data.
[0150] Furthermore, the on-chain data includes a first type of data; when the on-chain data is the first type of data, the node selection module 20 is also used to send a status query to each alliance chain node to determine the current storage space capacity and current consensus status of each alliance chain node; determine the idle nodes in the alliance chain nodes based on the current consensus status; and filter out the target storage nodes from the idle nodes according to the current storage space capacity of each alliance chain node and the response information of each alliance chain node to the status query.
[0151] Furthermore, the node selection module 20 is also used to sort the current storage space capacity of each idle node to obtain a space capacity sorting result; sort the idle nodes according to the response information of each alliance chain node to the status query and the space capacity sorting result to obtain an idle node sorting result; and filter out the target storage node from the idle nodes based on the preset consensus node number corresponding to the first type of data and the idle node sorting result.
[0152] Furthermore, the on-chain data also includes a second type of data, which is usage-related data of the first type of data. The second type of data includes associated identification data, user identification data and usage data. The alliance chain includes a main chain, a side chain and a seed chain. The associated identification data is stored in the main chain, the user identification data is stored in the side chain, the usage data is stored in the seed chain, the seed chain is connected to the side chain block in the side chain, and the side chain is connected to the main chain block in the main chain.
[0153] Furthermore, when the on-chain data is the second type of data, the alliance chain data processing device further includes:
[0154] The data storage module 50 is used to determine, in response to receiving the second type of data, a target main chain block associated with the second type of data in the main chain based on the association identification data of the second type of data; determine a target side chain block associated with the second type of data in the side chain based on the user identification data of the second type of data; obtain data usage information according to the usage data of the second type of data; determine the current block state of the seed chain corresponding to the target side chain block; generate a target seed chain block based on the current block state and the data usage information, and mount the target seed chain block on the seed chain corresponding to the target side chain block.
[0155] Furthermore, the alliance chain data processing device further includes:
[0156] The data recovery module 60 is used to respond to a data offline request, obtain a data identifier of the data to be offline based on the data offline request; generate an offline block based on the data identifier, and publish the offline block to the alliance chain for consensus; in response to the alliance chain nodes in the alliance chain reaching a consensus, delete the first type of data corresponding to the data identifier and the second type of data associated with the first type of data.
[0157] This embodiment responds to data on-chain information, determines the data type of the on-chain data according to the data on-chain information, determines the target storage node in the alliance chain node according to the data type, generates an on-chain block based on the on-chain data, publishes the on-chain block to the alliance chain for consensus, and in response to the alliance chain nodes in the alliance chain reaching a consensus, sends the on-chain data to the target storage node so that the target storage node stores the on-chain data, thereby adaptively selecting different nodes for storage for different types of data, achieving rapid storage of complete data while achieving storage cost economy, effectively improving data storage efficiency, and reducing data storage costs.
[0158] The alliance chain data processing device provided by the present application adopts the alliance chain data processing method in the above embodiment, which can solve the technical problems of alliance chain data processing. Compared with the prior art, the beneficial effects of the alliance chain data processing device provided by the present application are the same as the beneficial effects of the alliance chain data processing method provided by the above embodiment, and the other technical features in the alliance chain data processing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0159] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.
[0160] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0161] In addition, for technical details not fully described in this embodiment, please refer to the alliance chain data processing method provided in any embodiment of the present invention, and will not be repeated here.
[0162] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0163] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0164] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0165] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A consortium chain data processing method, It is characterized in that The alliance chain data processing method is executed by the alliance chain node, and the alliance chain data processing method includes: In response to the data uplink information, determine the data type of the uplink data according to the data uplink information; Determine a target storage node in the alliance chain node according to the data type; Generate an on-chain block based on the on-chain data, and publish the on-chain block to the alliance chain for consensus; In response to consensus reached by the alliance chain nodes in the alliance chain, the on-chain data is sent to the target storage node so that the target storage node stores the on-chain data.
2. The alliance chain data processing method according to claim 1, It is characterized in that The on-chain data includes first-type data; when the on-chain data is first-type data, determining a target storage node in the alliance chain node according to the data type includes: Send status inquiries to each alliance chain node to determine the current storage space capacity and current consensus status of each alliance chain node; Determine an idle node in the alliance chain node based on the current consensus state; The target storage node is selected from the idle nodes according to the current storage space capacity of each alliance chain node and the response information of each alliance chain node to the status inquiry.
3. The alliance chain data processing method according to claim 2, It is characterized in that The step of selecting a target storage node from the idle nodes according to the current storage space capacity of each alliance chain node and the response information of each alliance chain node to the status query includes: Sort the current storage space capacity of each idle node to obtain the space capacity sorting result; Sort the idle nodes according to the response information of each alliance chain node to the status query and the space capacity sorting result to obtain the idle node sorting result; The target storage node is selected from the idle nodes based on the preset consensus node quantity corresponding to the first type of data and the idle node sorting result.
4. The alliance chain data processing method according to claim 3, It is characterized in that The on-chain data also includes second-type data, which is usage-related data of the first-type data. The second-type data includes association identification data, user identification data and usage data. The alliance chain includes a main chain, a side chain and a seed chain. The association identification data is stored in the main chain, the user identification data is stored in the side chain, and the usage data is stored in the seed chain. The seed chain is connected to the side chain block in the side chain, and the side chain is connected to the main chain block in the main chain.
5. The alliance chain data processing method according to claim 4, It is characterized in that When the uplink data is the second type of data, after sending the uplink data to the target storage node, the method further includes: In response to receiving the second type of data, determining a target main chain block in the main chain associated with the second type of data based on the associated identification data of the second type of data; Determine a target side chain block in the side chain associated with the second type of data based on the user identification data of the second type of data; Acquiring data usage information according to the usage data of the second type of data; Determine the current block state of the seed chain corresponding to the target side chain block; A target seed chain block is generated based on the current block state and the data usage information, and the target seed chain block is mounted on the seed chain corresponding to the target side chain block.
6. The alliance chain data processing method according to any one of claims 1 to 5, It is characterized in that After sending the uplink data to the target storage node, the method further includes: In response to a data offline request, obtaining a data identifier of the data to be offline based on the data offline request; Generate an offline block based on the data identifier, and publish the offline block to the alliance chain for consensus; In response to consensus reached by the alliance chain nodes in the alliance chain, the first type of data corresponding to the data identifier and the second type of data associated with the first type of data are deleted.
7. A consortium chain data processing device, It is characterized in that The alliance chain data processing device includes: An uplink response module, configured to respond to the data uplink information and determine the data type of the uplink data according to the data uplink information; A node selection module, used to determine a target storage node in the alliance chain node according to the data type; An on-chain consensus module, used to generate an on-chain block based on the on-chain data, and publish the on-chain block to the alliance chain for consensus; The data processing module is used to send the on-chain data to the target storage node in response to the consensus reached by the alliance chain nodes in the alliance chain, so that the target storage node stores the on-chain data.
8. A consortium chain data processing device, It is characterized in that The alliance chain data processing device includes: a memory, a processor, and an alliance chain data processing program stored in the memory and executable on the processor, wherein the alliance chain data processing program is configured to implement the alliance chain data processing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a consortium chain data processing program, and when the consortium chain data processing program is executed by the processor, the consortium chain data processing method according to any one of claims 1 to 6 is implemented.
10. A computer program product, It is characterized in that The computer program product includes a consortium chain data processing program, which, when executed by a processor, implements the steps of the consortium chain data processing method as described in any one of claims 1 to 6.
Citation Information
Cited By
Content detection method and device, equipment, storage medium and product
CN119474468A
